From 650ba5f72e384c007eedf062511b21711e895129 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Wed, 2 Dec 2026 13:14:52 +0100 Subject: [PATCH 1/7] Updatesettings and meta --- .../models/organizations/organization.ts | 5 ++++ .../organization-settings.component.html | 24 +++++++++++-------- .../organization-settings.component.ts | 4 ++-- meta | 2 +- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/client/src/app/domain/models/organizations/organization.ts b/client/src/app/domain/models/organizations/organization.ts index 60717a2e742..3fd891cc2ba 100644 --- a/client/src/app/domain/models/organizations/organization.ts +++ b/client/src/app/domain/models/organizations/organization.ts @@ -34,6 +34,9 @@ export class OrganizationSetting { public saml_enabled!: boolean; // default: false public saml_login_button_text!: string; + public idm_identity_key: string; + public idm_committee_management_key!: string; + public idm_organization_management_key!: string; public saml_attr_mapping!: unknown; public saml_metadata_idp!: string; public saml_metadata_sp!: string; @@ -83,6 +86,8 @@ export class Organization extends BaseModel { `require_duplicate_from`, `enable_anonymous`, `restrict_editing_same_level_committee_admins`, + `idm_committee_management_key`, + `idm_organization_management_key`, `saml_enabled`, `saml_login_button_text`, `saml_attr_mapping`, diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html index b166455ae5d..c83ec2ac154 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html @@ -223,16 +223,6 @@

{{ 'Single Sign-On settings' | translate }}

Separate group ids with comma - - {{ 'Committee Admin Mapping Attribute' | translate }} - - - - - {{ 'Organizationadmin or Accountadmin Mapping Attribute' | translate }} - - - {{ 'Condition' | translate }} @@ -295,6 +285,20 @@

{{ 'Single Sign-On settings' | translate }}

+
+ + {{ 'Committee Admin Mapping Attribute' | translate }} + + +
+
+ + + {{ 'Organizationadmin or Accountadmin Mapping Attribute' | translate }} + + + +
{{ 'Metadata of Identity Provider (IdP)' | translate }} diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts index 694b3a73032..cd48f618472 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts @@ -55,8 +55,6 @@ export class OrganizationSettingsComponent extends BaseComponent { id: new FormControl(null), group_external_ids: new FormControl([``]), weight: new FormControl(null), - idm_committee_management_key: new FormControl(``), - idm_organization_management_key: new FormControl(``) }); public conditionForm = new FormGroup({ @@ -179,6 +177,8 @@ export class OrganizationSettingsComponent extends BaseComponent { ], restrict_edit_forward_committees: [this._currentOrgaSettings.restrict_edit_forward_committees ?? false], saml_login_button_text: [this._currentOrgaSettings.saml_login_button_text], + idm_committee_management_key: [this._currentOrgaSettings.idm_committee_management_key], + idm_organization_management_key: [this._currentOrgaSettings.idm_organization_management_key], saml_attr_mapping: [ this._currentOrgaSettings.saml_attr_mapping && typeof this._currentOrgaSettings.saml_attr_mapping !== `string` diff --git a/meta b/meta index e0b79cc83fd..1fdfd9a7cfa 160000 --- a/meta +++ b/meta @@ -1 +1 @@ -Subproject commit e0b79cc83fdc55f9bd91a973732c56d463f4d1e8 +Subproject commit 1fdfd9a7cfaceedccb36cbad1be38b60d5ae3f68 From df0cc137f2ba818ecb1b52f8e69fee12ec808049 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Wed, 2 Dec 2026 14:04:08 +0100 Subject: [PATCH 2/7] Add identity_key to subscription --- .../organization/pages/committees/committees.subscription.ts | 2 ++ .../components/meeting-edit/meeting-edit.component.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts index db7c2838e94..8d1e48d30f3 100644 --- a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts +++ b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts @@ -39,6 +39,7 @@ export const getCommitteeListMinimalSubscriptionConfig: SubscriptionConfigGenera `meeting_ids`, `forward_to_committee_ids`, `receive_forwardings_from_committee_ids`, + `identity_key`, `organization_tag_ids`, `manager_ids`, `external_id`, @@ -60,6 +61,7 @@ export const getCommitteeDetailSubscriptionConfig: SubscriptionConfigGenerator = `description`, `forward_to_committee_ids`, `id`, + `identity_key`, `manager_ids`, `native_user_ids`, `all_parent_ids`, diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts index 51216e4c0dd..51d6b55de9b 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts @@ -287,6 +287,7 @@ export class MeetingEditComponent extends BaseComponent implements OnInit { ], admin_ids: [[], Validators.minLength(1)], organization_tag_ids: [[]], + identity_key: [``], external_id: [``] }; From ddeed338a19d6d6790cde3d3c6bdc99149dd3a75 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Wed, 2 Dec 2026 14:07:17 +0100 Subject: [PATCH 3/7] Linter --- .../organization-settings.component.html | 20 +++++++++---------- .../organization-settings.component.ts | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html index c83ec2ac154..fad42fe1412 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html @@ -286,18 +286,18 @@

{{ 'Single Sign-On settings' | translate }}

- - {{ 'Committee Admin Mapping Attribute' | translate }} - - + + {{ 'Committee Admin Mapping Attribute' | translate }} + +
- - - {{ 'Organizationadmin or Accountadmin Mapping Attribute' | translate }} - - - + + + {{ 'Organizationadmin or Accountadmin Mapping Attribute' | translate }} + + +
diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts index cd48f618472..9f5bae31c99 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts @@ -54,7 +54,7 @@ export class OrganizationSettingsComponent extends BaseComponent { public mapperForm = new FormGroup({ id: new FormControl(null), group_external_ids: new FormControl([``]), - weight: new FormControl(null), + weight: new FormControl(null) }); public conditionForm = new FormGroup({ From f6892d246baa4c0e0c609eea36049fbd1b860839 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Wed, 2 Dec 2026 14:19:56 +0100 Subject: [PATCH 4/7] update models --- client/src/app/domain/models/organizations/organization.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/app/domain/models/organizations/organization.ts b/client/src/app/domain/models/organizations/organization.ts index 3fd891cc2ba..f25df5eb962 100644 --- a/client/src/app/domain/models/organizations/organization.ts +++ b/client/src/app/domain/models/organizations/organization.ts @@ -86,14 +86,15 @@ export class Organization extends BaseModel { `require_duplicate_from`, `enable_anonymous`, `restrict_editing_same_level_committee_admins`, - `idm_committee_management_key`, - `idm_organization_management_key`, `saml_enabled`, `saml_login_button_text`, `saml_attr_mapping`, `saml_metadata_idp`, `saml_metadata_sp`, `saml_private_key`, + `idm_identity_key`, + `idm_organization_management_key`, + `idm_committee_management_key`, `committee_ids`, `active_meeting_ids`, `archived_meeting_ids`, From 50fb2bedad6f3c8e5ad06f4323ad8dbfe1fb5394 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Wed, 2 Dec 2026 16:31:43 +0100 Subject: [PATCH 5/7] Create models, repos and actions --- .../app/domain/models/idm/idm-condition.ts | 16 +++++++ .../src/app/domain/models/idm/idm-mapper.ts | 25 ++++++++++ .../src/app/domain/models/idm/idm-mapping.ts | 35 ++++++++++++++ .../models/organizations/organization.ts | 2 + .../idm/idm-condition-repository.service.ts | 42 ++++++++++++++++ .../repositories/idm/idm-condition.action.ts | 5 ++ .../idm/idm-mapper-repository.service.ts | 45 +++++++++++++++++ .../repositories/idm/idm-mapper.action.ts | 6 +++ .../idm/idm-mapping-repository.service.ts | 48 +++++++++++++++++++ .../repositories/idm/idm-mapping.action.ts | 5 ++ .../gateways/repositories/idm/idm.config.ts | 32 +++++++++++++ .../definitions/relations/relations.ts | 23 +++++++++ .../services/app-load.service.ts | 4 +- .../view-models/view-idm-condition.ts | 19 ++++++++ .../view-models/view-idm-mapper.ts | 23 +++++++++ .../view-models/view-idm-mapping.ts | 19 ++++++++ .../view-models/view-organization.ts | 2 + 17 files changed, 350 insertions(+), 1 deletion(-) create mode 100644 client/src/app/domain/models/idm/idm-condition.ts create mode 100644 client/src/app/domain/models/idm/idm-mapper.ts create mode 100644 client/src/app/domain/models/idm/idm-mapping.ts create mode 100644 client/src/app/gateways/repositories/idm/idm-condition-repository.service.ts create mode 100644 client/src/app/gateways/repositories/idm/idm-condition.action.ts create mode 100644 client/src/app/gateways/repositories/idm/idm-mapper-repository.service.ts create mode 100644 client/src/app/gateways/repositories/idm/idm-mapper.action.ts create mode 100644 client/src/app/gateways/repositories/idm/idm-mapping-repository.service.ts create mode 100644 client/src/app/gateways/repositories/idm/idm-mapping.action.ts create mode 100644 client/src/app/gateways/repositories/idm/idm.config.ts create mode 100644 client/src/app/site/pages/organization/view-models/view-idm-condition.ts create mode 100644 client/src/app/site/pages/organization/view-models/view-idm-mapper.ts create mode 100644 client/src/app/site/pages/organization/view-models/view-idm-mapping.ts diff --git a/client/src/app/domain/models/idm/idm-condition.ts b/client/src/app/domain/models/idm/idm-condition.ts new file mode 100644 index 00000000000..174a6a3ece1 --- /dev/null +++ b/client/src/app/domain/models/idm/idm-condition.ts @@ -0,0 +1,16 @@ +import { Id } from '../../definitions/key-types'; +import { BaseModel } from '../base/base-model'; + +export class IdmCondition extends BaseModel { + public static COLLECTION = `idm_condition`; + + public idm_field!: string; + public regex!: string; + public mapper_id!: Id; // idm_mapper/condition_ids + + public constructor(input?: Partial) { + super(IdmCondition.COLLECTION, input); + } + + public static readonly REQUESTABLE_FIELDS: (keyof IdmCondition)[] = [`id`, `idm_field`, `regex`, `mapper_id`]; +} diff --git a/client/src/app/domain/models/idm/idm-mapper.ts b/client/src/app/domain/models/idm/idm-mapper.ts new file mode 100644 index 00000000000..2b1b5513fd8 --- /dev/null +++ b/client/src/app/domain/models/idm/idm-mapper.ts @@ -0,0 +1,25 @@ +import { Id } from '../../definitions/key-types'; +import { BaseModel } from '../base/base-model'; + +export class IdmMapper extends BaseModel { + public static COLLECTION = `idm_mapper`; + + public group_external_ids!: string[]; + public weight?: number; + public organization_id!: Id; // organization/idm_mapper_ids + public condition_ids!: Id[]; // (idm_condition/mapper_id)[] + public mapping_ids!: Id[]; // (idm_mapping/mapper_id)[] + + public constructor(input?: Partial) { + super(IdmMapper.COLLECTION, input); + } + + public static readonly REQUESTABLE_FIELDS: (keyof IdmMapper)[] = [ + `id`, + `group_external_ids`, + `weight`, + `organization_id`, + `condition_ids`, + `mapping_ids` + ]; +} diff --git a/client/src/app/domain/models/idm/idm-mapping.ts b/client/src/app/domain/models/idm/idm-mapping.ts new file mode 100644 index 00000000000..681bb9d430d --- /dev/null +++ b/client/src/app/domain/models/idm/idm-mapping.ts @@ -0,0 +1,35 @@ +import { Id } from '../../definitions/key-types'; +import { BaseModel } from '../base/base-model'; + +export enum IdmMappingOsField { + STRUCTURE_LEVEL_IDS = `structure_level_ids`, + NUMBER = `number`, + VOTE_WEIGHT = `vote_weight`, + PRESENT = `present`, + COMMENT = `comment` +} + +export class IdmMapping extends BaseModel { + public static COLLECTION = `idm_mapping`; + + public idm_field!: string; + public os_field!: IdmMappingOsField; + public default_value?: string; + public allow_update?: boolean; + public override_default?: boolean; + public mapper_id!: Id; // idm_mapper/mapping_ids + + public constructor(input?: Partial) { + super(IdmMapping.COLLECTION, input); + } + + public static readonly REQUESTABLE_FIELDS: (keyof IdmMapping)[] = [ + `id`, + `idm_field`, + `os_field`, + `default_value`, + `allow_update`, + `override_default`, + `mapper_id` + ]; +} diff --git a/client/src/app/domain/models/organizations/organization.ts b/client/src/app/domain/models/organizations/organization.ts index f25df5eb962..0d313fa8c4f 100644 --- a/client/src/app/domain/models/organizations/organization.ts +++ b/client/src/app/domain/models/organizations/organization.ts @@ -59,6 +59,7 @@ export class Organization extends BaseModel { public template_meeting_ids!: Id[]; // (meeting/template_for_organization_id)[]; public mediafile_ids!: Id[]; public gender_ids!: Id[]; // (gender/organization_id); + public idm_mapper_ids!: Id[]; // (idm_mapper/organization_id)[]; public published_mediafile_ids!: Id[]; public time_zone!: string; @@ -95,6 +96,7 @@ export class Organization extends BaseModel { `idm_identity_key`, `idm_organization_management_key`, `idm_committee_management_key`, + `idm_mapper_ids`, `committee_ids`, `active_meeting_ids`, `archived_meeting_ids`, diff --git a/client/src/app/gateways/repositories/idm/idm-condition-repository.service.ts b/client/src/app/gateways/repositories/idm/idm-condition-repository.service.ts new file mode 100644 index 00000000000..a9932981249 --- /dev/null +++ b/client/src/app/gateways/repositories/idm/idm-condition-repository.service.ts @@ -0,0 +1,42 @@ +import { Service } from '@angular/core'; +import { Id } from '@app/domain/definitions/key-types'; +import { Identifiable } from '@app/domain/interfaces'; +import { IdmCondition } from '@app/domain/models/idm/idm-condition'; +import { BaseRepository } from '@app/gateways/repositories/base-repository'; +import { ViewIdmCondition } from '@app/site/pages/organization/view-models/view-idm-condition'; + +import { Action } from '../../actions/action'; +import { IdmConditionAction } from './idm-condition.action'; + +@Service() +export class IdmConditionRepositoryService extends BaseRepository { + public baseModelCtor = IdmCondition; + + public getVerboseName = (plural?: boolean): string => + this.translate.instant(plural ? `IDM conditions` : `IDM condition`); + + public getTitle = (viewModel: ViewIdmCondition): string => viewModel.idm_field ?? ``; + + public create(...conditions: Partial[]): Action { + const payload = conditions.map(condition => ({ + mapper_id: condition.mapper_id, + idm_field: condition.idm_field, + regex: condition.regex + })); + return this.createAction(IdmConditionAction.CREATE, payload); + } + + public update(update: Partial, id: Id): Action { + const payload = { + id, + idm_field: update.idm_field, + regex: update.regex + }; + return this.createAction(IdmConditionAction.UPDATE, payload); + } + + public delete(...ids: Id[]): Action { + const payload = ids.map(id => ({ id })); + return this.createAction(IdmConditionAction.DELETE, payload); + } +} diff --git a/client/src/app/gateways/repositories/idm/idm-condition.action.ts b/client/src/app/gateways/repositories/idm/idm-condition.action.ts new file mode 100644 index 00000000000..de9c1b3e666 --- /dev/null +++ b/client/src/app/gateways/repositories/idm/idm-condition.action.ts @@ -0,0 +1,5 @@ +export class IdmConditionAction { + public static readonly CREATE = `idm_condition.create`; + public static readonly UPDATE = `idm_condition.update`; + public static readonly DELETE = `idm_condition.delete`; +} diff --git a/client/src/app/gateways/repositories/idm/idm-mapper-repository.service.ts b/client/src/app/gateways/repositories/idm/idm-mapper-repository.service.ts new file mode 100644 index 00000000000..23ff3e7e32e --- /dev/null +++ b/client/src/app/gateways/repositories/idm/idm-mapper-repository.service.ts @@ -0,0 +1,45 @@ +import { Service } from '@angular/core'; +import { Id } from '@app/domain/definitions/key-types'; +import { Identifiable } from '@app/domain/interfaces'; +import { IdmMapper } from '@app/domain/models/idm/idm-mapper'; +import { BaseRepository } from '@app/gateways/repositories/base-repository'; +import { ViewIdmMapper } from '@app/site/pages/organization/view-models/view-idm-mapper'; + +import { Action } from '../../actions/action'; +import { IdmMapperAction } from './idm-mapper.action'; + +@Service() +export class IdmMapperRepositoryService extends BaseRepository { + public baseModelCtor = IdmMapper; + + public getVerboseName = (plural?: boolean): string => this.translate.instant(plural ? `IDM mappers` : `IDM mapper`); + + public getTitle = (viewModel: ViewIdmMapper): string => viewModel.group_external_ids?.join(`, `) ?? ``; + + public create(...mappers: Partial[]): Action { + const payload = mappers.map(mapper => ({ + group_external_ids: mapper.group_external_ids + })); + return this.createAction(IdmMapperAction.CREATE, payload); + } + + public update(update: Partial, id: Id): Action { + const payload = { + id, + group_external_ids: update.group_external_ids + }; + return this.createAction(IdmMapperAction.UPDATE, payload); + } + + public sort(idmMapperIds: Id[]): Action { + const payload = { + idm_mapper_ids: idmMapperIds + }; + return this.createAction(IdmMapperAction.SORT, payload); + } + + public delete(...ids: Id[]): Action { + const payload = ids.map(id => ({ id })); + return this.createAction(IdmMapperAction.DELETE, payload); + } +} diff --git a/client/src/app/gateways/repositories/idm/idm-mapper.action.ts b/client/src/app/gateways/repositories/idm/idm-mapper.action.ts new file mode 100644 index 00000000000..146503112e7 --- /dev/null +++ b/client/src/app/gateways/repositories/idm/idm-mapper.action.ts @@ -0,0 +1,6 @@ +export class IdmMapperAction { + public static readonly CREATE = `idm_mapper.create`; + public static readonly UPDATE = `idm_mapper.update`; + public static readonly SORT = `idm_mapper.sort`; + public static readonly DELETE = `idm_mapper.delete`; +} diff --git a/client/src/app/gateways/repositories/idm/idm-mapping-repository.service.ts b/client/src/app/gateways/repositories/idm/idm-mapping-repository.service.ts new file mode 100644 index 00000000000..5678628b7b8 --- /dev/null +++ b/client/src/app/gateways/repositories/idm/idm-mapping-repository.service.ts @@ -0,0 +1,48 @@ +import { Service } from '@angular/core'; +import { Id } from '@app/domain/definitions/key-types'; +import { Identifiable } from '@app/domain/interfaces'; +import { IdmMapping } from '@app/domain/models/idm/idm-mapping'; +import { BaseRepository } from '@app/gateways/repositories/base-repository'; +import { ViewIdmMapping } from '@app/site/pages/organization/view-models/view-idm-mapping'; + +import { Action } from '../../actions/action'; +import { IdmMappingAction } from './idm-mapping.action'; + +@Service() +export class IdmMappingRepositoryService extends BaseRepository { + public baseModelCtor = IdmMapping; + + public getVerboseName = (plural?: boolean): string => + this.translate.instant(plural ? `IDM mappings` : `IDM mapping`); + + public getTitle = (viewModel: ViewIdmMapping): string => viewModel.idm_field ?? ``; + + public create(...mappings: Partial[]): Action { + const payload = mappings.map(mapping => ({ + mapper_id: mapping.mapper_id, + idm_field: mapping.idm_field, + os_field: mapping.os_field, + default_value: mapping.default_value, + allow_update: mapping.allow_update, + override_default: mapping.override_default + })); + return this.createAction(IdmMappingAction.CREATE, payload); + } + + public update(update: Partial, id: Id): Action { + const payload = { + id, + idm_field: update.idm_field, + os_field: update.os_field, + default_value: update.default_value, + allow_update: update.allow_update, + override_default: update.override_default + }; + return this.createAction(IdmMappingAction.UPDATE, payload); + } + + public delete(...ids: Id[]): Action { + const payload = ids.map(id => ({ id })); + return this.createAction(IdmMappingAction.DELETE, payload); + } +} diff --git a/client/src/app/gateways/repositories/idm/idm-mapping.action.ts b/client/src/app/gateways/repositories/idm/idm-mapping.action.ts new file mode 100644 index 00000000000..ee0bd2d60e0 --- /dev/null +++ b/client/src/app/gateways/repositories/idm/idm-mapping.action.ts @@ -0,0 +1,5 @@ +export class IdmMappingAction { + public static readonly CREATE = `idm_mapping.create`; + public static readonly UPDATE = `idm_mapping.update`; + public static readonly DELETE = `idm_mapping.delete`; +} diff --git a/client/src/app/gateways/repositories/idm/idm.config.ts b/client/src/app/gateways/repositories/idm/idm.config.ts new file mode 100644 index 00000000000..bd154b44dae --- /dev/null +++ b/client/src/app/gateways/repositories/idm/idm.config.ts @@ -0,0 +1,32 @@ +import { IdmCondition } from '@app/domain/models/idm/idm-condition'; +import { IdmMapper } from '@app/domain/models/idm/idm-mapper'; +import { IdmMapping } from '@app/domain/models/idm/idm-mapping'; +import { AppConfig } from '@app/infrastructure/definitions/app-config'; +import { ViewIdmCondition } from '@app/site/pages/organization/view-models/view-idm-condition'; +import { ViewIdmMapper } from '@app/site/pages/organization/view-models/view-idm-mapper'; +import { ViewIdmMapping } from '@app/site/pages/organization/view-models/view-idm-mapping'; + +import { IdmConditionRepositoryService } from './idm-condition-repository.service'; +import { IdmMapperRepositoryService } from './idm-mapper-repository.service'; +import { IdmMappingRepositoryService } from './idm-mapping-repository.service'; + +export const IdmAppConfig: AppConfig = { + name: `idm`, + models: [ + { + model: IdmMapper, + viewModel: ViewIdmMapper, + repository: IdmMapperRepositoryService + }, + { + model: IdmCondition, + viewModel: ViewIdmCondition, + repository: IdmConditionRepositoryService + }, + { + model: IdmMapping, + viewModel: ViewIdmMapping, + repository: IdmMappingRepositoryService + } + ] +}; diff --git a/client/src/app/infrastructure/definitions/relations/relations.ts b/client/src/app/infrastructure/definitions/relations/relations.ts index a00232a16f2..163947b2efa 100644 --- a/client/src/app/infrastructure/definitions/relations/relations.ts +++ b/client/src/app/infrastructure/definitions/relations/relations.ts @@ -26,6 +26,9 @@ import { ViewPollCandidateList } from '@app/site/pages/meetings/pages/polls/view import { ViewMeetingUser } from '@app/site/pages/meetings/view-models/view-meeting-user'; import { ViewGender } from '@app/site/pages/organization/pages/accounts/pages/gender/view-models/view-gender'; import { ViewResource } from '@app/site/pages/organization/pages/resources/view-models'; +import { ViewIdmCondition } from '@app/site/pages/organization/view-models/view-idm-condition'; +import { ViewIdmMapper } from '@app/site/pages/organization/view-models/view-idm-mapper'; +import { ViewIdmMapping } from '@app/site/pages/organization/view-models/view-idm-mapping'; import { BaseViewModel, ViewModelConstructor } from '../../../site/base/base-view-model'; import { HasListOfSpeakers } from '../../../site/pages/meetings/pages/agenda/modules/list-of-speakers/view-models/has-list-of-speakers'; @@ -178,6 +181,26 @@ export const RELATIONS: Relation[] = [ MField: `organization`, isFullList: true }), + ...makeM2O({ + OViewModel: ViewOrganization, + MViewModel: ViewIdmMapper, + OField: `idm_mappers`, + MField: `organization`, + isFullList: true + }), + // ########## IDM + ...makeM2O({ + OViewModel: ViewIdmMapper, + MViewModel: ViewIdmCondition, + OField: `conditions`, + MField: `mapper` + }), + ...makeM2O({ + OViewModel: ViewIdmMapper, + MViewModel: ViewIdmMapping, + OField: `mappings`, + MField: `mapper` + }), // ########## Organization tags ...makeGenericM2M({ viewModel: ViewOrganizationTag, diff --git a/client/src/app/openslides-main-module/services/app-load.service.ts b/client/src/app/openslides-main-module/services/app-load.service.ts index 5d380335295..5154fb23834 100644 --- a/client/src/app/openslides-main-module/services/app-load.service.ts +++ b/client/src/app/openslides-main-module/services/app-load.service.ts @@ -1,6 +1,7 @@ import { inject, Injector, Service, Type } from '@angular/core'; import { ActionWorkerAppConfig } from '@app/gateways/repositories/action-worker/action-worker.config'; import { BaseRepository } from '@app/gateways/repositories/base-repository'; +import { IdmAppConfig } from '@app/gateways/repositories/idm/idm.config'; import { MeetingUserAppConfig } from '@app/gateways/repositories/meeting_user/meeting-user-config'; import { AppConfig } from '@app/infrastructure/definitions/app-config'; import { OnAfterAppsLoaded } from '@app/infrastructure/definitions/hooks/after-apps-loaded'; @@ -57,7 +58,8 @@ const appConfigs: AppConfig[] = [ ChatAppConfig, ActionWorkerAppConfig, MeetingUserAppConfig, - GendersAppConfig + GendersAppConfig, + IdmAppConfig ]; @Service() diff --git a/client/src/app/site/pages/organization/view-models/view-idm-condition.ts b/client/src/app/site/pages/organization/view-models/view-idm-condition.ts new file mode 100644 index 00000000000..3cfbf5f625e --- /dev/null +++ b/client/src/app/site/pages/organization/view-models/view-idm-condition.ts @@ -0,0 +1,19 @@ +import { IdmCondition } from '@app/domain/models/idm/idm-condition'; +import { BaseViewModel, ViewModelRelations } from '@app/site/base/base-view-model'; + +import { ViewIdmMapper } from './view-idm-mapper'; + +export class ViewIdmCondition extends BaseViewModel { + public static readonly COLLECTION = IdmCondition.COLLECTION; + protected _collection = IdmCondition.COLLECTION; + + public get idmCondition(): IdmCondition { + return this._model; + } +} + +interface IIdmConditionRelations { + mapper: ViewIdmMapper; +} + +export interface ViewIdmCondition extends IdmCondition, ViewModelRelations {} diff --git a/client/src/app/site/pages/organization/view-models/view-idm-mapper.ts b/client/src/app/site/pages/organization/view-models/view-idm-mapper.ts new file mode 100644 index 00000000000..b4f5acf9535 --- /dev/null +++ b/client/src/app/site/pages/organization/view-models/view-idm-mapper.ts @@ -0,0 +1,23 @@ +import { IdmMapper } from '@app/domain/models/idm/idm-mapper'; +import { BaseViewModel, ViewModelRelations } from '@app/site/base/base-view-model'; + +import { ViewIdmCondition } from './view-idm-condition'; +import { ViewIdmMapping } from './view-idm-mapping'; +import { ViewOrganization } from './view-organization'; + +export class ViewIdmMapper extends BaseViewModel { + public static readonly COLLECTION = IdmMapper.COLLECTION; + protected _collection = IdmMapper.COLLECTION; + + public get idmMapper(): IdmMapper { + return this._model; + } +} + +interface IIdmMapperRelations { + organization: ViewOrganization; + conditions: ViewIdmCondition[]; + mappings: ViewIdmMapping[]; +} + +export interface ViewIdmMapper extends IdmMapper, ViewModelRelations {} diff --git a/client/src/app/site/pages/organization/view-models/view-idm-mapping.ts b/client/src/app/site/pages/organization/view-models/view-idm-mapping.ts new file mode 100644 index 00000000000..a9b8d38275e --- /dev/null +++ b/client/src/app/site/pages/organization/view-models/view-idm-mapping.ts @@ -0,0 +1,19 @@ +import { IdmMapping } from '@app/domain/models/idm/idm-mapping'; +import { BaseViewModel, ViewModelRelations } from '@app/site/base/base-view-model'; + +import { ViewIdmMapper } from './view-idm-mapper'; + +export class ViewIdmMapping extends BaseViewModel { + public static readonly COLLECTION = IdmMapping.COLLECTION; + protected _collection = IdmMapping.COLLECTION; + + public get idmMapping(): IdmMapping { + return this._model; + } +} + +interface IIdmMappingRelations { + mapper: ViewIdmMapper; +} + +export interface ViewIdmMapping extends IdmMapping, ViewModelRelations {} diff --git a/client/src/app/site/pages/organization/view-models/view-organization.ts b/client/src/app/site/pages/organization/view-models/view-organization.ts index 2c17933668a..1aa6a066cfb 100644 --- a/client/src/app/site/pages/organization/view-models/view-organization.ts +++ b/client/src/app/site/pages/organization/view-models/view-organization.ts @@ -9,6 +9,7 @@ import { ViewCommittee } from '../pages/committees/view-models/view-committee'; import { ViewTheme } from '../pages/designs/view-models/view-theme'; import { ViewOrganizationTag } from '../pages/organization-tags/view-models/view-organization-tag'; import { ViewResource } from '../pages/resources/view-models/view-resource'; +import { ViewIdmMapper } from './view-idm-mapper'; export class ViewOrganization extends BaseViewModel { public static COLLECTION = Organization.COLLECTION; @@ -29,6 +30,7 @@ interface IOrganizationRelations { themes: ViewTheme[]; users: ViewUser[]; genders: ViewGender[]; + idm_mappers: ViewIdmMapper[]; published_mediafiles: ViewMediafile[]; } export interface ViewOrganization extends Organization, ViewModelRelations {} From a78e96dd69d2a2f7b1c5ccdef0d522d7c59409d0 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Wed, 2 Dec 2026 18:19:07 +0100 Subject: [PATCH 6/7] Extract identity manager into its own component --- .../identity-mapper.component.html | 81 +++++++++++++++++++ .../identity-mapper.component.scss | 25 ++++++ .../identity-mapper.component.ts | 60 ++++++++++++++ .../organization-settings.component.html | 72 +---------------- .../organization-settings.component.scss | 21 ----- .../organization-settings.component.ts | 43 ---------- .../settings-detail/settings-detail.module.ts | 4 +- 7 files changed, 170 insertions(+), 136 deletions(-) create mode 100644 client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.html create mode 100644 client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.scss create mode 100644 client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.ts diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.html b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.html new file mode 100644 index 00000000000..fb2bf1ae3f9 --- /dev/null +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.html @@ -0,0 +1,81 @@ + + + {{ 'Identity Mapper' | translate }} + + + +
+ + {{ 'External group Title' | translate }} + + Separate group ids with comma + + + + + + {{ 'Condition' | translate }} + + + + + + + {{ 'IDP-Attribute' | translate }} + + + + + {{ 'Regular Expression' | translate }} + + + + +
+ + + + + {{ 'Mapper' | translate }} + + +
+ + + {{ 'IDP-Attribute' | translate }} + + + +
+ + + {{ 'OpenSlides Attribute' | translate }} + + + @for (type of mappingChoices; track type) { + + {{ type.name }} + + } + + +
+ + + {{ 'Default atribute' | translate }} + + +
+ + {{ 'Allow update on login' | translate }} + + + {{ 'Allow overrite on login' | translate }} + +
+
+
+
+ +
+
diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.scss b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.scss new file mode 100644 index 00000000000..cb5191c46ce --- /dev/null +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.scss @@ -0,0 +1,25 @@ +mat-form-field { + display: block; + margin: 6px 0; +} + +.condition-line { + display: grid; + grid-template-columns: auto auto; + column-gap: 32px; +} + +.mapping-line { + display: grid; + grid-template-columns: auto auto auto; + column-gap: 32px; +} + +.checkbox-row { + display: flex; + flex-direction: column; +} + +.sub-set { + margin-left: 15px; +} diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.ts b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.ts new file mode 100644 index 00000000000..8ef46d4eaef --- /dev/null +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/identity-mapper/identity-mapper.component.ts @@ -0,0 +1,60 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; +import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { IdmMappingOsField } from '@app/domain/models/idm/idm-mapping'; +import { _, TranslatePipe } from '@ngx-translate/core'; + +/** + * Determine type for Mapping Choices items + */ +const MappingTypeChoices = [ + { key: IdmMappingOsField.STRUCTURE_LEVEL_IDS, name: _(`Structure level`) }, + { key: IdmMappingOsField.NUMBER, name: _(`Participant number`) }, + { key: IdmMappingOsField.VOTE_WEIGHT, name: _(`Vote weight`) }, + { key: IdmMappingOsField.PRESENT, name: _(`Present Status`) }, + { key: IdmMappingOsField.COMMENT, name: _(`Comment`) } +]; + +@Component({ + selector: `os-identity-mapper`, + templateUrl: `./identity-mapper.component.html`, + styleUrls: [`./identity-mapper.component.scss`], + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ + MatCardModule, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + MatSelectModule, + MatCheckboxModule, + TranslatePipe + ] +}) +export class IdentityMapperComponent { + public mappingChoices = MappingTypeChoices; + + public mapperForm = new FormGroup({ + id: new FormControl(null), + group_external_ids: new FormControl([``]), + weight: new FormControl(null) + }); + + public conditionForm = new FormGroup({ + mapper_id: new FormControl(null), + idm_field: new FormControl(``), + regex: new FormControl(``) + }); + + public mappingForm = new FormGroup({ + mapper_id: new FormControl(null), + idm_field: new FormControl(``), + os_field: new FormControl(null), + default_value: new FormControl(``), + allow_update: new FormControl(false), + override_default: new FormControl(false) + }); +} diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html index fad42fe1412..57504be4740 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.html @@ -213,77 +213,7 @@

{{ 'Single Sign-On settings' | translate }}

- - - {{ 'Identity Mapper' | translate }} - -
- - {{ 'External group Title' | translate }} - - Separate group ids with comma - - - - {{ 'Condition' | translate }} - - - - - {{ 'IDP-Attribute' | translate }} - - - - - {{ 'Regular Expression' | translate }} - - -
- - - {{ 'Mapper' | translate }} - -
- - - {{ 'IDP-Attribute' | translate }} - - - -
- - - {{ 'OpenSlides Attribute' | translate }} - - - @for (type of mappingChoices; track type) { - - {{ type.name }} - - } - - -
- - - {{ 'Default atribute' | translate }} - - -
- - {{ 'Allow update on login' | translate }} - - - {{ 'Allow overrite on login' | translate }} - -
-
- -
+
diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.scss b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.scss index 744721d8de6..1ded6707ecc 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.scss +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.scss @@ -26,24 +26,3 @@ mat-card mat-card-content h2 { padding-bottom: 0px; font-size: 12px; } - -.condition-line { - display: grid; - grid-template-columns: auto auto; - column-gap: 32px; -} - -.mapping-line { - display: grid; - grid-template-columns: auto auto auto; - column-gap: 32px; -} - -.checkbox-row { - display: flex; - flex-direction: column; -} - -.sub-set { - margin-left: 15px; -} diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts index 9f5bae31c99..f6cbf9a6846 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/components/organization-settings/organization-settings.component.ts @@ -1,6 +1,5 @@ import { ChangeDetectionStrategy, Component, ElementRef, inject, signal, viewChild } from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { FormControl, FormGroup } from '@angular/forms'; import { Selectable } from '@app/domain/interfaces'; import { objectToFormattedString } from '@app/infrastructure/utils'; import { createEmailValidator } from '@app/infrastructure/utils/validators/email'; @@ -12,25 +11,6 @@ import { OperatorService } from '@app/site/services/operator.service'; import { TimeZoneService } from '@app/site/services/time-zone.service'; import { _ } from '@ngx-translate/core'; -enum MappingItemType { - STRUCTURE_LEVEL = `structure_level`, - NUMBER = `number`, - VOTE_WEIGHT = `vote_weight`, - PRESENT = `present`, - COMMENT = `comment` -} - -/** - * Determine type for Mapping Choices items - */ -const MappingTypeChoices = [ - { key: MappingItemType.STRUCTURE_LEVEL, name: _(`Structure level`) }, - { key: MappingItemType.NUMBER, name: _(`Participant number`) }, - { key: MappingItemType.VOTE_WEIGHT, name: _(`Vote weight`) }, - { key: MappingItemType.PRESENT, name: _(`Present Status`) }, - { key: MappingItemType.COMMENT, name: _(`Comment`) } -]; - @Component({ selector: `os-organization-settings`, templateUrl: `./organization-settings.component.html`, @@ -49,29 +29,6 @@ export class OrganizationSettingsComponent extends BaseComponent { inter: `Between` }; - public mappingChoices = MappingTypeChoices; - - public mapperForm = new FormGroup({ - id: new FormControl(null), - group_external_ids: new FormControl([``]), - weight: new FormControl(null) - }); - - public conditionForm = new FormGroup({ - mapper_id: new FormControl(null), - idm_field: new FormControl(``), - regex: new FormControl(``) - }); - - public mappingForm = new FormGroup({ - mapper_id: new FormControl(null), - idm_field: new FormControl(``), - os_field: new FormControl(null), - default_value: new FormControl(``), - allow_update: new FormControl(false), - override_default: new FormControl(false) - }); - public orgaSettingsForm: UntypedFormGroup | null = null; public get hasEdits(): boolean { diff --git a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/settings-detail.module.ts b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/settings-detail.module.ts index 27fe5bef321..31e3bed55fb 100644 --- a/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/settings-detail.module.ts +++ b/client/src/app/site/pages/organization/pages/settings/modules/settings-detail/settings-detail.module.ts @@ -12,6 +12,7 @@ import { DirectivesModule } from '@app/ui/directives'; import { HeadBarModule } from '@app/ui/modules/head-bar'; import { SearchSelectorModule } from '@app/ui/modules/search-selector'; +import { IdentityMapperComponent } from './components/identity-mapper/identity-mapper.component'; import { OrganizationSettingsComponent } from './components/organization-settings/organization-settings.component'; import { SettingsDetailRoutingModule } from './settings-detail-routing.module'; @@ -31,7 +32,8 @@ import { SettingsDetailRoutingModule } from './settings-detail-routing.module'; MatAutocompleteModule, OpenSlidesTranslationModule, DirectivesModule, - SearchSelectorModule + SearchSelectorModule, + IdentityMapperComponent ] }) export class SettingsDetailModule {} From af05e9963624bf4db7f4fb6cef42aaaf42365872 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Wed, 2 Dec 2026 19:24:03 +0100 Subject: [PATCH 7/7] Add missing fields to orga settings fieldset --- .../gateways/repositories/organization-repository.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/app/gateways/repositories/organization-repository.service.ts b/client/src/app/gateways/repositories/organization-repository.service.ts index 9cadba04b46..8967718fd87 100644 --- a/client/src/app/gateways/repositories/organization-repository.service.ts +++ b/client/src/app/gateways/repositories/organization-repository.service.ts @@ -40,6 +40,9 @@ export class OrganizationRepositoryService extends BaseRepository