From f2e4851b5569bdda8d1f4eeacb110040373c338a Mon Sep 17 00:00:00 2001 From: BulotF Date: Wed, 31 Mar 2021 18:00:51 +0200 Subject: [PATCH 01/46] init home.js and dependencies --- package.json | 1 + packages/codelists/rollup.config.js | 2 +- packages/codelists/src/apis/codelists-api.js | 3 + .../codelists/src/components/home/home.js | 54 +++++- .../codelists/src/components/search/search.js | 161 ++++++++++++++++++ .../src/utils/constants/dsd-components.js | 26 +++ .../codelists/src/utils/constants/index.js | 3 + .../codelists/src/utils/constants/prefixes.js | 3 + packages/codelists/src/utils/constants/xsd.js | 15 ++ packages/codelists/src/utils/index.js | 18 ++ yarn.lock | 76 +++++++++ 11 files changed, 357 insertions(+), 5 deletions(-) create mode 100644 packages/codelists/src/components/search/search.js create mode 100644 packages/codelists/src/utils/constants/dsd-components.js create mode 100644 packages/codelists/src/utils/constants/index.js create mode 100644 packages/codelists/src/utils/constants/prefixes.js create mode 100644 packages/codelists/src/utils/constants/xsd.js create mode 100644 packages/codelists/src/utils/index.js diff --git a/package.json b/package.json index 6611a9fb5..e30091083 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "webpack": "4.44.0" }, "dependencies": { + "@babel/preset-react": "^7.12.13", "jest-environment-jsdom-sixteen": "^1.0.3", "prop-types": "15.7.2", "react": "17.0.1", diff --git a/packages/codelists/rollup.config.js b/packages/codelists/rollup.config.js index 6fa953a36..01ddc8617 100644 --- a/packages/codelists/rollup.config.js +++ b/packages/codelists/rollup.config.js @@ -11,7 +11,7 @@ const { dependencies: rootDependencies } = require('../../package.json'); export default { input: 'src/index.js', output: { - name: 'bauhaus-structures', + name: 'bauhaus-codelists', file: 'dist/index.js', format: 'cjs', strict: false, diff --git a/packages/codelists/src/apis/codelists-api.js b/packages/codelists/src/apis/codelists-api.js index da4c9bec0..8881ebdfc 100644 --- a/packages/codelists/src/apis/codelists-api.js +++ b/packages/codelists/src/apis/codelists-api.js @@ -1,7 +1,10 @@ import { API } from 'bauhaus-utilities'; const api = { + getMutualizedComponents: () => ['components'], + getMutualizedComponent: (id) => ['components/' + id], + }; export default API.buildApi('codeList', api); diff --git a/packages/codelists/src/components/home/home.js b/packages/codelists/src/components/home/home.js index b8bb9af10..6692f832c 100644 --- a/packages/codelists/src/components/home/home.js +++ b/packages/codelists/src/components/home/home.js @@ -1,7 +1,53 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; +import { + NewButton, + SearchableList, + PageTitle, + VerticalMenu, + Loading, +} from '@inseefr/wilco'; +import CodeListsAPI from '../../apis/codelists-api'; +import { formatLabel } from '../../utils'; +import D from '../../i18n/build-dictionary'; -const Home = () => { - return

Hello

+function CodeListsList() { + const [items, setItems] = useState([]); + const [loading, setLoading] = useState(true); + +// const filteredItems = items.map(({ id, labelLg1, labelLg2 }) => ({ id, labelLg1 , labelLg2 }) ); + + useEffect(() => { + CodeListsAPI + .getMutualizedComponents() + .then((components) => { + setItems(components); + }) + .finally(() => setLoading(false)); + }, []); + + + if (loading) { + return ; + } + return
+
+ + + +
+ + formatLabel(component)} + /> +
+
+
} -export default Home; +export default CodeListsList; diff --git a/packages/codelists/src/components/search/search.js b/packages/codelists/src/components/search/search.js new file mode 100644 index 000000000..50d298a96 --- /dev/null +++ b/packages/codelists/src/components/search/search.js @@ -0,0 +1,161 @@ +import React, { useState, useEffect } from 'react'; +import { Select, Loading } from '@inseefr/wilco'; +import { Link, Redirect } from 'react-router-dom'; +import CodeListsAPI from '../../apis/structure-api'; +import D from '../../i18n/build-dictionary'; +import { formatLabel } from '../../utils'; +import { + ConceptsAPI, + ArrayUtils, + AdvancedSearchList, + ItemToSelectModel, + AbstractAdvancedSearchComponent, Stores, +} from 'bauhaus-utilities'; +import { useSelector } from 'react-redux'; + +const filterLabel = ArrayUtils.filterKeyDeburr(['labelLg1']); +const filterConcept = ArrayUtils.filterKeyDeburr(['concept']); +const filterCreator = ArrayUtils.filterKeyDeburr(['creator']); +const filterValidationState = ArrayUtils.filterKeyDeburr(['validationState']); + +const fields = ['labelLg1', 'concept', 'creator', 'validationState']; + +const validateStateOptions = [ + {value: 'Unpublished', label: D.statusUnpublishedM}, + {value: 'Modified', label: D.statusModifiedM}, + {value: 'Validated', label: D.statusValidatedM} +] + +export class SearchFormList extends AbstractAdvancedSearchComponent { + static defaultState = { + labelLg1: '', + concept: '', + creator: '', + validationState: '' + }; + + constructor(props) { + super(props, SearchFormList.defaultState); + } + + handlers = this.handleChange(fields, newState => { + const { labelLg1, concept, creator, validationState } = newState; + return this.props.data + .filter(filterConcept(concept)) + .filter(filterLabel(labelLg1)) + .filter(filterCreator(creator)) + .filter(filterValidationState(validationState)); + }); + + render() { + const { data, labelLg1, concept, creator, validationState } = this.state; + const { concepts, stampListOptions } = this.props; + + const conceptsOptions = ItemToSelectModel.toSelectModel(concepts); + const dataLinks = data.map(component => ( +
  • + + {formatLabel(component)} + +
  • + )); + return ( + } + > +
    +
    + +
    +
    +
    +
    + +
    +
    + -
    -
    -
    -
    - -
    -
    - +
    +
    +
    + ); + } +} +class SearchListContainer extends Component { + constructor(props) { + super(props); + this.state = {}; + } + componentWillMount() { + api.getFamiliesSearchList().then((data) => { + this.setState({ data: sortByLabel(data) }); + }); + } + + render() { + const { data } = this.state; + if (!data) return ; + return ; + } +} + +export default SearchListContainer; diff --git a/packages/codelists/src/index.js b/packages/codelists/src/index.js index c60342acc..a10925ec8 100644 --- a/packages/codelists/src/index.js +++ b/packages/codelists/src/index.js @@ -2,4 +2,5 @@ export * from './apis'; export { default as D, D1, D2 } from './i18n/build-dictionary'; export { default as Menu } from './menu'; export { default as Home } from './components/home/home'; +export { default as SearchFormList } from './components/search/search'; export { default as CodelistComponentView } from './components/component-detail/view-container'; From 00dc38d62993033aea6fc49ba320f24f223d31d6 Mon Sep 17 00:00:00 2001 From: BulotF Date: Wed, 5 May 2021 17:05:34 +0200 Subject: [PATCH 16/46] use package APIs --- packages/codelists/src/apis/codelists-api.js | 8 +- packages/codelists/src/apis/index.js | 2 +- .../component-detail/view-container.js | 7 +- .../codelists/src/components/home/home.js | 4 +- .../codelists/src/components/search/search.js | 118 +++++++++++++----- 5 files changed, 103 insertions(+), 36 deletions(-) diff --git a/packages/codelists/src/apis/codelists-api.js b/packages/codelists/src/apis/codelists-api.js index 2db9920e3..200760d86 100644 --- a/packages/codelists/src/apis/codelists-api.js +++ b/packages/codelists/src/apis/codelists-api.js @@ -1,5 +1,11 @@ import { API } from 'bauhaus-utilities'; -const api = {}; +const api = { + getCodelists: () => [''], + getCodelist: (id) => [`${id}`], + getDetailedCodelist: (id) => [`detailed/${id}`], + getCodelistsForSearch: () => ['search'], + getCodelistCode: (id, code) => [`${id}/code/${code}`], +}; export default API.buildApi('codeList', api); diff --git a/packages/codelists/src/apis/index.js b/packages/codelists/src/apis/index.js index 025f33493..db118fe3d 100644 --- a/packages/codelists/src/apis/index.js +++ b/packages/codelists/src/apis/index.js @@ -1 +1 @@ -export { default as CodeListsAPI } from './codelists-api'; +export { default as API } from './codelists-api'; diff --git a/packages/codelists/src/components/component-detail/view-container.js b/packages/codelists/src/components/component-detail/view-container.js index 9829189bb..09b471e59 100644 --- a/packages/codelists/src/components/component-detail/view-container.js +++ b/packages/codelists/src/components/component-detail/view-container.js @@ -1,7 +1,8 @@ import React, { useState, useEffect, useCallback } from 'react'; import { Loading, goBack } from '@inseefr/wilco'; import { ComponentDetailView } from './view'; -import { CodesList, Stores } from 'bauhaus-utilities'; +import { Stores } from 'bauhaus-utilities'; +import { API } from '../../apis'; import ComponentTitle from './title'; import { useSelector } from 'react-redux'; import { useParams } from 'react-router-dom'; @@ -17,7 +18,7 @@ const CodelistComponentView = (props) => { }, [props]); useEffect(() => { - CodesList.getCodesList(notation) + API.getCodelist(notation) .then((codelist) => { setComponent(codelist); }) @@ -36,7 +37,7 @@ const CodelistComponentView = (props) => { col={2} component={component} handleBack={handleBack} - handleUpdate={`/structures/components/${component.notation}/modify`} + handleUpdate={`/codelists/components/${component.notation}/modify`} mutualized={true} updatable={true} /> diff --git a/packages/codelists/src/components/home/home.js b/packages/codelists/src/components/home/home.js index 799bb6cdb..a5d953ed2 100644 --- a/packages/codelists/src/components/home/home.js +++ b/packages/codelists/src/components/home/home.js @@ -6,7 +6,7 @@ import { VerticalMenu, Loading, } from '@inseefr/wilco'; -import { CodesList } from 'bauhaus-utilities'; +import { API } from '../../apis'; import { formatLabel } from '../../utils'; import D from '../../i18n/build-dictionary'; @@ -21,7 +21,7 @@ function CodeListsList() { })); useEffect(() => { - CodesList.getCodesLists() + API.getCodelists() .then((codelists) => { setItems(codelists); }) diff --git a/packages/codelists/src/components/search/search.js b/packages/codelists/src/components/search/search.js index b96ced300..12d5a1c02 100644 --- a/packages/codelists/src/components/search/search.js +++ b/packages/codelists/src/components/search/search.js @@ -1,22 +1,33 @@ +import React, { useState, useEffect } from 'react'; +import { Select, Loading } from '@inseefr/wilco'; import { Link, Redirect } from 'react-router-dom'; -import React, { Component } from 'react'; -import { Loading } from '@inseefr/wilco'; -import api from 'js/remote-api/operations-api'; -import D from '../../i18n/build-dictionary'; - +import { useSelector } from 'react-redux'; import { ArrayUtils, AbstractAdvancedSearchComponent, AdvancedSearchList, + Stores, } from 'bauhaus-utilities'; +import API from '../../apis'; +import D from '../../i18n/build-dictionary'; +import { formatLabel } from '../../utils'; const filterLabel = ArrayUtils.filterKeyDeburr(['labelLg1']); -const fields = ['labelLg1']; -const sortByLabel = ArrayUtils.sortArray('labelLg1'); +const filterCreator = ArrayUtils.filterKeyDeburr(['creator']); +const filterValidationState = ArrayUtils.filterKeyDeburr(['validationState']); + +const fields = ['labelLg1', 'creator', 'validationState']; +const validateStateOptions = [ + { value: 'Unpublished', label: D.statusUnpublishedM }, + { value: 'Modified', label: D.statusModifiedM }, + { value: 'Validated', label: D.statusValidatedM }, +]; class SearchFormList extends AbstractAdvancedSearchComponent { static defaultState = { labelLg1: '', + creator: '', + validationState: '', }; constructor(props) { @@ -24,20 +35,31 @@ class SearchFormList extends AbstractAdvancedSearchComponent { } handlers = this.handleChange(fields, (newState) => { - const { labelLg1 } = newState; - return this.props.data.filter(filterLabel(labelLg1)); + const { labelLg1, creator, validationState } = newState; + return this.props.data + .filter(filterLabel(labelLg1)) + .filter(filterCreator(creator)) + .filter(filterValidationState(validationState)); }); render() { - const { data, labelLg1 } = this.state; - const dataLinks = data.map(({ notation, labelLg1 }) => ( -
  • - {labelLg1} + const { data, labelLg1, creator, validationState } = this.state; + const { stampListOptions } = this.props; + /* const dataLinks = data.map(({ id, labelLg1 }) => ( +
  • + {labelLg1} +
  • + )); */ + const dataLinks = data.map((component) => ( +
  • + + {formatLabel(component)} +
  • )); return ( } @@ -55,26 +77,64 @@ class SearchFormList extends AbstractAdvancedSearchComponent { +
    +
    + +
    +
    ); } } -class SearchListContainer extends Component { - constructor(props) { - super(props); - this.state = {}; - } - componentWillMount() { - api.getFamiliesSearchList().then((data) => { - this.setState({ data: sortByLabel(data) }); - }); - } - render() { - const { data } = this.state; - if (!data) return ; - return ; +const SearchListContainer = () => { + const [loading, setLoading] = useState(true); + const [items, setItems] = useState([]); + const stampListOptions = useSelector((state) => + Stores.Stamps.getStampListOptions(state) + ); + + useEffect(() => { + API.getCodelistsForSearch() + .then(([codelists]) => { + setItems(codelists); + }) + .finally(() => setLoading(false)); + }, []); + if (loading) { + return ; } -} + return ; +}; export default SearchListContainer; From 8e343814ebf87af7767f1e572cb6b40c14f08025 Mon Sep 17 00:00:00 2001 From: BulotF Date: Fri, 7 May 2021 10:24:57 +0200 Subject: [PATCH 17/46] Bug with API call from search --- packages/codelists/src/components/search/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/codelists/src/components/search/search.js b/packages/codelists/src/components/search/search.js index 12d5a1c02..7b4990f1d 100644 --- a/packages/codelists/src/components/search/search.js +++ b/packages/codelists/src/components/search/search.js @@ -8,7 +8,7 @@ import { AdvancedSearchList, Stores, } from 'bauhaus-utilities'; -import API from '../../apis'; +import { API } from '../../apis'; import D from '../../i18n/build-dictionary'; import { formatLabel } from '../../utils'; @@ -126,7 +126,7 @@ const SearchListContainer = () => { useEffect(() => { API.getCodelistsForSearch() - .then(([codelists]) => { + .then((codelists) => { setItems(codelists); }) .finally(() => setLoading(false)); From f2a5bbab7bce4fb63e3ef1038283eedf434bd675 Mon Sep 17 00:00:00 2001 From: BulotF Date: Fri, 7 May 2021 10:25:13 +0200 Subject: [PATCH 18/46] Update dictionary.js --- packages/codelists/src/i18n/dictionary.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/codelists/src/i18n/dictionary.js b/packages/codelists/src/i18n/dictionary.js index a9c52277b..b1b2a83c0 100644 --- a/packages/codelists/src/i18n/dictionary.js +++ b/packages/codelists/src/i18n/dictionary.js @@ -1,5 +1,9 @@ const dictionary = { codelistsTitle: { fr: 'Listes de codes', en: 'Code lists' }, + codelistsSearchTitle: { + fr: 'Listes de codes - Recherche', + en: 'Code lists - Search', + }, componentTitle: { fr: 'Listes de codes', en: 'Codelists', @@ -32,6 +36,10 @@ const dictionary = { fr: 'Propriétaires', en: 'Creator', }, + labelTitle: { + fr: 'Libellé', + en: 'Label', + }, descriptionTitle: { fr: 'Description', en: 'Description', From b6496c43c5cf23bc8b1de4988934feb94dccc287 Mon Sep 17 00:00:00 2001 From: BulotF Date: Fri, 7 May 2021 11:42:25 +0200 Subject: [PATCH 19/46] Update dictionary.js --- packages/codelists/src/i18n/dictionary.js | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/codelists/src/i18n/dictionary.js b/packages/codelists/src/i18n/dictionary.js index b1b2a83c0..036a67f12 100644 --- a/packages/codelists/src/i18n/dictionary.js +++ b/packages/codelists/src/i18n/dictionary.js @@ -60,5 +60,29 @@ const dictionary = { fr: 'Description', en: 'Description', }, + statusValidatedM: { + fr: 'Publié', + en: 'Published', + }, + statusValidatedF: { + fr: 'Publiée', + en: 'Published', + }, + statusModifiedM: { + fr: 'Provisoire, déjà publié', + en: 'Temporary, already published', + }, + statusModifiedF: { + fr: 'Provisoire, déjà publiée', + en: 'Temporary, already published', + }, + statusUnpublishedM: { + fr: 'Provisoire, jamais publié', + en: 'Temporary, never published', + }, + statusUnpublishedF: { + fr: 'Provisoire, jamais publiée', + en: 'Temporary, never published', + }, }; export default dictionary; From aa91f4e5f9f6eb7ab0b31fe0fb063ce7bb2a7fa6 Mon Sep 17 00:00:00 2001 From: BulotF Date: Fri, 7 May 2021 11:42:48 +0200 Subject: [PATCH 20/46] add fields id and code in search --- .../codelists/src/components/search/search.js | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/packages/codelists/src/components/search/search.js b/packages/codelists/src/components/search/search.js index 7b4990f1d..efc651fb3 100644 --- a/packages/codelists/src/components/search/search.js +++ b/packages/codelists/src/components/search/search.js @@ -12,11 +12,13 @@ import { API } from '../../apis'; import D from '../../i18n/build-dictionary'; import { formatLabel } from '../../utils'; +const filterId = ArrayUtils.filterKeyDeburr(['id']); const filterLabel = ArrayUtils.filterKeyDeburr(['labelLg1']); +const filterCode = ArrayUtils.filterKeyDeburr(['codes/labelLg1']); const filterCreator = ArrayUtils.filterKeyDeburr(['creator']); const filterValidationState = ArrayUtils.filterKeyDeburr(['validationState']); -const fields = ['labelLg1', 'creator', 'validationState']; +const fields = ['id', 'labelLg1', 'code', 'creator', 'validationState']; const validateStateOptions = [ { value: 'Unpublished', label: D.statusUnpublishedM }, { value: 'Modified', label: D.statusModifiedM }, @@ -25,7 +27,9 @@ const validateStateOptions = [ class SearchFormList extends AbstractAdvancedSearchComponent { static defaultState = { + id: '', labelLg1: '', + code: [''], creator: '', validationState: '', }; @@ -35,21 +39,18 @@ class SearchFormList extends AbstractAdvancedSearchComponent { } handlers = this.handleChange(fields, (newState) => { - const { labelLg1, creator, validationState } = newState; + const { id, labelLg1, code, creator, validationState } = newState; return this.props.data + .filter(filterId(id)) .filter(filterLabel(labelLg1)) + .filter(filterCode(code)) .filter(filterCreator(creator)) .filter(filterValidationState(validationState)); }); render() { - const { data, labelLg1, creator, validationState } = this.state; + const { data, id, labelLg1, code, creator, validationState } = this.state; const { stampListOptions } = this.props; - /* const dataLinks = data.map(({ id, labelLg1 }) => ( -
  • - {labelLg1} -
  • - )); */ const dataLinks = data.map((component) => (
  • @@ -64,6 +65,19 @@ class SearchFormList extends AbstractAdvancedSearchComponent { initializeState={this.initializeState} redirect={} > +
    +
    + +
    +
    +
    +
    + +
    +
    -
    - } - title={D.listElements} - alone={true} - /> -
    + { +
    + + } + title={D.listElements} + alone={true} + /> +
    + } ); }; From f7f74f45bdd31d523e2f0d612e606b4f5173cc5a Mon Sep 17 00:00:00 2001 From: NicoLaval Date: Sun, 16 May 2021 11:10:00 +0200 Subject: [PATCH 25/46] Add env support & kub objects --- .kubernetes/deployment.yml | 29 +++++++ .kubernetes/ingress.yml | 18 ++++ .kubernetes/service.yml | 11 +++ app/.env | 7 +- app/entrypoint.sh | 8 ++ app/public/env-config.js | 1 + app/public/index.html | 2 + app/src/js/app.js | 32 ++++---- app/src/js/applications/structures/home.js | 3 +- app/src/js/router/index.js | 9 +- app/src/js/router/routes.js | 82 +++++++++++-------- app/src/js/utils/env.js | 2 + package.json | 5 +- .../structure-visualization/controls.js | 2 +- scripts/generate-entrypoint.js | 22 +++++ 15 files changed, 175 insertions(+), 58 deletions(-) create mode 100644 .kubernetes/deployment.yml create mode 100644 .kubernetes/ingress.yml create mode 100644 .kubernetes/service.yml create mode 100644 app/entrypoint.sh create mode 100644 app/public/env-config.js create mode 100644 app/src/js/utils/env.js create mode 100644 scripts/generate-entrypoint.js diff --git a/.kubernetes/deployment.yml b/.kubernetes/deployment.yml new file mode 100644 index 000000000..6aa774e22 --- /dev/null +++ b/.kubernetes/deployment.yml @@ -0,0 +1,29 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: bauhaus +spec: + replicas: 1 + selector: + matchLabels: + app: bauhaus + template: + metadata: + labels: + app: bauhaus + spec: + containers: + - name: bauhaus + image: nicolaslaval/bauhaus:3.0.0 + env: + - name: API_BASE_HOST + value: 'https://bauhaus-api.toto.fr/api' + - name: API_MODE + # server or local + value: 'server' + - name: APPLICATIONS + value: 'concepts,classifications,operations,structures' + - name: NAME + value: 'Bauhaus' + - name: VERSION + value: '3.0.0' diff --git a/.kubernetes/ingress.yml b/.kubernetes/ingress.yml new file mode 100644 index 000000000..3979943f7 --- /dev/null +++ b/.kubernetes/ingress.yml @@ -0,0 +1,18 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: bauhaus + annotations: + kubernetes.io/ingress.class: nginx +spec: + tls: + - hosts: + - bauhaus.todo.fr + rules: + - host: bauhaus.todo.fr + http: + paths: + - path: / + backend: + serviceName: bauhaus + servicePort: http diff --git a/.kubernetes/service.yml b/.kubernetes/service.yml new file mode 100644 index 000000000..6e1021473 --- /dev/null +++ b/.kubernetes/service.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: bauhaus +spec: + ports: + - name: http + targetPort: 80 + port: 80 + selector: + app: bauhaus diff --git a/app/.env b/app/.env index f76a98a5e..ba45020b8 100644 --- a/app/.env +++ b/app/.env @@ -1,2 +1,7 @@ SKIP_PREFLIGHT_CHECK=true -REACT_APP_API_MODE = 'server' \ No newline at end of file +REACT_APP_API_MODE=server +REACT_APP_API_BASE_HOST= +REACT_APP_APPLICATIONS=concepts,classifications,operations,structures +REACT_APP_NAME=Bauhaus +// TODO: Handle dynamically importing package.json version +REACT_APP_VERSION=3.0.0 \ No newline at end of file diff --git a/app/entrypoint.sh b/app/entrypoint.sh new file mode 100644 index 000000000..ffc6bc6ce --- /dev/null +++ b/app/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +echo "window._env_['SKIP_PREFLIGHT_CHECK'] = '$SKIP_PREFLIGHT_CHECK';" >> /usr/share/nginx/html/env-config.js +echo "window._env_['API_MODE'] = '$API_MODE';" >> /usr/share/nginx/html/env-config.js +echo "window._env_['API_BASE_HOST'] = '$API_BASE_HOST';" >> /usr/share/nginx/html/env-config.js +echo "window._env_['APPLICATIONS'] = '$APPLICATIONS';" >> /usr/share/nginx/html/env-config.js +echo "window._env_['NAME'] = '$NAME';" >> /usr/share/nginx/html/env-config.js +echo "window._env_['VERSION'] = '$VERSION';" >> /usr/share/nginx/html/env-config.js +exec "$@" \ No newline at end of file diff --git a/app/public/env-config.js b/app/public/env-config.js new file mode 100644 index 000000000..d31acf519 --- /dev/null +++ b/app/public/env-config.js @@ -0,0 +1 @@ +if (!window._env_) window._env_ = {}; diff --git a/app/public/index.html b/app/public/index.html index 6a44c0350..49aaf8333 100755 --- a/app/public/index.html +++ b/app/public/index.html @@ -25,6 +25,8 @@ + +