|
|
@@ -15,6 +15,8 @@ export class AdjusterPresetsService {
|
|
|
applicationLoD = 'http://www.semanticweb.org/attractiveness/municipality';
|
|
|
applicationCoverage = 'http://www.semanticweb.org/attractiveness/CzechRepublic';
|
|
|
defaultSchemaId: string;
|
|
|
+ enabledRoleIds: Array<string>;
|
|
|
+ enabledSchemaIds: Array<string>;
|
|
|
|
|
|
schemaChanges: Subject<Schema> = new Subject();
|
|
|
problemChanges: Subject<Problem> = new Subject();
|
|
|
@@ -26,7 +28,9 @@ export class AdjusterPresetsService {
|
|
|
constructor(
|
|
|
public adjusterEventService: AdjusterEventService,
|
|
|
private hsLanguageService: HsLanguageService
|
|
|
- ) {
|
|
|
+ ) {
|
|
|
+ this.enabledRoleIds = attractivenessConfig?.enabledRoles;
|
|
|
+ this.enabledSchemaIds = attractivenessConfig?.enabledSchemas;
|
|
|
this.defaultSchemaId = attractivenessConfig?.defaultClassificationSchema;
|
|
|
this.adjusterEventService.ontologyLoads.subscribe((ontology) => {
|
|
|
this.ontology = ontology;
|
|
|
@@ -101,6 +105,9 @@ export class AdjusterPresetsService {
|
|
|
)
|
|
|
}
|
|
|
});
|
|
|
+ if (this.enabledRoleIds) {
|
|
|
+ this.roles = this.roles.filter((role) => this.enabledRoleIds.includes(role.id));
|
|
|
+ }
|
|
|
this.activeRole = this.roles[0];
|
|
|
this.activeProblem = this.roles[0].problems[0];
|
|
|
}
|
|
|
@@ -122,6 +129,9 @@ export class AdjusterPresetsService {
|
|
|
)
|
|
|
}
|
|
|
});
|
|
|
+ if (this.enabledSchemaIds) {
|
|
|
+ this.schemas = this.schemas.filter((schema) => this.enabledSchemaIds.includes(schema.id));
|
|
|
+ }
|
|
|
this.activeSchema = this.schemas.find((schema) => schema.id == this.defaultSchemaId) ?? this.schemas[0];
|
|
|
this.schemaChanges.next(this.activeSchema);
|
|
|
}
|