@genesislcap/pbc-notify-ui 1.0.16 → 1.0.18

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.
@@ -10,7 +10,7 @@ export declare class RuleConditionBuilder extends FASTElement {
10
10
  logicalOperator: string;
11
11
  rightCriteria: RightCriteria;
12
12
  rightValueText: string;
13
- rightValueField: string;
13
+ rightValueUserEntry: string;
14
14
  formActive: boolean;
15
15
  conditionChanged(): Promise<void>;
16
16
  assignLeftValue(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"rule-condition-builder.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AAGjF,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAkB,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAI1E,qBAKa,oBAAqB,SAAQ,WAAW;IAEpC,aAAa,EAAE,aAAa,CAAC;IAEhC,SAAS,EAAE,sBAAsB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,KAAK,EAAE,CAAC;IAExB,SAAS,EAAE,MAAM,CAAC;IAElB,eAAe,EAAE,MAAM,CAAC;IAExB,aAAa,EAAE,aAAa,CAAwB;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IAGpC,UAAU,EAAE,OAAO,CAAQ;IAErB,gBAAgB;IAYhB,eAAe;IASrB,gBAAgB;IAShB,gBAAgB;IAOhB,sBAAsB;IAOtB,oBAAoB;IAcpB,qBAAqB;IAOrB,0BAA0B;IAO1B,eAAe;CAGhB"}
1
+ {"version":3,"file":"rule-condition-builder.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AAGjF,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAkB,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAI1E,qBAKa,oBAAqB,SAAQ,WAAW;IAEpC,aAAa,EAAE,aAAa,CAAC;IAEhC,SAAS,EAAE,sBAAsB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,KAAK,EAAE,CAAC;IAExB,SAAS,EAAE,MAAM,CAAC;IAElB,eAAe,EAAE,MAAM,CAAC;IAExB,aAAa,EAAE,aAAa,CAAwB;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAGxC,UAAU,EAAE,OAAO,CAAQ;IAErB,gBAAgB;IAYhB,eAAe;IASrB,gBAAgB;IAShB,gBAAgB;IAOhB,sBAAsB;IAOtB,oBAAoB;IAcpB,qBAAqB;IAOrB,0BAA0B;IAO1B,eAAe;CAGhB"}
@@ -18,30 +18,24 @@ export declare function createAssignment(field: string, value: string): {
18
18
  export declare function getAssignmentValue(assignments: any[], field: string): string;
19
19
  export declare function createConditions(conditions: ConditionBuilderEntity[], parameters?: any): any;
20
20
  export declare function getLeftExpression(condition: ConditionBuilderEntity): {
21
- TYPE: string;
22
- VALUE: any;
23
- NAME?: undefined;
24
- } | {
25
21
  TYPE: string;
26
22
  NAME: any;
27
- VALUE?: undefined;
28
23
  };
29
- export declare function getLeftType(condition: ConditionBuilderEntity): "FIELD" | "NUMBER" | "STRING";
30
24
  export declare function getRightExpression(condition: ConditionBuilderEntity, parameters?: any): {
31
25
  TYPE: string;
32
26
  KEY: any;
33
- VALUE?: undefined;
34
27
  NAME?: undefined;
28
+ VALUE?: undefined;
35
29
  } | {
36
30
  TYPE: string;
37
- VALUE: string;
31
+ NAME: string;
38
32
  KEY?: undefined;
39
- NAME?: undefined;
33
+ VALUE?: undefined;
40
34
  } | {
41
35
  TYPE: string;
42
- NAME: string;
36
+ VALUE: string;
43
37
  KEY?: undefined;
44
- VALUE?: undefined;
38
+ NAME?: undefined;
45
39
  };
46
40
  export declare function createParameterDetails(parameters: any): {};
47
41
  //# sourceMappingURL=template-dialog.utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"template-dialog.utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGzF,qBAAa,aAAa;IAElB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAO;IAEhC,MAAM,CAAC,UAAU,IAAI,MAAM;CAG5B;AAED,wBAAgB,oBAAoB,IAAI,sBAAsB,CAQ7D;AAED,wBAAgB,oBAAoB,IAAI,sBAAsB,CAS7D;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM;;;;;;;;;EAYd;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,EAAE,EAAE,UAAU,CAAC,KAAA,GAAG,GAAG,CAQvF;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,sBAAsB;;;;;;;;EAclE;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,sBAAsB,iCAa5D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,sBAAsB,EAAE,UAAU,CAAC,KAAA;;;;;;;;;;;;;;;EAmBhF;AAED,wBAAgB,sBAAsB,CAAC,UAAU,KAAA,MAYhD"}
1
+ {"version":3,"file":"template-dialog.utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGzF,qBAAa,aAAa;IAElB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAO;IAEhC,MAAM,CAAC,UAAU,IAAI,MAAM;CAG5B;AAED,wBAAgB,oBAAoB,IAAI,sBAAsB,CAQ7D;AAED,wBAAgB,oBAAoB,IAAI,sBAAsB,CAS7D;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM;;;;;;;;;EAYd;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,EAAE,EAAE,UAAU,CAAC,KAAA,GAAG,GAAG,CAQvF;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,sBAAsB;;;EAKlE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,sBAAsB,EAAE,UAAU,CAAC,KAAA;;;;;;;;;;;;;;;EAyChF;AAED,wBAAgB,sBAAsB,CAAC,UAAU,KAAA,MAYhD"}
@@ -1,7 +1,7 @@
1
1
  export declare const NotifyPermission: {
2
- NOTIFY_RULE_VIEW: string;
3
- NOTIFICATION_RULE_TEMPLATE_VIEW: string;
4
- NOTIFY_ROUTE_VIEW: string;
5
- NOTIFY_AUDIT_VIEW: string;
2
+ NotificationRuleView: string;
3
+ NotificationRuleTemplateView: string;
4
+ NotificationRouteView: string;
5
+ NotificationAuditView: string;
6
6
  };
7
7
  //# sourceMappingURL=notifyPermissions.d.ts.map
@@ -21,7 +21,7 @@ export const FoundationInboxTemplate = html `
21
21
  >
22
22
  Alert Log
23
23
  </zero-tab>
24
- ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NOTIFY_RULE_VIEW), html `
24
+ ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NotificationRuleView), html `
25
25
  <zero-tab
26
26
  slot="my-alerts-tab"
27
27
  id=${InboxTab.MyAlerts}
@@ -31,7 +31,7 @@ export const FoundationInboxTemplate = html `
31
31
  My Alerts
32
32
  </zero-tab>
33
33
  `)}
34
- ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NOTIFICATION_RULE_TEMPLATE_VIEW), html `
34
+ ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NotificationRuleTemplateView), html `
35
35
  <zero-tab
36
36
  slot="subscribe-tab"
37
37
  id=${InboxTab.Subscribe}
@@ -73,7 +73,7 @@ export const FoundationInboxTemplate = html `
73
73
  `)}
74
74
  </div>
75
75
  </zero-tab-panel>
76
- ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NOTIFY_RULE_VIEW), html `
76
+ ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NotificationRuleView), html `
77
77
  <!-- Rules -->
78
78
  <zero-tab-panel
79
79
  slot="my-alerts-tab"
@@ -110,7 +110,7 @@ export const FoundationInboxTemplate = html `
110
110
  </div>
