diff --git a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts index e95d87773..e6d544816 100644 --- a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts +++ b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts @@ -57,6 +57,11 @@ export class ConfigurationService extends BaseComponent { return this._guideAssets; } + private _allowOrganizationCreator: boolean; + get allowOrganizationCreator():boolean { + return this._allowOrganizationCreator; + } + public loadConfiguration(): Promise { return new Promise((r, e) => { @@ -92,6 +97,7 @@ export class ConfigurationService extends BaseComponent { this._logging = Logging.parseValue(config.logging); this._lockInterval = config.lockInterval; this._guideAssets = config.guideAssets; + this._allowOrganizationCreator = config.allowOrganizationCreator; } } diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html index 50d7d2fef..620a27cb4 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html @@ -46,7 +46,7 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} {{'DMP-EDITOR.FIELDS.ORGANISATIONS-HINT' | translate}} - diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts index f21ddfed9..1435dfaef 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts @@ -22,6 +22,7 @@ import { Observable } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; import { AddOrganizationComponent } from '../add-organization/add-organization.component'; import { isNullOrUndefined } from 'util'; +import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; @Component({ selector: 'app-general-tab', @@ -71,7 +72,8 @@ export class GeneralTabComponent extends BaseComponent implements OnInit { private externalSourcesService: ExternalSourcesService, private _service: DmpService, private dialog: MatDialog, - private language: TranslateService + private language: TranslateService, + private configurationService: ConfigurationService ) { super(); } @@ -194,6 +196,10 @@ export class GeneralTabComponent extends BaseComponent implements OnInit { }); } + showOrganizationCreator(): boolean { + return this.configurationService.allowOrganizationCreator; + } + canAddOrganizations(): boolean { if (!isNullOrUndefined(this.formGroup.get('organizations'))) { return this.formGroup.get('organiztions').disabled; diff --git a/dmp-frontend/src/assets/config/config.json b/dmp-frontend/src/assets/config/config.json index 1c32e5676..7674363b7 100644 --- a/dmp-frontend/src/assets/config/config.json +++ b/dmp-frontend/src/assets/config/config.json @@ -49,5 +49,6 @@ "logLevels": ["debug", "info", "warning", "error"] }, "lockInterval": 60000, - "guideAssets": "assets/images/guide" + "guideAssets": "assets/images/guide", + "allowOrganizationCreator": true }