@genesislcap/pbc-notify-ui 1.0.22 → 1.0.24
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/.husky/commit-msg +3 -0
- package/.husky/pre-commit +4 -0
- package/commitlint.config.js +25 -0
- package/dist/dts/components/components.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/inbox-subscription.d.ts +3 -3
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/inbox-subscription.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/inbox-subscription.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.d.ts +2 -2
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.template.d.ts +1 -1
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox-base/inbox-base.d.ts +8 -8
- package/dist/dts/components/foundation-inbox/inbox-base/inbox-base.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox.styles.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox.types.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox.utils.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/notify-audit/notify-audit-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/routes/route-management.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/routes/tabs/email-distribution-route-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/routes/tabs/email-user-route-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/routes/tabs/log-route-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/routes/tabs/ms-teams-route-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/routes/tabs/screen-route-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/columns.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/columns.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.types.d.ts.map +1 -1
- 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.styles.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.d.ts +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-dialog/rule-dialog.types.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-management.d.ts +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/columns.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/columns.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.template.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.d.ts +3 -3
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.template.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.d.ts +2 -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.styles.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.d.ts +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-dialog/template-dialog.types.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-management.d.ts +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.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/types/right-criteria.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/types/rule-execution-strategy.d.ts.map +1 -1
- package/dist/dts/services/alert.service.d.ts.map +1 -1
- package/dist/dts/services/notify.service.d.ts.map +1 -1
- package/dist/dts/services/rule.service.d.ts.map +1 -1
- package/dist/dts/services/system.service.d.ts.map +1 -1
- package/dist/dts/services/template.service.d.ts.map +1 -1
- package/dist/dts/utils/eventDetail.d.ts +1 -1
- package/dist/dts/utils/gridConfig.d.ts.map +1 -1
- package/dist/dts/utils/humanize.d.ts.map +1 -1
- package/dist/dts/utils/icons.d.ts.map +1 -1
- package/dist/dts/utils/logger.d.ts.map +1 -1
- package/dist/dts/utils/updateArray.d.ts.map +1 -1
- package/dist/esm/components/components.js +10 -10
- package/dist/esm/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.template.js +1 -1
- package/dist/esm/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.js +1 -1
- package/dist/esm/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.styles.js +1 -1
- package/dist/esm/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.template.js +5 -10
- package/dist/esm/components/foundation-inbox/components/inbox-subscription/inbox-subscription.js +9 -11
- package/dist/esm/components/foundation-inbox/components/inbox-subscription/inbox-subscription.styles.js +2 -2
- package/dist/esm/components/foundation-inbox/components/inbox-subscription/inbox-subscription.template.js +12 -13
- package/dist/esm/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.js +6 -6
- package/dist/esm/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.styles.js +1 -1
- package/dist/esm/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.template.js +27 -33
- package/dist/esm/components/foundation-inbox/inbox-base/inbox-base.js +15 -22
- package/dist/esm/components/foundation-inbox/inbox.js +1 -1
- package/dist/esm/components/foundation-inbox/inbox.styles.js +17 -33
- package/dist/esm/components/foundation-inbox/inbox.template.js +44 -37
- package/dist/esm/components/foundation-inbox/inbox.utils.js +4 -8
- package/dist/esm/components/foundation-notification-dashboard/components/notify-audit/notify-audit-management.js +9 -10
- package/dist/esm/components/foundation-notification-dashboard/components/routes/route-management.js +4 -4
- package/dist/esm/components/foundation-notification-dashboard/components/routes/tabs/email-distribution-route-management.js +8 -9
- package/dist/esm/components/foundation-notification-dashboard/components/routes/tabs/email-user-route-management.js +8 -9
- package/dist/esm/components/foundation-notification-dashboard/components/routes/tabs/log-route-management.js +11 -12
- package/dist/esm/components/foundation-notification-dashboard/components/routes/tabs/ms-teams-route-management.js +12 -13
- package/dist/esm/components/foundation-notification-dashboard/components/routes/tabs/screen-route-management.js +17 -18
- package/dist/esm/components/foundation-notification-dashboard/components/rules/columns.js +10 -10
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.js +2 -2
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.styles.js +2 -2
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.js +21 -32
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.js +12 -19
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.styles.js +29 -18
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.js +30 -64
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-management.js +15 -19
- package/dist/esm/components/foundation-notification-dashboard/components/templates/columns.js +10 -10
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.js +4 -8
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.styles.js +2 -2
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.template.js +25 -47
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.js +4 -8
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.styles.js +4 -4
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.template.js +25 -44
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.js +29 -29
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.styles.js +29 -21
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.js +32 -72
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.js +18 -18
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-management.js +15 -19
- package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.js +2 -2
- package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.tabs.js +5 -5
- package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.template.js +7 -5
- package/dist/esm/components/foundation-notification-dashboard/styles/management.styles.js +1 -1
- package/dist/esm/components/foundation-notification-dashboard/styles/rules-and-templates.styles.js +1 -1
- package/dist/esm/components/foundation-notification-dashboard/types/expression-type.js +1 -1
- package/dist/esm/components/foundation-notification-dashboard/types/right-criteria.js +1 -4
- package/dist/esm/components/foundation-notification-dashboard/types/rule-execution-strategy.js +1 -4
- package/dist/esm/components/foundation-notification-dashboard/types/severity.js +1 -1
- package/dist/esm/index.federated.js +1 -0
- package/dist/esm/services/alert.service.js +3 -3
- package/dist/esm/services/notify.service.js +6 -6
- package/dist/esm/services/rule.service.js +15 -12
- package/dist/esm/services/system.service.js +11 -8
- package/dist/esm/services/template.service.js +11 -9
- package/dist/esm/utils/gridConfig.js +1 -1
- package/dist/esm/utils/humanize.js +3 -2
- package/dist/esm/utils/icons.js +3 -10
- package/dist/esm/utils/notifyPermissions.js +4 -4
- package/package.json +43 -5
- package/scripts/commitlint.js +24 -0
|
@@ -1,63 +1,41 @@
|
|
|
1
1
|
import { sync } from '@genesislcap/foundation-utils';
|
|
2
|
-
import { html, repeat, when } from
|
|
2
|
+
import { html, repeat, when } from '@microsoft/fast-element';
|
|
3
3
|
import { ALL_LOGICAL_OPERATORS } from '../../../../types/logical-operator';
|
|
4
|
-
import { ALL_RIGHT_CRITERIAS, RIGHT_CRITERIA_USER_ENTRY, RIGHT_CRITERIA_VALUE } from '../../../../types/right-criteria';
|
|
4
|
+
import { ALL_RIGHT_CRITERIAS, RIGHT_CRITERIA_USER_ENTRY, RIGHT_CRITERIA_VALUE, } from '../../../../types/right-criteria';
|
|
5
5
|
export const ConditionBuilderTemplate = html `
|
|
6
6
|
<div class="condition-builder">
|
|
7
|
-
<zero-select
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
position="below"
|
|
11
|
-
>
|
|
12
|
-
${repeat(x => x.leftValueItems, html `
|
|
13
|
-
<zero-option value=${x => JSON.stringify(x)}>${x => x.FIELD_NAME}</zero-option>
|
|
7
|
+
<zero-select :value=${sync((x) => x.leftValue)} class="left-value">
|
|
8
|
+
${repeat((x) => x.leftValueItems, html `
|
|
9
|
+
<zero-option value=${(x) => JSON.stringify(x)}>${(x) => x.FIELD_NAME}</zero-option>
|
|
14
10
|
`)}
|
|
15
11
|
</zero-select>
|
|
16
12
|
|
|
17
|
-
<zero-select
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
position="below"
|
|
21
|
-
>
|
|
22
|
-
${repeat(x => ALL_LOGICAL_OPERATORS, html `
|
|
23
|
-
<zero-option value=${x => x}>${x => x}</zero-option>
|
|
13
|
+
<zero-select class="logical-operator" :value=${sync((x) => x.logicalOperator)}>
|
|
14
|
+
${repeat((x) => ALL_LOGICAL_OPERATORS, html `
|
|
15
|
+
<zero-option value=${(x) => x}>${(x) => x}</zero-option>
|
|
24
16
|
`)}
|
|
25
17
|
</zero-select>
|
|
26
|
-
|
|
27
|
-
<zero-select
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
position="below"
|
|
31
|
-
>
|
|
32
|
-
${repeat(x => ALL_RIGHT_CRITERIAS, html `
|
|
33
|
-
<zero-option value=${x => x}>${x => x}</zero-option>
|
|
18
|
+
|
|
19
|
+
<zero-select class="right-criteria" :value=${sync((x) => x.rightCriteria)}>
|
|
20
|
+
${repeat((x) => ALL_RIGHT_CRITERIAS, html `
|
|
21
|
+
<zero-option value=${(x) => x}>${(x) => x}</zero-option>
|
|
34
22
|
`)}
|
|
35
23
|
</zero-select>
|
|
36
24
|
|
|
37
|
-
${when(x => x.rightCriteria === RIGHT_CRITERIA_VALUE, html `
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
:value=${sync(x => x.rightValueUserEntry)}
|
|
50
|
-
position="below"
|
|
51
|
-
>
|
|
52
|
-
${x => x.rightValueItemsProperty}
|
|
53
|
-
</zero-select>
|
|
54
|
-
`)}
|
|
25
|
+
${when((x) => x.rightCriteria === RIGHT_CRITERIA_VALUE, html `
|
|
26
|
+
<zero-text-field
|
|
27
|
+
class="right-criteria-value"
|
|
28
|
+
:value=${sync((x) => x.rightValueText)}
|
|
29
|
+
placeholder="Value"
|
|
30
|
+
></zero-text-field>
|
|
31
|
+
`)}
|
|
32
|
+
${when((x) => x.rightCriteria === RIGHT_CRITERIA_USER_ENTRY, html `
|
|
33
|
+
<zero-select class="right-criteria-user-entry" :value=${sync((x) => x.rightValueUserEntry)}>
|
|
34
|
+
${(x) => x.rightValueItemsProperty}
|
|
35
|
+
</zero-select>
|
|
36
|
+
`)}
|
|
55
37
|
|
|
56
|
-
<zero-button
|
|
57
|
-
appearance="icon"
|
|
58
|
-
class="delete"
|
|
59
|
-
@click=${x => x.deleteCondition()}
|
|
60
|
-
>
|
|
38
|
+
<zero-button appearance="icon" class="delete" @click=${(x) => x.deleteCondition()}>
|
|
61
39
|
<zero-icon name="trash" part="icon"></zero-icon>
|
|
62
40
|
</zero-button>
|
|
63
41
|
</div>
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { FASTElement, attr, customElement, observable } from
|
|
3
|
-
import {
|
|
2
|
+
import { FASTElement, attr, customElement, observable } from '@microsoft/fast-element';
|
|
3
|
+
import { PARAM_SOURCE_TYPE_DEFINED_GROUP, PARAM_SOURCE_TYPE_REQ_REP, } from '../../../../types/param-source-type';
|
|
4
4
|
import { ParameterBuilderStyles as styles } from './parameter-builder.styles';
|
|
5
|
-
import {
|
|
5
|
+
import { ParameterBuilderTemplate as template } from './parameter-builder.template';
|
|
6
6
|
const name = 'parameter-builder';
|
|
7
7
|
let ParameterBuilder = class ParameterBuilder extends FASTElement {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
|
-
this.reqRepItems = [
|
|
11
|
-
'REQUEST_1',
|
|
12
|
-
'REQUEST_2',
|
|
13
|
-
'REQUEST_3',
|
|
14
|
-
];
|
|
10
|
+
this.reqRepItems = ['REQUEST_1', 'REQUEST_2', 'REQUEST_3'];
|
|
15
11
|
}
|
|
16
12
|
connectedCallback() {
|
|
17
13
|
const _super = Object.create(null, {
|
|
@@ -6,13 +6,13 @@ export const ParameterBuilderStyles = css `
|
|
|
6
6
|
gap: calc(var(--design-unit) * 2px);
|
|
7
7
|
margin-bottom: calc(var(--design-unit) * 2px);
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
zero-button {
|
|
11
|
-
margin:
|
|
11
|
+
margin: 0;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
.delete {
|
|
15
|
-
margin:
|
|
15
|
+
margin: 0;
|
|
16
16
|
background-color: var(--neutral-layer-1);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -1,82 +1,63 @@
|
|
|
1
1
|
import { sync } from '@genesislcap/foundation-utils';
|
|
2
|
-
import { html, ref, repeat, when } from
|
|
3
|
-
import { ALL_PARAM_SOURCE_TYPES, PARAM_SOURCE_TYPE_DEFINED_GROUP, PARAM_SOURCE_TYPE_REQ_REP, PARAM_SOURCE_TYPE_USER_TEXT } from '../../../../types/param-source-type';
|
|
2
|
+
import { html, ref, repeat, when } from '@microsoft/fast-element';
|
|
3
|
+
import { ALL_PARAM_SOURCE_TYPES, PARAM_SOURCE_TYPE_DEFINED_GROUP, PARAM_SOURCE_TYPE_REQ_REP, PARAM_SOURCE_TYPE_USER_TEXT, } from '../../../../types/param-source-type';
|
|
4
4
|
import { ALL_PARAM_TYPES } from '../../../../types/param-type';
|
|
5
5
|
export const ParameterBuilderTemplate = html `
|
|
6
6
|
<div class="parameter-builder">
|
|
7
7
|
<zero-text-field
|
|
8
8
|
id="param-name"
|
|
9
9
|
placeholder="Name"
|
|
10
|
-
:value=${sync(x => x.name)}
|
|
11
|
-
>
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
:value=${sync((x) => x.name)}
|
|
11
|
+
></zero-text-field>
|
|
12
|
+
|
|
14
13
|
<zero-text-field
|
|
15
14
|
id="param-label"
|
|
16
15
|
placeholder="Label"
|
|
17
|
-
:value=${sync(x => x.label)}
|
|
18
|
-
>
|
|
19
|
-
</zero-text-field>
|
|
16
|
+
:value=${sync((x) => x.label)}
|
|
17
|
+
></zero-text-field>
|
|
20
18
|
|
|
21
19
|
<zero-select
|
|
22
20
|
id="param-source-type"
|
|
23
|
-
:value=${sync(x => x.sourceType)}
|
|
21
|
+
:value=${sync((x) => x.sourceType)}
|
|
24
22
|
class="param-source-type"
|
|
25
|
-
position="below"
|
|
26
23
|
>
|
|
27
|
-
${repeat(x => ALL_PARAM_SOURCE_TYPES, html `
|
|
28
|
-
<zero-option value=${x => x}>${x => x}</zero-option>
|
|
24
|
+
${repeat((x) => ALL_PARAM_SOURCE_TYPES, html `
|
|
25
|
+
<zero-option value=${(x) => x}>${(x) => x}</zero-option>
|
|
29
26
|
`)}
|
|
30
27
|
</zero-select>
|
|
31
28
|
|
|
32
|
-
${when(x => x.sourceType === PARAM_SOURCE_TYPE_USER_TEXT, html `
|
|
33
|
-
<zero-text-field
|
|
34
|
-
class="param-source"
|
|
35
|
-
disabled
|
|
36
|
-
>
|
|
37
|
-
</zero-text-field>
|
|
29
|
+
${when((x) => x.sourceType === PARAM_SOURCE_TYPE_USER_TEXT, html `
|
|
30
|
+
<zero-text-field class="param-source" disabled></zero-text-field>
|
|
38
31
|
`)}
|
|
39
|
-
|
|
40
|
-
${when(x => x.sourceType === PARAM_SOURCE_TYPE_REQ_REP, html `
|
|
32
|
+
${when((x) => x.sourceType === PARAM_SOURCE_TYPE_REQ_REP, html `
|
|
41
33
|
<zero-select
|
|
42
34
|
${ref('sourceSelect')}
|
|
43
35
|
id="param-source"
|
|
44
|
-
:value=${sync(x => x.sourceSelected)}
|
|
36
|
+
:value=${sync((x) => x.sourceSelected)}
|
|
45
37
|
class="param-source"
|
|
46
|
-
?disabled=${x => x.sourceType !== PARAM_SOURCE_TYPE_REQ_REP}
|
|
38
|
+
?disabled=${(x) => x.sourceType !== PARAM_SOURCE_TYPE_REQ_REP}
|
|
47
39
|
>
|
|
48
|
-
${repeat(x => x.reqRepItems, html `
|
|
49
|
-
<zero-option value=${x => x}>${x => x}</zero-option>
|
|
40
|
+
${repeat((x) => x.reqRepItems, html `
|
|
41
|
+
<zero-option value=${(x) => x}>${(x) => x}</zero-option>
|
|
50
42
|
`)}
|
|
51
43
|
</zero-select>
|
|
52
44
|
`)}
|
|
53
|
-
|
|
54
|
-
${when(x => x.sourceType === PARAM_SOURCE_TYPE_DEFINED_GROUP, html `
|
|
45
|
+
${when((x) => x.sourceType === PARAM_SOURCE_TYPE_DEFINED_GROUP, html `
|
|
55
46
|
<zero-text-field
|
|
56
47
|
${ref('sourceTextField')}
|
|
57
48
|
class="param-source"
|
|
58
49
|
placeholder="item1,item2,item3"
|
|
59
|
-
:value=${sync(x => x.sourceTyped)}
|
|
60
|
-
>
|
|
61
|
-
</zero-text-field>
|
|
50
|
+
:value=${sync((x) => x.sourceTyped)}
|
|
51
|
+
></zero-text-field>
|
|
62
52
|
`)}
|
|
63
|
-
|
|
64
|
-
<zero-select
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class="param-type"
|
|
68
|
-
position="below"
|
|
69
|
-
>
|
|
70
|
-
${repeat(x => ALL_PARAM_TYPES, html `
|
|
71
|
-
<zero-option value=${x => x}>${x => x}</zero-option>
|
|
53
|
+
|
|
54
|
+
<zero-select id="param-type" :value=${sync((x) => x.type)} class="param-type">
|
|
55
|
+
${repeat((x) => ALL_PARAM_TYPES, html `
|
|
56
|
+
<zero-option value=${(x) => x}>${(x) => x}</zero-option>
|
|
72
57
|
`)}
|
|
73
58
|
</zero-select>
|
|
74
59
|
|
|
75
|
-
<zero-button
|
|
76
|
-
appearance="icon"
|
|
77
|
-
class="delete"
|
|
78
|
-
@click=${x => x.deleteParameter()}
|
|
79
|
-
>
|
|
60
|
+
<zero-button appearance="icon" class="delete" @click=${(x) => x.deleteParameter()}>
|
|
80
61
|
<zero-icon name="trash" part="icon"></zero-icon>
|
|
81
62
|
</zero-button>
|
|
82
63
|
</div>
|
|
@@ -10,8 +10,8 @@ import { RIGHT_CRITERIA_USER_ENTRY, RIGHT_CRITERIA_VALUE } from '../../../types/
|
|
|
10
10
|
import { SEVERITY_INFORMATION } from '../../../types/severity';
|
|
11
11
|
import { TemplateDialogStyles as styles } from './template-dialog.styles';
|
|
12
12
|
import { TemplateDialogTemplate as template } from './template-dialog.template';
|
|
13
|
-
import { TemplateDialogMode } from './template-dialog.types';
|
|
14
|
-
import { createAssignment, createConditions, createEmptyCondition, createEmptyParameter, createParameterDetails, getAssignmentValue, UUIDGenerator } from './template-dialog.utils';
|
|
13
|
+
import { TemplateDialogMode, } from './template-dialog.types';
|
|
14
|
+
import { createAssignment, createConditions, createEmptyCondition, createEmptyParameter, createParameterDetails, getAssignmentValue, UUIDGenerator, } from './template-dialog.utils';
|
|
15
15
|
const name = 'template-dialog';
|
|
16
16
|
let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
17
17
|
constructor() {
|
|
@@ -39,24 +39,24 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
39
39
|
break;
|
|
40
40
|
case TemplateDialogMode.EDIT:
|
|
41
41
|
const ruleTemplate = params.data;
|
|
42
|
-
this.
|
|
42
|
+
this.templateId = ruleTemplate.DYNAMIC_RULE_ID;
|
|
43
43
|
this.name = ruleTemplate.RULE_NAME;
|
|
44
44
|
this.description = ruleTemplate.RULE_DESCRIPTION;
|
|
45
45
|
this.resource = ruleTemplate.RULE_TABLE;
|
|
46
46
|
this.fields = yield this.systemService.getFields(this.resource);
|
|
47
47
|
// Parameters
|
|
48
|
-
this.parameters = Object.keys(ruleTemplate.PARAMETERS).map(key => {
|
|
48
|
+
this.parameters = Object.keys(ruleTemplate.PARAMETERS).map((key) => {
|
|
49
49
|
return {
|
|
50
50
|
UUID: UUIDGenerator.createUuid(),
|
|
51
51
|
PARAM_NAME: ruleTemplate.PARAMETERS[key].PARAM_NAME,
|
|
52
52
|
PARAM_LABEL: ruleTemplate.PARAMETERS[key].PARAM_LABEL,
|
|
53
53
|
PARAM_TYPE: ruleTemplate.PARAMETERS[key].PARAM_TYPE,
|
|
54
54
|
PARAM_SOURCE_TYPE: ruleTemplate.PARAMETERS[key].PARAM_SOURCE_TYPE,
|
|
55
|
-
PARAM_SOURCE: ruleTemplate.PARAMETERS[key].PARAM_SOURCE
|
|
55
|
+
PARAM_SOURCE: ruleTemplate.PARAMETERS[key].PARAM_SOURCE,
|
|
56
56
|
};
|
|
57
57
|
});
|
|
58
58
|
// Conditions
|
|
59
|
-
this.conditions = ruleTemplate.RULE_EXPRESSION.CONDITIONS.map(condition => {
|
|
59
|
+
this.conditions = ruleTemplate.RULE_EXPRESSION.CONDITIONS.map((condition) => {
|
|
60
60
|
var _a, _b;
|
|
61
61
|
return {
|
|
62
62
|
ID: UUIDGenerator.createUuid(),
|
|
@@ -66,8 +66,9 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
66
66
|
? RIGHT_CRITERIA_USER_ENTRY
|
|
67
67
|
: RIGHT_CRITERIA_VALUE,
|
|
68
68
|
RIGHT_VALUE: condition.RIGHT.TYPE === EXPRESSION_TYPE_PLACEHOLDER
|
|
69
|
-
? this.parameters.find(parameter => parameter.PARAM_NAME === condition.RIGHT.KEY)
|
|
70
|
-
|
|
69
|
+
? this.parameters.find((parameter) => parameter.PARAM_NAME === condition.RIGHT.KEY)
|
|
70
|
+
.UUID
|
|
71
|
+
: (_b = condition.RIGHT.VALUE) !== null && _b !== void 0 ? _b : condition.RIGHT.NAME,
|
|
71
72
|
};
|
|
72
73
|
});
|
|
73
74
|
// Assignments
|
|
@@ -87,32 +88,32 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
get templateDialogTitle() {
|
|
90
|
-
const mode = this.templateDialogMode === TemplateDialogMode.CREATE
|
|
91
|
-
? 'Create'
|
|
92
|
-
: 'Edit';
|
|
91
|
+
const mode = this.templateDialogMode === TemplateDialogMode.CREATE ? 'Create' : 'Edit';
|
|
93
92
|
return `${mode} Template`;
|
|
94
93
|
}
|
|
95
94
|
submit() {
|
|
96
|
-
const
|
|
97
|
-
|
|
95
|
+
const ruleTemplate = Object.assign(Object.assign({}, (this.templateDialogMode === TemplateDialogMode.EDIT && {
|
|
96
|
+
DYNAMIC_RULE_ID: this.templateId,
|
|
97
|
+
})), { RULE_NAME: this.name, RULE_DESCRIPTION: this.description, RULE_TABLE: this.resource, RULE_EXPRESSION: {
|
|
98
|
+
CONDITIONS: createConditions(this.conditions, this.parameters),
|
|
98
99
|
}, RAW_RULE_EXPRESSION: null, RESULT_EXPRESSION: {
|
|
99
100
|
ASSIGNMENTS: [
|
|
100
101
|
createAssignment('TOPIC', this.topic),
|
|
101
102
|
createAssignment('HEADER', this.header),
|
|
102
103
|
createAssignment('BODY', this.message),
|
|
103
|
-
createAssignment('NOTIFY_SEVERITY', humanize(this.severity))
|
|
104
|
-
]
|
|
104
|
+
createAssignment('NOTIFY_SEVERITY', humanize(this.severity)),
|
|
105
|
+
],
|
|
105
106
|
}, PARAMETER_DETAILS: createParameterDetails(this.parameters), RULE_EXECUTION_STRATEGY: 'UNLIMITED' });
|
|
106
107
|
switch (this.templateDialogMode) {
|
|
107
108
|
case TemplateDialogMode.CREATE:
|
|
108
|
-
this.
|
|
109
|
-
.createRuleTemplate(
|
|
110
|
-
.then(response => this.validateResponse(response));
|
|
109
|
+
this.templateService
|
|
110
|
+
.createRuleTemplate(ruleTemplate)
|
|
111
|
+
.then((response) => this.validateResponse(response));
|
|
111
112
|
break;
|
|
112
113
|
case TemplateDialogMode.EDIT:
|
|
113
|
-
this.
|
|
114
|
-
.editRuleTemplate(
|
|
115
|
-
.then(response => this.validateResponse(response));
|
|
114
|
+
this.templateService
|
|
115
|
+
.editRuleTemplate(ruleTemplate)
|
|
116
|
+
.then((response) => this.validateResponse(response));
|
|
116
117
|
break;
|
|
117
118
|
default:
|
|
118
119
|
logger.error('Error on TemplateDialogMode');
|
|
@@ -137,7 +138,7 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
137
138
|
}
|
|
138
139
|
close() {
|
|
139
140
|
this.dialog.close();
|
|
140
|
-
this.
|
|
141
|
+
this.templateId = null;
|
|
141
142
|
this.name = null;
|
|
142
143
|
this.description = null;
|
|
143
144
|
this.header = null;
|
|
@@ -155,13 +156,12 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
155
156
|
newCondition() {
|
|
156
157
|
this.conditions.push(createEmptyCondition());
|
|
157
158
|
}
|
|
158
|
-
editCondition(editedCondition) {
|
|
159
|
-
}
|
|
159
|
+
editCondition(editedCondition) { }
|
|
160
160
|
deleteCondition(deletedCondition) {
|
|
161
161
|
if (this.conditions.length <= 1) {
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
this.conditions = this.conditions.filter(condition => condition !== deletedCondition);
|
|
164
|
+
this.conditions = this.conditions.filter((condition) => condition !== deletedCondition);
|
|
165
165
|
}
|
|
166
166
|
// #endregion
|
|
167
167
|
// #region Parameter
|
|
@@ -172,10 +172,10 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
172
172
|
this.parameters = [...this.parameters];
|
|
173
173
|
}
|
|
174
174
|
deleteParameter(deletedParameter) {
|
|
175
|
-
if (this.conditions.find(condition => condition.RIGHT_VALUE === deletedParameter.UUID)) {
|
|
175
|
+
if (this.conditions.find((condition) => condition.RIGHT_VALUE === deletedParameter.UUID)) {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
this.parameters = this.parameters.filter(parameter => parameter.UUID !== deletedParameter.UUID);
|
|
178
|
+
this.parameters = this.parameters.filter((parameter) => parameter.UUID !== deletedParameter.UUID);
|
|
179
179
|
}
|
|
180
180
|
// #endregion
|
|
181
181
|
resourceChanged() {
|
|
@@ -187,7 +187,7 @@ let TemplateDialog = class TemplateDialog extends FASTElement {
|
|
|
187
187
|
};
|
|
188
188
|
__decorate([
|
|
189
189
|
TemplateService
|
|
190
|
-
], TemplateDialog.prototype, "
|
|
190
|
+
], TemplateDialog.prototype, "templateService", void 0);
|
|
191
191
|
__decorate([
|
|
192
192
|
SystemService
|
|
193
193
|
], TemplateDialog.prototype, "systemService", void 0);
|
|
@@ -196,7 +196,7 @@ __decorate([
|
|
|
196
196
|
], TemplateDialog.prototype, "notifyService", void 0);
|
|
197
197
|
__decorate([
|
|
198
198
|
observable
|
|
199
|
-
], TemplateDialog.prototype, "
|
|
199
|
+
], TemplateDialog.prototype, "templateId", void 0);
|
|
200
200
|
__decorate([
|
|
201
201
|
observable
|
|
202
202
|
], TemplateDialog.prototype, "name", void 0);
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
const modalWidthPx = 940;
|
|
3
|
-
const
|
|
3
|
+
const top = css `
|
|
4
4
|
zero-modal::part(top) {
|
|
5
5
|
padding: calc(var(--design-unit) * 4px);
|
|
6
6
|
border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
|
|
7
|
-
margin:
|
|
7
|
+
margin: 0;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.template-dialog-
|
|
10
|
+
.template-dialog-top {
|
|
11
11
|
font-weight: bold;
|
|
12
12
|
align-self: center;
|
|
13
13
|
}
|
|
14
14
|
`;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const bottom = css `
|
|
16
|
+
zero-modal::part(bottom) {
|
|
17
|
+
padding: calc(var(--design-unit) * 4px);
|
|
18
|
+
border-top: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
|
|
19
|
+
margin: 0;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
.template-dialog-
|
|
22
|
-
|
|
23
|
-
margin-bottom: 0px;
|
|
22
|
+
.template-dialog-bottom {
|
|
23
|
+
display: flex;
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
26
26
|
export const TemplateDialogStyles = css `
|
|
27
|
-
${
|
|
28
|
-
${
|
|
27
|
+
${top}
|
|
28
|
+
${bottom}
|
|
29
29
|
|
|
30
30
|
zero-modal::part(dialog) {
|
|
31
31
|
padding: 0;
|
|
@@ -35,9 +35,10 @@ export const TemplateDialogStyles = css `
|
|
|
35
35
|
|
|
36
36
|
.template-dialog-content {
|
|
37
37
|
display: flex;
|
|
38
|
-
justify-content: center;
|
|
39
38
|
flex-direction: column;
|
|
40
39
|
width: ${String(modalWidthPx)}px;
|
|
40
|
+
max-height: 500px;
|
|
41
|
+
overflow-y: scroll;
|
|
41
42
|
gap: calc(var(--design-unit) * 3px);
|
|
42
43
|
padding: calc(var(--design-unit) * 4px);
|
|
43
44
|
}
|
|
@@ -56,26 +57,21 @@ export const TemplateDialogStyles = css `
|
|
|
56
57
|
|
|
57
58
|
.parameters,
|
|
58
59
|
.conditions {
|
|
59
|
-
height: 150px;
|
|
60
|
-
max-height: 200px;
|
|
61
60
|
border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
|
|
62
61
|
border-radius: calc(var(--control-corner-radius) * 1px);
|
|
63
62
|
display: flex;
|
|
64
|
-
flex-direction: column;
|
|
65
63
|
padding: calc(var(--design-unit) * 2px);
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
overflow-y: scroll;
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
.parameter,
|
|
71
67
|
.condition {
|
|
72
|
-
gap:
|
|
68
|
+
gap: 0;
|
|
73
69
|
flex-direction: column;
|
|
74
|
-
margin-bottom:
|
|
70
|
+
margin-bottom: 0;
|
|
75
71
|
}
|
|
76
72
|
|
|
77
73
|
zero-button {
|
|
78
|
-
margin:
|
|
74
|
+
margin: 0;
|
|
79
75
|
}
|
|
80
76
|
|
|
81
77
|
zero-select {
|
|
@@ -85,4 +81,16 @@ export const TemplateDialogStyles = css `
|
|
|
85
81
|
zero-select::part(listbox) {
|
|
86
82
|
max-height: 160px;
|
|
87
83
|
}
|
|
84
|
+
|
|
85
|
+
.horizontal {
|
|
86
|
+
flex-direction: row;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.destination {
|
|
90
|
+
align-self: center;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.topic {
|
|
94
|
+
min-width: revert-layer;
|
|
95
|
+
}
|
|
88
96
|
`;
|