Skip to content

Commit

Permalink
Merge pull request #11 from georchestra/mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas authored Nov 27, 2023
2 parents 78c4184 + cf0cf0c commit a9db8ce
Show file tree
Hide file tree
Showing 22 changed files with 771 additions and 74 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ Iframe can still be set with defining `legacy-url` attribute, style can also be
```html
<geor-header legacy-url="myheader.com" legacy-style="width: 100%"></geor-header>
```

Attributes available :

| Attribute | Description | Example | For host | For legacy |
|---------------|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|----------|------------|
| lang | Used to force header language (default value : en) | `<geor-header lang='de'>` | v | |
| active-app | Use this attribute to set the active class in menu | `<geor-header active-app='console'>` | v | v |
| logo-url | Use this attribute to set the logo for the new header (not legacy one). | `<geor-header logo-url='https://linktomylogo.com'>` | v | |
| legacy-header | Use this attribute to enable the legacy header `iframe` tag. Needs `legacy-url`. | `<geor-header legacy-header='true' legacy-url="/header/">` | | v |
| legacy-url | Legacy URL: if set, activates iframe with src attribute pointing to this URL. Needs `legacy-header`. | `<geor-header legacy-header='true' legacy-url="/header/"></geor-header>` | | v |
| style | adds this style to iframe or host tag (if legacy url is not used) | `<geor-header legacy-url="myheader.com" style="width: 100%"></geor-header>` | v | v |


## Development
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>geOrchestra header</title>
</head>
<body style="margin: 0">
<geor-header></geor-header>
<body style="margin: 0; height: 80px">
<geor-header logo-url="https://www.georchestra.org/public/georchestra-logo.svg" active-app="datahub"></geor-header>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
145 changes: 131 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"prepare": "husky install"
},
"dependencies": {
"vue": "^3.2.45"
"vue": "^3.2.45",
"vue-i18n": "^9.7.0"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.4",
Expand All @@ -31,10 +32,11 @@
"lint-staged": "^13.1.1",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.21",
"postcss-rem-to-responsive-pixel": "^6.0.0",
"prettier": "^2.7.1",
"tailwindcss": "^3.2.4",
"typescript": "~4.7.4",
"vite": "^4.0.0",
"vite": "4.1.5",
"vue-tsc": "^1.0.12"
},
"lint-staged": {
Expand Down
5 changes: 5 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
'postcss-rem-to-responsive-pixel': {
rootValue: 16,
propList: ['*'],
transformUnit: 'px',
},
},
}
19 changes: 19 additions & 0 deletions src/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const AUTH_API_URL = '/whoami'
const CONSOLE_PLATFORM_API_URL = '/console/private/platform/infos'

type KNOWN_ROLES =
| 'ROLE_SUPERUSER'
Expand Down Expand Up @@ -60,3 +61,21 @@ export function getAdminRoles(roles: KNOWN_ROLES[]): AdminRoles | null {
viewer,
}
}

export interface PlatformInfos {
analyticsEnabled: boolean
extractorappEnabled: boolean
saslEnabled: boolean
}

export async function getPlatformInfos(): Promise<PlatformInfos> {
return fetch(CONSOLE_PLATFORM_API_URL)
.then(response => response.json())
.then((json: PlatformInfos) => {
return {
analyticsEnabled: json.analyticsEnabled,
extractorappEnabled: json.extractorappEnabled,
saslEnabled: json.saslEnabled,
}
})
}
Loading

0 comments on commit a9db8ce

Please sign in to comment.