diff --git a/client/src/app/instance/home/components/welcome.component.html b/client/src/app/instance/home/components/welcome.component.html index b4132609fa7fc4db2e9e41022217580ed6c0222d..4413a0155a6a05ad2b662469dbee20ffa3982a4c 100644 --- a/client/src/app/instance/home/components/welcome.component.html +++ b/client/src/app/instance/home/components/welcome.component.html @@ -2,5 +2,5 @@ <div class="col-6 col-md-4 order-md-2 mx-auto text-center"> <img class="img-fluid mb-3 mb-md-0" src="{{ getLogoSrc() }}" alt="Instance logo"> </div> - <div class="col-md-8 order-md-1 text-justify pr-md-5" [innerHtml]="instance.config.home.home_config.home_component_text"></div> + <div class="col-md-8 order-md-1 text-justify pr-md-5" [innerHtml]="instance.home_component_config.home_component_text"></div> </div> diff --git a/client/src/app/instance/home/components/welcome.component.ts b/client/src/app/instance/home/components/welcome.component.ts index 8f54362d32ebd7cfc09bb19e39c16361a6193ab3..6eaf4c53a14d15805687e9a3901f78df9c56a4a6 100644 --- a/client/src/app/instance/home/components/welcome.component.ts +++ b/client/src/app/instance/home/components/welcome.component.ts @@ -30,6 +30,6 @@ export class WelcomeComponent { * @return string */ getLogoSrc(): string { - return `${this.apiUrl}/download-instance-file/${this.instance.name}/${this.instance.config.home.home_config.home_component_logo}`; + return `${this.apiUrl}/download-instance-file/${this.instance.name}/${this.instance.home_component_config.home_component_logo}`; } } diff --git a/client/src/app/instance/instance.component.ts b/client/src/app/instance/instance.component.ts index bb78d58ce124b33a795c7e5f88dc0fee2a80bc7a..b5ccc3a2fc77e84dc3eec2b44a599d96ecc85055 100644 --- a/client/src/app/instance/instance.component.ts +++ b/client/src/app/instance/instance.component.ts @@ -57,17 +57,17 @@ export class InstanceComponent implements OnInit, OnDestroy { Promise.resolve(null).then(() => this.store.dispatch(datasetActions.loadDatasetList())); Promise.resolve(null).then(() => this.store.dispatch(surveyActions.loadSurveyList())); this.instanceSubscription = this.instance.subscribe(instance => { - if (instance.config.search.search_by_criteria_allowed) { - this.links.push({ label: instance.config.search.search_by_criteria_label, icon: 'fas fa-search', routerLink: 'search' }); + if (instance.search_by_criteria_allowed) { + this.links.push({ label: instance.search_by_criteria_label, icon: 'fas fa-search', routerLink: 'search' }); } - if (instance.config.search.search_multiple_allowed) { - this.links.push({ label: instance.config.search.search_multiple_label, icon: 'fas fa-search-plus', routerLink: 'search-multiple' }); + if (instance.search_multiple_allowed) { + this.links.push({ label: instance.search_multiple_label, icon: 'fas fa-search-plus', routerLink: 'search-multiple' }); } - if (instance.config.documentation.documentation_allowed) { - this.links.push({ label: instance.config.documentation.documentation_label, icon: 'fas fa-question', routerLink: 'documentation' }); + if (instance.documentation_allowed) { + this.links.push({ label: instance.documentation_label, icon: 'fas fa-question', routerLink: 'documentation' }); } - if (instance.config.design.design_favicon !== '') { - this.favIcon.href = `${this.config.apiUrl}/download-instance-file/${instance.name}/${instance.config.design.design_favicon}`; + if (instance.design_favicon !== '') { + this.favIcon.href = `${this.config.apiUrl}/download-instance-file/${instance.name}/${instance.design_favicon}`; } this.title.innerHTML = instance.label; }) diff --git a/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.html b/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.html index 7ac8fc5b28b1f1ba5aea2ee70bc3f431787446ef..54904e5ecb171fded00a42d506b5e104c8e5d2da 100644 --- a/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.html +++ b/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.html @@ -8,7 +8,7 @@ <div class="progress progress-with-circle"> <div class="progress-bar" [ngClass]="getStepClass()" - [ngStyle]="{'background-color': instance.config.design.design_color }" + [ngStyle]="{'background-color': instance.design_color }" role="progressbar" aria-valuenow="1" aria-valuemin="1" diff --git a/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.ts b/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.ts index 0fbeafa0d654dac7fc133ccde1ee597140fbc43a..9a09a721236ea1f314b9958270f1b9b9690b77e7 100644 --- a/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.ts +++ b/client/src/app/instance/search-multiple/components/progress-bar-multiple.component.ts @@ -60,7 +60,7 @@ export class ProgressBarMultipleComponent { */ getNavItemAStyle(currentStep: string, checked: boolean): { color: string } | null { if (this.currentStep === currentStep || checked) { - return { 'color': this.instance.config.design.design_color } + return { 'color': this.instance.design_color } } return null; } @@ -76,12 +76,12 @@ export class ProgressBarMultipleComponent { getNavItemIconCircleStyle(currentStep: string, checked: boolean): any { let style = {}; if (this.currentStep === currentStep) { - style['border-color'] = this.instance.config.design.design_color; - style['background-color'] = this.instance.config.design.design_color; + style['border-color'] = this.instance.design_color; + style['background-color'] = this.instance.design_color; } if (checked) { - style['border-color'] = this.instance.config.design.design_color; - style['color'] = this.instance.config.design.design_color; + style['border-color'] = this.instance.design_color; + style['color'] = this.instance.design_color; } return style; } diff --git a/client/src/app/instance/search/components/progress-bar.component.html b/client/src/app/instance/search/components/progress-bar.component.html index b248b98ca39a6d168c490a0d93ee6e375aa01b19..797513487ceca35b94deac0f758a336468008e51 100644 --- a/client/src/app/instance/search/components/progress-bar.component.html +++ b/client/src/app/instance/search/components/progress-bar.component.html @@ -8,7 +8,7 @@ <div class="progress progress-with-circle"> <div class="progress-bar" [ngClass]="getStepClass()" - [ngStyle]="{'background-color': instance.config.design.design_color }" + [ngStyle]="{'background-color': instance.design_color }" role="progressbar" aria-valuenow="1" aria-valuemin="1" diff --git a/client/src/app/instance/search/components/progress-bar.component.ts b/client/src/app/instance/search/components/progress-bar.component.ts index 64a727878469177543983997f63934430c9d057b..ed20b92f0361354ad8723378f8709a56c795466f 100644 --- a/client/src/app/instance/search/components/progress-bar.component.ts +++ b/client/src/app/instance/search/components/progress-bar.component.ts @@ -60,7 +60,7 @@ export class ProgressBarComponent { getNavItemAStyle(currentStep: string, checked: boolean): { color: string } | null { if (this.currentStep === currentStep || checked) { return { - 'color': this.instance.config.design.design_color + 'color': this.instance.design_color } } else { return null; @@ -75,12 +75,12 @@ export class ProgressBarComponent { getNavItemIconCircleStyle(currentStep: string, checked: boolean): {} { let style = {}; if (this.currentStep === currentStep) { - style['border-color'] = this.instance.config.design.design_color; - style['background-color'] = this.instance.config.design.design_color; + style['border-color'] = this.instance.design_color; + style['background-color'] = this.instance.design_color; } if (checked) { - style['border-color'] = this.instance.config.design.design_color; - style['color'] = this.instance.config.design.design_color; + style['border-color'] = this.instance.design_color; + style['color'] = this.instance.design_color; } return style; } diff --git a/client/src/app/instance/search/components/result/datatable.component.html b/client/src/app/instance/search/components/result/datatable.component.html index 0647cae6aa7c479d26a4a022839dca28464509f0..587d19ee4cfa75a059af8ca2cd55704eadd3e6cf 100644 --- a/client/src/app/instance/search/components/result/datatable.component.html +++ b/client/src/app/instance/search/components/result/datatable.component.html @@ -35,7 +35,7 @@ <span class="far fa-square fa-lg text-secondary"></span> </span> <span *ngIf="isSelected(datum)"> - <span class="fas fa-check-square fa-lg" [ngStyle]="{ 'color': instance.config.design.design_color }"></span> + <span class="fas fa-check-square fa-lg" [ngStyle]="{ 'color': instance.design_color }"></span> </span> </button> </td> diff --git a/client/src/app/instance/search/containers/output.component.html b/client/src/app/instance/search/containers/output.component.html index 4e68b9b9cc56631b056a6459f61a8283a91094f8..a5ecb6dadc1fd1a5579fa7aee35520db9a3b37c0 100644 --- a/client/src/app/instance/search/containers/output.component.html +++ b/client/src/app/instance/search/containers/output.component.html @@ -12,7 +12,7 @@ [outputFamilyList]="outputFamilyList | async" [outputCategoryList]="outputCategoryList | async" [outputList]="outputList | async" - [designColor]="(instance | async).config.design.design_color" + [designColor]="(instance | async).design_color" (change)="updateOutputList($event)"> </app-output-tabs> </div> diff --git a/client/src/app/instance/store/effects/search-multiple.effects.ts b/client/src/app/instance/store/effects/search-multiple.effects.ts index 129727b1be6ec10ef13edab17cbb4e49947e947e..bfdf3a1bf9aa7732e14d6665c8f50d9b9393ccc0 100644 --- a/client/src/app/instance/store/effects/search-multiple.effects.ts +++ b/client/src/app/instance/store/effects/search-multiple.effects.ts @@ -77,7 +77,7 @@ export class SearchMultipleEffects { searchMultipleActions.updateSelectedDatasets({ selectedDatasets }), searchMultipleActions.checkDatasets() ); - } else if (instance.config.search.search_multiple_all_datasets_selected) { + } else if (instance.search_multiple_all_datasets_selected) { const selectedDatasets = datasetList.map(dataset => dataset.name); actions.push( searchMultipleActions.updateSelectedDatasets({ selectedDatasets }) diff --git a/client/src/app/metamodel/models/instance.model.ts b/client/src/app/metamodel/models/instance.model.ts index bbb5436413cfed03eb5fe121d83183fab8d11246..1e155b23d151de6b3d604a7f0107bfca793029b5 100644 --- a/client/src/app/metamodel/models/instance.model.ts +++ b/client/src/app/metamodel/models/instance.model.ts @@ -16,32 +16,22 @@ export interface Instance { name: string; label: string; data_path: string; - config: { - design: { - design_color: string; - design_background_color: string; - design_logo: string; - design_favicon: string; - }; - home: { - home_component: string; - home_config: { - home_component_text: string; - home_component_logo: string; - }; - }; - search: { - search_by_criteria_allowed: boolean; - search_by_criteria_label: string; - search_multiple_allowed: boolean; - search_multiple_label: string; - search_multiple_all_datasets_selected: boolean; - }; - documentation: { - documentation_allowed: boolean; - documentation_label: string; - }; + design_color: string; + design_background_color: string; + design_logo: string; + design_favicon: string; + home_component: string; + home_component_config: { + home_component_text: string; + home_component_logo: string; }; + search_by_criteria_allowed: boolean; + search_by_criteria_label: string; + search_multiple_allowed: boolean; + search_multiple_label: string; + search_multiple_all_datasets_selected: boolean; + documentation_allowed: boolean; + documentation_label: string; nb_dataset_families: number; nb_datasets: number; } diff --git a/client/src/app/shared/components/navbar.component.html b/client/src/app/shared/components/navbar.component.html index 6213927093e79526d7ccd9dc4ea7b77d689c2297..ffce6366942e45249ba4e6e9847b6ab85fbdc07f 100644 --- a/client/src/app/shared/components/navbar.component.html +++ b/client/src/app/shared/components/navbar.component.html @@ -25,7 +25,7 @@ </button> <span *ngIf="isAuthenticated" id="dropdown-menu" dropdown> <button id="button-basic" dropdownToggle type="button" class="btn btn-light" aria-controls="dropdown-basic"> - <span class="fa-stack" [ngStyle]="{ color: instance ? instance.config.design.design_color : '#7AC29A' }"> + <span class="fa-stack" [ngStyle]="{ color: instance ? instance.design_color : '#7AC29A' }"> <span class="fas fa-circle fa-2x"></span> <span class="fas fa-user fa-stack-1x fa-inverse"></span> </span> diff --git a/client/src/app/shared/components/navbar.component.ts b/client/src/app/shared/components/navbar.component.ts index 6dd71ea2ad04614e4056163940b62c58a9807c77..66e69019716c1befcc07d5ef60ae97dd04ef92c7 100644 --- a/client/src/app/shared/components/navbar.component.ts +++ b/client/src/app/shared/components/navbar.component.ts @@ -40,8 +40,8 @@ export class NavbarComponent { * @return string */ getLogoHref(): string { - if (this.instance.config.design.design_logo) { - return `${this.apiUrl}/download-instance-file/${this.instance.name}/${this.instance.config.design.design_logo}`; + if (this.instance.design_logo) { + return `${this.apiUrl}/download-instance-file/${this.instance.name}/${this.instance.design_logo}`; } return 'assets/cesam_anis40.png'; } diff --git a/conf-dev/create-db.sh b/conf-dev/create-db.sh index 9d007ea5ebfee2df17a8ea0629c777ac335c8a89..e0e599b77224be492e05524edddcb502057cec42 100644 --- a/conf-dev/create-db.sh +++ b/conf-dev/create-db.sh @@ -60,7 +60,7 @@ curl -d '{"label":"Spectra graph","value":"spectra_graph","display":20,"select_n curl -d '{"label":"Test","dbname":"anis_test","dbtype":"pdo_pgsql","dbhost":"db","dbport":5432,"dblogin":"anis","dbpassword":"anis"}' --header 'Content-Type: application/json' -X POST http://localhost/database # Add default instance -curl -d '{"name":"default","label":"Default instance","data_path":"\/DEFAULT","config":{"design":{"design_color":"#7AC29A","design_logo":"logo.png","design_favicon":"favicon.ico"},"home":{"home_component":"WelcomeComponent","home_config":{"home_component_text":"AstroNomical Information System","home_component_logo":"home_component_logo.png"}},"search":{"search_by_criteria_allowed":true,"search_by_criteria_label":"Search","search_multiple_allowed":false,"search_multiple_label":"Search multiple","search_multiple_all_datasets_selected":false},"documentation":{"documentation_allowed":false,"documentation_label":"Documentation"}}}' --header 'Content-Type: application/json' -X POST http://localhost/instance +curl -d '{"name":"default","label":"Default instance","data_path":"\/DEFAULT","design_color":"#7AC29A","design_background_color":"","design_logo":"logo.png","design_favicon":"favicon.ico","home_component":"WelcomeComponent","home_component_config":{"home_component_text":"AstroNomical Information System","home_component_logo":"home_component_logo.png"},"search_by_criteria_allowed":true,"search_by_criteria_label":"Search","search_multiple_allowed":false,"search_multiple_label":"Search multiple","search_multiple_all_datasets_selected":false,"documentation_allowed":false,"documentation_label":"Documentation"}' --header 'Content-Type: application/json' -X POST http://localhost/instance # Add ANIS, SVOM and IRIS surveys curl -d '{"name":"anis_survey","label":"ANIS survey","description":"Survey used for testing","link":"https://anis.lam.fr","manager":"F. Agneray","id_database":1}' --header 'Content-Type: application/json' -X POST http://localhost/survey diff --git a/server/cli-config.php b/server/cli-config.php index 6ad8fe5b787a83b0369c37ada6168e6ff64c8df1..d0351e855acb15e434fe25bff11bd0ccd160b1e4 100644 --- a/server/cli-config.php +++ b/server/cli-config.php @@ -27,9 +27,4 @@ if ($devMode) { $em = \Doctrine\ORM\EntityManager::create($database['connection_options'], $c); -$helpers = new Symfony\Component\Console\Helper\HelperSet(array( - 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), - 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) -)); - return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($em); diff --git a/server/doctrine-proxy/__CG__AppEntityAttribute.php b/server/doctrine-proxy/__CG__AppEntityAttribute.php index fecb1e943901737c21d88981d28e32bffa5614d9..f2c804ff7c8fa36ccb39646e673ab270dbe21789 100644 --- a/server/doctrine-proxy/__CG__AppEntityAttribute.php +++ b/server/doctrine-proxy/__CG__AppEntityAttribute.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityCriteriaFamily.php b/server/doctrine-proxy/__CG__AppEntityCriteriaFamily.php index f8c224adcdc3e9cb0079bb72e5482eb4abed8d0d..f872b7607c23c4273c75572033bf78e371c989a8 100644 --- a/server/doctrine-proxy/__CG__AppEntityCriteriaFamily.php +++ b/server/doctrine-proxy/__CG__AppEntityCriteriaFamily.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityDatabase.php b/server/doctrine-proxy/__CG__AppEntityDatabase.php index 29820260186af5992872186a4e379937fde60181..f700d2ed73f86ad1733d93c46265370ae6627a44 100644 --- a/server/doctrine-proxy/__CG__AppEntityDatabase.php +++ b/server/doctrine-proxy/__CG__AppEntityDatabase.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityDataset.php b/server/doctrine-proxy/__CG__AppEntityDataset.php index b4ef9b32f1f00f6bcd5228cc6e839d55547062b3..857d284e684341cef7497494ffbcf8b580a3323a 100644 --- a/server/doctrine-proxy/__CG__AppEntityDataset.php +++ b/server/doctrine-proxy/__CG__AppEntityDataset.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityDatasetFamily.php b/server/doctrine-proxy/__CG__AppEntityDatasetFamily.php index c933fe64e4f65af53d3d2caaa6c1f7bff0212c5e..1654475b0584bcb9bfe6449590bf906e20ce1f57 100644 --- a/server/doctrine-proxy/__CG__AppEntityDatasetFamily.php +++ b/server/doctrine-proxy/__CG__AppEntityDatasetFamily.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityGroup.php b/server/doctrine-proxy/__CG__AppEntityGroup.php index c8e25db74b26f3c60f4a144f5a9342662e127567..d416c30c0f006686a5d2631cd7bc379ca7650492 100644 --- a/server/doctrine-proxy/__CG__AppEntityGroup.php +++ b/server/doctrine-proxy/__CG__AppEntityGroup.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityInstance.php b/server/doctrine-proxy/__CG__AppEntityInstance.php index 1c792170673c2f0ae369dbd195300054c86522c1..6b47482b79f49b1c55a489739e6ba79f8ea3d05f 100644 --- a/server/doctrine-proxy/__CG__AppEntityInstance.php +++ b/server/doctrine-proxy/__CG__AppEntityInstance.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ @@ -66,10 +67,10 @@ class Instance extends \App\Entity\Instance implements \Doctrine\ORM\Proxy\Proxy public function __sleep() { if ($this->__isInitialized__) { - return ['__isInitialized__', 'name', 'label', 'dataPath', 'config', 'datasetFamilies']; + return ['__isInitialized__', 'name', 'label', 'dataPath', 'designColor', 'designBackgroundColor', 'designLogo', 'designFavicon', 'homeComponent', 'homeComponentConfig', 'searchByCriteriaAllowed', 'searchByCriteriaLabel', 'searchMultipleAllowed', 'searchMultipleLabel', 'searchMultipleAllDatasetsSelected', 'documentationAllowed', 'documentationLabel', 'datasetFamilies']; } - return ['__isInitialized__', 'name', 'label', 'dataPath', 'config', 'datasetFamilies']; + return ['__isInitialized__', 'name', 'label', 'dataPath', 'designColor', 'designBackgroundColor', 'designLogo', 'designFavicon', 'homeComponent', 'homeComponentConfig', 'searchByCriteriaAllowed', 'searchByCriteriaLabel', 'searchMultipleAllowed', 'searchMultipleLabel', 'searchMultipleAllDatasetsSelected', 'documentationAllowed', 'documentationLabel', 'datasetFamilies']; } /** @@ -238,23 +239,287 @@ class Instance extends \App\Entity\Instance implements \Doctrine\ORM\Proxy\Proxy /** * {@inheritDoc} */ - public function getConfig() + public function getDesignColor() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDesignColor', []); + + return parent::getDesignColor(); + } + + /** + * {@inheritDoc} + */ + public function setDesignColor($designColor) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDesignColor', [$designColor]); + + return parent::setDesignColor($designColor); + } + + /** + * {@inheritDoc} + */ + public function getDesignBackgroundColor() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDesignBackgroundColor', []); + + return parent::getDesignBackgroundColor(); + } + + /** + * {@inheritDoc} + */ + public function setDesignBackgroundColor($designBackgroundColor) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDesignBackgroundColor', [$designBackgroundColor]); + + return parent::setDesignBackgroundColor($designBackgroundColor); + } + + /** + * {@inheritDoc} + */ + public function getDesignLogo() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDesignLogo', []); + + return parent::getDesignLogo(); + } + + /** + * {@inheritDoc} + */ + public function setDesignLogo($designLogo) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDesignLogo', [$designLogo]); + + return parent::setDesignLogo($designLogo); + } + + /** + * {@inheritDoc} + */ + public function getDesignFavicon() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDesignFavicon', []); + + return parent::getDesignFavicon(); + } + + /** + * {@inheritDoc} + */ + public function setDesignFavicon($designFavicon) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDesignFavicon', [$designFavicon]); + + return parent::setDesignFavicon($designFavicon); + } + + /** + * {@inheritDoc} + */ + public function getHomeComponent() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHomeComponent', []); + + return parent::getHomeComponent(); + } + + /** + * {@inheritDoc} + */ + public function setHomeComponent($homeComponent) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHomeComponent', [$homeComponent]); + + return parent::setHomeComponent($homeComponent); + } + + /** + * {@inheritDoc} + */ + public function getHomeComponentConfig() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHomeComponentConfig', []); + + return parent::getHomeComponentConfig(); + } + + /** + * {@inheritDoc} + */ + public function setHomeComponentConfig($homeComponentConfig) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHomeComponentConfig', [$homeComponentConfig]); + + return parent::setHomeComponentConfig($homeComponentConfig); + } + + /** + * {@inheritDoc} + */ + public function getSearchByCriteriaAllowed() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSearchByCriteriaAllowed', []); + + return parent::getSearchByCriteriaAllowed(); + } + + /** + * {@inheritDoc} + */ + public function setSearchByCriteriaAllowed($searchByCriteriaAllowed) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSearchByCriteriaAllowed', [$searchByCriteriaAllowed]); + + return parent::setSearchByCriteriaAllowed($searchByCriteriaAllowed); + } + + /** + * {@inheritDoc} + */ + public function getSearchByCriteriaLabel() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSearchByCriteriaLabel', []); + + return parent::getSearchByCriteriaLabel(); + } + + /** + * {@inheritDoc} + */ + public function setSearchByCriteriaLabel($searchByCriteriaLabel) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSearchByCriteriaLabel', [$searchByCriteriaLabel]); + + return parent::setSearchByCriteriaLabel($searchByCriteriaLabel); + } + + /** + * {@inheritDoc} + */ + public function getSearchMultipleAllowed() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSearchMultipleAllowed', []); + + return parent::getSearchMultipleAllowed(); + } + + /** + * {@inheritDoc} + */ + public function setSearchMultipleAllowed($searchMultipleAllowed) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSearchMultipleAllowed', [$searchMultipleAllowed]); + + return parent::setSearchMultipleAllowed($searchMultipleAllowed); + } + + /** + * {@inheritDoc} + */ + public function getSearchMultipleLabel() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSearchMultipleLabel', []); + + return parent::getSearchMultipleLabel(); + } + + /** + * {@inheritDoc} + */ + public function setSearchMultipleLabel($searchMultipleLabel) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSearchMultipleLabel', [$searchMultipleLabel]); + + return parent::setSearchMultipleLabel($searchMultipleLabel); + } + + /** + * {@inheritDoc} + */ + public function getSearchMultipleAllDatasetsSelected() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSearchMultipleAllDatasetsSelected', []); + + return parent::getSearchMultipleAllDatasetsSelected(); + } + + /** + * {@inheritDoc} + */ + public function setSearchMultipleAllDatasetsSelected($searchMultipleAllDatasetsSelected) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSearchMultipleAllDatasetsSelected', [$searchMultipleAllDatasetsSelected]); + + return parent::setSearchMultipleAllDatasetsSelected($searchMultipleAllDatasetsSelected); + } + + /** + * {@inheritDoc} + */ + public function getDocumentationAllowed() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDocumentationAllowed', []); + + return parent::getDocumentationAllowed(); + } + + /** + * {@inheritDoc} + */ + public function setDocumentationAllowed($documentationAllowed) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDocumentationAllowed', [$documentationAllowed]); + + return parent::setDocumentationAllowed($documentationAllowed); + } + + /** + * {@inheritDoc} + */ + public function getDocumentationLabel() { - $this->__initializer__ && $this->__initializer__->__invoke($this, 'getConfig', []); + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDocumentationLabel', []); - return parent::getConfig(); + return parent::getDocumentationLabel(); } /** * {@inheritDoc} */ - public function setConfig($config) + public function setDocumentationLabel($documentationLabel) { - $this->__initializer__ && $this->__initializer__->__invoke($this, 'setConfig', [$config]); + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDocumentationLabel', [$documentationLabel]); - return parent::setConfig($config); + return parent::setDocumentationLabel($documentationLabel); } /** diff --git a/server/doctrine-proxy/__CG__AppEntityOption.php b/server/doctrine-proxy/__CG__AppEntityOption.php index 10bf9bfcc96a44a50804f98ac73cf182428953f3..f101582d195f2863b3aeefd1c9ee2c28e664ad4b 100644 --- a/server/doctrine-proxy/__CG__AppEntityOption.php +++ b/server/doctrine-proxy/__CG__AppEntityOption.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityOutputCategory.php b/server/doctrine-proxy/__CG__AppEntityOutputCategory.php index 697217f516e344e8cf30ee837d935c8af6325ace..95d24126b098dbe59843f52f5704c2a4f1fdb258 100644 --- a/server/doctrine-proxy/__CG__AppEntityOutputCategory.php +++ b/server/doctrine-proxy/__CG__AppEntityOutputCategory.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntityOutputFamily.php b/server/doctrine-proxy/__CG__AppEntityOutputFamily.php index 0faa5bac9862991679f0344787bc83b1a3ed9b7d..14fe15d5431a6f084cde701469a42bbce8121480 100644 --- a/server/doctrine-proxy/__CG__AppEntityOutputFamily.php +++ b/server/doctrine-proxy/__CG__AppEntityOutputFamily.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntitySelect.php b/server/doctrine-proxy/__CG__AppEntitySelect.php index 88871e3465157f23680686957f07c70ad68960cc..00df23065298acf482a35cc3a1685f7eb5badc2c 100644 --- a/server/doctrine-proxy/__CG__AppEntitySelect.php +++ b/server/doctrine-proxy/__CG__AppEntitySelect.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/doctrine-proxy/__CG__AppEntitySurvey.php b/server/doctrine-proxy/__CG__AppEntitySurvey.php index 75107381de1471b664480b62b8713b1816833f38..aa09365115e9cb3c363ca1792b65ff15a75f62f0 100644 --- a/server/doctrine-proxy/__CG__AppEntitySurvey.php +++ b/server/doctrine-proxy/__CG__AppEntitySurvey.php @@ -2,6 +2,7 @@ namespace DoctrineProxies\__CG__\App\Entity; + /** * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR */ diff --git a/server/src/Action/InstanceAction.php b/server/src/Action/InstanceAction.php index 82442eb8881917e3e9b2c9292758a7c513ec383c..b06de54ef2a199417a3247f2e52b7a073aac10f3 100644 --- a/server/src/Action/InstanceAction.php +++ b/server/src/Action/InstanceAction.php @@ -60,7 +60,7 @@ final class InstanceAction extends AbstractAction $parsedBody = $request->getParsedBody(); // If mandatories empty fields 400 - foreach (array('label', 'data_path') as $a) { + foreach (array('label') as $a) { if ($this->isEmptyField($a, $parsedBody)) { throw new HttpBadRequestException( $request, @@ -93,8 +93,21 @@ final class InstanceAction extends AbstractAction private function editInstance(Instance $instance, array $parsedBody): void { $instance->setLabel($parsedBody['label']); - $instance->setConfig($parsedBody['config']); $instance->setDataPath($parsedBody['data_path']); + $instance->setDesignColor($parsedBody['design_color']); + $instance->setDesignBackgroundColor($parsedBody['design_background_color']); + $instance->setDesignLogo($parsedBody['design_logo']); + $instance->setDesignFavicon($parsedBody['design_favicon']); + $instance->setHomeComponent($parsedBody['home_component']); + $instance->setHomeComponentConfig($parsedBody['home_component_config']); + $instance->setSearchByCriteriaAllowed($parsedBody['search_by_criteria_allowed']); + $instance->setSearchByCriteriaLabel($parsedBody['search_by_criteria_label']); + $instance->setSearchMultipleAllowed($parsedBody['search_multiple_allowed']); + $instance->setSearchMultipleLabel($parsedBody['search_multiple_label']); + $instance->setSearchMultipleAllDatasetsSelected($parsedBody['search_multiple_all_datasets_selected']); + $instance->setDocumentationAllowed($parsedBody['documentation_allowed']); + $instance->setDocumentationLabel($parsedBody['documentation_label']); + $this->em->flush(); } } diff --git a/server/src/Action/InstanceListAction.php b/server/src/Action/InstanceListAction.php index 9e226441a04659f0e18a5ae2b3ce00c08ef3c6a6..7e7dae416ca9b6727630b5f0f7c833d25fb95a91 100644 --- a/server/src/Action/InstanceListAction.php +++ b/server/src/Action/InstanceListAction.php @@ -48,7 +48,7 @@ final class InstanceListAction extends AbstractAction $parsedBody = $request->getParsedBody(); // To work this action needs user information to update - foreach (array('name', 'label', 'data_path') as $a) { + foreach (array('name', 'label') as $a) { if ($this->isEmptyField($a, $parsedBody)) { throw new HttpBadRequestException( $request, @@ -76,8 +76,20 @@ final class InstanceListAction extends AbstractAction private function postInstance(array $parsedBody): Instance { $instance = new Instance($parsedBody['name'], $parsedBody['label']); - $instance->setConfig($parsedBody['config']); $instance->setDataPath($parsedBody['data_path']); + $instance->setDesignColor($parsedBody['design_color']); + $instance->setDesignBackgroundColor($parsedBody['design_background_color']); + $instance->setDesignLogo($parsedBody['design_logo']); + $instance->setDesignFavicon($parsedBody['design_favicon']); + $instance->setHomeComponent($parsedBody['home_component']); + $instance->setHomeComponentConfig($parsedBody['home_component_config']); + $instance->setSearchByCriteriaAllowed($parsedBody['search_by_criteria_allowed']); + $instance->setSearchByCriteriaLabel($parsedBody['search_by_criteria_label']); + $instance->setSearchMultipleAllowed($parsedBody['search_multiple_allowed']); + $instance->setSearchMultipleLabel($parsedBody['search_multiple_label']); + $instance->setSearchMultipleAllDatasetsSelected($parsedBody['search_multiple_all_datasets_selected']); + $instance->setDocumentationAllowed($parsedBody['documentation_allowed']); + $instance->setDocumentationLabel($parsedBody['documentation_label']); $this->em->persist($instance); $this->em->flush(); diff --git a/server/src/Entity/Instance.php b/server/src/Entity/Instance.php index e0e6f3850bd74aa4acdfb06d29d70ca17773cd1c..fac4540ece8bbd9e44764ae8b13994bf49de2467 100644 --- a/server/src/Entity/Instance.php +++ b/server/src/Entity/Instance.php @@ -48,9 +48,93 @@ class Instance implements \JsonSerializable /** * @var string * - * @Column(type="json", nullable=true) + * @Column(type="string", name="design_color", nullable=true) */ - protected $config; + protected $designColor; + + /** + * @var string + * + * @Column(type="string", name="design_background_color", nullable=true) + */ + protected $designBackgroundColor; + + /** + * @var string + * + * @Column(type="string", name="design_logo", nullable=true) + */ + protected $designLogo; + + /** + * @var string + * + * @Column(type="string", name="design_favicon", nullable=true) + */ + protected $designFavicon; + + /** + * @var string + * + * @Column(type="string", name="home_component", nullable=true) + */ + protected $homeComponent; + + /** + * @var array + * + * @Column(type="json", name="home_component_config", nullable=true) + */ + protected $homeComponentConfig; + + /** + * @var bool + * + * @Column(type="boolean", name="search_by_criteria_allowed", nullable=false) + */ + protected $searchByCriteriaAllowed; + + /** + * @var string + * + * @Column(type="string", name="search_by_criteria_label", nullable=false) + */ + protected $searchByCriteriaLabel; + + /** + * @var bool + * + * @Column(type="boolean", name="search_multiple_allowed", nullable=false) + */ + protected $searchMultipleAllowed; + + /** + * @var string + * + * @Column(type="string", name="search_multiple_label", nullable=false) + */ + protected $searchMultipleLabel; + + /** + * @var bool + * + * @Column(type="boolean", name="search_multiple_all_datasets_selected", nullable=false) + */ + protected $searchMultipleAllDatasetsSelected; + + /** + * @var bool + * + * @Column(type="boolean", name="documentation_allowed", nullable=false) + */ + protected $documentationAllowed; + + /** + * @var string + * + * @Column(type="string", name="documentation_label", nullable=false) + */ + protected $documentationLabel; /** * @var DatasetFamily[] @@ -91,14 +175,134 @@ class Instance implements \JsonSerializable $this->dataPath = $dataPath; } - public function getConfig() + public function getDesignColor() + { + return $this->designColor; + } + + public function setDesignColor($designColor) + { + $this->designColor = $designColor; + } + + public function getDesignBackgroundColor() + { + return $this->designBackgroundColor; + } + + public function setDesignBackgroundColor($designBackgroundColor) + { + $this->designBackgroundColor = $designBackgroundColor; + } + + public function getDesignLogo() + { + return $this->designLogo; + } + + public function setDesignLogo($designLogo) + { + $this->designLogo = $designLogo; + } + + public function getDesignFavicon() + { + return $this->designFavicon; + } + + public function setDesignFavicon($designFavicon) + { + $this->designFavicon = $designFavicon; + } + + public function getHomeComponent() + { + return $this->homeComponent; + } + + public function setHomeComponent($homeComponent) + { + $this->homeComponent = $homeComponent; + } + + public function getHomeComponentConfig() + { + return $this->homeComponentConfig; + } + + public function setHomeComponentConfig($homeComponentConfig) + { + $this->homeComponentConfig = $homeComponentConfig; + } + + public function getSearchByCriteriaAllowed() + { + return $this->searchByCriteriaAllowed; + } + + public function setSearchByCriteriaAllowed($searchByCriteriaAllowed) + { + $this->searchByCriteriaAllowed = $searchByCriteriaAllowed; + } + + public function getSearchByCriteriaLabel() + { + return $this->searchByCriteriaLabel; + } + + public function setSearchByCriteriaLabel($searchByCriteriaLabel) + { + $this->searchByCriteriaLabel = $searchByCriteriaLabel; + } + + public function getSearchMultipleAllowed() + { + return $this->searchMultipleAllowed; + } + + public function setSearchMultipleAllowed($searchMultipleAllowed) + { + $this->searchMultipleAllowed = $searchMultipleAllowed; + } + + public function getSearchMultipleLabel() + { + return $this->searchMultipleLabel; + } + + public function setSearchMultipleLabel($searchMultipleLabel) + { + $this->searchMultipleLabel = $searchMultipleLabel; + } + + public function getSearchMultipleAllDatasetsSelected() + { + return $this->searchMultipleAllDatasetsSelected; + } + + public function setSearchMultipleAllDatasetsSelected($searchMultipleAllDatasetsSelected) + { + $this->searchMultipleAllDatasetsSelected = $searchMultipleAllDatasetsSelected; + } + + public function getDocumentationAllowed() + { + return $this->documentationAllowed; + } + + public function setDocumentationAllowed($documentationAllowed) + { + $this->documentationAllowed = $documentationAllowed; + } + + public function getDocumentationLabel() { - return $this->config; + return $this->documentationLabel; } - public function setConfig($config) + public function setDocumentationLabel($documentationLabel) { - $this->config = $config; + $this->documentationLabel = $documentationLabel; } public function getDatasetFamilies() @@ -121,7 +325,19 @@ class Instance implements \JsonSerializable 'name' => $this->getName(), 'label' => $this->getLabel(), 'data_path' => $this->getDataPath(), - 'config' => $this->getConfig(), + 'design_color' => $this->getDesignColor(), + 'design_background_color' => $this->getDesignBackgroundColor(), + 'design_logo' => $this->getDesignLogo(), + 'designFavicon' => $this->getDesignFavicon(), + 'home_component' => $this->getHomeComponent(), + 'home_component_config' => $this->getHomeComponentConfig(), + 'search_by_criteria_allowed' => $this->getSearchByCriteriaAllowed(), + 'search_by_criteria_label' => $this->getSearchByCriteriaLabel(), + 'search_multiple_allowed' => $this->getSearchMultipleAllowed(), + 'search_multiple_label' => $this->getSearchMultipleLabel(), + 'search_multiple_all_datasets_selected' => $this->getSearchMultipleAllDatasetsSelected(), + 'documentation_allowed' => $this->getDocumentationAllowed(), + 'documentation_label' => $this->getDocumentationLabel(), 'nb_dataset_families' => count($this->getDatasetFamilies()), 'nb_datasets' => $this->getNbDatasets() ];