Allow Organization Creator to be visible by configuration (ref #255)
This commit is contained in:
parent
05e2374f97
commit
8ae58c9ef3
|
@ -57,6 +57,11 @@ export class ConfigurationService extends BaseComponent {
|
|||
return this._guideAssets;
|
||||
}
|
||||
|
||||
private _allowOrganizationCreator: boolean;
|
||||
get allowOrganizationCreator():boolean {
|
||||
return this._allowOrganizationCreator;
|
||||
}
|
||||
|
||||
|
||||
public loadConfiguration(): Promise<any> {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
<mat-error *ngIf="formGroup.get('organisations').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' |
|
||||
translate}}</mat-error>
|
||||
<mat-hint>{{'DMP-EDITOR.FIELDS.ORGANISATIONS-HINT' | translate}}</mat-hint>
|
||||
<button matSuffix class="input-btn" [disabled]="canAddOrganizations()" type="button" (click)="addOrganization($event)">
|
||||
<button *ngIf="showOrganizationCreator()" matSuffix class="input-btn" [disabled]="canAddOrganizations()" type="button" (click)="addOrganization($event)">
|
||||
<mat-icon class="icon-btn">add_circle</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -49,5 +49,6 @@
|
|||
"logLevels": ["debug", "info", "warning", "error"]
|
||||
},
|
||||
"lockInterval": 60000,
|
||||
"guideAssets": "assets/images/guide"
|
||||
"guideAssets": "assets/images/guide",
|
||||
"allowOrganizationCreator": true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue