diff --git a/client/src/app/domain/models/organizations/organization.ts b/client/src/app/domain/models/organizations/organization.ts index fffff11a70..09b5d2e72d 100644 --- a/client/src/app/domain/models/organizations/organization.ts +++ b/client/src/app/domain/models/organizations/organization.ts @@ -33,6 +33,7 @@ export class OrganizationSetting { public saml_metadata_idp!: string; public saml_metadata_sp!: string; public saml_private_key!: string; + public genders!: string[]; } export class Organization extends BaseModel { @@ -87,7 +88,8 @@ export class Organization extends BaseModel { `users_email_replyto`, `users_email_subject`, `users_email_body`, - `url` + `url`, + `genders` ]; } diff --git a/client/src/app/domain/models/users/user.constants.ts b/client/src/app/domain/models/users/user.constants.ts index 6af3fe8818..cf28498ab5 100644 --- a/client/src/app/domain/models/users/user.constants.ts +++ b/client/src/app/domain/models/users/user.constants.ts @@ -8,7 +8,7 @@ export const userHeadersAndVerboseNames: { [key in keyof User]?: any } = { last_name: _(`Surname`), email: _(`Email`), pronoun: _(`Pronoun`), - gender: _(`Gender`), + gender: _(`Gender, possible options: %gender%`), username: _(`Username`), default_password: _(`Initial password`), is_active: _(`Active`), diff --git a/client/src/app/gateways/repositories/organization-repository.service.ts b/client/src/app/gateways/repositories/organization-repository.service.ts index 74b47fe190..6d4611d9cf 100644 --- a/client/src/app/gateways/repositories/organization-repository.service.ts +++ b/client/src/app/gateways/repositories/organization-repository.service.ts @@ -42,7 +42,8 @@ export class OrganizationRepositoryService extends BaseRepository ({ property: header, - label: (accountHeadersAndVerboseNames)[header], + label: ((accountHeadersAndVerboseNames)[header] as string).replace( + `%gender%`, + this.orgaSettings.instant(`genders`).join(`, `) + ), isTableColumn: true })); public constructor( componentServiceCollector: ComponentServiceCollectorService, protected override translate: TranslateService, - public override importer: AccountImportService + public override importer: AccountImportService, + public orgaSettings: OrganizationSettingsService ) { super(componentServiceCollector, translate, importer); } diff --git a/client/src/app/site/pages/organization/pages/accounts/pages/account-import/services/account-import.service/account-import.service.ts b/client/src/app/site/pages/organization/pages/accounts/pages/account-import/services/account-import.service/account-import.service.ts index 5ce1c4489f..07989a1c33 100644 --- a/client/src/app/site/pages/organization/pages/accounts/pages/account-import/services/account-import.service/account-import.service.ts +++ b/client/src/app/site/pages/organization/pages/accounts/pages/account-import/services/account-import.service/account-import.service.ts @@ -31,7 +31,7 @@ export class AccountImportService extends BaseBackendImportService { created: _(`Accounts created`), updated: _(`Accounts updated`), error: _(`Accounts with errors`), - warning: _(`Accounts with warnings (will be skipped)`) + warning: _(`Accounts with warnings (columns will be skipped)`) }; public constructor( diff --git a/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.html b/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.html index 300fd942b4..d05cd9b5dd 100644 --- a/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.html +++ b/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.html @@ -199,7 +199,7 @@

{{ finishedWithWarning ? ('Rows with warnings' | translate) : ('Preview' | t {{ entry | translate }} - {{ entry }} + {{ entry }} {{ entry }}   @@ -216,16 +216,34 @@

{{ finishedWithWarning ? ('Rows with warnings' | translate) : ('Preview' | t rowClass="import-list-preview-row" >
{{ getActionIcon(row) }} + + warning + +
+ +
+ + {{ getActionIcon(row) }} +
#
diff --git a/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.ts b/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.ts index 71bca16841..6da44cf0ae 100644 --- a/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.ts +++ b/client/src/app/ui/modules/import-list/components/via-backend-import-list/backend-import-list.component.ts @@ -381,7 +381,7 @@ export class BackendImportListComponent implements OnInit, OnDestroy { _(`There is an unspecified error in this line, which prevents the import.`) ); case BackendImportState.Warning: - return this.getErrorDescription(row) ?? _(`This row will not be imported, due to an unknown reason.`); + return this.getErrorDescription(row) ?? _(`The affected columns will not be imported.`); case BackendImportState.New: return this.translate.instant(this.modelName) + ` ` + this.translate.instant(`will be imported`); case BackendImportState.Done: // item will be updated / has been imported @@ -397,6 +397,18 @@ export class BackendImportListComponent implements OnInit, OnDestroy { } } + public getWarningRowTooltip(row: BackendImportIdentifiedRow): string { + switch (row.state) { + case BackendImportState.Error: // no import possible + return ( + this.getErrorDescription(row) ?? + _(`There is an unspecified error in this line, which prevents the import.`) + ); + default: + return this.getErrorDescription(row) ?? _(`The affected columns will not be imported.`); + } + } + /** * A function to trigger the csv example download. */ @@ -466,7 +478,7 @@ export class BackendImportListComponent implements OnInit, OnDestroy { } private getErrorDescription(entry: BackendImportIdentifiedRow): string { - return entry.messages?.map(error => this.translate.instant(this._importer.verbose(error))).join(`,\n `); + return entry.messages?.map(error => this.translate.instant(this._importer.verbose(error))).join(`\n `); } private fillPreviewData(previews: BackendImportPreview[]) {