From be52bc4978612388a55381135d13f9dfaf018512 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 14 Dec 2020 11:41:33 +0300 Subject: [PATCH] feat: add contributor types for identity config --- .../identity/src/lib/models/config-options.ts | 42 +++++++++++++++++++ .../packages/identity/src/lib/models/index.ts | 2 + 2 files changed, 44 insertions(+) create mode 100644 npm/ng-packs/packages/identity/src/lib/models/config-options.ts create mode 100644 npm/ng-packs/packages/identity/src/lib/models/index.ts diff --git a/npm/ng-packs/packages/identity/src/lib/models/config-options.ts b/npm/ng-packs/packages/identity/src/lib/models/config-options.ts new file mode 100644 index 0000000000..6a1fc29a00 --- /dev/null +++ b/npm/ng-packs/packages/identity/src/lib/models/config-options.ts @@ -0,0 +1,42 @@ +import { + CreateFormPropContributorCallback, + EditFormPropContributorCallback, + EntityActionContributorCallback, + EntityPropContributorCallback, + ToolbarActionContributorCallback, +} from '@abp/ng.theme.shared/extensions'; +import { eIdentityComponents } from '../enums/components'; +import { IdentityRoleDto, IdentityUserDto } from '../proxy/identity/models'; + +export type IdentityEntityActionContributors = Partial<{ + [eIdentityComponents.Roles]: EntityActionContributorCallback[]; + [eIdentityComponents.Users]: EntityActionContributorCallback[]; +}>; + +export type IdentityToolbarActionContributors = Partial<{ + [eIdentityComponents.Roles]: ToolbarActionContributorCallback[]; + [eIdentityComponents.Users]: ToolbarActionContributorCallback[]; +}>; + +export type IdentityEntityPropContributors = Partial<{ + [eIdentityComponents.Roles]: EntityPropContributorCallback[]; + [eIdentityComponents.Users]: EntityPropContributorCallback[]; +}>; + +export type IdentityCreateFormPropContributors = Partial<{ + [eIdentityComponents.Roles]: CreateFormPropContributorCallback[]; + [eIdentityComponents.Users]: CreateFormPropContributorCallback[]; +}>; + +export type IdentityEditFormPropContributors = Partial<{ + [eIdentityComponents.Roles]: EditFormPropContributorCallback[]; + [eIdentityComponents.Users]: EditFormPropContributorCallback[]; +}>; + +export interface IdentityConfigOptions { + entityActionContributors?: IdentityEntityActionContributors; + toolbarActionContributors?: IdentityToolbarActionContributors; + entityPropContributors?: IdentityEntityPropContributors; + createFormPropContributors?: IdentityCreateFormPropContributors; + editFormPropContributors?: IdentityEditFormPropContributors; +} diff --git a/npm/ng-packs/packages/identity/src/lib/models/index.ts b/npm/ng-packs/packages/identity/src/lib/models/index.ts new file mode 100644 index 0000000000..c7964853da --- /dev/null +++ b/npm/ng-packs/packages/identity/src/lib/models/index.ts @@ -0,0 +1,2 @@ +export * from './config-options'; +export * from './identity';