@masterteam/governance 0.0.8 → 0.0.10

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.
@@ -15,6 +15,7 @@ import { toSignal } from '@angular/core/rxjs-interop';
15
15
  import { map, finalize } from 'rxjs';
16
16
  import { DynamicForm } from '@masterteam/forms/dynamic-form';
17
17
  import { Button } from '@masterteam/components/button';
18
+ import { Message } from 'primeng/message';
18
19
  import { ModalRef } from '@masterteam/components/dialog';
19
20
  import { ToastService } from '@masterteam/components/toast';
20
21
  import { Icon } from '@masterteam/icons';
@@ -822,6 +823,26 @@ function trimBilingualValue(value) {
822
823
  ar: value.ar.trim(),
823
824
  };
824
825
  }
826
+ function normalizeKeySegment(value) {
827
+ return value
828
+ .normalize('NFKD')
829
+ .replace(/[\u0300-\u036f]/g, '')
830
+ .toLowerCase()
831
+ .replace(/[^a-z0-9]+/g, '-')
832
+ .replace(/^-+|-+$/g, '');
833
+ }
834
+ function resolveRuleKey(currentKey, name, fallback) {
835
+ const existingKey = toNullableString(currentKey);
836
+ if (existingKey) {
837
+ return existingKey;
838
+ }
839
+ const nameKey = normalizeKeySegment(name.en);
840
+ if (nameKey) {
841
+ return nameKey;
842
+ }
843
+ const fallbackKey = normalizeKeySegment(String(fallback ?? ''));
844
+ return fallbackKey || 'governance-rule';
845
+ }
825
846
  function buildRecipeConfiguration(formValue) {
826
847
  switch (formValue.recipeKey) {
827
848
  case 'require-module': {
@@ -894,12 +915,13 @@ function buildCreatePayload(formValue, ruleType) {
894
915
  const name = trimBilingualValue(formValue.name);
895
916
  const description = trimBilingualValue(formValue.description);
896
917
  const errorMessage = trimBilingualValue(formValue.errorMessage);
918
+ const ruleTypeKey = readGovernanceRuleTypeKey(ruleType);
897
919
  return {
898
- key: formValue.key.trim(),
920
+ key: resolveRuleKey(formValue.key, name, ruleTypeKey),
899
921
  name,
900
922
  description: description.en || description.ar ? description : undefined,
901
923
  errorMessage,
902
- ruleType: readGovernanceRuleTypeKey(ruleType),
924
+ ruleType: ruleTypeKey,
903
925
  targetScope: mapAppliesToToTargetScope(formValue.appliesTo),
904
926
  targetModuleKey: formValue.appliesTo === 'specific-module'
905
927
  ? (toNullableString(formValue.selectedModuleKey) ?? undefined)
@@ -1032,12 +1054,13 @@ function packLegacyFormToCreateDto(formValue) {
1032
1054
  const name = trimBilingualValue(formValue.name);
1033
1055
  const description = trimBilingualValue(formValue.description);
1034
1056
  const errorMessage = trimBilingualValue(formValue.errorMessage);
1057
+ const ruleType = String(formValue.ruleType ?? '');
1035
1058
  return {
1036
- key: String(formValue.key ?? '').trim(),
1059
+ key: resolveRuleKey(formValue.key, name, ruleType),
1037
1060
  name,
1038
1061
  description: description.en || description.ar ? description : undefined,
1039
1062
  errorMessage,
1040
- ruleType: String(formValue.ruleType ?? ''),
1063
+ ruleType,
1041
1064
  targetScope: String(formValue.targetScope ?? ''),
1042
1065
  targetModuleKey: String(formValue.targetModuleKey ?? '') || undefined,
1043
1066
  targetOperationKey: String(formValue.targetOperationKey ?? '') || undefined,
@@ -1085,24 +1108,13 @@ function buildWizardFormConfig({ translate, isEdit, recipeKey, appliesToOptions,
1085
1108
  label: translate('basic-information'),
1086
1109
  order: 1,
1087
1110
  fields: [
1088
- new TextFieldConfig({
1089
- key: 'key',
1090
- label: translate('rule-key'),
1091
- validators: [
1092
- ValidatorConfig.required(translate('wizard.required-message')),
1093
- ValidatorConfig.pattern('^[a-z0-9-]+$', translate('wizard.key-pattern-message')),
1094
- ],
1095
- readonly: isEdit,
1096
- order: 1,
1097
- colSpan: 12,
1098
- }),
1099
1111
  new TextFieldConfig({
1100
1112
  key: 'name.en',
1101
1113
  label: translate('name-en'),
1102
1114
  validators: [
1103
1115
  ValidatorConfig.required(translate('wizard.required-message')),
1104
1116
  ],
1105
- order: 2,
1117
+ order: 1,
1106
1118
  colSpan: 6,
1107
1119
  }),
1108
1120
  new TextFieldConfig({
@@ -1111,21 +1123,21 @@ function buildWizardFormConfig({ translate, isEdit, recipeKey, appliesToOptions,
1111
1123
  validators: [
1112
1124
  ValidatorConfig.required(translate('wizard.required-message')),
1113
1125
  ],
1114
- order: 3,
1126
+ order: 2,
1115
1127
  colSpan: 6,
1116
1128
  }),
1117
1129
  new TextareaFieldConfig({
1118
1130
  key: 'description.en',
1119
1131
  label: translate('description-en'),
1120
1132
  rows: 3,
1121
- order: 4,
1133
+ order: 3,
1122
1134
  colSpan: 6,
1123
1135
  }),
1124
1136
  new TextareaFieldConfig({
1125
1137
  key: 'description.ar',
1126
1138
  label: translate('description-ar'),
1127
1139
  rows: 3,
1128
- order: 5,
1140
+ order: 4,
1129
1141
  colSpan: 6,
1130
1142
  }),
1131
1143
  new TextareaFieldConfig({
@@ -1135,7 +1147,7 @@ function buildWizardFormConfig({ translate, isEdit, recipeKey, appliesToOptions,
1135
1147
  ValidatorConfig.required(translate('wizard.required-message')),
1136
1148
  ],
1137
1149
  rows: 3,
1138
- order: 6,
1150
+ order: 5,
1139
1151
  colSpan: 6,
1140
1152
  }),
1141
1153
  new TextareaFieldConfig({
@@ -1145,7 +1157,7 @@ function buildWizardFormConfig({ translate, isEdit, recipeKey, appliesToOptions,
1145
1157
  ValidatorConfig.required(translate('wizard.required-message')),
1146
1158
  ],
1147
1159
  rows: 3,
1148
- order: 7,
1160
+ order: 6,
1149
1161
  colSpan: 6,
1150
1162
  }),
1151
1163
  ],
@@ -1503,18 +1515,6 @@ function buildLegacyFormConfig({ translate, isEdit, langCode, selectedRuleType,
1503
1515
  label: translate('basic-information'),
1504
1516
  order: 1,
1505
1517
  fields: [
1506
- new TextFieldConfig({
1507
- key: 'key',
1508
- label: translate('rule-key'),
1509
- placeholder: translate('wizard.rule-key-placeholder'),
1510
- validators: [
1511
- ValidatorConfig.required(),
1512
- ValidatorConfig.pattern('^[a-z0-9-]+$', translate('wizard.key-pattern-message')),
1513
- ],
1514
- order: 1,
1515
- colSpan: 12,
1516
- readonly: isEdit,
1517
- }),
1518
1518
  new NumberFieldConfig({
1519
1519
  key: 'priority',
1520
1520
  label: translate('priority'),
@@ -1522,7 +1522,7 @@ function buildLegacyFormConfig({ translate, isEdit, langCode, selectedRuleType,
1522
1522
  validators: [ValidatorConfig.required(), ValidatorConfig.min(0)],
1523
1523
  min: 0,
1524
1524
  max: 1000,
1525
- order: 2,
1525
+ order: 1,
1526
1526
  colSpan: 6,
1527
1527
  }),
1528
1528
  new TextFieldConfig({
@@ -1530,7 +1530,7 @@ function buildLegacyFormConfig({ translate, isEdit, langCode, selectedRuleType,
1530
1530
  label: translate('name-en'),
1531
1531
  placeholder: translate('name-en-placeholder'),
1532
1532
  validators: [ValidatorConfig.required()],
1533
- order: 3,
1533
+ order: 2,
1534
1534
  colSpan: 6,
1535
1535
  }),
1536
1536
  new TextFieldConfig({
@@ -1538,21 +1538,21 @@ function buildLegacyFormConfig({ translate, isEdit, langCode, selectedRuleType,
1538
1538
  label: translate('name-ar'),
1539
1539
  placeholder: translate('name-ar-placeholder'),
1540
1540
  validators: [ValidatorConfig.required()],
1541
- order: 4,
1541
+ order: 3,
1542
1542
  colSpan: 6,
1543
1543
  }),
1544
1544
  new TextareaFieldConfig({
1545
1545
  key: 'description.en',
1546
1546
  label: translate('description-en'),
1547
1547
  placeholder: translate('description-en-placeholder'),
1548
- order: 5,
1548
+ order: 4,
1549
1549
  colSpan: 6,
1550
1550
  }),
1551
1551
  new TextareaFieldConfig({
1552
1552
  key: 'description.ar',
1553
1553
  label: translate('description-ar'),
1554
1554
  placeholder: translate('description-ar-placeholder'),
1555
- order: 6,
1555
+ order: 5,
1556
1556
  colSpan: 6,
1557
1557
  }),
1558
1558
  new TextareaFieldConfig({
@@ -1560,7 +1560,7 @@ function buildLegacyFormConfig({ translate, isEdit, langCode, selectedRuleType,
1560
1560
  label: translate('error-message-en'),
1561
1561
  placeholder: translate('error-message-en-placeholder'),
1562
1562
  validators: [ValidatorConfig.required()],
1563
- order: 7,
1563
+ order: 6,
1564
1564
  colSpan: 6,
1565
1565
  }),
1566
1566
  new TextareaFieldConfig({
@@ -1568,7 +1568,7 @@ function buildLegacyFormConfig({ translate, isEdit, langCode, selectedRuleType,
1568
1568
  label: translate('error-message-ar'),
1569
1569
  placeholder: translate('error-message-ar-placeholder'),
1570
1570
  validators: [ValidatorConfig.required()],
1571
- order: 8,
1571
+ order: 7,
1572
1572
  colSpan: 6,
1573
1573
  }),
1574
1574
  ],
@@ -2499,7 +2499,7 @@ class GovernanceRuleForm {
2499
2499
  }));
2500
2500
  }
2501
2501
  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=\"rounded-2xl border border-slate-900 bg-slate-900 p-4\">\n <p\n class=\"m-0 text-xs font-semibold uppercase tracking-[0.18em] text-white/70\"\n >\n {{ t(\"wizard.summary-title\") }}\n </p>\n <p class=\"mt-2 mb-0 text-sm leading-6 text-white\">\n {{ reviewSummary() }}\n </p>\n </section>\n }\n }\n </div>\n\n <div\n [class]=\"\n 'governance-rule-form-footer ' +\n modal.footerClass +\n ' flex-col gap-2 sm:flex-row sm:items-center sm:justify-end'\n \"\n >\n <mt-button\n variant=\"outlined\"\n [label]=\"'cancel' | transloco\"\n (click)=\"ref.close()\"\n styleClass=\"w-full sm:w-auto\"\n />\n\n <mt-button\n [label]=\"ruleForEdit() ? t('update') : t('create')\"\n [loading]=\"isAddingRule() || isUpdatingRule()\"\n [disabled]=\"isAddingRule() || isUpdatingRule()\"\n (click)=\"onSubmit()\"\n styleClass=\"w-full sm:w-auto\"\n />\n </div>\n</ng-container>\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: "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 });
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 });
2503
2503
  }
2504
2504
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GovernanceRuleForm, decorators: [{
2505
2505
  type: Component,
@@ -2507,13 +2507,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
2507
2507
  CommonModule,
2508
2508
  Button,
2509
2509
  DynamicForm,
2510
+ Message,
2510
2511
  ReactiveFormsModule,
2511
2512
  SkeletonModule,
2512
2513
  TranslocoDirective,
2513
2514
  TranslocoPipe,
2514
2515
  ], host: {
2515
2516
  class: 'block h-full',
2516
- }, 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=\"rounded-2xl border border-slate-900 bg-slate-900 p-4\">\n <p\n class=\"m-0 text-xs font-semibold uppercase tracking-[0.18em] text-white/70\"\n >\n {{ t(\"wizard.summary-title\") }}\n </p>\n <p class=\"mt-2 mb-0 text-sm leading-6 text-white\">\n {{ reviewSummary() }}\n </p>\n </section>\n }\n }\n </div>\n\n <div\n [class]=\"\n 'governance-rule-form-footer ' +\n modal.footerClass +\n ' flex-col gap-2 sm:flex-row sm:items-center sm:justify-end'\n \"\n >\n <mt-button\n variant=\"outlined\"\n [label]=\"'cancel' | transloco\"\n (click)=\"ref.close()\"\n styleClass=\"w-full sm:w-auto\"\n />\n\n <mt-button\n [label]=\"ruleForEdit() ? t('update') : t('create')\"\n [loading]=\"isAddingRule() || isUpdatingRule()\"\n [disabled]=\"isAddingRule() || isUpdatingRule()\"\n (click)=\"onSubmit()\"\n styleClass=\"w-full sm:w-auto\"\n />\n </div>\n</ng-container>\n", styles: [":host{display:block;min-height:100%}\n"] }]
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"] }]
2517
2518
  }], ctorParameters: () => [], propDecorators: { ruleForEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "ruleForEdit", required: false }] }], dynamicFormRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DynamicForm), { isSignal: true }] }] } });
2518
2519
 
2519
2520
  class GovernanceRulesList {