@masterteam/governance 0.0.6 → 0.0.8
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 +199 -73
- package/assets/i18n/en.json +199 -73
- package/fesm2022/masterteam-governance.mjs +1880 -544
- package/fesm2022/masterteam-governance.mjs.map +1 -1
- package/package.json +3 -3
- package/types/masterteam-governance.d.ts +120 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masterteam/governance",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"directory": "../../../dist/masterteam/governance",
|
|
6
6
|
"linkDirectory": false,
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"tailwindcss": "^4.1.17",
|
|
21
21
|
"tailwindcss-primeui": "^0.6.1",
|
|
22
22
|
"@ngxs/store": "^20.1.0",
|
|
23
|
-
"@masterteam/components": "^0.0.
|
|
23
|
+
"@masterteam/components": "^0.0.125",
|
|
24
24
|
"@masterteam/icons": "^0.0.14",
|
|
25
|
-
"@masterteam/forms": "^0.0.
|
|
25
|
+
"@masterteam/forms": "^0.0.60"
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"exports": {
|
|
@@ -4,6 +4,7 @@ import { TableAction, ColumnDef, CellChangeEvent } from '@masterteam/components/
|
|
|
4
4
|
import { ModalService } from '@masterteam/components/modal';
|
|
5
5
|
import * as _masterteam_governance from '@masterteam/governance';
|
|
6
6
|
import { FormControl } from '@angular/forms';
|
|
7
|
+
import { DynamicForm } from '@masterteam/forms/dynamic-form';
|
|
7
8
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
8
9
|
import * as _masterteam_components from '@masterteam/components';
|
|
9
10
|
import { CrudStateBase, DynamicFormConfig } from '@masterteam/components';
|
|
@@ -373,67 +374,138 @@ declare class GovernanceRulesList implements OnDestroy {
|
|
|
373
374
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<GovernanceRulesList, "mt-governance-rules-list", never, {}, {}, never, never, true, never>;
|
|
374
375
|
}
|
|
375
376
|
|
|
377
|
+
type GovernanceRuleAppliesTo = 'level' | 'any-module' | 'specific-module' | 'phase-gate';
|
|
378
|
+
type GovernanceRuleActionKey = 'create' | 'update' | 'delete';
|
|
379
|
+
type GovernanceRuleRecipeKey = 'require-module' | 'prevent-module' | 'module-max-count' | 'module-min-count' | 'phase-gate-completed' | 'phase-gate-module-required' | 'no-active-request' | 'property-value';
|
|
380
|
+
interface GovernanceRuleWizardFormValue {
|
|
381
|
+
key: string;
|
|
382
|
+
name: Translatable;
|
|
383
|
+
description: Translatable;
|
|
384
|
+
errorMessage: Translatable;
|
|
385
|
+
appliesTo: GovernanceRuleAppliesTo;
|
|
386
|
+
selectedModuleKey: string | null;
|
|
387
|
+
actionKey: GovernanceRuleActionKey | null;
|
|
388
|
+
recipeKey: GovernanceRuleRecipeKey | null;
|
|
389
|
+
requiredModuleKey: string | null;
|
|
390
|
+
blockedModuleKey: string | null;
|
|
391
|
+
countedModuleKey: string | null;
|
|
392
|
+
countValue: number | null;
|
|
393
|
+
phaseGateSchemaId: string | null;
|
|
394
|
+
requestSchemaId: string | null;
|
|
395
|
+
blockingStatuses: string[];
|
|
396
|
+
propertyKey: string | null;
|
|
397
|
+
operator: string | null;
|
|
398
|
+
expectedValue: string;
|
|
399
|
+
priority: number | null;
|
|
400
|
+
stopOnFailure: boolean;
|
|
401
|
+
isActive: boolean;
|
|
402
|
+
}
|
|
403
|
+
interface GovernanceLegacyFormValue {
|
|
404
|
+
key: string;
|
|
405
|
+
priority: number | null;
|
|
406
|
+
name: Translatable;
|
|
407
|
+
description: Translatable;
|
|
408
|
+
errorMessage: Translatable;
|
|
409
|
+
ruleType: string;
|
|
410
|
+
targetScope: string;
|
|
411
|
+
targetModuleKey: string;
|
|
412
|
+
targetOperationKey: string;
|
|
413
|
+
stopOnFailure: boolean;
|
|
414
|
+
isActive: boolean;
|
|
415
|
+
[key: string]: unknown;
|
|
416
|
+
}
|
|
417
|
+
interface GovernanceRuleRecipeDefinition {
|
|
418
|
+
key: GovernanceRuleRecipeKey;
|
|
419
|
+
ruleTypeKeys: readonly string[];
|
|
420
|
+
labelKey: string;
|
|
421
|
+
}
|
|
422
|
+
interface GovernanceTranslatedOption<TValue extends string = string> {
|
|
423
|
+
value: TValue;
|
|
424
|
+
labelKey: string;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
type GovernanceRuleWizardFormState = GovernanceRuleWizardFormValue & {
|
|
428
|
+
phaseGateCompletedSchemaId: string | null;
|
|
429
|
+
phaseGateOptionalSchemaId: string | null;
|
|
430
|
+
};
|
|
431
|
+
|
|
376
432
|
declare class GovernanceRuleForm implements OnInit {
|
|
377
|
-
modal: ModalService;
|
|
378
|
-
ref: ModalRef;
|
|
433
|
+
readonly modal: ModalService;
|
|
434
|
+
readonly ref: ModalRef;
|
|
379
435
|
private readonly translocoService;
|
|
380
436
|
private readonly facade;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
437
|
+
private readonly toast;
|
|
438
|
+
readonly ruleForEdit: _angular_core.InputSignal<GovernanceRule | null>;
|
|
439
|
+
readonly dynamicFormRef: _angular_core.Signal<DynamicForm | undefined>;
|
|
440
|
+
readonly selectedRule: _angular_core.Signal<GovernanceRule | null>;
|
|
441
|
+
readonly ruleTypes: _angular_core.Signal<_masterteam_governance.GovernanceRuleType[]>;
|
|
442
|
+
readonly isLoadingRule: _angular_core.Signal<boolean>;
|
|
443
|
+
readonly isLoadingRuleTypes: _angular_core.Signal<boolean>;
|
|
444
|
+
readonly isAddingRule: _angular_core.Signal<boolean>;
|
|
445
|
+
readonly isUpdatingRule: _angular_core.Signal<boolean>;
|
|
446
|
+
readonly modules: _angular_core.Signal<_masterteam_governance.GovernanceModule[]>;
|
|
447
|
+
readonly requestSchemas: _angular_core.Signal<_masterteam_governance.GovernanceRequestSchema[]>;
|
|
448
|
+
readonly properties: _angular_core.Signal<_masterteam_governance.GovernanceProperty[]>;
|
|
449
|
+
readonly wizardFormControl: FormControl<GovernanceRuleWizardFormState>;
|
|
450
|
+
readonly legacyFormControl: FormControl<GovernanceLegacyFormValue | null>;
|
|
451
|
+
private readonly wizardStateRaw;
|
|
452
|
+
private readonly legacyFormValue;
|
|
453
|
+
private readonly activeLang;
|
|
454
|
+
readonly langCode: _angular_core.Signal<"en" | "ar">;
|
|
455
|
+
readonly isEditMode: _angular_core.Signal<boolean>;
|
|
456
|
+
readonly wizardState: _angular_core.Signal<GovernanceRuleWizardFormState>;
|
|
457
|
+
readonly wizardValue: _angular_core.Signal<GovernanceRuleWizardFormValue>;
|
|
458
|
+
readonly moduleOptions: _angular_core.Signal<ConfigurationFieldOption[]>;
|
|
459
|
+
readonly requestSchemaOptions: _angular_core.Signal<ConfigurationFieldOption[]>;
|
|
460
|
+
readonly propertyOptions: _angular_core.Signal<ConfigurationFieldOption[]>;
|
|
461
|
+
readonly appliesToCardOptions: _angular_core.Signal<{
|
|
462
|
+
id: GovernanceRuleAppliesTo;
|
|
463
|
+
name: string;
|
|
464
|
+
}[]>;
|
|
465
|
+
readonly availableActionOptions: _angular_core.Signal<GovernanceTranslatedOption<GovernanceRuleActionKey>[]>;
|
|
466
|
+
readonly actionCardOptions: _angular_core.Signal<{
|
|
467
|
+
id: GovernanceRuleActionKey;
|
|
468
|
+
name: string;
|
|
469
|
+
}[]>;
|
|
470
|
+
readonly availableRecipeDefinitions: _angular_core.Signal<GovernanceRuleRecipeDefinition[]>;
|
|
471
|
+
readonly recipeCardOptions: _angular_core.Signal<{
|
|
472
|
+
id: GovernanceRuleRecipeKey;
|
|
473
|
+
name: string;
|
|
403
474
|
}[]>;
|
|
404
|
-
|
|
475
|
+
readonly selectedRuleType: _angular_core.Signal<_masterteam_governance.GovernanceRuleType | null>;
|
|
476
|
+
readonly useLegacyEditor: _angular_core.Signal<boolean>;
|
|
477
|
+
readonly isInitializing: _angular_core.Signal<boolean>;
|
|
478
|
+
readonly noRecipesAvailable: _angular_core.Signal<boolean>;
|
|
479
|
+
readonly hasReviewSummary: _angular_core.Signal<boolean>;
|
|
480
|
+
readonly canSubmit: _angular_core.Signal<boolean>;
|
|
481
|
+
readonly reviewSummary: _angular_core.Signal<string>;
|
|
482
|
+
readonly wizardFormConfig: _angular_core.Signal<DynamicFormConfig>;
|
|
483
|
+
readonly selectedLegacyRuleType: _angular_core.Signal<_masterteam_governance.GovernanceRuleType | null>;
|
|
484
|
+
readonly scopeOptions: _angular_core.Signal<{
|
|
405
485
|
label: string;
|
|
406
486
|
value: string;
|
|
407
487
|
}[]>;
|
|
408
|
-
|
|
488
|
+
readonly operationOptions: _angular_core.Signal<{
|
|
409
489
|
label: string;
|
|
410
490
|
value: string;
|
|
411
491
|
}[]>;
|
|
412
|
-
|
|
492
|
+
readonly legacyFormConfig: _angular_core.Signal<DynamicFormConfig>;
|
|
413
493
|
constructor();
|
|
414
|
-
/**
|
|
415
|
-
* Extract default values from rule type's configuration schema
|
|
416
|
-
*/
|
|
417
|
-
private getDefaultsFromSchema;
|
|
418
494
|
ngOnInit(): void;
|
|
419
495
|
onSubmit(): void;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
private
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
private
|
|
433
|
-
private unpackRuleToForm;
|
|
434
|
-
private packFormToCreateDto;
|
|
435
|
-
private packFormToUpdateDto;
|
|
436
|
-
private extractConfiguration;
|
|
496
|
+
getPhaseGateOptions(): ConfigurationFieldOption[];
|
|
497
|
+
getBlockingStatusOptions(): string[];
|
|
498
|
+
private translate;
|
|
499
|
+
private translateScopeLabel;
|
|
500
|
+
private translateOperationLabel;
|
|
501
|
+
private patchWizardState;
|
|
502
|
+
private setWizardState;
|
|
503
|
+
private resetWizardForm;
|
|
504
|
+
private clearReferenceData;
|
|
505
|
+
private saveCreate;
|
|
506
|
+
private saveUpdate;
|
|
507
|
+
private submitLegacyForm;
|
|
508
|
+
private ruleTypeOptions;
|
|
437
509
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<GovernanceRuleForm, never>;
|
|
438
510
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<GovernanceRuleForm, "mt-governance-rule-form", never, { "ruleForEdit": { "alias": "ruleForEdit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
439
511
|
}
|