@genesislcap/pbc-notify-ui 1.0.31 → 1.0.32
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/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.d.ts +2 -2
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.d.ts +4 -2
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts +1 -14
- package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/styles/dynamic-rule.styles.d.ts.map +1 -1
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.js +13 -7
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.js +19 -16
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-management.js +2 -4
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.js +16 -6
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.js +11 -9
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-management.js +2 -4
- package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.utils.js +1 -18
- package/dist/esm/components/foundation-notification-dashboard/styles/dynamic-rule.styles.js +33 -8
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Auth } from '@genesislcap/foundation-comms';
|
|
2
1
|
import { Modal } from '@genesislcap/foundation-zero';
|
|
3
2
|
import { FASTElement } from '@microsoft/fast-element';
|
|
4
3
|
import { ConditionBuilderEntity, UpdateType } from '../../../../../notify.types';
|
|
@@ -7,7 +6,6 @@ import { RuleService } from '../../../../../services/rule.service';
|
|
|
7
6
|
import { Field, SystemService } from '../../../../../services/system.service';
|
|
8
7
|
import { RuleDialogMode, RuleDialogParams } from './rule-dialog.types';
|
|
9
8
|
export declare class RuleDialog extends FASTElement {
|
|
10
|
-
auth: Auth;
|
|
11
9
|
ruleService: RuleService;
|
|
12
10
|
systemService: SystemService;
|
|
13
11
|
notifyService: NotifyService;
|
|
@@ -26,6 +24,7 @@ export declare class RuleDialog extends FASTElement {
|
|
|
26
24
|
resources: Array<string>;
|
|
27
25
|
fields: Array<Field>;
|
|
28
26
|
topics: string[];
|
|
27
|
+
private requiredFields;
|
|
29
28
|
openDialog(params: RuleDialogParams): Promise<void>;
|
|
30
29
|
close(): void;
|
|
31
30
|
private createRule;
|
|
@@ -39,5 +38,6 @@ export declare class RuleDialog extends FASTElement {
|
|
|
39
38
|
newCondition(): void;
|
|
40
39
|
editCondition(editedCondition: ConditionBuilderEntity): void;
|
|
41
40
|
deleteCondition(deletedCondition: ConditionBuilderEntity): void;
|
|
41
|
+
get validateRequiredFields(): boolean;
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=rule-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"rule-dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,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5B,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,MAAM;IAiBN,OAAO,CAAC,gBAAgB;IAqBxB,gBAAgB,CAAC,QAAQ,KAAA;IASnB,eAAe;IAMrB,YAAY;IAIZ,aAAa,CAAC,eAAe,EAAE,sBAAsB;IAErD,eAAe,CAAC,gBAAgB,EAAE,sBAAsB;IASxD,IACW,sBAAsB,IAAI,OAAO,CAE3C;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-dialog.template.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAK1E,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"rule-dialog.template.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAK1E,eAAO,MAAM,kBAAkB,EAAE,YA2HhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-management.d.ts","sourceRoot":"","sources":["../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-management.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"rule-management.d.ts","sourceRoot":"","sources":["../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-management.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAqB,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,qBA6Ba,cAAe,SAAQ,WAAW;IAChC,WAAW,EAAE,WAAW,CAAC;IACtC,UAAU,EAAE,UAAU,CAAC;IAEvB,cAAc;IAIR,QAAQ,CAAC,GAAG,KAAA;IAKlB,UAAU,CAAC,IAAI,KAAA;CAqBhB"}
|
|
@@ -9,6 +9,8 @@ export declare class TemplateDialog extends FASTElement {
|
|
|
9
9
|
templateService: TemplateService;
|
|
10
10
|
systemService: SystemService;
|
|
11
11
|
notifyService: NotifyService;
|
|
12
|
+
dialog: Modal;
|
|
13
|
+
templateDialogMode: (typeof TemplateDialogMode)[keyof typeof TemplateDialogMode];
|
|
12
14
|
templateId: string;
|
|
13
15
|
name: string;
|
|
14
16
|
description: string;
|
|
@@ -23,8 +25,7 @@ export declare class TemplateDialog extends FASTElement {
|
|
|
23
25
|
resources: Array<string>;
|
|
24
26
|
fields: Array<Field>;
|
|
25
27
|
topics: Array<string>;
|
|
26
|
-
|
|
27
|
-
dialog: Modal;
|
|
28
|
+
private requiredFields;
|
|
28
29
|
openDialog(params: any): Promise<void>;
|
|
29
30
|
close(): void;
|
|
30
31
|
private createTemplate;
|
|
@@ -41,5 +42,6 @@ export declare class TemplateDialog extends FASTElement {
|
|
|
41
42
|
newParameter(): void;
|
|
42
43
|
editParameter(editedParameter: ParameterBuilderEntity): void;
|
|
43
44
|
deleteParameter(deletedParameter: ParameterBuilderEntity): void;
|
|
45
|
+
get validateRequiredFields(): boolean;
|
|
44
46
|
}
|
|
45
47
|
//# sourceMappingURL=template-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAiB,WAAW,
|
|
1
|
+
{"version":3,"file":"template-dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,C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mB,IAAI,MAAM,CAEhC;IAED,MAAM;IAwBN,OAAO,CAAC,oBAAoB;IAyB5B,gBAAgB,CAAC,QAAQ,KAAA;IASnB,eAAe;IAMrB,YAAY;IAIZ,aAAa,CAAC,eAAe,EAAE,sBAAsB;IAErD,eAAe,CAAC,gBAAgB,EAAE,sBAAsB;IAUxD,YAAY;IAIZ,aAAa,CAAC,eAAe,EAAE,sBAAsB;IAIrD,eAAe,CAAC,gBAAgB,EAAE,sBAAsB;IAWxD,IACW,sBAAsB,IAAI,OAAO,CAE3C;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-dialog.template.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAK1E,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"template-dialog.template.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAK1E,eAAO,MAAM,sBAAsB,EAAE,YA0IpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-management.d.ts","sourceRoot":"","sources":["../../../../../../src/components/foundation-notification-dashboard/components/templates/template-management.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"template-management.d.ts","sourceRoot":"","sources":["../../../../../../src/components/foundation-notification-dashboard/components/templates/template-management.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAqB,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnE,qBA6Ba,kBAAmB,SAAQ,WAAW;IAChC,eAAe,EAAE,eAAe,CAAC;IAClD,cAAc,EAAE,cAAc,CAAC;IAE/B,kBAAkB;IAIZ,YAAY,CAAC,GAAG,KAAA;IAKtB,cAAc,CAAC,QAAQ,KAAA;CAqBxB"}
|
package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class UUIDGenerator {
|
|
|
4
4
|
private static uuid;
|
|
5
5
|
static createUUID: () => string;
|
|
6
6
|
}
|
|
7
|
+
export declare const isEmpty: (value: any) => boolean;
|
|
7
8
|
export declare class DynamicRuleUtils {
|
|
8
9
|
static createEmptyCondition: () => ConditionBuilderEntity;
|
|
9
10
|
static createAssignment: (field: string, value: string) => {
|
|
@@ -38,18 +39,4 @@ export declare class RuleUtils {
|
|
|
38
39
|
static getConditions(conditions: any): any;
|
|
39
40
|
}
|
|
40
41
|
export declare function showNotificationError(error: any): void;
|
|
41
|
-
export declare function getNotificationDialogDeleteObject(id: any, entityName: any, service: any, deleteEvent: any): {
|
|
42
|
-
title: string;
|
|
43
|
-
body: string;
|
|
44
|
-
dialog: {
|
|
45
|
-
dismissingAction: {
|
|
46
|
-
label: string;
|
|
47
|
-
action: () => any;
|
|
48
|
-
};
|
|
49
|
-
confirmingActions: {
|
|
50
|
-
label: string;
|
|
51
|
-
action: () => any;
|
|
52
|
-
}[];
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
42
|
//# sourceMappingURL=notification-dashboard.utils.d.ts.map
|
package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-dashboard.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-notification-dashboard/notification-dashboard.utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EAQvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,qBAAa,aAAa;IAClB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAO;IAChC,MAAM,CAAC,UAAU,QAAO,MAAM,CAAyB;CACxD;
|
|
1
|
+
{"version":3,"file":"notification-dashboard.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-notification-dashboard/notification-dashboard.utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EAQvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,qBAAa,aAAa;IAClB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAO;IAChC,MAAM,CAAC,UAAU,QAAO,MAAM,CAAyB;CACxD;AAED,eAAO,MAAM,OAAO,yBACuD,CAAC;AAkH5E,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,oBAAoB,QAAO,sBAAsB,CAMrD;IAEH,MAAM,CAAC,gBAAgB,UAAW,MAAM,SAAS,MAAM;;;;;;;;;MASpD;IAEH,MAAM,CAAC,kBAAkB,gBAAiB,GAAG,EAAE,SAAS,MAAM,KAAG,MAAM,CACS;IAEhF,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,EAAE,EAAE,UAAU,CAAC,KAAA,GAAG,GAAG;CAUhF;AAED,qBAAa,aAAa;IACxB,MAAM,CAAC,oBAAoB,QAAO,sBAAsB,CAOrD;IAEH,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA;;;;;;;;IAe/B,OAAO,CAAC,MAAM,CAAC,eAAe;IAe9B,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA,EAAE,UAAU,CAAC,KAAA;IAgB5C,MAAM,CAAC,sBAAsB,CAAC,UAAU,KAAA;CAmBzC;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,eAAe;IAe9B,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA;CAYhC;AAID,wBAAgB,qBAAqB,CAAC,KAAK,KAAA,QAa1C"}
|
package/dist/dts/components/foundation-notification-dashboard/styles/dynamic-rule.styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-rule.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/foundation-notification-dashboard/styles/dynamic-rule.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,iDAevC,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamic-rule.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/foundation-notification-dashboard/styles/dynamic-rule.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,iDAevC,CAAC;AA8DF,eAAO,MAAM,uBAAuB,iDAgEnC,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import {
|
|
3
|
-
import { customElement, FASTElement, observable } from '@microsoft/fast-element';
|
|
2
|
+
import { customElement, FASTElement, observable, volatile } from '@microsoft/fast-element';
|
|
4
3
|
import { Assignment, defaultUpdateType, Severity, } from '../../../../../notify.types';
|
|
5
4
|
import { NotifyService } from '../../../../../services/notify.service';
|
|
6
5
|
import { RuleService } from '../../../../../services/rule.service';
|
|
7
6
|
import { SystemService } from '../../../../../services/system.service';
|
|
8
7
|
import { humanize } from '../../../../../utils';
|
|
9
|
-
import { DynamicRuleUtils, RuleUtils, showNotificationError, } from '../../../notification-dashboard.utils';
|
|
8
|
+
import { DynamicRuleUtils, RuleUtils, showNotificationError, isEmpty, } from '../../../notification-dashboard.utils';
|
|
10
9
|
import { DynamicRuleDialogStyles } from '../../../styles/dynamic-rule.styles';
|
|
11
10
|
import { RuleDialogTemplate } from './rule-dialog.template';
|
|
12
11
|
import { RuleDialogMode } from './rule-dialog.types';
|
|
@@ -20,7 +19,7 @@ let RuleDialog = class RuleDialog extends FASTElement {
|
|
|
20
19
|
this.conditions = [];
|
|
21
20
|
this.resources = [];
|
|
22
21
|
this.fields = [];
|
|
23
|
-
|
|
22
|
+
this.requiredFields = () => [this.name, this.description, this.header, this.message];
|
|
24
23
|
}
|
|
25
24
|
openDialog(params) {
|
|
26
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -95,6 +94,9 @@ let RuleDialog = class RuleDialog extends FASTElement {
|
|
|
95
94
|
return `${this.ruleDialogMode === RuleDialogMode.CREATE ? 'Create' : 'Edit'} Rule`;
|
|
96
95
|
}
|
|
97
96
|
submit() {
|
|
97
|
+
if (this.requiredFields().some((value) => isEmpty(value))) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
98
100
|
const rule = this.createRuleObject();
|
|
99
101
|
switch (this.ruleDialogMode) {
|
|
100
102
|
case RuleDialogMode.CREATE:
|
|
@@ -141,10 +143,11 @@ let RuleDialog = class RuleDialog extends FASTElement {
|
|
|
141
143
|
}
|
|
142
144
|
this.conditions = this.conditions.filter((condition) => condition !== deletedCondition);
|
|
143
145
|
}
|
|
146
|
+
// #endregion
|
|
147
|
+
get validateRequiredFields() {
|
|
148
|
+
return this.requiredFields().some((value) => isEmpty(value));
|
|
149
|
+
}
|
|
144
150
|
};
|
|
145
|
-
__decorate([
|
|
146
|
-
Auth
|
|
147
|
-
], RuleDialog.prototype, "auth", void 0);
|
|
148
151
|
__decorate([
|
|
149
152
|
RuleService
|
|
150
153
|
], RuleDialog.prototype, "ruleService", void 0);
|
|
@@ -193,6 +196,9 @@ __decorate([
|
|
|
193
196
|
__decorate([
|
|
194
197
|
observable
|
|
195
198
|
], RuleDialog.prototype, "topics", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
volatile
|
|
201
|
+
], RuleDialog.prototype, "validateRequiredFields", null);
|
|
196
202
|
RuleDialog = __decorate([
|
|
197
203
|
customElement({
|
|
198
204
|
name: 'rule-dialog',
|
|
@@ -9,20 +9,15 @@ export const RuleDialogTemplate = html `
|
|
|
9
9
|
<div class="dialog-content">
|
|
10
10
|
<div class="content-row">
|
|
11
11
|
<div class="control">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
autofocus
|
|
16
|
-
autocomplete="off"
|
|
17
|
-
></zero-text-field>
|
|
12
|
+
<zero-text-field :value=${sync((x) => x.name)} autofocus autocomplete="off" required>
|
|
13
|
+
Name
|
|
14
|
+
</zero-text-field>
|
|
18
15
|
</div>
|
|
19
16
|
|
|
20
17
|
<div class="control">
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
autocomplete="off"
|
|
25
|
-
></zero-text-field>
|
|
18
|
+
<zero-text-field :value=${sync((x) => x.description)} autocomplete="off" required>
|
|
19
|
+
Description
|
|
20
|
+
</zero-text-field>
|
|
26
21
|
</div>
|
|
27
22
|
</div>
|
|
28
23
|
|
|
@@ -78,13 +73,15 @@ export const RuleDialogTemplate = html `
|
|
|
78
73
|
|
|
79
74
|
<div class="content-row">
|
|
80
75
|
<div class="control">
|
|
81
|
-
<
|
|
82
|
-
|
|
76
|
+
<zero-text-field required :value=${sync((x) => x.header)} autocomplete="off">
|
|
77
|
+
Header
|
|
78
|
+
</zero-text-field>
|
|
83
79
|
</div>
|
|
84
80
|
|
|
85
81
|
<div class="control">
|
|
86
|
-
<
|
|
87
|
-
|
|
82
|
+
<zero-text-field required :value=${sync((x) => x.message)} autocomplete="off">
|
|
83
|
+
Message
|
|
84
|
+
</zero-text-field>
|
|
88
85
|
</div>
|
|
89
86
|
</div>
|
|
90
87
|
|
|
@@ -110,7 +107,13 @@ export const RuleDialogTemplate = html `
|
|
|
110
107
|
</div>
|
|
111
108
|
|
|
112
109
|
<div slot="bottom" class="dialog-bottom">
|
|
113
|
-
<zero-button
|
|
110
|
+
<zero-button
|
|
111
|
+
appearance="accent"
|
|
112
|
+
@click=${(x) => x.submit()}
|
|
113
|
+
?disabled=${(x) => x.validateRequiredFields}
|
|
114
|
+
>
|
|
115
|
+
Submit
|
|
116
|
+
</zero-button>
|
|
114
117
|
</div>
|
|
115
118
|
</zero-modal>
|
|
116
119
|
`;
|
package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-management.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
2
|
import { showNotificationDialog } from '@genesislcap/foundation-notifications';
|
|
3
|
-
import {
|
|
3
|
+
import { customElement, FASTElement, html, ref, repeat } from '@microsoft/fast-element';
|
|
4
4
|
import { RuleService } from '../../../../services/rule.service';
|
|
5
5
|
import { DynamicRuleManagementStyles } from '../../styles/dynamic-rule.styles';
|
|
6
6
|
import { RULE_MANAGEMENT_COLUMNS } from './columns';
|
|
@@ -62,9 +62,7 @@ RuleManagement = __decorate([
|
|
|
62
62
|
|
|
63
63
|
<rule-dialog ${ref('ruleDialog')}></rule-dialog>
|
|
64
64
|
`,
|
|
65
|
-
styles:
|
|
66
|
-
${DynamicRuleManagementStyles}
|
|
67
|
-
`,
|
|
65
|
+
styles: DynamicRuleManagementStyles,
|
|
68
66
|
})
|
|
69
67
|
], RuleManagement);
|
|
70
68
|
export { RuleManagement };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { customElement, FASTElement, observable } from '@microsoft/fast-element';
|
|
2
|
+
import { customElement, FASTElement, observable, volatile } from '@microsoft/fast-element';
|
|
3
3
|
import { Assignment, defaultUpdateType, Severity, } from '../../../../../notify.types';
|
|
4
4
|
import { NotifyService } from '../../../../../services/notify.service';
|
|
5
5
|
import { SystemService } from '../../../../../services/system.service';
|
|
6
6
|
import { TemplateService } from '../../../../../services/template.service';
|
|
7
7
|
import { humanize, logger } from '../../../../../utils';
|
|
8
|
-
import { DynamicRuleUtils, showNotificationError, TemplateUtils, } from '../../../notification-dashboard.utils';
|
|
8
|
+
import { DynamicRuleUtils, showNotificationError, TemplateUtils, isEmpty, } from '../../../notification-dashboard.utils';
|
|
9
9
|
import { DynamicRuleDialogStyles } from '../../../styles/dynamic-rule.styles';
|
|
10
10
|
import { TemplateDialogTemplate } from './template-dialog.template';
|
|
11
11
|
import { TemplateDialogMode } from './template-dialog.types';
|
|
12
12
|
let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
+
this.templateDialogMode = null;
|
|
15
16
|
this.resource = ''; // TODO: Tables + Views
|
|
16
17
|
this.updateType = defaultUpdateType;
|
|
17
18
|
this.parameters = [];
|
|
@@ -19,8 +20,7 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
19
20
|
this.resources = [];
|
|
20
21
|
this.fields = [];
|
|
21
22
|
this.topics = [];
|
|
22
|
-
this.
|
|
23
|
-
// #endregion
|
|
23
|
+
this.requiredFields = () => [this.name, this.description, this.header, this.message];
|
|
24
24
|
}
|
|
25
25
|
openDialog(params) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -100,6 +100,9 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
100
100
|
return `${this.templateDialogMode === TemplateDialogMode.CREATE ? 'Create' : 'Edit'} Template`;
|
|
101
101
|
}
|
|
102
102
|
submit() {
|
|
103
|
+
if (this.requiredFields().some((value) => isEmpty(value))) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
103
106
|
const template = this.createTemplateObject();
|
|
104
107
|
switch (this.templateDialogMode) {
|
|
105
108
|
case TemplateDialogMode.CREATE:
|
|
@@ -169,6 +172,10 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
169
172
|
}
|
|
170
173
|
this.parameters = this.parameters.filter((parameter) => parameter.UUID !== deletedParameter.UUID);
|
|
171
174
|
}
|
|
175
|
+
// #endregion
|
|
176
|
+
get validateRequiredFields() {
|
|
177
|
+
return this.requiredFields().some((value) => isEmpty(value));
|
|
178
|
+
}
|
|
172
179
|
};
|
|
173
180
|
__decorate([
|
|
174
181
|
TemplateService
|
|
@@ -179,6 +186,9 @@ __decorate([
|
|
|
179
186
|
__decorate([
|
|
180
187
|
NotifyService
|
|
181
188
|
], TemplateDialog.prototype, "notifyService", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
observable
|
|
191
|
+
], TemplateDialog.prototype, "templateDialogMode", void 0);
|
|
182
192
|
__decorate([
|
|
183
193
|
observable
|
|
184
194
|
], TemplateDialog.prototype, "templateId", void 0);
|
|
@@ -222,8 +232,8 @@ __decorate([
|
|
|
222
232
|
observable
|
|
223
233
|
], TemplateDialog.prototype, "topics", void 0);
|
|
224
234
|
__decorate([
|
|
225
|
-
|
|
226
|
-
], TemplateDialog.prototype, "
|
|
235
|
+
volatile
|
|
236
|
+
], TemplateDialog.prototype, "validateRequiredFields", null);
|
|
227
237
|
TemplateDialog = __decorate([
|
|
228
238
|
customElement({
|
|
229
239
|
name: 'template-dialog',
|
|
@@ -9,13 +9,11 @@ export const TemplateDialogTemplate = html `
|
|
|
9
9
|
<div class="dialog-content">
|
|
10
10
|
<div class="content-row">
|
|
11
11
|
<div class="control">
|
|
12
|
-
<
|
|
13
|
-
<zero-text-field :value=${sync((x) => x.name)} autofocus></zero-text-field>
|
|
12
|
+
<zero-text-field :value=${sync((x) => x.name)} autofocus>Name</zero-text-field>
|
|
14
13
|
</div>
|
|
15
14
|
|
|
16
15
|
<div class="control">
|
|
17
|
-
<
|
|
18
|
-
<zero-text-field :value=${sync((x) => x.description)}></zero-text-field>
|
|
16
|
+
<zero-text-field :value=${sync((x) => x.description)}>Description</zero-text-field>
|
|
19
17
|
</div>
|
|
20
18
|
</div>
|
|
21
19
|
|
|
@@ -71,13 +69,11 @@ export const TemplateDialogTemplate = html `
|
|
|
71
69
|
|
|
72
70
|
<div class="content-row">
|
|
73
71
|
<div class="control">
|
|
74
|
-
<
|
|
75
|
-
<zero-text-field :value=${sync((x) => x.header)}></zero-text-field>
|
|
72
|
+
<zero-text-field :value=${sync((x) => x.header)}>Header</zero-text-field>
|
|
76
73
|
</div>
|
|
77
74
|
|
|
78
75
|
<div class="control">
|
|
79
|
-
<
|
|
80
|
-
<zero-text-field :value=${sync((x) => x.message)}></zero-text-field>
|
|
76
|
+
<zero-text-field :value=${sync((x) => x.message)}>Message</zero-text-field>
|
|
81
77
|
</div>
|
|
82
78
|
</div>
|
|
83
79
|
|
|
@@ -123,7 +119,13 @@ export const TemplateDialogTemplate = html `
|
|
|
123
119
|
</div>
|
|
124
120
|
|
|
125
121
|
<div slot="bottom" class="dialog-bottom">
|
|
126
|
-
<zero-button
|
|
122
|
+
<zero-button
|
|
123
|
+
appearance="accent"
|
|
124
|
+
@click=${(x) => x.submit()}
|
|
125
|
+
?disabled=${(x) => x.validateRequiredFields}
|
|
126
|
+
>
|
|
127
|
+
Submit
|
|
128
|
+
</zero-button>
|
|
127
129
|
</div>
|
|
128
130
|
</zero-modal>
|
|
129
131
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
2
|
import { showNotificationDialog } from '@genesislcap/foundation-notifications';
|
|
3
|
-
import {
|
|
3
|
+
import { customElement, FASTElement, html, ref, repeat } from '@microsoft/fast-element';
|
|
4
4
|
import { TemplateService } from '../../../../services/template.service';
|
|
5
5
|
import { DynamicRuleManagementStyles } from '../../styles/dynamic-rule.styles';
|
|
6
6
|
import { TEMPLATE_MANAGEMENT_COLUMNS } from './columns';
|
|
@@ -62,9 +62,7 @@ TemplateManagement = __decorate([
|
|
|
62
62
|
|
|
63
63
|
<template-dialog ${ref('templateDialog')}></template-dialog>
|
|
64
64
|
`,
|
|
65
|
-
styles:
|
|
66
|
-
${DynamicRuleManagementStyles}
|
|
67
|
-
`,
|
|
65
|
+
styles: DynamicRuleManagementStyles,
|
|
68
66
|
})
|
|
69
67
|
], TemplateManagement);
|
|
70
68
|
export { TemplateManagement };
|
package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.utils.js
CHANGED
|
@@ -11,6 +11,7 @@ UUIDGenerator.createUUID = () => _a.uuid.createId();
|
|
|
11
11
|
__decorate([
|
|
12
12
|
UUID
|
|
13
13
|
], UUIDGenerator, "uuid", void 0);
|
|
14
|
+
export const isEmpty = (value) => value == null || (typeof value === 'string' && value.trim().length === 0);
|
|
14
15
|
// #region Rules and Templates
|
|
15
16
|
class ConditionUtils {
|
|
16
17
|
static transformLogicalOperator(logicalOperator) {
|
|
@@ -255,22 +256,4 @@ export function showNotificationError(error) {
|
|
|
255
256
|
},
|
|
256
257
|
}, 'zero');
|
|
257
258
|
}
|
|
258
|
-
export function getNotificationDialogDeleteObject(id, entityName, service, deleteEvent) {
|
|
259
|
-
return {
|
|
260
|
-
title: 'Confirm Delete',
|
|
261
|
-
body: `Do you really want to delete this ${entityName}?`,
|
|
262
|
-
dialog: {
|
|
263
|
-
dismissingAction: {
|
|
264
|
-
label: 'Dismiss',
|
|
265
|
-
action: () => null,
|
|
266
|
-
},
|
|
267
|
-
confirmingActions: [
|
|
268
|
-
{
|
|
269
|
-
label: 'Confirm',
|
|
270
|
-
action: () => service[deleteEvent](id),
|
|
271
|
-
},
|
|
272
|
-
],
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
259
|
// #endregion
|
|
@@ -40,6 +40,36 @@ const bottom = css `
|
|
|
40
40
|
display: flex;
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
|
+
const textField = css `
|
|
44
|
+
zero-text-field {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
gap: calc(var(--design-unit) * 2px);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
zero-text-field::part(label) {
|
|
51
|
+
margin: 0;
|
|
52
|
+
color: var(--neutral-foreground-rest);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
zero-text-field::part(label)::after {
|
|
56
|
+
content: '*';
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
const select = css `
|
|
60
|
+
zero-select,
|
|
61
|
+
zero-multiselect::part(root) {
|
|
62
|
+
min-width: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
zero-select::part(listbox) {
|
|
66
|
+
max-height: 160px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
zero-multiselect {
|
|
70
|
+
max-height: 40px;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
43
73
|
export const DynamicRuleDialogStyles = css `
|
|
44
74
|
${top}
|
|
45
75
|
${bottom}
|
|
@@ -86,18 +116,13 @@ export const DynamicRuleDialogStyles = css `
|
|
|
86
116
|
margin-bottom: 0;
|
|
87
117
|
}
|
|
88
118
|
|
|
119
|
+
${textField}
|
|
120
|
+
${select}
|
|
121
|
+
|
|
89
122
|
zero-button {
|
|
90
123
|
margin: 0;
|
|
91
124
|
}
|
|
92
125
|
|
|
93
|
-
zero-select {
|
|
94
|
-
min-width: 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
zero-select::part(listbox) {
|
|
98
|
-
max-height: 160px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
126
|
.horizontal {
|
|
102
127
|
flex-direction: row;
|
|
103
128
|
}
|