@masterteam/governance 0.0.10 → 0.0.12
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/assets/governance.css +1 -1
- package/assets/i18n/ar.json +220 -199
- package/assets/i18n/en.json +220 -199
- package/fesm2022/masterteam-governance.mjs +213 -97
- package/fesm2022/masterteam-governance.mjs.map +1 -1
- package/package.json +3 -3
- package/types/masterteam-governance.d.ts +17 -6
|
@@ -636,6 +636,16 @@ const GOVERNANCE_RULE_RECIPE_DEFINITIONS = [
|
|
|
636
636
|
ruleTypeKeys: ['PropertyValueEquals', 'FieldValue'],
|
|
637
637
|
labelKey: 'wizard.recipes.property-value.label',
|
|
638
638
|
},
|
|
639
|
+
{
|
|
640
|
+
key: 'property-has-value',
|
|
641
|
+
ruleTypeKeys: ['PropertyHasValue'],
|
|
642
|
+
labelKey: 'wizard.recipes.property-has-value.label',
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
key: 'mandatory-gate-items-completed',
|
|
646
|
+
ruleTypeKeys: ['PhaseGateMandatoryItemsCompleted'],
|
|
647
|
+
labelKey: 'wizard.recipes.mandatory-gate-items-completed.label',
|
|
648
|
+
},
|
|
639
649
|
];
|
|
640
650
|
const GOVERNANCE_APPLIES_TO_OPTIONS = [
|
|
641
651
|
{
|
|
@@ -668,6 +678,14 @@ const GOVERNANCE_ACTION_OPTIONS = [
|
|
|
668
678
|
value: 'delete',
|
|
669
679
|
labelKey: 'wizard.actions.delete',
|
|
670
680
|
},
|
|
681
|
+
{
|
|
682
|
+
value: 'manage-phase-gate',
|
|
683
|
+
labelKey: 'wizard.actions.manage-phase-gate',
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
value: 'move-phase-gate',
|
|
687
|
+
labelKey: 'wizard.actions.move-phase-gate',
|
|
688
|
+
},
|
|
671
689
|
];
|
|
672
690
|
const GOVERNANCE_OPERATOR_OPTIONS = [
|
|
673
691
|
{
|
|
@@ -761,7 +779,6 @@ function mapAppliesToToTargetScope(appliesTo) {
|
|
|
761
779
|
case 'level':
|
|
762
780
|
return 'Level';
|
|
763
781
|
case 'phase-gate':
|
|
764
|
-
return 'PhaseGate';
|
|
765
782
|
case 'any-module':
|
|
766
783
|
case 'specific-module':
|
|
767
784
|
default:
|
|
@@ -771,24 +788,29 @@ function mapAppliesToToTargetScope(appliesTo) {
|
|
|
771
788
|
function mapActionToOperationKey(actionKey) {
|
|
772
789
|
switch (actionKey) {
|
|
773
790
|
case 'update':
|
|
791
|
+
case 'manage-phase-gate':
|
|
774
792
|
return 'Update';
|
|
775
793
|
case 'delete':
|
|
776
794
|
return 'Delete';
|
|
795
|
+
case 'move-phase-gate':
|
|
796
|
+
return 'MovePhaseGate';
|
|
777
797
|
case 'create':
|
|
778
798
|
default:
|
|
779
799
|
return 'Create';
|
|
780
800
|
}
|
|
781
801
|
}
|
|
782
|
-
function mapOperationKeyToAction(operationKey) {
|
|
802
|
+
function mapOperationKeyToAction(operationKey, isPhaseGateTarget = false) {
|
|
783
803
|
switch (String(operationKey ?? '')
|
|
784
804
|
.trim()
|
|
785
805
|
.toLowerCase()) {
|
|
786
806
|
case 'create':
|
|
787
|
-
return 'create';
|
|
807
|
+
return isPhaseGateTarget ? null : 'create';
|
|
788
808
|
case 'update':
|
|
789
|
-
return 'update';
|
|
809
|
+
return isPhaseGateTarget ? 'manage-phase-gate' : 'update';
|
|
790
810
|
case 'delete':
|
|
791
|
-
return 'delete';
|
|
811
|
+
return isPhaseGateTarget ? null : 'delete';
|
|
812
|
+
case 'movephasegate':
|
|
813
|
+
return isPhaseGateTarget ? 'move-phase-gate' : null;
|
|
792
814
|
default:
|
|
793
815
|
return null;
|
|
794
816
|
}
|
|
@@ -907,6 +929,14 @@ function buildRecipeConfiguration(formValue) {
|
|
|
907
929
|
? { propertyKey, operator, expectedValue }
|
|
908
930
|
: undefined;
|
|
909
931
|
}
|
|
932
|
+
case 'property-has-value': {
|
|
933
|
+
const propertyKey = toNullableString(formValue.propertyKey);
|
|
934
|
+
return propertyKey ? { propertyKey } : undefined;
|
|
935
|
+
}
|
|
936
|
+
case 'mandatory-gate-items-completed': {
|
|
937
|
+
const phaseGateSchemaId = toNullableNumber(formValue.phaseGateSchemaId);
|
|
938
|
+
return phaseGateSchemaId !== null ? { phaseGateSchemaId } : {};
|
|
939
|
+
}
|
|
910
940
|
default:
|
|
911
941
|
return undefined;
|
|
912
942
|
}
|
|
@@ -923,9 +953,11 @@ function buildCreatePayload(formValue, ruleType) {
|
|
|
923
953
|
errorMessage,
|
|
924
954
|
ruleType: ruleTypeKey,
|
|
925
955
|
targetScope: mapAppliesToToTargetScope(formValue.appliesTo),
|
|
926
|
-
targetModuleKey: formValue.appliesTo === '
|
|
927
|
-
?
|
|
928
|
-
:
|
|
956
|
+
targetModuleKey: formValue.appliesTo === 'phase-gate'
|
|
957
|
+
? 'PhaseGate'
|
|
958
|
+
: formValue.appliesTo === 'specific-module'
|
|
959
|
+
? (toNullableString(formValue.selectedModuleKey) ?? undefined)
|
|
960
|
+
: undefined,
|
|
929
961
|
targetOperationKey: formValue.actionKey !== null
|
|
930
962
|
? mapActionToOperationKey(formValue.actionKey)
|
|
931
963
|
: undefined,
|
|
@@ -946,7 +978,7 @@ function mapRuleToWizardFormValue(rule) {
|
|
|
946
978
|
return null;
|
|
947
979
|
}
|
|
948
980
|
const appliesTo = resolveAppliesTo(rule, recipeKey);
|
|
949
|
-
const actionKey = mapOperationKeyToAction(rule.targetOperationKey);
|
|
981
|
+
const actionKey = mapOperationKeyToAction(rule.targetOperationKey, isPhaseGateTarget(rule));
|
|
950
982
|
if (!actionKey) {
|
|
951
983
|
return null;
|
|
952
984
|
}
|
|
@@ -1006,21 +1038,41 @@ function mapRuleToWizardFormValue(rule) {
|
|
|
1006
1038
|
formValue.blockedModuleKey = null;
|
|
1007
1039
|
formValue.countedModuleKey = null;
|
|
1008
1040
|
}
|
|
1041
|
+
if (recipeKey === 'property-has-value') {
|
|
1042
|
+
formValue.requiredModuleKey = null;
|
|
1043
|
+
formValue.blockedModuleKey = null;
|
|
1044
|
+
formValue.countedModuleKey = null;
|
|
1045
|
+
formValue.expectedValue = '';
|
|
1046
|
+
}
|
|
1047
|
+
if (recipeKey === 'mandatory-gate-items-completed') {
|
|
1048
|
+
formValue.requiredModuleKey = null;
|
|
1049
|
+
formValue.blockedModuleKey = null;
|
|
1050
|
+
formValue.countedModuleKey = null;
|
|
1051
|
+
formValue.propertyKey = null;
|
|
1052
|
+
formValue.expectedValue = '';
|
|
1053
|
+
}
|
|
1009
1054
|
return formValue;
|
|
1010
1055
|
}
|
|
1011
|
-
function
|
|
1056
|
+
function isPhaseGateTarget(rule) {
|
|
1057
|
+
const scope = String(rule.targetScope ?? '')
|
|
1058
|
+
.trim()
|
|
1059
|
+
.toLowerCase();
|
|
1060
|
+
const targetModuleKey = String(rule.targetModuleKey ?? '')
|
|
1061
|
+
.trim()
|
|
1062
|
+
.toLowerCase();
|
|
1063
|
+
return scope === 'phasegate' || targetModuleKey === 'phasegate';
|
|
1064
|
+
}
|
|
1065
|
+
function resolveAppliesTo(rule, _recipeKey) {
|
|
1012
1066
|
const scope = String(rule.targetScope ?? '').trim();
|
|
1013
|
-
const targetModuleKey = String(rule.targetModuleKey ?? '').trim();
|
|
1014
1067
|
if (scope === 'Level') {
|
|
1015
1068
|
return 'level';
|
|
1016
1069
|
}
|
|
1017
|
-
if (
|
|
1018
|
-
((recipeKey === 'phase-gate-completed' ||
|
|
1019
|
-
recipeKey === 'phase-gate-module-required') &&
|
|
1020
|
-
targetModuleKey.toLowerCase() === 'phasegate')) {
|
|
1070
|
+
if (isPhaseGateTarget(rule)) {
|
|
1021
1071
|
return 'phase-gate';
|
|
1022
1072
|
}
|
|
1023
|
-
return targetModuleKey
|
|
1073
|
+
return String(rule.targetModuleKey ?? '').trim()
|
|
1074
|
+
? 'specific-module'
|
|
1075
|
+
: 'any-module';
|
|
1024
1076
|
}
|
|
1025
1077
|
function mapRuleToLegacyFormValue(rule) {
|
|
1026
1078
|
const formData = {
|
|
@@ -1376,6 +1428,11 @@ function buildWizardFormConfig({ translate, isEdit, recipeKey, appliesToOptions,
|
|
|
1376
1428
|
value: 'phase-gate-module-required',
|
|
1377
1429
|
action: 'show',
|
|
1378
1430
|
},
|
|
1431
|
+
{
|
|
1432
|
+
key: 'recipeKey',
|
|
1433
|
+
value: 'mandatory-gate-items-completed',
|
|
1434
|
+
action: 'show',
|
|
1435
|
+
},
|
|
1379
1436
|
],
|
|
1380
1437
|
}),
|
|
1381
1438
|
new SelectFieldConfig({
|
|
@@ -1430,6 +1487,11 @@ function buildWizardFormConfig({ translate, isEdit, recipeKey, appliesToOptions,
|
|
|
1430
1487
|
value: 'property-value',
|
|
1431
1488
|
action: 'show',
|
|
1432
1489
|
},
|
|
1490
|
+
{
|
|
1491
|
+
key: 'recipeKey',
|
|
1492
|
+
value: 'property-has-value',
|
|
1493
|
+
action: 'show',
|
|
1494
|
+
},
|
|
1433
1495
|
],
|
|
1434
1496
|
}),
|
|
1435
1497
|
new SelectFieldConfig({
|
|
@@ -1844,6 +1906,20 @@ function resolveRecipeSummary({ value, moduleOptions, requestSchemaOptions, prop
|
|
|
1844
1906
|
expectedValue: value.expectedValue || '',
|
|
1845
1907
|
}).trim();
|
|
1846
1908
|
}
|
|
1909
|
+
case 'property-has-value': {
|
|
1910
|
+
const propertyLabel = findOptionLabel(propertyOptions, value.propertyKey) ??
|
|
1911
|
+
value.propertyKey ??
|
|
1912
|
+
translate('wizard.summary.fallbacks.property');
|
|
1913
|
+
return translate('wizard.summary.property-has-value', {
|
|
1914
|
+
property: propertyLabel,
|
|
1915
|
+
});
|
|
1916
|
+
}
|
|
1917
|
+
case 'mandatory-gate-items-completed': {
|
|
1918
|
+
const phaseGateLabel = findOptionLabel(phaseGateOptions, value.phaseGateSchemaId);
|
|
1919
|
+
return translate('wizard.summary.mandatory-gate-items-completed', {
|
|
1920
|
+
phaseGate: phaseGateLabel ?? translate('wizard.summary.fallbacks.phase-gate'),
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1847
1923
|
default:
|
|
1848
1924
|
return translate('wizard.summary-empty');
|
|
1849
1925
|
}
|
|
@@ -1873,7 +1949,8 @@ function mapWizardFormValueToState(value) {
|
|
|
1873
1949
|
phaseGateCompletedSchemaId: value.recipeKey === 'phase-gate-completed'
|
|
1874
1950
|
? value.phaseGateSchemaId
|
|
1875
1951
|
: null,
|
|
1876
|
-
phaseGateOptionalSchemaId: value.recipeKey === 'phase-gate-module-required'
|
|
1952
|
+
phaseGateOptionalSchemaId: value.recipeKey === 'phase-gate-module-required' ||
|
|
1953
|
+
value.recipeKey === 'mandatory-gate-items-completed'
|
|
1877
1954
|
? value.phaseGateSchemaId
|
|
1878
1955
|
: null,
|
|
1879
1956
|
};
|
|
@@ -1975,6 +2052,10 @@ function resolveRecipeDefinitionKeyForRuleType(ruleType) {
|
|
|
1975
2052
|
case 'PropertyValueEquals':
|
|
1976
2053
|
case 'FieldValue':
|
|
1977
2054
|
return 'property-value';
|
|
2055
|
+
case 'PropertyHasValue':
|
|
2056
|
+
return 'property-has-value';
|
|
2057
|
+
case 'PhaseGateMandatoryItemsCompleted':
|
|
2058
|
+
return 'mandatory-gate-items-completed';
|
|
1978
2059
|
default:
|
|
1979
2060
|
return null;
|
|
1980
2061
|
}
|
|
@@ -2134,7 +2215,12 @@ class GovernanceRuleForm {
|
|
|
2134
2215
|
name: this.translate(option.labelKey),
|
|
2135
2216
|
})), ...(ngDevMode ? [{ debugName: "appliesToCardOptions" }] : []));
|
|
2136
2217
|
availableActionOptions = computed(() => {
|
|
2137
|
-
|
|
2218
|
+
const appliesTo = this.wizardValue().appliesTo;
|
|
2219
|
+
const allowedActions = appliesTo === 'phase-gate'
|
|
2220
|
+
? ['manage-phase-gate', 'move-phase-gate']
|
|
2221
|
+
: ['create', 'update', 'delete'];
|
|
2222
|
+
return GOVERNANCE_ACTION_OPTIONS.filter((option) => allowedActions.includes(option.value) &&
|
|
2223
|
+
hasCompatibleRecipe(this.ruleTypes(), appliesTo, option.value));
|
|
2138
2224
|
}, ...(ngDevMode ? [{ debugName: "availableActionOptions" }] : []));
|
|
2139
2225
|
actionCardOptions = computed(() => this.availableActionOptions().map((option) => ({
|
|
2140
2226
|
id: option.value,
|
|
@@ -2248,6 +2334,10 @@ class GovernanceRuleForm {
|
|
|
2248
2334
|
{ label: this.translateOperationLabel('Create'), value: 'Create' },
|
|
2249
2335
|
{ label: this.translateOperationLabel('Update'), value: 'Update' },
|
|
2250
2336
|
{ label: this.translateOperationLabel('Delete'), value: 'Delete' },
|
|
2337
|
+
{
|
|
2338
|
+
label: this.translateOperationLabel('MovePhaseGate'),
|
|
2339
|
+
value: 'MovePhaseGate',
|
|
2340
|
+
},
|
|
2251
2341
|
];
|
|
2252
2342
|
}
|
|
2253
2343
|
return [
|
|
@@ -2323,16 +2413,14 @@ class GovernanceRuleForm {
|
|
|
2323
2413
|
effect(() => {
|
|
2324
2414
|
const recipeKey = this.wizardValue().recipeKey;
|
|
2325
2415
|
const appliesTo = this.wizardValue().appliesTo;
|
|
2326
|
-
const targetModuleKey = appliesTo === '
|
|
2327
|
-
?
|
|
2328
|
-
:
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
? 'PhaseGate'
|
|
2333
|
-
: 'Module';
|
|
2416
|
+
const targetModuleKey = appliesTo === 'phase-gate'
|
|
2417
|
+
? 'PhaseGate'
|
|
2418
|
+
: appliesTo === 'specific-module'
|
|
2419
|
+
? (this.wizardValue().selectedModuleKey ?? undefined)
|
|
2420
|
+
: undefined;
|
|
2421
|
+
const targetScope = mapAppliesToToTargetScope(appliesTo);
|
|
2334
2422
|
const needsRequestSchemas = recipeKey === 'no-active-request';
|
|
2335
|
-
const needsProperties = recipeKey === 'property-value';
|
|
2423
|
+
const needsProperties = recipeKey === 'property-value' || recipeKey === 'property-has-value';
|
|
2336
2424
|
if (!needsRequestSchemas && !needsProperties) {
|
|
2337
2425
|
this.clearReferenceData();
|
|
2338
2426
|
return;
|
|
@@ -2428,6 +2516,8 @@ class GovernanceRuleForm {
|
|
|
2428
2516
|
return this.translate('update');
|
|
2429
2517
|
case 'Delete':
|
|
2430
2518
|
return this.translate('delete');
|
|
2519
|
+
case 'MovePhaseGate':
|
|
2520
|
+
return this.translate('wizard.actions.move-phase-gate');
|
|
2431
2521
|
default:
|
|
2432
2522
|
return operation;
|
|
2433
2523
|
}
|
|
@@ -2499,7 +2589,7 @@ class GovernanceRuleForm {
|
|
|
2499
2589
|
}));
|
|
2500
2590
|
}
|
|
2501
2591
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GovernanceRuleForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2502
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: GovernanceRuleForm, isStandalone: true, selector: "mt-governance-rule-form", inputs: { ruleForEdit: { classPropertyName: "ruleForEdit", publicName: "ruleForEdit", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block h-full" }, viewQueries: [{ propertyName: "dynamicFormRef", first: true, predicate: DynamicForm, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\n <div\n [class]=\"\n 'governance-rule-form-content flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4 sm:p-5 ' +\n modal.contentClass\n \"\n >\n @if (isInitializing()) {\n <div class=\"space-y-4\">\n <p-skeleton height=\"4rem\" />\n <p-skeleton height=\"12rem\" />\n <p-skeleton height=\"12rem\" />\n </div>\n } @else if (useLegacyEditor()) {\n <section class=\"rounded-2xl border border-amber-200 bg-amber-50/70 p-4\">\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\n {{ t(\"wizard.legacy-title\") }}\n </p>\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\n {{ t(\"wizard.legacy-description\") }}\n </p>\n </section>\n\n <mt-dynamic-form\n [formConfig]=\"legacyFormConfig()\"\n [formControl]=\"legacyFormControl\"\n />\n } @else {\n @if (noRecipesAvailable()) {\n <section\n class=\"rounded-2xl border border-orange-200 bg-orange-50/80 p-4\"\n >\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\n {{ t(\"wizard.no-recipes-title\") }}\n </p>\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\n {{ t(\"wizard.no-recipes-description\") }}\n </p>\n </section>\n }\n\n <mt-dynamic-form\n [formConfig]=\"wizardFormConfig()\"\n [formControl]=\"wizardFormControl\"\n />\n\n @if (hasReviewSummary()) {\n <section class=\"flex flex-col gap-2\">\n <p\n class=\"m-0 text-xs font-semibold uppercase tracking-[0.18em] text-slate-500\"\n >\n {{ t(\"wizard.summary-title\") }}\n </p>\n <p-message\n severity=\"warn\"\n styleClass=\"w-full\"\n [text]=\"reviewSummary()\"\n />\n </section>\n }\n }\n </div>\n\r\n <div\r\n [class]=\"\r\n 'governance-rule-form-footer ' +\r\n modal.footerClass +\r\n ' flex-col gap-2 sm:flex-row sm:items-center sm:justify-end'\r\n \"\r\n >\r\n <mt-button\r\n severity=\"secondary\"\r\n [label]=\"'cancel' | transloco\"\r\n (click)=\"ref.close()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"ruleForEdit() ? t('update') : t('create')\"\r\n [loading]=\"isAddingRule() || isUpdatingRule()\"\r\n [disabled]=\"isAddingRule() || isUpdatingRule()\"\r\n (click)=\"onSubmit()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:block;min-height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys"], outputs: ["runtimeMessagesChange"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2592
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: GovernanceRuleForm, isStandalone: true, selector: "mt-governance-rule-form", inputs: { ruleForEdit: { classPropertyName: "ruleForEdit", publicName: "ruleForEdit", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block h-full" }, viewQueries: [{ propertyName: "dynamicFormRef", first: true, predicate: DynamicForm, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\r\n <div\r\n [class]=\"\r\n 'governance-rule-form-content flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4 sm:p-5 ' +\r\n modal.contentClass\r\n \"\r\n >\r\n @if (isInitializing()) {\r\n <div class=\"space-y-4\">\r\n <p-skeleton height=\"4rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n </div>\r\n } @else if (useLegacyEditor()) {\r\n <section class=\"rounded-2xl border border-amber-200 bg-amber-50/70 p-4\">\r\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\r\n {{ t(\"wizard.legacy-title\") }}\r\n </p>\r\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\r\n {{ t(\"wizard.legacy-description\") }}\r\n </p>\r\n </section>\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"legacyFormConfig()\"\r\n [formControl]=\"legacyFormControl\"\r\n />\r\n } @else {\r\n @if (noRecipesAvailable()) {\r\n <section\r\n class=\"rounded-2xl border border-orange-200 bg-orange-50/80 p-4\"\r\n >\r\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\r\n {{ t(\"wizard.no-recipes-title\") }}\r\n </p>\r\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\r\n {{ t(\"wizard.no-recipes-description\") }}\r\n </p>\r\n </section>\r\n }\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"wizardFormConfig()\"\r\n [formControl]=\"wizardFormControl\"\r\n />\r\n\r\n @if (hasReviewSummary()) {\r\n <section class=\"flex flex-col gap-2\">\r\n <p\r\n class=\"m-0 text-xs font-semibold uppercase tracking-[0.18em] text-slate-500\"\r\n >\r\n {{ t(\"wizard.summary-title\") }}\r\n </p>\r\n <p-message\r\n severity=\"warn\"\r\n styleClass=\"w-full\"\r\n [text]=\"reviewSummary()\"\r\n />\r\n </section>\r\n }\r\n }\r\n </div>\r\n\r\n <div\r\n [class]=\"\r\n 'governance-rule-form-footer ' +\r\n modal.footerClass +\r\n ' flex-col gap-2 sm:flex-row sm:items-center sm:justify-end'\r\n \"\r\n >\r\n <mt-button\r\n severity=\"secondary\"\r\n [label]=\"'cancel' | transloco\"\r\n (click)=\"ref.close()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"ruleForEdit() ? t('update') : t('create')\"\r\n [loading]=\"isAddingRule() || isUpdatingRule()\"\r\n [disabled]=\"isAddingRule() || isUpdatingRule()\"\r\n (click)=\"onSubmit()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:block;min-height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys"], outputs: ["runtimeMessagesChange"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2503
2593
|
}
|
|
2504
2594
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GovernanceRuleForm, decorators: [{
|
|
2505
2595
|
type: Component,
|
|
@@ -2514,7 +2604,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
2514
2604
|
TranslocoPipe,
|
|
2515
2605
|
], host: {
|
|
2516
2606
|
class: 'block h-full',
|
|
2517
|
-
}, template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\n <div\n [class]=\"\n 'governance-rule-form-content flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4 sm:p-5 ' +\n modal.contentClass\n \"\n >\n @if (isInitializing()) {\n <div class=\"space-y-4\">\n <p-skeleton height=\"4rem\" />\n <p-skeleton height=\"12rem\" />\n <p-skeleton height=\"12rem\" />\n </div>\n } @else if (useLegacyEditor()) {\n <section class=\"rounded-2xl border border-amber-200 bg-amber-50/70 p-4\">\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\n {{ t(\"wizard.legacy-title\") }}\n </p>\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\n {{ t(\"wizard.legacy-description\") }}\n </p>\n </section>\n\n <mt-dynamic-form\n [formConfig]=\"legacyFormConfig()\"\n [formControl]=\"legacyFormControl\"\n />\n } @else {\n @if (noRecipesAvailable()) {\n <section\n class=\"rounded-2xl border border-orange-200 bg-orange-50/80 p-4\"\n >\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\n {{ t(\"wizard.no-recipes-title\") }}\n </p>\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\n {{ t(\"wizard.no-recipes-description\") }}\n </p>\n </section>\n }\n\n <mt-dynamic-form\n [formConfig]=\"wizardFormConfig()\"\n [formControl]=\"wizardFormControl\"\n />\n\n @if (hasReviewSummary()) {\n <section class=\"flex flex-col gap-2\">\n <p\n class=\"m-0 text-xs font-semibold uppercase tracking-[0.18em] text-slate-500\"\n >\n {{ t(\"wizard.summary-title\") }}\n </p>\n <p-message\n severity=\"warn\"\n styleClass=\"w-full\"\n [text]=\"reviewSummary()\"\n />\n </section>\n }\n }\n </div>\n\r\n <div\r\n [class]=\"\r\n 'governance-rule-form-footer ' +\r\n modal.footerClass +\r\n ' flex-col gap-2 sm:flex-row sm:items-center sm:justify-end'\r\n \"\r\n >\r\n <mt-button\r\n severity=\"secondary\"\r\n [label]=\"'cancel' | transloco\"\r\n (click)=\"ref.close()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"ruleForEdit() ? t('update') : t('create')\"\r\n [loading]=\"isAddingRule() || isUpdatingRule()\"\r\n [disabled]=\"isAddingRule() || isUpdatingRule()\"\r\n (click)=\"onSubmit()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:block;min-height:100%}\n"] }]
|
|
2607
|
+
}, template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\r\n <div\r\n [class]=\"\r\n 'governance-rule-form-content flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4 sm:p-5 ' +\r\n modal.contentClass\r\n \"\r\n >\r\n @if (isInitializing()) {\r\n <div class=\"space-y-4\">\r\n <p-skeleton height=\"4rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n </div>\r\n } @else if (useLegacyEditor()) {\r\n <section class=\"rounded-2xl border border-amber-200 bg-amber-50/70 p-4\">\r\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\r\n {{ t(\"wizard.legacy-title\") }}\r\n </p>\r\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\r\n {{ t(\"wizard.legacy-description\") }}\r\n </p>\r\n </section>\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"legacyFormConfig()\"\r\n [formControl]=\"legacyFormControl\"\r\n />\r\n } @else {\r\n @if (noRecipesAvailable()) {\r\n <section\r\n class=\"rounded-2xl border border-orange-200 bg-orange-50/80 p-4\"\r\n >\r\n <p class=\"m-0 text-sm font-semibold text-slate-900\">\r\n {{ t(\"wizard.no-recipes-title\") }}\r\n </p>\r\n <p class=\"mt-1 mb-0 text-sm leading-6 text-slate-600\">\r\n {{ t(\"wizard.no-recipes-description\") }}\r\n </p>\r\n </section>\r\n }\r\n\r\n <mt-dynamic-form\r\n [formConfig]=\"wizardFormConfig()\"\r\n [formControl]=\"wizardFormControl\"\r\n />\r\n\r\n @if (hasReviewSummary()) {\r\n <section class=\"flex flex-col gap-2\">\r\n <p\r\n class=\"m-0 text-xs font-semibold uppercase tracking-[0.18em] text-slate-500\"\r\n >\r\n {{ t(\"wizard.summary-title\") }}\r\n </p>\r\n <p-message\r\n severity=\"warn\"\r\n styleClass=\"w-full\"\r\n [text]=\"reviewSummary()\"\r\n />\r\n </section>\r\n }\r\n }\r\n </div>\r\n\r\n <div\r\n [class]=\"\r\n 'governance-rule-form-footer ' +\r\n modal.footerClass +\r\n ' flex-col gap-2 sm:flex-row sm:items-center sm:justify-end'\r\n \"\r\n >\r\n <mt-button\r\n severity=\"secondary\"\r\n [label]=\"'cancel' | transloco\"\r\n (click)=\"ref.close()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"ruleForEdit() ? t('update') : t('create')\"\r\n [loading]=\"isAddingRule() || isUpdatingRule()\"\r\n [disabled]=\"isAddingRule() || isUpdatingRule()\"\r\n (click)=\"onSubmit()\"\r\n styleClass=\"w-full sm:w-auto\"\r\n />\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:block;min-height:100%}\n"] }]
|
|
2518
2608
|
}], ctorParameters: () => [], propDecorators: { ruleForEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "ruleForEdit", required: false }] }], dynamicFormRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DynamicForm), { isSignal: true }] }] } });
|
|
2519
2609
|
|
|
2520
2610
|
class GovernanceRulesList {
|
|
@@ -2523,6 +2613,7 @@ class GovernanceRulesList {
|
|
|
2523
2613
|
// ============================================================================
|
|
2524
2614
|
typeCol = viewChild.required('typeCol');
|
|
2525
2615
|
scopeCol = viewChild.required('scopeCol');
|
|
2616
|
+
whenCol = viewChild.required('whenCol');
|
|
2526
2617
|
priorityCol = viewChild.required('priorityCol');
|
|
2527
2618
|
// ============================================================================
|
|
2528
2619
|
// Services
|
|
@@ -2530,6 +2621,7 @@ class GovernanceRulesList {
|
|
|
2530
2621
|
facade = inject(GovernanceFacade);
|
|
2531
2622
|
modal = inject(ModalService);
|
|
2532
2623
|
translocoService = inject(TranslocoService);
|
|
2624
|
+
ruleTypes = this.facade.ruleTypes;
|
|
2533
2625
|
// ============================================================================
|
|
2534
2626
|
// Breadcrumb
|
|
2535
2627
|
// ============================================================================
|
|
@@ -2565,6 +2657,25 @@ class GovernanceRulesList {
|
|
|
2565
2657
|
return all;
|
|
2566
2658
|
}
|
|
2567
2659
|
}, ...(ngDevMode ? [{ debugName: "rules" }] : []));
|
|
2660
|
+
ruleTypeOptions = computed(() => {
|
|
2661
|
+
const ruleTypes = this.ruleTypes();
|
|
2662
|
+
if (ruleTypes.length > 0) {
|
|
2663
|
+
return ruleTypes
|
|
2664
|
+
.map((ruleType) => this.readRuleTypeKey(ruleType))
|
|
2665
|
+
.filter((key, index, items) => !!key && items.indexOf(key) === index)
|
|
2666
|
+
.map((key) => ({
|
|
2667
|
+
label: this.getRuleTypeLabel(key),
|
|
2668
|
+
value: key,
|
|
2669
|
+
}));
|
|
2670
|
+
}
|
|
2671
|
+
return this.rules()
|
|
2672
|
+
.map((rule) => rule.ruleTypeKey)
|
|
2673
|
+
.filter((key, index, items) => !!key && items.indexOf(key) === index)
|
|
2674
|
+
.map((key) => ({
|
|
2675
|
+
label: this.getRuleTypeLabel(key),
|
|
2676
|
+
value: key,
|
|
2677
|
+
}));
|
|
2678
|
+
}, ...(ngDevMode ? [{ debugName: "ruleTypeOptions" }] : []));
|
|
2568
2679
|
// ============================================================================
|
|
2569
2680
|
// Tabs
|
|
2570
2681
|
// ============================================================================
|
|
@@ -2653,37 +2764,20 @@ class GovernanceRulesList {
|
|
|
2653
2764
|
filterConfig: {
|
|
2654
2765
|
type: 'select',
|
|
2655
2766
|
label: this.translocoService.translate('governance.rule-type'),
|
|
2656
|
-
options: this.
|
|
2767
|
+
options: this.ruleTypeOptions(),
|
|
2657
2768
|
},
|
|
2658
2769
|
},
|
|
2659
2770
|
{
|
|
2660
2771
|
key: 'targetScope',
|
|
2661
|
-
label: this.translocoService.translate('governance.
|
|
2772
|
+
label: this.translocoService.translate('governance.applies-to'),
|
|
2662
2773
|
type: 'custom',
|
|
2663
2774
|
customCellTpl: this.scopeCol(),
|
|
2664
|
-
filterConfig: {
|
|
2665
|
-
type: 'select',
|
|
2666
|
-
label: this.translocoService.translate('governance.scope'),
|
|
2667
|
-
options: [
|
|
2668
|
-
{
|
|
2669
|
-
label: this.translocoService.translate('governance.scope-level'),
|
|
2670
|
-
value: 'Level',
|
|
2671
|
-
},
|
|
2672
|
-
{
|
|
2673
|
-
label: this.translocoService.translate('governance.scope-module'),
|
|
2674
|
-
value: 'Module',
|
|
2675
|
-
},
|
|
2676
|
-
{
|
|
2677
|
-
label: this.translocoService.translate('governance.scope-phase-gate'),
|
|
2678
|
-
value: 'PhaseGate',
|
|
2679
|
-
},
|
|
2680
|
-
],
|
|
2681
|
-
},
|
|
2682
2775
|
},
|
|
2683
2776
|
{
|
|
2684
|
-
key: '
|
|
2685
|
-
label: this.translocoService.translate('governance.
|
|
2686
|
-
type: '
|
|
2777
|
+
key: 'targetOperationKey',
|
|
2778
|
+
label: this.translocoService.translate('governance.when'),
|
|
2779
|
+
type: 'custom',
|
|
2780
|
+
customCellTpl: this.whenCol(),
|
|
2687
2781
|
},
|
|
2688
2782
|
{
|
|
2689
2783
|
key: 'isActive',
|
|
@@ -2712,6 +2806,11 @@ class GovernanceRulesList {
|
|
|
2712
2806
|
allRules = this.facade.rules;
|
|
2713
2807
|
activeRules = this.facade.activeRules;
|
|
2714
2808
|
inactiveRules = this.facade.inactiveRules;
|
|
2809
|
+
ngOnInit() {
|
|
2810
|
+
if (!this.ruleTypes().length) {
|
|
2811
|
+
this.facade.getRuleTypes();
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2715
2814
|
ngOnDestroy() {
|
|
2716
2815
|
this.facade.resetState();
|
|
2717
2816
|
}
|
|
@@ -2736,65 +2835,82 @@ class GovernanceRulesList {
|
|
|
2736
2835
|
this.facade.toggleRuleActive(event.row.id);
|
|
2737
2836
|
}
|
|
2738
2837
|
}
|
|
2739
|
-
|
|
2740
|
-
return
|
|
2741
|
-
{
|
|
2742
|
-
label: this.translocoService.translate('governance.rule-types.ModuleExists'),
|
|
2743
|
-
value: 'ModuleExists',
|
|
2744
|
-
},
|
|
2745
|
-
{
|
|
2746
|
-
label: this.translocoService.translate('governance.rule-types.ModuleDoesNotExist'),
|
|
2747
|
-
value: 'ModuleDoesNotExist',
|
|
2748
|
-
},
|
|
2749
|
-
{
|
|
2750
|
-
label: this.translocoService.translate('governance.rule-types.ModuleMaxCount'),
|
|
2751
|
-
value: 'ModuleMaxCount',
|
|
2752
|
-
},
|
|
2753
|
-
{
|
|
2754
|
-
label: this.translocoService.translate('governance.rule-types.ModuleMinCount'),
|
|
2755
|
-
value: 'ModuleMinCount',
|
|
2756
|
-
},
|
|
2757
|
-
{
|
|
2758
|
-
label: this.translocoService.translate('governance.rule-types.FieldRequired'),
|
|
2759
|
-
value: 'FieldRequired',
|
|
2760
|
-
},
|
|
2761
|
-
{
|
|
2762
|
-
label: this.translocoService.translate('governance.rule-types.FieldValue'),
|
|
2763
|
-
value: 'FieldValue',
|
|
2764
|
-
},
|
|
2765
|
-
{
|
|
2766
|
-
label: this.translocoService.translate('governance.rule-types.PhaseGateModuleRequired'),
|
|
2767
|
-
value: 'PhaseGateModuleRequired',
|
|
2768
|
-
},
|
|
2769
|
-
{
|
|
2770
|
-
label: this.translocoService.translate('governance.rule-types.NoActiveRequest'),
|
|
2771
|
-
value: 'NoActiveRequest',
|
|
2772
|
-
},
|
|
2773
|
-
];
|
|
2838
|
+
getRuleTypeLabel(ruleTypeKey) {
|
|
2839
|
+
return this.translocoService.translate(`governance.rule-types.${ruleTypeKey}`);
|
|
2774
2840
|
}
|
|
2775
2841
|
getRuleTypeChipClass(ruleTypeKey) {
|
|
2776
2842
|
const classes = {
|
|
2777
2843
|
ModuleExists: 'bg-blue-100 text-blue-700',
|
|
2844
|
+
ModuleNotExists: 'bg-red-100 text-red-700',
|
|
2778
2845
|
ModuleDoesNotExist: 'bg-red-100 text-red-700',
|
|
2779
2846
|
ModuleMaxCount: 'bg-amber-100 text-amber-700',
|
|
2780
2847
|
ModuleMinCount: 'bg-orange-100 text-orange-700',
|
|
2781
2848
|
FieldRequired: 'bg-purple-100 text-purple-700',
|
|
2782
2849
|
FieldValue: 'bg-indigo-100 text-indigo-700',
|
|
2850
|
+
PropertyValueEquals: 'bg-indigo-100 text-indigo-700',
|
|
2851
|
+
PropertyHasValue: 'bg-cyan-100 text-cyan-700',
|
|
2852
|
+
PhaseGateCompleted: 'bg-emerald-100 text-emerald-700',
|
|
2783
2853
|
PhaseGateModuleRequired: 'bg-green-100 text-green-700',
|
|
2854
|
+
PhaseGateMandatoryItemsCompleted: 'bg-teal-100 text-teal-700',
|
|
2784
2855
|
NoActiveRequest: 'bg-rose-100 text-rose-700',
|
|
2785
2856
|
};
|
|
2786
2857
|
return classes[ruleTypeKey] ?? 'bg-slate-100 text-slate-700';
|
|
2787
2858
|
}
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2859
|
+
getAppliesToLabel(rule) {
|
|
2860
|
+
if (this.isPhaseGateRule(rule)) {
|
|
2861
|
+
return this.translocoService.translate('governance.wizard.applies-to.phase-gate.label');
|
|
2862
|
+
}
|
|
2863
|
+
if (rule.targetScope === 'Level') {
|
|
2864
|
+
return this.translocoService.translate('governance.wizard.applies-to.level.label');
|
|
2865
|
+
}
|
|
2866
|
+
if (rule.targetModuleKey) {
|
|
2867
|
+
return this.translocoService.translate('governance.wizard.applies-to.specific-module.label');
|
|
2868
|
+
}
|
|
2869
|
+
return this.translocoService.translate('governance.wizard.applies-to.any-module.label');
|
|
2870
|
+
}
|
|
2871
|
+
getAppliesToIcon(rule) {
|
|
2872
|
+
if (this.isPhaseGateRule(rule)) {
|
|
2873
|
+
return 'general.flag-01';
|
|
2874
|
+
}
|
|
2875
|
+
if (rule.targetScope === 'Level') {
|
|
2876
|
+
return 'general.layers-three-01';
|
|
2877
|
+
}
|
|
2878
|
+
return 'general.cube-01';
|
|
2879
|
+
}
|
|
2880
|
+
getWhenLabel(rule) {
|
|
2881
|
+
if (this.isPhaseGateRule(rule)) {
|
|
2882
|
+
switch (rule.targetOperationKey) {
|
|
2883
|
+
case 'Update':
|
|
2884
|
+
return this.translocoService.translate('governance.wizard.actions.manage-phase-gate');
|
|
2885
|
+
case 'MovePhaseGate':
|
|
2886
|
+
return this.translocoService.translate('governance.wizard.actions.move-phase-gate');
|
|
2887
|
+
default:
|
|
2888
|
+
break;
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
switch (rule.targetOperationKey) {
|
|
2892
|
+
case 'Create':
|
|
2893
|
+
return this.translocoService.translate('governance.create');
|
|
2894
|
+
case 'Update':
|
|
2895
|
+
return this.translocoService.translate('governance.update');
|
|
2896
|
+
case 'Delete':
|
|
2897
|
+
return this.translocoService.translate('governance.delete');
|
|
2898
|
+
case 'MovePhaseGate':
|
|
2899
|
+
return this.translocoService.translate('governance.wizard.actions.move-phase-gate');
|
|
2900
|
+
default:
|
|
2901
|
+
return (rule.targetOperationKey ||
|
|
2902
|
+
this.translocoService.translate('governance.all'));
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
isPhaseGateRule(rule) {
|
|
2906
|
+
return (rule.targetScope === 'PhaseGate' ||
|
|
2907
|
+
String(rule.targetModuleKey ?? '').toLowerCase() === 'phasegate');
|
|
2908
|
+
}
|
|
2909
|
+
readRuleTypeKey(ruleType) {
|
|
2910
|
+
return String(ruleType.key ?? ruleType.type ?? '').trim();
|
|
2795
2911
|
}
|
|
2796
2912
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GovernanceRulesList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2797
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: GovernanceRulesList, isStandalone: true, selector: "mt-governance-rules-list", viewQueries: [{ propertyName: "typeCol", first: true, predicate: ["typeCol"], descendants: true, isSignal: true }, { propertyName: "scopeCol", first: true, predicate: ["scopeCol"], descendants: true, isSignal: true }, { propertyName: "priorityCol", first: true, predicate: ["priorityCol"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\
|
|
2913
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: GovernanceRulesList, isStandalone: true, selector: "mt-governance-rules-list", viewQueries: [{ propertyName: "typeCol", first: true, predicate: ["typeCol"], descendants: true, isSignal: true }, { propertyName: "scopeCol", first: true, predicate: ["scopeCol"], descendants: true, isSignal: true }, { propertyName: "whenCol", first: true, predicate: ["whenCol"], descendants: true, isSignal: true }, { propertyName: "priorityCol", first: true, predicate: ["priorityCol"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\n <div class=\"space-y-4\">\n <ng-template #typeCol let-row>\n <mt-chip\n [label]=\"getRuleTypeLabel(row.ruleTypeKey)\"\n [styleClass]=\"getRuleTypeChipClass(row.ruleTypeKey)\"\n />\n </ng-template>\n\n <ng-template #scopeCol let-row>\n <div class=\"flex items-center gap-2\">\n <mt-icon class=\"text-lg\" [icon]=\"getAppliesToIcon(row)\"></mt-icon>\n <span>{{ getAppliesToLabel(row) }}</span>\n @if (\n row.targetModuleKey &&\n getAppliesToLabel(row) !== t(\"wizard.applies-to.phase-gate.label\")\n ) {\n <span class=\"text-slate-500\">→ {{ row.targetModuleKey }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template #whenCol let-row>\n <span>{{ getWhenLabel(row) }}</span>\n </ng-template>\n\n <ng-template #priorityCol let-row>\n <div\n class=\"flex items-center justify-center w-8 h-8 rounded-full bg-slate-100 text-slate-700 font-semibold text-sm\"\n >\n {{ row.priority }}\n </div>\n </ng-template>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"rules()\"\n [columns]=\"tableColumns()\"\n [actions]=\"tableActions()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [showFilters]=\"true\"\n [loading]=\"loading()\"\n (cellChange)=\"onCellChange($event)\"\n >\n </mt-table>\n </div>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "exportable", "exportFilename", "actionShape", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "pageSize", "currentPage", "first", "filterTerm"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Chip, selector: "mt-chip", inputs: ["label", "icon", "image", "removable", "removeIcon", "styleClass"], outputs: ["onRemove", "onImageError"] }] });
|
|
2798
2914
|
}
|
|
2799
2915
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GovernanceRulesList, decorators: [{
|
|
2800
2916
|
type: Component,
|
|
@@ -2805,8 +2921,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
2805
2921
|
TranslocoDirective,
|
|
2806
2922
|
Icon,
|
|
2807
2923
|
Chip,
|
|
2808
|
-
], template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\
|
|
2809
|
-
}], propDecorators: { typeCol: [{ type: i0.ViewChild, args: ['typeCol', { isSignal: true }] }], scopeCol: [{ type: i0.ViewChild, args: ['scopeCol', { isSignal: true }] }], priorityCol: [{ type: i0.ViewChild, args: ['priorityCol', { isSignal: true }] }] } });
|
|
2924
|
+
], template: "<ng-container *transloco=\"let t; prefix: 'governance'\">\n <div class=\"space-y-4\">\n <ng-template #typeCol let-row>\n <mt-chip\n [label]=\"getRuleTypeLabel(row.ruleTypeKey)\"\n [styleClass]=\"getRuleTypeChipClass(row.ruleTypeKey)\"\n />\n </ng-template>\n\n <ng-template #scopeCol let-row>\n <div class=\"flex items-center gap-2\">\n <mt-icon class=\"text-lg\" [icon]=\"getAppliesToIcon(row)\"></mt-icon>\n <span>{{ getAppliesToLabel(row) }}</span>\n @if (\n row.targetModuleKey &&\n getAppliesToLabel(row) !== t(\"wizard.applies-to.phase-gate.label\")\n ) {\n <span class=\"text-slate-500\">→ {{ row.targetModuleKey }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template #whenCol let-row>\n <span>{{ getWhenLabel(row) }}</span>\n </ng-template>\n\n <ng-template #priorityCol let-row>\n <div\n class=\"flex items-center justify-center w-8 h-8 rounded-full bg-slate-100 text-slate-700 font-semibold text-sm\"\n >\n {{ row.priority }}\n </div>\n </ng-template>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"rules()\"\n [columns]=\"tableColumns()\"\n [actions]=\"tableActions()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [showFilters]=\"true\"\n [loading]=\"loading()\"\n (cellChange)=\"onCellChange($event)\"\n >\n </mt-table>\n </div>\n</ng-container>\n" }]
|
|
2925
|
+
}], propDecorators: { typeCol: [{ type: i0.ViewChild, args: ['typeCol', { isSignal: true }] }], scopeCol: [{ type: i0.ViewChild, args: ['scopeCol', { isSignal: true }] }], whenCol: [{ type: i0.ViewChild, args: ['whenCol', { isSignal: true }] }], priorityCol: [{ type: i0.ViewChild, args: ['priorityCol', { isSignal: true }] }] } });
|
|
2810
2926
|
|
|
2811
2927
|
/**
|
|
2812
2928
|
* Generated bundle index. Do not edit.
|