@acorex-platform/module-common-client 0.0.53 → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{acorex-platform-module-common-client-acorex-platform-module-common-client-Cd7vTe3G.mjs → acorex-platform-module-common-client-acorex-platform-module-common-client-BtSt1xRl.mjs} +232 -39
- package/fesm2022/acorex-platform-module-common-client-acorex-platform-module-common-client-BtSt1xRl.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-archive-entity.command-DiOJ6IkD.mjs → acorex-platform-module-common-client-archive-entity.command-BOV-yh5h.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-archive-entity.command-DiOJ6IkD.mjs.map → acorex-platform-module-common-client-archive-entity.command-BOV-yh5h.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-common-client-archive-entity.command.util-DhCNqo2R.mjs → acorex-platform-module-common-client-archive-entity.command.util-Cd65r7rb.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-archive-entity.command.util-DhCNqo2R.mjs.map → acorex-platform-module-common-client-archive-entity.command.util-Cd65r7rb.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-common-client-audit-info-column.component-DihrUmRM.mjs → acorex-platform-module-common-client-audit-info-column.component-DhYUlBgr.mjs} +9 -4
- package/fesm2022/acorex-platform-module-common-client-audit-info-column.component-DhYUlBgr.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-audit-info-edit.component-COMMBgsX.mjs → acorex-platform-module-common-client-audit-info-edit.component-aCgPXlef.mjs} +23 -2
- package/fesm2022/acorex-platform-module-common-client-audit-info-edit.component-aCgPXlef.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-audit-info-view.component-UOTT-ir_.mjs → acorex-platform-module-common-client-audit-info-view.component-lgzqcHCv.mjs} +23 -2
- package/fesm2022/acorex-platform-module-common-client-audit-info-view.component-lgzqcHCv.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-common-client-audit-info.util-CUlUTX8l.mjs +9 -0
- package/fesm2022/acorex-platform-module-common-client-audit-info.util-CUlUTX8l.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-bulk-archive-entity.command-D01227SB.mjs → acorex-platform-module-common-client-bulk-archive-entity.command-B-S45xY1.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-bulk-archive-entity.command-D01227SB.mjs.map → acorex-platform-module-common-client-bulk-archive-entity.command-B-S45xY1.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-common-client-bulk-restore-archive-entity.command-CaTT2Rqd.mjs → acorex-platform-module-common-client-bulk-restore-archive-entity.command-CqZxZrkm.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-bulk-restore-archive-entity.command-CaTT2Rqd.mjs.map → acorex-platform-module-common-client-bulk-restore-archive-entity.command-CqZxZrkm.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-common-client-clone-entity.command-BxT9kdpw.mjs → acorex-platform-module-common-client-clone-entity.command-DmmdZyoL.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-clone-entity.command-BxT9kdpw.mjs.map → acorex-platform-module-common-client-clone-entity.command-DmmdZyoL.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-common-client-contracts.mjs +57 -1
- package/fesm2022/acorex-platform-module-common-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-common-client-create-entity-version-draft.command-DLNMbq3M.mjs → acorex-platform-module-common-client-create-entity-version-draft.command-CbLI7jvZ.mjs} +14 -2
- package/fesm2022/acorex-platform-module-common-client-create-entity-version-draft.command-CbLI7jvZ.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-delete-entity-version-draft.command-Dq0zjfak.mjs → acorex-platform-module-common-client-delete-entity-version-draft.command-CLWHs4DO.mjs} +14 -2
- package/fesm2022/acorex-platform-module-common-client-delete-entity-version-draft.command-CLWHs4DO.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-publish-entity-version.command-BtyWjtJj.mjs → acorex-platform-module-common-client-publish-entity-version.command-JNy0K1ZR.mjs} +14 -2
- package/fesm2022/acorex-platform-module-common-client-publish-entity-version.command-JNy0K1ZR.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-restore-archive-entity.command-BWF8iH1Z.mjs → acorex-platform-module-common-client-restore-archive-entity.command-Bami3ybY.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-restore-archive-entity.command-BWF8iH1Z.mjs.map → acorex-platform-module-common-client-restore-archive-entity.command-Bami3ybY.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-common-client-search-popup.component-B4LA5yh1.mjs → acorex-platform-module-common-client-search-popup.component-DVE0Hc3g.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-search-popup.component-B4LA5yh1.mjs.map → acorex-platform-module-common-client-search-popup.component-DVE0Hc3g.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-common-client-show-entity-version-history.command-CoFbuUYP.mjs +553 -0
- package/fesm2022/acorex-platform-module-common-client-show-entity-version-history.command-CoFbuUYP.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-common-client-timeline-version-history-popup.component-CPmN0kme.mjs → acorex-platform-module-common-client-timeline-version-history-popup.component-Ap83-gMD.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-common-client-timeline-version-history-popup.component-CPmN0kme.mjs.map → acorex-platform-module-common-client-timeline-version-history-popup.component-Ap83-gMD.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-common-client-versioning-entity.command.util-CKlJNPHa.mjs → acorex-platform-module-common-client-versioning-entity.command.util-Bibv8EgV.mjs} +18 -1
- package/fesm2022/acorex-platform-module-common-client-versioning-entity.command.util-Bibv8EgV.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-common-client.mjs +1 -1
- package/i18n/en-AU/_feature-sample.json +47 -0
- package/i18n/en-AU/_module-sample.json +114 -0
- package/i18n/en-AU/common.json +1164 -0
- package/i18n/en-AU/global-search.json +38 -0
- package/i18n/en-AU/lock-system.json +66 -0
- package/i18n/en-US/_feature-sample.json +47 -0
- package/i18n/en-US/_module-sample.json +114 -0
- package/i18n/en-US/common.json +1164 -0
- package/i18n/en-US/global-search.json +38 -0
- package/i18n/en-US/lock-system.json +66 -0
- package/i18n/fa-IR/_feature-sample.json +48 -0
- package/i18n/fa-IR/_module-sample.json +115 -0
- package/i18n/fa-IR/common.json +1164 -0
- package/i18n/fa-IR/global-search.json +38 -0
- package/i18n/fa-IR/lock-system.json +66 -0
- package/package.json +1 -1
- package/types/acorex-platform-module-common-client-contracts.d.ts +42 -2
- package/types/acorex-platform-module-common-client.d.ts +5 -1
- package/fesm2022/acorex-platform-module-common-client-acorex-platform-module-common-client-Cd7vTe3G.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-common-client-audit-info-column.component-DihrUmRM.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-common-client-audit-info-edit.component-COMMBgsX.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-common-client-audit-info-view.component-UOTT-ir_.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-common-client-create-entity-version-draft.command-DLNMbq3M.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-common-client-delete-entity-version-draft.command-Dq0zjfak.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-common-client-publish-entity-version.command-BtyWjtJj.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-common-client-versioning-entity.command.util-CKlJNPHa.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AXTranslationService } from '@acorex/core/translation';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, Injectable } from '@angular/core';
|
|
4
|
-
import { A as AXPArchiveEntityCommandHelper, n as normalizeArchiveSingleInput, b as buildArchivePatch, a as buildArchiveRefreshMeta } from './acorex-platform-module-common-client-archive-entity.command.util-
|
|
4
|
+
import { A as AXPArchiveEntityCommandHelper, n as normalizeArchiveSingleInput, b as buildArchivePatch, a as buildArchiveRefreshMeta } from './acorex-platform-module-common-client-archive-entity.command.util-Cd65r7rb.mjs';
|
|
5
5
|
|
|
6
6
|
class AXPArchiveEntityCommand {
|
|
7
7
|
constructor() {
|
|
@@ -48,4 +48,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
48
48
|
}] });
|
|
49
49
|
|
|
50
50
|
export { AXPArchiveEntityCommand };
|
|
51
|
-
//# sourceMappingURL=acorex-platform-module-common-client-archive-entity.command-
|
|
51
|
+
//# sourceMappingURL=acorex-platform-module-common-client-archive-entity.command-BOV-yh5h.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-common-client-archive-entity.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-archive-entity.command-BOV-yh5h.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPArchiveEntityCommandHelper } from './archive-entity.command.helper';\nimport { buildArchivePatch, buildArchiveRefreshMeta, normalizeArchiveSingleInput } from './archive-entity.command.util';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPArchiveEntityCommand implements AXPCommand<AXPContextData, void> {\n private readonly helper = inject(AXPArchiveEntityCommandHelper);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: AXPContextData): AXPCommandExecuteResultPromise<void> {\n const context = normalizeArchiveSingleInput(input);\n if (!context) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const confirmed = await this.helper.confirm(\n '@general:actions.archive.confirm.title',\n '@general:actions.archive.confirm.message',\n );\n if (!confirmed) {\n return { success: false };\n }\n\n const loadingDialog = this.helper.showLoading(\n await this.translationService.translateAsync('@general:actions.archive.confirm.processing'),\n 'Archiving...',\n );\n\n try {\n const entityDefinition = await this.helper.resolveEntity(context.refType);\n const patch = buildArchivePatch(true);\n await this.helper.applyPatch(context.refType, context.refId, patch);\n\n const meta = buildArchiveRefreshMeta(entityDefinition, context.rowData);\n this.helper.dispatchArchived(context.refType, context.refId, meta);\n loadingDialog.close();\n await this.helper.showSuccessToast(\n '@general:workflow.entity-archived',\n '@general:workflow.entity-archived-body',\n );\n\n return { success: true, kind: 'object', data: undefined, metadata: { refresh: false } };\n } catch (error) {\n loadingDialog.close();\n await this.helper.showErrorToastFor(error, '@general:messages.generic.error.description');\n return { success: false };\n }\n }\n}\n"],"names":[],"mappings":";;;;;MASa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC9C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA8CnE,IAAA;IA5CC,MAAM,OAAO,CAAC,KAAqB,EAAA;AACjC,QAAA,MAAM,OAAO,GAAG,2BAA2B,CAAC,KAAK,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AAC5F,iBAAA;aACF;QACH;AAEA,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACzC,wCAAwC,EACxC,0CAA0C,CAC3C;QACD,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;QAEA,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3C,MAAM,IAA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A,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -7,7 +7,7 @@ import { AXPEntityBroadcastService } from '@acorex-platform/framework-client/cor
|
|
|
7
7
|
import { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
9
|
import { inject, Injectable } from '@angular/core';
|
|
10
|
-
import { A as AXP_ENTITY_ARCHIVE_OVERRIDES } from './acorex-platform-module-common-client-acorex-platform-module-common-client-
|
|
10
|
+
import { A as AXP_ENTITY_ARCHIVE_OVERRIDES } from './acorex-platform-module-common-client-acorex-platform-module-common-client-BtSt1xRl.mjs';
|
|
11
11
|
import { resolveEntityActionRef, resolveEntityActionBulkRef } from '@acorex-platform/framework-shared/runtime';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -153,4 +153,4 @@ function buildArchiveRefreshMeta(entityDefinition, rowData) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
export { AXPArchiveEntityCommandHelper as A, buildArchiveRefreshMeta as a, buildArchivePatch as b, normalizeArchiveBulkInput as c, normalizeArchiveSingleInput as n };
|
|
156
|
-
//# sourceMappingURL=acorex-platform-module-common-client-archive-entity.command.util-
|
|
156
|
+
//# sourceMappingURL=acorex-platform-module-common-client-archive-entity.command.util-Cd65r7rb.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-common-client-archive-entity.command.util-DhCNqo2R.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.helper.ts","../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.util.ts"],"sourcesContent":["import { AXDialogService } from '@acorex/components/dialog';\nimport { AXLoadingDialogService } from '@acorex/components/loading-dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommonSettings,\n AXPSettingsService,\n extractRequestErrorInfo,\n platformErrorI18nKey,\n throwIfCommandFailed,\n} from '@acorex-platform/framework-client/common';\nimport { AXPEntityBroadcastService } from '@acorex-platform/framework-client/core';\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXP_ENTITY_ARCHIVE_OVERRIDES } from '../archive-entity.override';\n\n/**\n * Injectable helper for archive commands: confirmation UI, persistence, toasts, and refresh events.\n * Pure input/patch logic lives in {@link archive-entity.command.util}.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPArchiveEntityCommandHelper {\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly dialogService = inject(AXDialogService);\n private readonly loadingDialog = inject(AXLoadingDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly entityEvents = inject(AXPEntityBroadcastService);\n private readonly archiveOverrides = inject(AXP_ENTITY_ARCHIVE_OVERRIDES, { optional: true }) ?? [];\n\n async resolveEntity(refType: string): Promise<AXPEntity> {\n const [moduleName, entityName] = refType.split('.');\n return this.entityRegistry.resolve(moduleName, entityName);\n }\n\n async applyPatch(refType: string, refId: string, patch: AXPContextData): Promise<void> {\n const override = this.archiveOverrides.find((entry) => entry.refType === refType);\n if (override) {\n const archived = patch['isArchived'] === true;\n if (archived) {\n await override.archive(refId);\n } else {\n await override.restore(refId);\n }\n return;\n }\n\n const entityDefinition = await this.resolveEntity(refType);\n const updateExec = entityDefinition.commands?.update?.execute as\n | ((payload: AXPContextData) => Promise<unknown>)\n | undefined;\n\n if (!updateExec) {\n throw new Error('Entity does not support update operation');\n }\n\n const result = await updateExec({ id: refId, ...patch });\n throwIfCommandFailed(result);\n }\n\n async confirm(titleKey: string, messageKey: string, messageParams?: AXPContextData): Promise<boolean> {\n const dialogResult = await this.dialogService.confirm(\n await this.translationService.translateAsync(titleKey),\n await this.translationService.translateAsync(messageKey, { params: messageParams }),\n 'warning',\n 'horizontal',\n false,\n 'cancel',\n );\n return dialogResult.result === true;\n }\n\n showLoading(title: string, status: string) {\n return this.loadingDialog.show({\n title,\n mode: 'indeterminate',\n status,\n });\n }\n\n async showSuccessToast(titleKey: string, contentKey?: string): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync(titleKey),\n content: contentKey ? await this.translationService.translateAsync(contentKey) : undefined,\n });\n }\n\n async showErrorToastFor(error: unknown, fallbackKey: string): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n const info = extractRequestErrorInfo(error);\n const contentKey =\n platformErrorI18nKey(info?.code) ??\n (typeof info?.message === 'string' && info.message.startsWith('@')\n ? info.message\n : null) ??\n fallbackKey;\n const content = contentKey.startsWith('@')\n ? await this.translationService.translateAsync(contentKey)\n : contentKey;\n\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content,\n closeButton: true,\n timeOut: 6000,\n timeOutProgress: true,\n });\n }\n\n dispatchArchived(refType: string, id: string, meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, meta as Record<string, unknown> | undefined);\n }\n\n dispatchUnarchived(refType: string, id: string, meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, meta as Record<string, unknown> | undefined);\n }\n\n dispatchBulkArchived(refType: string, ids: string[], meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, { refreshType: 'bulk-archive', ...(meta ?? {}) });\n }\n\n dispatchBulkUnarchived(refType: string, ids: string[], meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, { refreshType: 'bulk-unarchive', ...(meta ?? {}) });\n }\n}\n","import type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport { resolveEntityActionBulkRef, resolveEntityActionRef } from '@acorex-platform/framework-shared/runtime';\n\nexport const DEFAULT_ARCHIVE_FIELD = 'isArchived';\nexport const ARCHIVE_TIMESTAMP_FIELD = 'archivedAt';\n\nexport interface AXPArchiveCommandContext {\n refId: string;\n refType: string;\n rowData?: AXPContextData;\n}\n\nexport interface AXPBulkArchiveCommandContext {\n refType: string;\n ids: string[];\n rows: AXPContextData[];\n}\n\nexport function normalizeArchiveSingleInput(input: AXPContextData): AXPArchiveCommandContext | null {\n const resolved = resolveEntityActionRef(input);\n if (!resolved) {\n return null;\n }\n\n return {\n refId: resolved.refId,\n refType: resolved.refType,\n rowData: resolved.rowData as AXPContextData | undefined,\n };\n}\n\nexport function normalizeArchiveBulkInput(input: AXPContextData): AXPBulkArchiveCommandContext | null {\n const resolved = resolveEntityActionBulkRef(input);\n if (!resolved) {\n return null;\n }\n\n return {\n refType: resolved.refType,\n ids: resolved.ids,\n rows: resolved.rows as AXPContextData[],\n };\n}\n\nexport function buildArchivePatch(archived: boolean): AXPContextData {\n if (archived) {\n return { [DEFAULT_ARCHIVE_FIELD]: true, [ARCHIVE_TIMESTAMP_FIELD]: new Date() };\n }\n return { [DEFAULT_ARCHIVE_FIELD]: false, [ARCHIVE_TIMESTAMP_FIELD]: null };\n}\n\nexport function buildArchiveRefreshMeta(\n entityDefinition: AXPEntity,\n rowData?: AXPContextData,\n): AXPContextData {\n const meta: AXPContextData = {};\n if (entityDefinition.parentKey && rowData?.[entityDefinition.parentKey] != null) {\n meta['refreshTargetId'] = rowData[entityDefinition.parentKey];\n }\n return meta;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmBA;;;AAGG;MAEU,6BA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,KAAK;QACrB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,OAAO,EAAE,QAAQ,CAAC,OAAqC;KACxD;AACH;AAEM,SAAU,yBAAyB,CAAC,KAAqB,EAAA;AAC7D,IAAA,MAAM,QAAQ,GAAG,0BAA0B,CAAC,KAAK,CAAC;IAClD,IAAI,CAAC,QAAQ,EAAE;AACb,QAAA,OAAO,IAAI;IACb;IAEA,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,IAAI,EAAE,QAAQ,CAAC,IAAwB;KACxC;AACH;AAEM,SAAU,iBAAiB,CAAC,QAAiB,EAAA;IACjD,IAAI,QAAQ,EAAE;AACZ,QAAA,OAAO,EAAE,CAAC,qBAAqB,GAAG,IAAI,EAAE,CAAC,uBAAuB,GAAG,IAAI,IAAI,EAAE,EAAE;IACjF;AACA,IAAA,OAAO,EAAE,CAAC,qBAAqB,GAAG,KAAK,EAAE,CAAC,uBAAuB,GAAG,IAAI,EAAE;AAC5E;AAEM,SAAU,uBAAuB,CACrC,gBAA2B,EAC3B,OAAwB,EAAA;IAExB,MAAM,IAAI,GAAmB,EAAE;AAC/B,IAAA,IAAI,gBAAgB,CAAC,SAAS,IAAI,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE;QAC/E,IAAI,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC/D;AACA,IAAA,OAAO,IAAI;AACb;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-archive-entity.command.util-Cd65r7rb.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.helper.ts","../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/archive-entity.command.util.ts"],"sourcesContent":["import { AXDialogService } from '@acorex/components/dialog';\nimport { AXLoadingDialogService } from '@acorex/components/loading-dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommonSettings,\n AXPSettingsService,\n extractRequestErrorInfo,\n platformErrorI18nKey,\n throwIfCommandFailed,\n} from '@acorex-platform/framework-client/common';\nimport { AXPEntityBroadcastService } from '@acorex-platform/framework-client/core';\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXP_ENTITY_ARCHIVE_OVERRIDES } from '../archive-entity.override';\n\n/**\n * Injectable helper for archive commands: confirmation UI, persistence, toasts, and refresh events.\n * Pure input/patch logic lives in {@link archive-entity.command.util}.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPArchiveEntityCommandHelper {\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly dialogService = inject(AXDialogService);\n private readonly loadingDialog = inject(AXLoadingDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly entityEvents = inject(AXPEntityBroadcastService);\n private readonly archiveOverrides = inject(AXP_ENTITY_ARCHIVE_OVERRIDES, { optional: true }) ?? [];\n\n async resolveEntity(refType: string): Promise<AXPEntity> {\n const [moduleName, entityName] = refType.split('.');\n return this.entityRegistry.resolve(moduleName, entityName);\n }\n\n async applyPatch(refType: string, refId: string, patch: AXPContextData): Promise<void> {\n const override = this.archiveOverrides.find((entry) => entry.refType === refType);\n if (override) {\n const archived = patch['isArchived'] === true;\n if (archived) {\n await override.archive(refId);\n } else {\n await override.restore(refId);\n }\n return;\n }\n\n const entityDefinition = await this.resolveEntity(refType);\n const updateExec = entityDefinition.commands?.update?.execute as\n | ((payload: AXPContextData) => Promise<unknown>)\n | undefined;\n\n if (!updateExec) {\n throw new Error('Entity does not support update operation');\n }\n\n const result = await updateExec({ id: refId, ...patch });\n throwIfCommandFailed(result);\n }\n\n async confirm(titleKey: string, messageKey: string, messageParams?: AXPContextData): Promise<boolean> {\n const dialogResult = await this.dialogService.confirm(\n await this.translationService.translateAsync(titleKey),\n await this.translationService.translateAsync(messageKey, { params: messageParams }),\n 'warning',\n 'horizontal',\n false,\n 'cancel',\n );\n return dialogResult.result === true;\n }\n\n showLoading(title: string, status: string) {\n return this.loadingDialog.show({\n title,\n mode: 'indeterminate',\n status,\n });\n }\n\n async showSuccessToast(titleKey: string, contentKey?: string): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync(titleKey),\n content: contentKey ? await this.translationService.translateAsync(contentKey) : undefined,\n });\n }\n\n async showErrorToastFor(error: unknown, fallbackKey: string): Promise<void> {\n const enabled = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enabled) {\n return;\n }\n\n const info = extractRequestErrorInfo(error);\n const contentKey =\n platformErrorI18nKey(info?.code) ??\n (typeof info?.message === 'string' && info.message.startsWith('@')\n ? info.message\n : null) ??\n fallbackKey;\n const content = contentKey.startsWith('@')\n ? await this.translationService.translateAsync(contentKey)\n : contentKey;\n\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content,\n closeButton: true,\n timeOut: 6000,\n timeOutProgress: true,\n });\n }\n\n dispatchArchived(refType: string, id: string, meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, meta as Record<string, unknown> | undefined);\n }\n\n dispatchUnarchived(refType: string, id: string, meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, meta as Record<string, unknown> | undefined);\n }\n\n dispatchBulkArchived(refType: string, ids: string[], meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, { refreshType: 'bulk-archive', ...(meta ?? {}) });\n }\n\n dispatchBulkUnarchived(refType: string, ids: string[], meta?: AXPContextData): void {\n this.entityEvents.publishLayoutRefresh(refType, { refreshType: 'bulk-unarchive', ...(meta ?? {}) });\n }\n}\n","import type { AXPContextData } from '@acorex-platform/framework-shared/core';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport { resolveEntityActionBulkRef, resolveEntityActionRef } from '@acorex-platform/framework-shared/runtime';\n\nexport const DEFAULT_ARCHIVE_FIELD = 'isArchived';\nexport const ARCHIVE_TIMESTAMP_FIELD = 'archivedAt';\n\nexport interface AXPArchiveCommandContext {\n refId: string;\n refType: string;\n rowData?: AXPContextData;\n}\n\nexport interface AXPBulkArchiveCommandContext {\n refType: string;\n ids: string[];\n rows: AXPContextData[];\n}\n\nexport function normalizeArchiveSingleInput(input: AXPContextData): AXPArchiveCommandContext | null {\n const resolved = resolveEntityActionRef(input);\n if (!resolved) {\n return null;\n }\n\n return {\n refId: resolved.refId,\n refType: resolved.refType,\n rowData: resolved.rowData as AXPContextData | undefined,\n };\n}\n\nexport function normalizeArchiveBulkInput(input: AXPContextData): AXPBulkArchiveCommandContext | null {\n const resolved = resolveEntityActionBulkRef(input);\n if (!resolved) {\n return null;\n }\n\n return {\n refType: resolved.refType,\n ids: resolved.ids,\n rows: resolved.rows as AXPContextData[],\n };\n}\n\nexport function buildArchivePatch(archived: boolean): AXPContextData {\n if (archived) {\n return { [DEFAULT_ARCHIVE_FIELD]: true, [ARCHIVE_TIMESTAMP_FIELD]: new Date() };\n }\n return { [DEFAULT_ARCHIVE_FIELD]: false, [ARCHIVE_TIMESTAMP_FIELD]: null };\n}\n\nexport function buildArchiveRefreshMeta(\n entityDefinition: AXPEntity,\n rowData?: AXPContextData,\n): AXPContextData {\n const meta: AXPContextData = {};\n if (entityDefinition.parentKey && rowData?.[entityDefinition.parentKey] != null) {\n meta['refreshTargetId'] = rowData[entityDefinition.parentKey];\n }\n return meta;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmBA;;;AAGG;MAEU,6BAA6B,CAAA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rB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,OAAO,EAAE,QAAQ,CAAC,OAAqC;KACxD;AACH;AAEM,SAAU,yBAAyB,CAAC,KAAqB,EAAA;AAC7D,IAAA,MAAM,QAAQ,GAAG,0BAA0B,CAAC,KAAK,CAAC;IAClD,IAAI,CAAC,QAAQ,EAAE;AACb,QAAA,OAAO,IAAI;IACb;IAEA,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,IAAI,EAAE,QAAQ,CAAC,IAAwB;KACxC;AACH;AAEM,SAAU,iBAAiB,CAAC,QAAiB,EAAA;IACjD,IAAI,QAAQ,EAAE;AACZ,QAAA,OAAO,EAAE,CAAC,qBAAqB,GAAG,IAAI,EAAE,CAAC,uBAAuB,GAAG,IAAI,IAAI,EAAE,EAAE;IACjF;AACA,IAAA,OAAO,EAAE,CAAC,qBAAqB,GAAG,KAAK,EAAE,CAAC,uBAAuB,GAAG,IAAI,EAAE;AAC5E;AAEM,SAAU,uBAAuB,CACrC,gBAA2B,EAC3B,OAAwB,EAAA;IAExB,MAAM,IAAI,GAAmB,EAAE;AAC/B,IAAA,IAAI,gBAAgB,CAAC,SAAS,IAAI,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE;QAC/E,IAAI,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC/D;AACA,IAAA,OAAO,IAAI;AACb;;"}
|
|
@@ -12,6 +12,7 @@ import { CommonModule } from '@angular/common';
|
|
|
12
12
|
import * as i4 from '@acorex/core/translation';
|
|
13
13
|
import { AXTranslationModule } from '@acorex/core/translation';
|
|
14
14
|
import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
|
|
15
|
+
import { r as readAuditReviewed } from './acorex-platform-module-common-client-audit-info.util-CUlUTX8l.mjs';
|
|
15
16
|
|
|
16
17
|
const SHOW_VERSION_HISTORY_POPUP_COMMAND = 'show-version-history-popup';
|
|
17
18
|
class AXPAuditInfoColumnComponent extends AXPColumnWidgetComponent {
|
|
@@ -68,7 +69,7 @@ class AXPAuditInfoColumnComponent extends AXPColumnWidgetComponent {
|
|
|
68
69
|
...(ngDevMode ? [{ debugName: "displayDate" }] : /* istanbul ignore next */ []));
|
|
69
70
|
this.hasAuditInfo = computed(() => {
|
|
70
71
|
const info = this.auditInfo();
|
|
71
|
-
return !!(info?.created || info?.updated || info?.deleted);
|
|
72
|
+
return !!(info?.created || info?.updated || info?.deleted || readAuditReviewed(info));
|
|
72
73
|
}, /* @ts-ignore */
|
|
73
74
|
...(ngDevMode ? [{ debugName: "hasAuditInfo" }] : /* istanbul ignore next */ []));
|
|
74
75
|
this.createdEvent = computed(() => {
|
|
@@ -83,6 +84,10 @@ class AXPAuditInfoColumnComponent extends AXPColumnWidgetComponent {
|
|
|
83
84
|
return this.auditInfo()?.deleted ?? null;
|
|
84
85
|
}, /* @ts-ignore */
|
|
85
86
|
...(ngDevMode ? [{ debugName: "deletedEvent" }] : /* istanbul ignore next */ []));
|
|
87
|
+
this.reviewedEvent = computed(() => {
|
|
88
|
+
return readAuditReviewed(this.auditInfo());
|
|
89
|
+
}, /* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [{ debugName: "reviewedEvent" }] : /* istanbul ignore next */ []));
|
|
86
91
|
this.hasHistoryPlugin = computed(() => {
|
|
87
92
|
const hasHistoryPlugin = this.options?.hasHistoryPlugin ?? false;
|
|
88
93
|
return hasHistoryPlugin && this.commandService.exists(SHOW_VERSION_HISTORY_POPUP_COMMAND);
|
|
@@ -158,12 +163,12 @@ class AXPAuditInfoColumnComponent extends AXPColumnWidgetComponent {
|
|
|
158
163
|
});
|
|
159
164
|
}
|
|
160
165
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPAuditInfoColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
161
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPAuditInfoColumnComponent, isStandalone: true, selector: "axp-audit-info-column", inputs: { rawValue: "rawValue", rowData: "rowData" }, viewQueries: [{ propertyName: "infoButton", first: true, predicate: ["infoButton"], descendants: true, isSignal: true }, { propertyName: "infoPopover", first: true, predicate: ["infoPopover"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(createdEvent()?.at)) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(createdEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(updatedEvent()?.at)) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(updatedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(deletedEvent()?.at)) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(deletedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2$1.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disablePanelClass", "visualContextScope", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "closeOnScroll", "closeOnNavigation", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
166
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPAuditInfoColumnComponent, isStandalone: true, selector: "axp-audit-info-column", inputs: { rawValue: "rawValue", rowData: "rowData" }, viewQueries: [{ propertyName: "infoButton", first: true, predicate: ["infoButton"], descendants: true, isSignal: true }, { propertyName: "infoPopover", first: true, predicate: ["infoPopover"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(createdEvent()?.at)) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(createdEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(updatedEvent()?.at)) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(updatedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Reviewed -->\n @if (reviewedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.reviewed' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (reviewedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>\n @if (reviewedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (reviewedEvent()?.reason) {\n <div class=\"text-muted\">{{ reviewedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(deletedEvent()?.at)) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(deletedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2$1.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disablePanelClass", "visualContextScope", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "closeOnScroll", "closeOnNavigation", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
162
167
|
}
|
|
163
168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPAuditInfoColumnComponent, decorators: [{
|
|
164
169
|
type: Component,
|
|
165
|
-
args: [{ selector: 'axp-audit-info-column', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AXBadgeModule, AXButtonModule, AXPopoverModule, AXTranslationModule], inputs: ['rawValue', 'rowData'], template: "<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(createdEvent()?.at)) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(createdEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(updatedEvent()?.at)) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(updatedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(deletedEvent()?.at)) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(deletedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n" }]
|
|
170
|
+
args: [{ selector: 'axp-audit-info-column', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AXBadgeModule, AXButtonModule, AXPopoverModule, AXTranslationModule], inputs: ['rawValue', 'rowData'], template: "<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(createdEvent()?.at)) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(createdEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(updatedEvent()?.at)) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(updatedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Reviewed -->\n @if (reviewedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.reviewed' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (reviewedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>\n @if (reviewedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (reviewedEvent()?.reason) {\n <div class=\"text-muted\">{{ reviewedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(deletedEvent()?.at)) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> \u2022 {{ formatUser($safeNavigationMigration(deletedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n" }]
|
|
166
171
|
}], propDecorators: { infoButton: [{ type: i0.ViewChild, args: ['infoButton', { isSignal: true }] }], infoPopover: [{ type: i0.ViewChild, args: ['infoPopover', { isSignal: true }] }] } });
|
|
167
172
|
|
|
168
173
|
export { AXPAuditInfoColumnComponent };
|
|
169
|
-
//# sourceMappingURL=acorex-platform-module-common-client-audit-info-column.component-
|
|
174
|
+
//# sourceMappingURL=acorex-platform-module-common-client-audit-info-column.component-DhYUlBgr.mjs.map
|
package/fesm2022/acorex-platform-module-common-client-audit-info-column.component-DhYUlBgr.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-audit-info-column.component-DhYUlBgr.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/history-plugin/components/audit-info-column.component.ts","../../../../libs/modules/common/client/src/lib/features/history-plugin/components/audit-info-column.component.html"],"sourcesContent":["import { AXPAuditEvent, AXPRecordAuditInfo } from '@acorex-platform/framework-shared/entity';\nimport { AXBadgeModule } from '@acorex/components/badge';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXPopoverComponent, AXPopoverModule } from '@acorex/components/popover';\nimport { AXFormatService } from '@acorex/core/format';\n\nimport { ChangeDetectionStrategy, Component, computed, ElementRef, inject, signal, viewChild } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { readAuditReviewed } from '../audit-info.util';\n\nconst SHOW_VERSION_HISTORY_POPUP_COMMAND = 'show-version-history-popup';\n\n@Component({\n selector: 'axp-audit-info-column',\n templateUrl: './audit-info-column.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXBadgeModule, AXButtonModule, AXPopoverModule, AXTranslationModule],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXPAuditInfoColumnComponent extends AXPColumnWidgetComponent<AXPRecordAuditInfo> {\n //#region ---- Dependencies ----\n\n private readonly formatService = inject(AXFormatService);\n private readonly commandService = inject(AXPCommandService);\n\n //#endregion\n\n //#region ---- View Children ----\n\n protected infoButton = viewChild<ElementRef>('infoButton');\n protected infoPopover = viewChild<AXPopoverComponent>('infoPopover');\n\n //#endregion\n\n //#region ---- Properties ----\n\n protected host = inject(ElementRef);\n protected isPopoverOpen = signal(false);\n\n //#endregion\n\n //#region ---- Computed Properties ----\n\n protected auditInfo = computed<AXPRecordAuditInfo | null>(() => {\n const value = this.rawValue;\n return value && typeof value === 'object' ? (value as AXPRecordAuditInfo) : null;\n });\n\n protected displayText = computed<string>(() => {\n const info = this.auditInfo();\n if (!info) {\n return '---';\n }\n\n if (info.updated?.at) {\n return this.formatAuditEvent(info.updated, 'updated');\n } else if (info.created?.at) {\n return this.formatAuditEvent(info.created, 'created');\n }\n\n return '---';\n });\n\n protected displayDate = computed<string>(() => {\n const info = this.auditInfo();\n if (!info) {\n return '';\n }\n\n if (info.updated?.at) {\n return this.formatDate(info.updated.at);\n } else if (info.created?.at) {\n return this.formatDate(info.created.at);\n }\n\n return '';\n });\n\n protected hasAuditInfo = computed<boolean>(() => {\n const info = this.auditInfo();\n return !!(info?.created || info?.updated || info?.deleted || readAuditReviewed(info));\n });\n\n protected createdEvent = computed<AXPAuditEvent | null>(() => {\n return this.auditInfo()?.created ?? null;\n });\n\n protected updatedEvent = computed<AXPAuditEvent | null>(() => {\n return this.auditInfo()?.updated ?? null;\n });\n\n protected deletedEvent = computed<AXPAuditEvent | null>(() => {\n return this.auditInfo()?.deleted ?? null;\n });\n\n protected reviewedEvent = computed<AXPAuditEvent | null>(() => {\n return readAuditReviewed(this.auditInfo());\n });\n\n //#endregion\n\n //#region ---- Public Methods ----\n\n protected showInfo(): void {\n this.openPopover();\n }\n\n protected onPopoverOpenChange(event: any): void {\n this.isPopoverOpen.set(event);\n }\n\n protected formatDate(date: Date | string | undefined): string {\n if (!date) {\n return '---';\n }\n\n try {\n const dateObj = typeof date === 'string' ? new Date(date) : date;\n return this.formatService.format(dateObj, 'datetime', {\n format: 'short',\n });\n } catch {\n return '---';\n }\n }\n\n protected formatUser(user: any): string {\n if (!user) {\n return '---';\n }\n\n return user.fullName || user.username || user.id || '---';\n }\n\n protected formatAuditEvent(event: AXPAuditEvent, type: 'created' | 'updated' | 'deleted'): string {\n if (!event?.at) {\n return '---';\n }\n\n const dateStr = this.formatDate(event.at);\n const userStr = this.formatUser(event.by);\n return `${dateStr}${userStr !== '---' ? ` by ${userStr}` : ''}`;\n }\n\n //#endregion\n\n //#region ---- Private Methods ----\n\n private openPopover(): void {\n if (this.infoPopover() && this.infoButton()) {\n this.infoPopover()!.target = this.infoButton()!.nativeElement;\n this.infoPopover()!.open();\n this.isPopoverOpen.set(true);\n }\n }\n\n protected hasHistoryPlugin = computed<boolean>(() => {\n const hasHistoryPlugin = (this.options as any)?.hasHistoryPlugin ?? false;\n return hasHistoryPlugin && this.commandService.exists(SHOW_VERSION_HISTORY_POPUP_COMMAND);\n });\n\n protected async showHistory(): Promise<void> {\n if (!this.hasHistoryPlugin()) {\n return;\n }\n\n const rowData = this.rowData as Record<string, any>;\n const entityId = rowData?.['id'];\n\n if (!entityId) {\n return;\n }\n\n const entityInfo = (this.options as any)?.entityInfo || rowData?.['__entityInfo'];\n const refType = entityInfo?.source || entityInfo?.refType;\n\n if (!refType) {\n return;\n }\n\n const fieldTitles = entityInfo?.fieldTitles || {};\n\n await this.commandService.execute(SHOW_VERSION_HISTORY_POPUP_COMMAND, {\n options: {\n refId: entityId,\n refType,\n fieldTitles,\n },\n });\n }\n\n //#endregion\n}\n","<div class=\"flex items-center gap-1.5\">\n @if (hasAuditInfo()) {\n <div class=\"flex items-center gap-1.5 cursor-pointer hover:opacity-80 transition-opacity\"\n (click)=\"showInfo()\" [title]=\"displayText()\" #infoButton>\n <i class=\"fa-light fa-calendar-circle-exclamation\"></i>\n <span class=\"text-xs\" [dir]=\"'ltr'\">{{ displayDate() }}</span>\n </div>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n</div>\n\n<!-- Audit Info Popover -->\n<ax-popover [openOn]=\"'manual'\" #infoPopover (openChange)=\"onPopoverOpenChange($event)\" [adaptivityEnabled]=\"true\">\n <div class=\"lightest-surface border rounded-lg shadow-lg p-3 min-w-[280px]\">\n <div class=\"mb-3 pb-2 border-b\">\n <h3 class=\"text-sm font-semibold\">\n {{ '@general:terms.audit.section-title' | translate | async }}\n </h3>\n </div>\n <div class=\"space-y-2.5\">\n <!-- Created -->\n @if (createdEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.created' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (createdEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(createdEvent()?.at)) }}</span>\n @if (createdEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(createdEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (createdEvent()?.reason) {\n <div class=\"text-muted\">{{ createdEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Updated -->\n @if (updatedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.updated' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (updatedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(updatedEvent()?.at)) }}</span>\n @if (updatedEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(updatedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (updatedEvent()?.reason) {\n <div class=\"text-muted\">{{ updatedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Reviewed -->\n @if (reviewedEvent()) {\n <div>\n <div class=\"text-xs mb-1 font-semibold\">\n {{ '@general:terms.audit.reviewed' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (reviewedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>\n @if (reviewedEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (reviewedEvent()?.reason) {\n <div class=\"text-muted\">{{ reviewedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n\n <!-- Deleted -->\n @if (deletedEvent()) {\n <div>\n <div class=\"text-xs text-muted mb-1 font-semibold\">\n {{ '@general:terms.audit.deleted' | translate | async }}\n </div>\n <div class=\"text-xs space-y-0.5\">\n @if (deletedEvent()?.at) {\n <div>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(deletedEvent()?.at)) }}</span>\n @if (deletedEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(deletedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (deletedEvent()?.reason) {\n <div class=\"text-muted\">{{ deletedEvent()?.reason }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (hasHistoryPlugin()) {\n <div class=\"mt-3 pt-3 border-t ax-sm\">\n <ax-button [text]=\"'@general:terms.audit.history' | translate | async\" (click)=\"showHistory()\" class=\"w-full\">\n </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;AAaA,MAAM,kCAAkC,GAAG,4BAA4B;AASjE,MAAO,2BAA4B,SAAQ,wBAA4C,CAAA;AAP7F,IAAA,WAAA,GAAA;;;AAUmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;QAMjD,IAAA,CAAA,UAAU,GAAG,SAAS,CAAa,YAAY;uFAAC;QAChD,IAAA,CAAA,WAAW,GAAG,SAAS,CAAqB,aAAa;wFAAC;;;AAM1D,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;QACzB,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,KAAK;0FAAC;;;AAM7B,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAA4B,MAAK;AAC7D,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ;AAC3B,YAAA,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,GAAI,KAA4B,GAAG,IAAI;QAClF,CAAC;sFAAC;AAEQ,QAAA,IAAA,CAAA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AAA,CAAA,CAAA;;2FAGhF,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAPvC,SAAS;+BACE,uBAAuB,EAAA,eAAA,EAEhB,uBAAuB,CAAC,MAAM,WACtC,CAAC,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,CAAC,UACpF,CAAC,UAAU,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,utIAAA,EAAA;AAYc,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,YAAY,qEACH,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;"}
|
|
@@ -6,6 +6,7 @@ import * as i4 from '@acorex/core/translation';
|
|
|
6
6
|
import { AXTranslationModule } from '@acorex/core/translation';
|
|
7
7
|
import * as i1 from '@angular/common';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { r as readAuditReviewed } from './acorex-platform-module-common-client-audit-info.util-CUlUTX8l.mjs';
|
|
9
10
|
|
|
10
11
|
class AXPAuditInfoEditComponent extends AXPValueWidgetComponent {
|
|
11
12
|
constructor() {
|
|
@@ -24,9 +25,11 @@ class AXPAuditInfoEditComponent extends AXPValueWidgetComponent {
|
|
|
24
25
|
...(ngDevMode ? [{ debugName: "auditInfo" }] : /* istanbul ignore next */ []));
|
|
25
26
|
this.hasAnyAuditInfo = computed(() => {
|
|
26
27
|
const info = this.auditInfo();
|
|
27
|
-
return !!(info?.created || info?.updated || info?.deleted);
|
|
28
|
+
return !!(info?.created || info?.updated || info?.deleted || readAuditReviewed(info));
|
|
28
29
|
}, /* @ts-ignore */
|
|
29
30
|
...(ngDevMode ? [{ debugName: "hasAnyAuditInfo" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.reviewedEvent = computed(() => readAuditReviewed(this.auditInfo()), /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "reviewedEvent" }] : /* istanbul ignore next */ []));
|
|
30
33
|
}
|
|
31
34
|
formatDate(date) {
|
|
32
35
|
if (!date) {
|
|
@@ -70,6 +73,15 @@ class AXPAuditInfoEditComponent extends AXPValueWidgetComponent {
|
|
|
70
73
|
}
|
|
71
74
|
</div>
|
|
72
75
|
}
|
|
76
|
+
@if (reviewedEvent()) {
|
|
77
|
+
<div>
|
|
78
|
+
<span class="text-muted">{{ '@general:terms.audit.reviewed' | translate | async }}: </span>
|
|
79
|
+
<span [dir]="'ltr'">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>
|
|
80
|
+
@if (reviewedEvent()?.by) {
|
|
81
|
+
<span class="text-muted"> • {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>
|
|
82
|
+
}
|
|
83
|
+
</div>
|
|
84
|
+
}
|
|
73
85
|
@if (auditInfo()?.deleted) {
|
|
74
86
|
<div>
|
|
75
87
|
<span class="text-muted">{{ '@general:terms.audit.deleted' | translate | async }}: </span>
|
|
@@ -108,6 +120,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
108
120
|
}
|
|
109
121
|
</div>
|
|
110
122
|
}
|
|
123
|
+
@if (reviewedEvent()) {
|
|
124
|
+
<div>
|
|
125
|
+
<span class="text-muted">{{ '@general:terms.audit.reviewed' | translate | async }}: </span>
|
|
126
|
+
<span [dir]="'ltr'">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>
|
|
127
|
+
@if (reviewedEvent()?.by) {
|
|
128
|
+
<span class="text-muted"> • {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>
|
|
129
|
+
}
|
|
130
|
+
</div>
|
|
131
|
+
}
|
|
111
132
|
@if (auditInfo()?.deleted) {
|
|
112
133
|
<div>
|
|
113
134
|
<span class="text-muted">{{ '@general:terms.audit.deleted' | translate | async }}: </span>
|
|
@@ -126,4 +147,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
126
147
|
}] });
|
|
127
148
|
|
|
128
149
|
export { AXPAuditInfoEditComponent };
|
|
129
|
-
//# sourceMappingURL=acorex-platform-module-common-client-audit-info-edit.component-
|
|
150
|
+
//# sourceMappingURL=acorex-platform-module-common-client-audit-info-edit.component-aCgPXlef.mjs.map
|
package/fesm2022/acorex-platform-module-common-client-audit-info-edit.component-aCgPXlef.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-audit-info-edit.component-aCgPXlef.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/history-plugin/components/audit-info-edit.component.ts"],"sourcesContent":["import { AXPRecordAuditInfo } from '@acorex-platform/framework-shared/entity';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\n\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { readAuditReviewed } from '../audit-info.util';\n\n@Component({\n selector: 'axp-audit-info-edit',\n template: `\n @if (auditInfo() && hasAnyAuditInfo()) {\n <div class=\"text-xs space-y-1\">\n @if (auditInfo()?.created) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.created' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(auditInfo()?.created?.at)) }}</span>\n @if (auditInfo()?.created?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(auditInfo()?.created?.by)) }}</span>\n }\n </div>\n }\n @if (auditInfo()?.updated) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.updated' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(auditInfo()?.updated?.at)) }}</span>\n @if (auditInfo()?.updated?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(auditInfo()?.updated?.by)) }}</span>\n }\n </div>\n }\n @if (reviewedEvent()) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.reviewed' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>\n @if (reviewedEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (auditInfo()?.deleted) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.deleted' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(auditInfo()?.deleted?.at)) }}</span>\n @if (auditInfo()?.deleted?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(auditInfo()?.deleted?.by)) }}</span>\n }\n </div>\n }\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXTranslationModule],\n})\nexport class AXPAuditInfoEditComponent extends AXPValueWidgetComponent<AXPRecordAuditInfo> {\n private readonly formatService = inject(AXFormatService);\n\n protected auditInfo = computed<AXPRecordAuditInfo | null>(() => {\n let value = this.getValue();\n\n if (!value) {\n const contextData = this.contextService.data() as Record<string, any>;\n if (contextData && 'auditInfo' in contextData) {\n value = contextData['auditInfo'];\n }\n }\n\n return value && typeof value === 'object' ? (value as AXPRecordAuditInfo) : null;\n });\n\n protected hasAnyAuditInfo = computed<boolean>(() => {\n const info = this.auditInfo();\n return !!(info?.created || info?.updated || info?.deleted || readAuditReviewed(info));\n });\n\n protected reviewedEvent = computed(() => readAuditReviewed(this.auditInfo()));\n\n protected formatDate(date: Date | string | undefined): string {\n if (!date) {\n return '---';\n }\n\n try {\n const dateObj = typeof date === 'string' ? new Date(date) : date;\n return this.formatService.format(dateObj, 'datetime', {\n format: 'short',\n });\n } catch {\n return '---';\n }\n }\n\n protected formatUser(user: any): string {\n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,CAAA;kBA/CrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;AAC7C,iBAAA;;;"}
|
|
@@ -6,6 +6,7 @@ import * as i4 from '@acorex/core/translation';
|
|
|
6
6
|
import { AXTranslationModule } from '@acorex/core/translation';
|
|
7
7
|
import * as i1 from '@angular/common';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { r as readAuditReviewed } from './acorex-platform-module-common-client-audit-info.util-CUlUTX8l.mjs';
|
|
9
10
|
|
|
10
11
|
class AXPAuditInfoViewComponent extends AXPValueWidgetComponent {
|
|
11
12
|
constructor() {
|
|
@@ -24,9 +25,11 @@ class AXPAuditInfoViewComponent extends AXPValueWidgetComponent {
|
|
|
24
25
|
...(ngDevMode ? [{ debugName: "auditInfo" }] : /* istanbul ignore next */ []));
|
|
25
26
|
this.hasAnyAuditInfo = computed(() => {
|
|
26
27
|
const info = this.auditInfo();
|
|
27
|
-
return !!(info?.created || info?.updated || info?.deleted);
|
|
28
|
+
return !!(info?.created || info?.updated || info?.deleted || readAuditReviewed(info));
|
|
28
29
|
}, /* @ts-ignore */
|
|
29
30
|
...(ngDevMode ? [{ debugName: "hasAnyAuditInfo" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.reviewedEvent = computed(() => readAuditReviewed(this.auditInfo()), /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "reviewedEvent" }] : /* istanbul ignore next */ []));
|
|
30
33
|
}
|
|
31
34
|
formatDate(date) {
|
|
32
35
|
if (!date) {
|
|
@@ -70,6 +73,15 @@ class AXPAuditInfoViewComponent extends AXPValueWidgetComponent {
|
|
|
70
73
|
}
|
|
71
74
|
</div>
|
|
72
75
|
}
|
|
76
|
+
@if (reviewedEvent()) {
|
|
77
|
+
<div>
|
|
78
|
+
<span class="text-muted">{{ '@general:terms.audit.reviewed' | translate | async }}: </span>
|
|
79
|
+
<span [dir]="'ltr'">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>
|
|
80
|
+
@if (reviewedEvent()?.by) {
|
|
81
|
+
<span class="text-muted"> • {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>
|
|
82
|
+
}
|
|
83
|
+
</div>
|
|
84
|
+
}
|
|
73
85
|
@if (auditInfo()?.deleted) {
|
|
74
86
|
<div>
|
|
75
87
|
<span class="text-muted">{{ '@general:terms.audit.deleted' | translate | async }}: </span>
|
|
@@ -108,6 +120,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
108
120
|
}
|
|
109
121
|
</div>
|
|
110
122
|
}
|
|
123
|
+
@if (reviewedEvent()) {
|
|
124
|
+
<div>
|
|
125
|
+
<span class="text-muted">{{ '@general:terms.audit.reviewed' | translate | async }}: </span>
|
|
126
|
+
<span [dir]="'ltr'">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>
|
|
127
|
+
@if (reviewedEvent()?.by) {
|
|
128
|
+
<span class="text-muted"> • {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>
|
|
129
|
+
}
|
|
130
|
+
</div>
|
|
131
|
+
}
|
|
111
132
|
@if (auditInfo()?.deleted) {
|
|
112
133
|
<div>
|
|
113
134
|
<span class="text-muted">{{ '@general:terms.audit.deleted' | translate | async }}: </span>
|
|
@@ -126,4 +147,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
126
147
|
}] });
|
|
127
148
|
|
|
128
149
|
export { AXPAuditInfoViewComponent };
|
|
129
|
-
//# sourceMappingURL=acorex-platform-module-common-client-audit-info-view.component-
|
|
150
|
+
//# sourceMappingURL=acorex-platform-module-common-client-audit-info-view.component-lgzqcHCv.mjs.map
|
package/fesm2022/acorex-platform-module-common-client-audit-info-view.component-lgzqcHCv.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-audit-info-view.component-lgzqcHCv.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/history-plugin/components/audit-info-view.component.ts"],"sourcesContent":["import { AXPRecordAuditInfo } from '@acorex-platform/framework-shared/entity';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\n\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { readAuditReviewed } from '../audit-info.util';\n\n@Component({\n selector: 'axp-audit-info-view',\n template: `\n @if (auditInfo() && hasAnyAuditInfo()) {\n <div class=\"text-xs space-y-1\">\n @if (auditInfo()?.created) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.created' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(auditInfo()?.created?.at)) }}</span>\n @if (auditInfo()?.created?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(auditInfo()?.created?.by)) }}</span>\n }\n </div>\n }\n @if (auditInfo()?.updated) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.updated' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(auditInfo()?.updated?.at)) }}</span>\n @if (auditInfo()?.updated?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(auditInfo()?.updated?.by)) }}</span>\n }\n </div>\n }\n @if (reviewedEvent()) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.reviewed' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(reviewedEvent()?.at)) }}</span>\n @if (reviewedEvent()?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(reviewedEvent()?.by)) }}</span>\n }\n </div>\n }\n @if (auditInfo()?.deleted) {\n <div>\n <span class=\"text-muted\">{{ '@general:terms.audit.deleted' | translate | async }}: </span>\n <span [dir]=\"'ltr'\">{{ formatDate($safeNavigationMigration(auditInfo()?.deleted?.at)) }}</span>\n @if (auditInfo()?.deleted?.by) {\n <span class=\"text-muted\"> • {{ formatUser($safeNavigationMigration(auditInfo()?.deleted?.by)) }}</span>\n }\n </div>\n }\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXTranslationModule],\n})\nexport class AXPAuditInfoViewComponent extends AXPValueWidgetComponent<AXPRecordAuditInfo> {\n private readonly formatService = inject(AXFormatService);\n\n protected auditInfo = computed<AXPRecordAuditInfo | null>(() => {\n let value = this.getValue();\n\n if (!value) {\n const contextData = this.contextService.data() as Record<string, any>;\n if (contextData && 'auditInfo' in contextData) {\n value = contextData['auditInfo'];\n }\n }\n\n return value && typeof value === 'object' ? (value as AXPRecordAuditInfo) : null;\n });\n\n protected hasAnyAuditInfo = computed<boolean>(() => {\n const info = this.auditInfo();\n return !!(info?.created || info?.updated || info?.deleted || readAuditReviewed(info));\n });\n\n protected reviewedEvent = computed(() => readAuditReviewed(this.auditInfo()));\n\n protected formatDate(date: Date | string | undefined): string {\n if (!date) {\n return '---';\n }\n\n try {\n const dateObj = typeof date === 'string' ? new Date(date) : date;\n return this.formatService.format(dateObj, 'datetime', {\n format: 'short',\n });\n } catch {\n return '---';\n }\n }\n\n protected formatUser(user: any): string {\n if (!user) {\n return '---';\n }\n\n return user.fullName || user.username || user.id || '---';\n }\n}\n"],"names":["i2"],"mappings":";;;;;;;;;;AAwDM,MAAO,yBAA0B,SAAQ,uBAA2C,CAAA;AA/C1F,IAAA,WAAA,GAAA;;AAgDmB,QAAA,IAAA,CAAA,aAAa,G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AAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;AAC7C,iBAAA;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function readAuditReviewed(info) {
|
|
2
|
+
if (!info || typeof info !== 'object') {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
return info.reviewed ?? null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { readAuditReviewed as r };
|
|
9
|
+
//# sourceMappingURL=acorex-platform-module-common-client-audit-info.util-CUlUTX8l.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-audit-info.util-CUlUTX8l.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/history-plugin/audit-info.util.ts"],"sourcesContent":["import type { AXPAuditEvent, AXPRecordAuditInfo } from '@acorex-platform/framework-shared/entity';\n\nexport type AXPRecordAuditInfoWithReviewed = AXPRecordAuditInfo & {\n reviewed?: AXPAuditEvent;\n};\n\nexport function readAuditReviewed(info: AXPRecordAuditInfo | null | undefined): AXPAuditEvent | null {\n if (!info || typeof info !== 'object') {\n return null;\n }\n return (info as AXPRecordAuditInfoWithReviewed).reviewed ?? null;\n}\n"],"names":[],"mappings":"AAMM,SAAU,iBAAiB,CAAC,IAA2C,EAAA;IAC3E,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AACrC,QAAA,OAAO,IAAI;IACb;AACA,IAAA,OAAQ,IAAuC,CAAC,QAAQ,IAAI,IAAI;AAClE;;"}
|
|
@@ -3,7 +3,7 @@ import { AXTranslationService } from '@acorex/core/translation';
|
|
|
3
3
|
import { AXPEntityBulkPatchPerformService } from '@acorex-platform/framework-client/layout/entity';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, Injectable } from '@angular/core';
|
|
6
|
-
import { A as AXPArchiveEntityCommandHelper, c as normalizeArchiveBulkInput, b as buildArchivePatch } from './acorex-platform-module-common-client-archive-entity.command.util-
|
|
6
|
+
import { A as AXPArchiveEntityCommandHelper, c as normalizeArchiveBulkInput, b as buildArchivePatch } from './acorex-platform-module-common-client-archive-entity.command.util-Cd65r7rb.mjs';
|
|
7
7
|
|
|
8
8
|
class AXPBulkArchiveEntityCommand {
|
|
9
9
|
constructor() {
|
|
@@ -63,4 +63,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
63
63
|
}] });
|
|
64
64
|
|
|
65
65
|
export { AXPBulkArchiveEntityCommand };
|
|
66
|
-
//# sourceMappingURL=acorex-platform-module-common-client-bulk-archive-entity.command-
|
|
66
|
+
//# sourceMappingURL=acorex-platform-module-common-client-bulk-archive-entity.command-B-S45xY1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-common-client-bulk-archive-entity.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-bulk-archive-entity.command-B-S45xY1.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/bulk-archive-entity.command.ts"],"sourcesContent":["import { runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, type AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityBulkPatchPerformService } from '@acorex-platform/framework-client/layout/entity';\nimport type { AXPBulkCommandResultData } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPArchiveEntityCommandHelper } from './archive-entity.command.helper';\nimport { buildArchivePatch, normalizeArchiveBulkInput } from './archive-entity.command.util';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPBulkArchiveEntityCommand\n implements AXPCommand<AXPContextData, AXPBulkCommandResultData>\n{\n private readonly helper = inject(AXPArchiveEntityCommandHelper);\n private readonly translationService = inject(AXTranslationService);\n private readonly bulkPatch = inject(AXPEntityBulkPatchPerformService);\n\n async execute(\n input: AXPContextData,\n ): AXPCommandExecuteResultPromise<AXPBulkCommandResultData> {\n const context = normalizeArchiveBulkInput(input);\n if (!context) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const confirmed = await this.helper.confirm(\n '@general:actions.bulk-archive.confirm.title',\n '@general:actions.bulk-archive.confirm.message',\n { count: context.ids.length },\n );\n if (!confirmed) {\n return { success: false };\n }\n\n const result = await this.bulkPatch.perform({\n entity: context.refType,\n ids: context.ids,\n patch: buildArchivePatch(true),\n loadingTitleKey: '@general:actions.bulk-archive.confirm.processing',\n successTitleKey: '@general:workflow.entity-bulk-archived',\n successBodyKey: '@general:workflow.entity-bulk-archived-body',\n partialTitleKey: '@general:workflow.bulk.partial-title',\n partialBodyKey: '@general:workflow.bulk.partial-body',\n partialBodyWithReasonKey: '@general:workflow.bulk.partial-body-with-reason',\n failTitleKey: '@general:workflow.bulk.fail-title',\n failBodyKey: '@general:workflow.bulk.fail-body',\n failBodyWithReasonKey: '@general:workflow.bulk.fail-body-with-reason',\n });\n\n const data = runtimeCommandPayloadData(result);\n if ((data?.succeeded ?? 0) > 0) {\n this.helper.dispatchBulkArchived(context.refType, context.ids, {\n failedIds: (data?.results ?? [])\n .filter((item: { success: boolean; id: string }) => !item.success)\n .map((item: { success: boolean; id: string }) => item.id),\n totalProcessed: data?.succeeded,\n totalFailed: data?.failed,\n });\n }\n\n // Dialog already presented — omit message to avoid toast middleware double-fire.\n return result.success\n ? { success: true, kind: 'object' as const, data: data!, metadata: { refresh: false } }\n : { success: false, message: result.message };\n }\n}\n"],"names":[],"mappings":";;;;;;;MAYa,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAC9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AAC;QAC9C,IAAI,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE;AAC9B,YAAA,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;AAC7D,gBAAA,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE;qBAC5B,MAAM,CAAC,CAAC,IAAsC,KAAK,CAAC,IAAI,CAAC,OAAO;qBAChE,GAAG,CAAC,CAAC,IAAsC,KAAK,IAAI,CAAC,EAAE,CAAC;gBAC3D,cAAc,EAAE,IAAI,EAAE,SAAS;gBAC/B,WAAW,EAAE,IAAI,EAAE,MAAM;AAC1B,aAAA,CAAC;QACJ;;QAGA,OAAO,MAAM,CAAC;cACV,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAiB,EAAE,IAAI,EAAE,IAAK,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AACrF,cAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE;IACjD;8GA3DW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -3,7 +3,7 @@ import { AXTranslationService } from '@acorex/core/translation';
|
|
|
3
3
|
import { AXPEntityBulkPatchPerformService } from '@acorex-platform/framework-client/layout/entity';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, Injectable } from '@angular/core';
|
|
6
|
-
import { A as AXPArchiveEntityCommandHelper, c as normalizeArchiveBulkInput, b as buildArchivePatch } from './acorex-platform-module-common-client-archive-entity.command.util-
|
|
6
|
+
import { A as AXPArchiveEntityCommandHelper, c as normalizeArchiveBulkInput, b as buildArchivePatch } from './acorex-platform-module-common-client-archive-entity.command.util-Cd65r7rb.mjs';
|
|
7
7
|
|
|
8
8
|
class AXPBulkRestoreArchiveEntityCommand {
|
|
9
9
|
constructor() {
|
|
@@ -62,4 +62,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
62
62
|
}] });
|
|
63
63
|
|
|
64
64
|
export { AXPBulkRestoreArchiveEntityCommand };
|
|
65
|
-
//# sourceMappingURL=acorex-platform-module-common-client-bulk-restore-archive-entity.command-
|
|
65
|
+
//# sourceMappingURL=acorex-platform-module-common-client-bulk-restore-archive-entity.command-CqZxZrkm.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-common-client-bulk-restore-archive-entity.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-common-client-bulk-restore-archive-entity.command-CqZxZrkm.mjs","sources":["../../../../libs/modules/common/client/src/lib/features/archive-plugin/commands/bulk-restore-archive-entity.command.ts"],"sourcesContent":["import { runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, type AXPContextData } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityBulkPatchPerformService } from '@acorex-platform/framework-client/layout/entity';\nimport type { AXPBulkCommandResultData } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPArchiveEntityCommandHelper } from './archive-entity.command.helper';\nimport { buildArchivePatch, normalizeArchiveBulkInput } from './archive-entity.command.util';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPBulkRestoreArchiveEntityCommand\n implements AXPCommand<AXPContextData, AXPBulkCommandResultData>\n{\n private readonly helper = inject(AXPArchiveEntityCommandHelper);\n private readonly translationService = inject(AXTranslationService);\n private readonly bulkPatch = inject(AXPEntityBulkPatchPerformService);\n\n async execute(\n input: AXPContextData,\n ): AXPCommandExecuteResultPromise<AXPBulkCommandResultData> {\n const context = normalizeArchiveBulkInput(input);\n if (!context) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const confirmed = await this.helper.confirm(\n '@general:actions.bulk-restore-archive.confirm.title',\n '@general:actions.bulk-restore-archive.confirm.message',\n { count: context.ids.length },\n );\n if (!confirmed) {\n return { success: false };\n }\n\n const result = await this.bulkPatch.perform({\n entity: context.refType,\n ids: context.ids,\n patch: buildArchivePatch(false),\n loadingTitleKey: '@general:actions.bulk-restore-archive.confirm.processing',\n successTitleKey: '@general:workflow.entity-bulk-unarchived',\n successBodyKey: '@general:workflow.entity-bulk-unarchived-body',\n partialTitleKey: '@general:workflow.bulk.partial-title',\n partialBodyKey: '@general:workflow.bulk.partial-body',\n partialBodyWithReasonKey: '@general:workflow.bulk.partial-body-with-reason',\n failTitleKey: '@general:workflow.bulk.fail-title',\n failBodyKey: '@general:workflow.bulk.fail-body',\n failBodyWithReasonKey: '@general:workflow.bulk.fail-body-with-reason',\n });\n\n const data = runtimeCommandPayloadData(result);\n if ((data?.succeeded ?? 0) > 0) {\n this.helper.dispatchBulkUnarchived(context.refType, context.ids, {\n failedIds: (data?.results ?? [])\n .filter((item: { success: boolean; id: string }) => !item.success)\n .map((item: { success: boolean; id: string }) => item.id),\n totalProcessed: data?.succeeded,\n totalFailed: data?.failed,\n });\n }\n\n return result.success\n ? { success: true, kind: 'object' as const, data: data!, metadata: { refresh: false } }\n : { success: false, message: result.message };\n }\n}"],"names":[],"mappings":";;;;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 +8,7 @@ import { AXPSettingsService, AXPCommonSettings } from '@acorex-platform/framewor
|
|
|
8
8
|
import { AXPEntityBroadcastService } from '@acorex-platform/framework-client/core';
|
|
9
9
|
import { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
|
|
10
10
|
import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtime';
|
|
11
|
-
import { t as toVariableName, i as isValidVariableName } from './acorex-platform-module-common-client-acorex-platform-module-common-client-
|
|
11
|
+
import { t as toVariableName, i as isValidVariableName } from './acorex-platform-module-common-client-acorex-platform-module-common-client-BtSt1xRl.mjs';
|
|
12
12
|
|
|
13
13
|
class AXPCloneEntityCommandHelper {
|
|
14
14
|
constructor() {
|
|
@@ -223,4 +223,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
223
223
|
}] });
|
|
224
224
|
|
|
225
225
|
export { AXPCloneEntityCommand };
|
|
226
|
-
//# sourceMappingURL=acorex-platform-module-common-client-clone-entity.command-
|
|
226
|
+
//# sourceMappingURL=acorex-platform-module-common-client-clone-entity.command-DmmdZyoL.mjs.map
|