111
111
  </zero-tab-panel>
112
112
  `)}
113
- ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NOTIFICATION_RULE_TEMPLATE_VIEW), html `
113
+ ${when((x) => x.auth.currentUser.hasPermission(NotifyPermission.NotificationRuleTemplateView), html `
114
114
  <!-- Templates -->
115
115
  <zero-tab-panel
116
116
  slot="subscribe-tab"
@@ -40,7 +40,7 @@ let RuleConditionBuilder = class RuleConditionBuilder extends FASTElement {
40
40
  this.rightValueText = this.condition.RIGHT_VALUE;
41
41
  }
42
42
  else {
43
- this.rightValueField = null;
43
+ this.rightValueUserEntry = null;
44
44
  }
45
45
  this.$emit('edit', this.condition);
46
46
  }
@@ -63,7 +63,7 @@ let RuleConditionBuilder = class RuleConditionBuilder extends FASTElement {
63
63
  this.rightValueText = '';
64
64
  }
65
65
  else {
66
- this.rightValueField = null;
66
+ this.rightValueUserEntry = this.resourceFields[0].FIELD_NAME;
67
67
  }
68
68
  this.$emit('edit', this.condition);
69
69
  }
@@ -76,7 +76,7 @@ let RuleConditionBuilder = class RuleConditionBuilder extends FASTElement {
76
76
  }
77
77
  rightValueUserEntryChanged() {
78
78
  if (this.condition) {
79
- this.condition.RIGHT_VALUE = this.rightValueField;
79
+ this.condition.RIGHT_VALUE = this.rightValueUserEntry;
80
80
  this.$emit('edit', this.condition);
81
81
  }
82
82
  }
@@ -110,7 +110,7 @@ __decorate([
110
110
  ], RuleConditionBuilder.prototype, "rightValueText", void 0);
111
111
  __decorate([
112
112
  observable
113
- ], RuleConditionBuilder.prototype, "rightValueField", void 0);
113
+ ], RuleConditionBuilder.prototype, "rightValueUserEntry", void 0);
114
114
  RuleConditionBuilder = __decorate([
115
115
  customElement({
116
116
  name,
@@ -43,7 +43,7 @@ export const ConditionBuilderTemplate = html `
43
43
 
44
44
  <zero-select
45
45
  class="right-criteria-user-entry ${x => classNames(['display-none', x.rightCriteria !== RIGHT_CRITERIA.FIELD])}"
46
- :value=${sync(x => x.rightValueField)}
46
+ :value=${sync(x => x.rightValueUserEntry)}
47
47
  >
48
48
  ${repeat(x => x.resourceFields, html `
49
49
  <zero-option value=${x => x.FIELD_NAME}>${x => x.FIELD_NAME}</zero-option>
@@ -1,9 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
- import { EXPRESSION_TYPE_FIELD, EXPRESSION_TYPE_PLACEHOLDER, EXPRESSION_TYPE_STRING } from "../../../types/expression-type";
3
2
  import { LOGICAL_OPERATOR_EQUALS } from "../../../types/logical-operator";
4
3
  import { PARAM_SOURCE_TYPE_USER_TEXT } from "../../../types/param-source-type";
5
- import { PARAM_TYPE_BOOLEAN, PARAM_TYPE_FIELD, PARAM_TYPE_NUMBER, PARAM_TYPE_STRING } from "../../../types/param-type";
6
- import { RIGHT_CRITERIA_USER_ENTRY, RIGHT_CRITERIA_VALUE } from "../../../types/right-criteria";
4
+ import { PARAM_TYPE_FIELD, PARAM_TYPE_STRING } from "../../../types/param-type";
5
+ import { RIGHT_CRITERIA_VALUE } from "../../../types/right-criteria";
7
6
  import { UUID } from '@genesislcap/foundation-utils';
8
7
  export class UUIDGenerator {
9
8
  static createUuid() {
@@ -57,49 +56,52 @@ export function createConditions(conditions, parameters) {
57
56
  });
58
57
  }
59
58
  export function getLeftExpression(condition) {
60
- const leftType = getLeftType(condition);
61
- if (PARAM_TYPE_STRING === leftType) {
62
- return {
63
- TYPE: PARAM_TYPE_STRING,
64
- VALUE: condition.LEFT_VALUE.FIELD_NAME
65
- };
66
- }
67
59
  return {
68
60
  TYPE: PARAM_TYPE_FIELD,
69
61
  NAME: condition.LEFT_VALUE.FIELD_NAME
70
62
  };
71
63
  }
72
- export function getLeftType(condition) {
73
- switch (condition.LEFT_VALUE.FIELD_TYPE) {
74
- case PARAM_TYPE_BOOLEAN:
75
- return PARAM_TYPE_FIELD;
76
- case 'INTEGER':
77
- case 'DOUBLE':
78
- case 'LONG':
79
- case 'SHORT':
80
- case 'BIGDECIMAL':
81
- return PARAM_TYPE_NUMBER;
82
- default:
83
- return PARAM_TYPE_STRING;
84
- }
85
- }
86
64
  export function getRightExpression(condition, parameters) {
87
- if (condition.RIGHT_CRITERIA === RIGHT_CRITERIA_USER_ENTRY) {
88
- return {
89
- TYPE: EXPRESSION_TYPE_PLACEHOLDER,
90
- KEY: parameters.find(parameter => parameter.UUID === condition.RIGHT_VALUE).PARAM_NAME
91
- };
92
- }
93
- if (condition.LEFT_VALUE.FIELD_TYPE === EXPRESSION_TYPE_STRING) {
94
- return {
95
- TYPE: EXPRESSION_TYPE_STRING,
96
- VALUE: condition.RIGHT_VALUE
97
- };
65
+ switch (condition.RIGHT_CRITERIA) {
66
+ case 'USER_ENTRY':
67
+ return {
68
+ TYPE: 'PLACEHOLDER',
69
+ KEY: parameters.find(parameter => parameter.UUID === condition.RIGHT_VALUE).PARAM_NAME
70
+ };
71
+ case 'FIELD': // Only for Rules
72
+ return {
73
+ TYPE: 'FIELD',
74
+ NAME: condition.RIGHT_VALUE
75
+ };
76
+ default:
77
+ switch (condition.LEFT_VALUE.FIELD_TYPE) {
78
+ case 'BOOLEAN':
79
+ return {
80
+ TYPE: 'BOOLEAN',
81
+ VALUE: condition.RIGHT_VALUE
82
+ };
83
+ case 'STRING':
84
+ case 'ENUM':
85
+ return {
86
+ TYPE: 'STRING',
87
+ VALUE: condition.RIGHT_VALUE
88
+ };
89
+ case 'INT':
90
+ case 'SHORT':
91
+ case 'DOUBLE':
92
+ case 'LONG':
93
+ case 'BIGDECIMAL':
94
+ return {
95
+ TYPE: 'NUMBER',
96
+ VALUE: condition.RIGHT_VALUE
97
+ };
98
+ default:
99
+ return {
100
+ TYPE: 'FIELD',
101
+ NAME: condition.RIGHT_VALUE
102
+ };
103
+ }
98
104
  }
99
- return {
100
- TYPE: EXPRESSION_TYPE_FIELD,
101
- NAME: condition.RIGHT_VALUE
102
- };
103
105
  }
104
106
  export function createParameterDetails(parameters) {
105
107
  const map = {};
@@ -5,24 +5,24 @@ export const NOTIFICATION_DASHBOARD_TABS = [
5
5
  id: 'rules',
6
6
  name: 'Rules',
7
7
  component: 'rule-management',
8
- right: 'NOTIFY_RULE_VIEW'
8
+ right: 'NotificationRuleView'
9
9
  },
10
10
  {
11
11
  id: 'templates',
12
12
  name: 'Templates',
13
13
  component: 'template-management',
14
- right: 'NOTIFICATION_RULE_TEMPLATE_VIEW'
14
+ right: 'NotificationRuleTemplateView'
15
15
  },
16
16
  {
17
17
  id: 'routes',
18
18
  name: 'Routes',
19
19
  component: 'route-management',
20
- right: 'NOTIFY_ROUTE_VIEW'
20
+ right: 'NotificationRouteView'
21
21
  },
22
22
  {
23
23
  id: 'notify-audit',
24
24
  name: 'Notify Audit',
25
25
  component: 'notify-audit-management',
26
- right: 'NOTIFY_AUDIT_VIEW'
26
+ right: 'NotificationAuditView'
27
27
  }
28
28
  ];
@@ -1,6 +1,6 @@
1
1
  export const NotifyPermission = {
2
- NOTIFY_RULE_VIEW: "NOTIFY_RULE_VIEW",
3
- NOTIFICATION_RULE_TEMPLATE_VIEW: "NOTIFICATION_RULE_TEMPLATE_VIEW",
4
- NOTIFY_ROUTE_VIEW: "NOTIFY_ROUTE_VIEW",
5
- NOTIFY_AUDIT_VIEW: "NOTIFY_AUDIT_VIEW",
2
+ NotificationRuleView: "NotificationRuleView",
3
+ NotificationRuleTemplateView: "NotificationRuleTemplateView",
4
+ NotificationRouteView: "NotificationRouteView",
5
+ NotificationAuditView: "NotificationAuditView",
6
6
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/pbc-notify-ui",
3
3
  "description": "Genesis PBC Notify UI",
4
- "version": "1.0.16",
4
+ "version": "1.0.18",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/dts/index.d.ts",