@genesislcap/pbc-notify-ui 1.0.36 → 1.0.37

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.
Files changed (22) hide show
  1. package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.d.ts.map +1 -1
  2. package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.d.ts.map +1 -1
  3. package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.d.ts.map +1 -1
  4. package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.d.ts.map +1 -1
  5. package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.d.ts.map +1 -1
  6. package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.d.ts.map +1 -1
  7. package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts.map +1 -1
  8. package/dist/dts/components/foundation-notification-dashboard/styles/condition-builder.styles.d.ts.map +1 -1
  9. package/dist/dts/components/foundation-notification-dashboard/styles/dynamic-rule.styles.d.ts.map +1 -1
  10. package/dist/dts/utils/toBoolean.d.ts +2 -0
  11. package/dist/dts/utils/toBoolean.d.ts.map +1 -0
  12. package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.js +24 -8
  13. package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.js +17 -8
  14. package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.js +1 -6
  15. package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.js +23 -9
  16. package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.js +15 -7
  17. package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.js +1 -6
  18. package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.utils.js +4 -3
  19. package/dist/esm/components/foundation-notification-dashboard/styles/condition-builder.styles.js +6 -0
  20. package/dist/esm/components/foundation-notification-dashboard/styles/dynamic-rule.styles.js +4 -0
  21. package/dist/esm/utils/toBoolean.js +6 -0
  22. package/package.json +1 -1
@@ -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,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAClF,OAAO,EACL,sBAAsB,EAGvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAMlE,qBAKa,oBAAqB,SAAQ,cAAc;IAC1C,SAAS,EAAE,sBAAsB,CAAC;IAClC,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAEhC,eAAe,EAAE,MAAM,CAAC;IAExB,aAAa,EAAE,MAAM,CAAuB;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IAErC,eAAe;IAIT,gBAAgB;IAatB,aAAa;IASb,OAAO,CAAC,eAAe;IAmBvB,gBAAgB;IAShB,gBAAgB;IAShB,sBAAsB;IActB,oBAAoB;IAsBpB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,qBAAqB;IAI7B,qBAAqB;IASrB,uBAAuB;CAQxB"}
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":"AACA,OAAO,EAAiB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAClF,OAAO,EACL,sBAAsB,EAGvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAMlE,qBAKa,oBAAqB,SAAQ,cAAc;IAC1C,SAAS,EAAE,sBAAsB,CAAC;IAClC,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAEhC,eAAe,EAAE,MAAM,CAAC;IAExB,aAAa,EAAE,MAAM,CAAuB;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IAErC,eAAe;IAIT,gBAAgB;IAetB,aAAa;IASb,OAAO,CAAC,eAAe;IAiBvB,gBAAgB;IAShB,gBAAgB;IAgBhB,sBAAsB;IActB,oBAAoB;IA0BpB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,qBAAqB;IAI7B,qBAAqB;IASrB,uBAAuB;CAQxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"rule-condition-builder.template.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,eAAO,MAAM,4BAA4B,2EA+ExC,CAAC"}
1
+ {"version":3,"file":"rule-condition-builder.template.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,eAAO,MAAM,4BAA4B,2EA2FxC,CAAC"}
@@ -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":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,kBAAkB,iEA0H9B,CAAC"}
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":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,kBAAkB,iEAqH9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"template-condition-builder.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AACxF,OAAO,EACL,sBAAsB,EAIvB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,qBAKa,wBAAyB,SAAQ,cAAc;IACpD,SAAS,EAAE,sBAAsB,CAAC;IAClC,UAAU,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEhB,SAAS,EAAE,GAAG,CAAC;IACf,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAEhC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAuB;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAE7C,eAAe;IAIT,gBAAgB;IAiBtB,iBAAiB;IAQjB,aAAa;IASb,sBAAsB;IAetB,OAAO,CAAC,eAAe;IAmBvB,gBAAgB;IAWhB,OAAO,CAAC,gBAAgB;IAcxB,oBAAoB;IAsBpB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,qBAAqB;IAI7B,qBAAqB;IASrB,uBAAuB;CASxB"}
1
+ {"version":3,"file":"template-condition-builder.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AACxF,OAAO,EACL,sBAAsB,EAIvB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,qBAKa,wBAAyB,SAAQ,cAAc;IACpD,SAAS,EAAE,sBAAsB,CAAC;IAClC,UAAU,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEhB,SAAS,EAAE,GAAG,CAAC;IACf,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAEhC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAuB;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAE7C,eAAe;IAIT,gBAAgB;IAetB,iBAAiB;IAQjB,aAAa;IASb,sBAAsB;IAetB,OAAO,CAAC,eAAe;IAiBvB,gBAAgB;IAkBhB,OAAO,CAAC,gBAAgB;IAcxB,oBAAoB;IA0BpB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,qBAAqB;IAI7B,qBAAqB;IASrB,uBAAuB;CASxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"template-condition-builder.template.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAE7E,eAAO,MAAM,gCAAgC,+EA2E5C,CAAC"}
1
+ {"version":3,"file":"template-condition-builder.template.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAE7E,eAAO,MAAM,gCAAgC,+EAsF5C,CAAC"}
@@ -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":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,sBAAsB,qEAyIlC,CAAC"}
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":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,sBAAsB,qEAoIlC,CAAC"}
@@ -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;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"}
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;AAG5B,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"condition-builder.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/foundation-notification-dashboard/styles/condition-builder.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,iDAqDlC,CAAC"}
1
+ {"version":3,"file":"condition-builder.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/foundation-notification-dashboard/styles/condition-builder.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,iDA2DlC,CAAC"}
@@ -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;AA8DF,eAAO,MAAM,uBAAuB,iDAoFnC,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;AAkEF,eAAO,MAAM,uBAAuB,iDAoFnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const toBoolean: (s: string) => any;
2
+ //# sourceMappingURL=toBoolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toBoolean.d.ts","sourceRoot":"","sources":["../../../src/utils/toBoolean.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,MAAO,MAAM,QAMlC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
+ import { FieldTypeEnum } from '@genesislcap/foundation-comms';
2
3
  import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
3
4
  import { LogicalOperator, nullAndBlankLogicalOperatorValues, } from '../../../../../../notify.types';
4
5
  import { logger } from '../../../../../../utils';
@@ -19,9 +20,11 @@ let RuleConditionBuilder = class RuleConditionBuilder extends GenesisElement {
19
20
  if (this.fields) {
20
21
  this.leftValueItems = this.fields;
21
22
  }
23
+ const rightValue = this.condition.RIGHT_VALUE;
22
24
  this.assignLeftValue();
23
25
  this.logicalOperator = this.condition.LOGICAL_OPERATOR;
24
26
  this.rightCriteria = this.condition.RIGHT_CRITERIA;
27
+ this.condition.RIGHT_VALUE = rightValue;
25
28
  this.assignRightValue();
26
29
  this.$emit('edit', this.condition);
27
30
  });
@@ -34,18 +37,20 @@ let RuleConditionBuilder = class RuleConditionBuilder extends GenesisElement {
34
37
  this.leftValue = JSON.stringify(this.leftValueItems[0]);
35
38
  }
36
39
  assignLeftValue() {
37
- // Add (fresh new; assign the 1st element)
40
+ var _a;
38
41
  if (!this.condition.LEFT_VALUE) {
42
+ // Add (fresh new; assign the 1st element)
39
43
  this.leftValue = JSON.stringify(this.leftValueItems[0]);
40
- return;
41
44
  }
42
- // Add (value changed)
43
- if (typeof this.condition.LEFT_VALUE !== 'string') {
45
+ else if (typeof this.condition.LEFT_VALUE !== 'string') {
46
+ // Add (value changed)
44
47
  this.leftValue = JSON.stringify(this.condition.LEFT_VALUE);
45
- return;
46
48
  }
47
- // Edit
48
- this.leftValue = JSON.stringify(this.leftValueItems.find((item) => item.FIELD_NAME === this.condition.LEFT_VALUE));
49
+ else {
50
+ // Edit
51
+ this.leftValue = JSON.stringify(this.leftValueItems.find((item) => item.FIELD_NAME === this.condition.LEFT_VALUE));
52
+ }
53
+ this.condition.LEFT_VALUE = JSON.parse((_a = this.leftValue) !== null && _a !== void 0 ? _a : '{}');
49
54
  }
50
55
  assignRightValue() {
51
56
  if (this.condition.RIGHT_CRITERIA === RightCriteria.VALUE) {
@@ -59,6 +64,12 @@ let RuleConditionBuilder = class RuleConditionBuilder extends GenesisElement {
59
64
  return;
60
65
  }
61
66
  this.condition.LEFT_VALUE = JSON.parse(this.leftValue);
67
+ if (this.condition.LEFT_VALUE.FIELD_TYPE === FieldTypeEnum.BOOLEAN) {
68
+ this.rightValueText = 'true';
69
+ }
70
+ else {
71
+ this.clearRightValueText();
72
+ }
62
73
  this.$emit('edit', this.condition);
63
74
  }
64
75
  logicalOperatorChanged() {
@@ -79,7 +90,12 @@ let RuleConditionBuilder = class RuleConditionBuilder extends GenesisElement {
79
90
  this.condition.RIGHT_CRITERIA = this.rightCriteria;
80
91
  switch (this.rightCriteria) {
81
92
  case RightCriteria.VALUE:
82
- this.clearRightValueText();
93
+ if (this.condition.LEFT_VALUE.FIELD_TYPE === FieldTypeEnum.BOOLEAN) {
94
+ this.rightValueText = 'true';
95
+ }
96
+ else {
97
+ this.clearRightValueText();
98
+ }
83
99
  break;
84
100
  case RightCriteria.FIELD:
85
101
  this.clearRightValueSelect();
@@ -1,5 +1,6 @@
1
+ import { FieldTypeEnum } from '@genesislcap/foundation-comms';
1
2
  import { sync } from '@genesislcap/foundation-utils';
2
- import { classNames, html, repeat, when } from '@genesislcap/web-core';
3
+ import { classNames, html, repeat, when, whenElse } from '@genesislcap/web-core';
3
4
  import { LogicalOperator, nullAndBlankLogicalOperatorValues } from '../../../../../../notify.types';
4
5
  import { RightCriteria } from './rule-condition-builder.types';
5
6
  export const RuleConditionBuilderTemplate = html `
@@ -28,17 +29,25 @@ export const RuleConditionBuilderTemplate = html `
28
29
 
29
30
  ${when((x) => !nullAndBlankLogicalOperatorValues.includes(LogicalOperator[x.logicalOperator]), html `
30
31
  <rapid-select class="right-criteria" :value=${sync((x) => x.rightCriteria)}>
31
- ${repeat((x) => Object.values(RightCriteria), html `
32
+ ${repeat((_) => Object.values(RightCriteria), html `
32
33
  <rapid-option value=${(x) => x}>${(x) => x}</rapid-option>
33
34
  `)}
34
35
  </rapid-select>
36
+
35
37
  ${when((x) => x.rightCriteria === RightCriteria.VALUE, html `
36
- <rapid-text-field
37
- class="right-criteria-text"
38
- :value=${sync((x) => x.rightValueText)}
39
- placeholder="Value"
40
- autocomplete="off"
41
- ></rapid-text-field>
38
+ ${whenElse((x) => { var _a; return JSON.parse((_a = x.leftValue) !== null && _a !== void 0 ? _a : '{}').FIELD_TYPE === FieldTypeEnum.BOOLEAN; }, html `
39
+ <rapid-select class="right-criteria-select" :value=${sync((x) => x.rightValueText)}>
40
+ <rapid-option value="true">true</rapid-option>
41
+ <rapid-option value="false">false</rapid-option>
42
+ </rapid-select>
43
+ `, html `
44
+ <rapid-text-field
45
+ class="right-criteria-text"
46
+ :value=${sync((x) => x.rightValueText)}
47
+ placeholder="Value"
48
+ autocomplete="off"
49
+ ></rapid-text-field>
50
+ `)}
42
51
  `)}
43
52
  ${when((x) => x.rightCriteria === RightCriteria.FIELD, html `
44
53
  <rapid-select class="right-criteria-select" :value=${sync((x) => x.rightValueSelect)}>
@@ -107,12 +107,7 @@ export const RuleDialogTemplate = html `
107
107
  </div>
108
108
 
109
109
  <div slot="bottom" class="dialog-bottom">
110
- <rapid-button
111
- appearance="accent"
112
- @click=${(x) => x.submit()}
113
- >
114
- Submit
115
- </rapid-button>
110
+ <rapid-button appearance="accent" @click=${(x) => x.submit()}>Submit</rapid-button>
116
111
  </div>
117
112
  </rapid-modal>
118
113
  `;
@@ -1,4 +1,5 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
+ import { FieldTypeEnum } from '@genesislcap/foundation-comms';
2
3
  import { attr, customElement, GenesisElement, observable } from '@genesislcap/web-core';
3
4
  import { LogicalOperator, RightCriteria, nullAndBlankLogicalOperatorValues, } from '../../../../../../notify.types';
4
5
  import { logger } from '../../../../../../utils';
@@ -20,9 +21,9 @@ let TemplateConditionBuilder = class TemplateConditionBuilder extends GenesisEle
20
21
  if (this.fields) {
21
22
  this.leftValueItems = this.fields;
22
23
  }
24
+ const rightValue = this.condition.RIGHT_VALUE;
23
25
  this.assignLeftValue();
24
26
  this.logicalOperator = this.condition.LOGICAL_OPERATOR;
25
- const rightValue = this.condition.RIGHT_VALUE;
26
27
  this.rightCriteria = this.condition.RIGHT_CRITERIA;
27
28
  this.condition.RIGHT_VALUE = rightValue;
28
29
  this.assignRightValue();
@@ -55,24 +56,32 @@ let TemplateConditionBuilder = class TemplateConditionBuilder extends GenesisEle
55
56
  }
56
57
  // #region LeftValue
57
58
  assignLeftValue() {
58
- // Add (fresh new; assign the 1st element)
59
+ var _a;
59
60
  if (!this.condition.LEFT_VALUE) {
61
+ // Add (fresh new; assign the 1st element)
60
62
  this.leftValue = JSON.stringify(this.leftValueItems[0]);
61
- return;
62
63
  }
63
- // Add (value changed)
64
- if (typeof this.condition.LEFT_VALUE !== 'string') {
64
+ else if (typeof this.condition.LEFT_VALUE !== 'string') {
65
+ // Add (value changed)
65
66
  this.leftValue = JSON.stringify(this.condition.LEFT_VALUE);
66
- return;
67
67
  }
68
- // Edit
69
- this.leftValue = JSON.stringify(this.leftValueItems.find((item) => item.FIELD_NAME === this.condition.LEFT_VALUE));
68
+ else {
69
+ // Edit
70
+ this.leftValue = JSON.stringify(this.leftValueItems.find((item) => item.FIELD_NAME === this.condition.LEFT_VALUE));
71
+ }
72
+ this.condition.LEFT_VALUE = JSON.parse((_a = this.leftValue) !== null && _a !== void 0 ? _a : '{}');
70
73
  }
71
74
  leftValueChanged() {
72
75
  if (!this.condition) {
73
76
  return;
74
77
  }
75
78
  this.condition.LEFT_VALUE = JSON.parse(this.leftValue);
79
+ if (this.condition.LEFT_VALUE.FIELD_TYPE === FieldTypeEnum.BOOLEAN) {
80
+ this.rightValueText = 'true';
81
+ }
82
+ else {
83
+ this.clearRightValueText();
84
+ }
76
85
  this.$emit('edit', this.condition);
77
86
  }
78
87
  // #endregion
@@ -96,7 +105,12 @@ let TemplateConditionBuilder = class TemplateConditionBuilder extends GenesisEle
96
105
  this.condition.RIGHT_CRITERIA = this.rightCriteria;
97
106
  switch (this.rightCriteria) {
98
107
  case RightCriteria.VALUE:
99
- this.clearRightValueText();
108
+ if (this.condition.LEFT_VALUE.FIELD_TYPE === FieldTypeEnum.BOOLEAN) {
109
+ this.rightValueText = 'true';
110
+ }
111
+ else {
112
+ this.clearRightValueText();
113
+ }
100
114
  break;
101
115
  case RightCriteria.USER_ENTRY:
102
116
  this.clearRightValueSelect();
@@ -1,5 +1,6 @@
1
+ import { FieldTypeEnum } from '@genesislcap/foundation-comms';
1
2
  import { sync } from '@genesislcap/foundation-utils';
2
- import { classNames, html, repeat, when } from '@genesislcap/web-core';
3
+ import { classNames, html, repeat, when, whenElse } from '@genesislcap/web-core';
3
4
  import { LogicalOperator, RightCriteria, nullAndBlankLogicalOperatorValues, } from '../../../../../../notify.types';
4
5
  export const TemplateConditionBuilderTemplate = html `
5
6
  <div class="condition-builder">
@@ -33,12 +34,19 @@ export const TemplateConditionBuilderTemplate = html `
33
34
  </rapid-select>
34
35
 
35
36
  ${when((x) => x.rightCriteria === RightCriteria.VALUE, html `
36
- <rapid-text-field
37
- class="right-criteria-text"
38
- :value=${sync((x) => x.rightValueText)}
39
- placeholder="Value"
40
- autocomplete="off"
41
- ></rapid-text-field>
37
+ ${whenElse((x) => { var _a; return JSON.parse((_a = x.leftValue) !== null && _a !== void 0 ? _a : '{}').FIELD_TYPE === FieldTypeEnum.BOOLEAN; }, html `
38
+ <rapid-select class="right-criteria-select" :value=${sync((x) => x.rightValueText)}>
39
+ <rapid-option value="true">true</rapid-option>
40
+ <rapid-option value="false">false</rapid-option>
41
+ </rapid-select>
42
+ `, html `
43
+ <rapid-text-field
44
+ class="right-criteria-text"
45
+ :value=${sync((x) => x.rightValueText)}
46
+ placeholder="Value"
47
+ autocomplete="off"
48
+ ></rapid-text-field>
49
+ `)}
42
50
  `)}
43
51
  ${when((x) => x.rightCriteria === RightCriteria.USER_ENTRY, html `
44
52
  <rapid-select class="right-criteria-select" :value=${sync((x) => x.rightValueSelect)}>
@@ -119,12 +119,7 @@ export const TemplateDialogTemplate = html `
119
119
  </div>
120
120
 
121
121
  <div slot="bottom" class="dialog-bottom">
122
- <rapid-button
123
- appearance="accent"
124
- @click=${(x) => x.submit()}
125
- >
126
- Submit
127
- </rapid-button>
122
+ <rapid-button appearance="accent" @click=${(x) => x.submit()}>Submit</rapid-button>
128
123
  </div>
129
124
  </rapid-modal>
130
125
  `;
@@ -4,6 +4,7 @@ import { showNotification } from '@genesislcap/foundation-notifications';
4
4
  import { UUID } from '@genesislcap/foundation-utils';
5
5
  import { EmptyValue, ExpressionType, LogicalOperator, ParamSourceType, ParamType, RightCriteria, nullAndBlankLogicalOperatorValues, } from '../../notify.types';
6
6
  import { logger } from '../../utils';
7
+ import { toBoolean } from '../../utils/toBoolean';
7
8
  export class UUIDGenerator {
8
9
  }
9
10
  _a = UUIDGenerator;
@@ -74,7 +75,7 @@ class ConditionUtils {
74
75
  case 'BOOLEAN':
75
76
  return {
76
77
  TYPE: 'BOOLEAN',
77
- VALUE: condition.RIGHT_VALUE,
78
+ VALUE: toBoolean(condition.RIGHT_VALUE),
78
79
  };
79
80
  case 'STRING':
80
81
  case 'ENUM':
@@ -171,7 +172,7 @@ export class TemplateUtils {
171
172
  return parameters.find((parameter) => parameter.PARAM_NAME === condition.RIGHT.KEY).UUID;
172
173
  }
173
174
  // If value is null, then NAME is filled
174
- return (_b = condition.RIGHT.VALUE) !== null && _b !== void 0 ? _b : condition.RIGHT.NAME;
175
+ return String((_b = condition.RIGHT.VALUE) !== null && _b !== void 0 ? _b : condition.RIGHT.NAME);
175
176
  }
176
177
  static getConditions(conditions, parameters) {
177
178
  return conditions.map((condition) => {
@@ -226,7 +227,7 @@ export class RuleUtils {
226
227
  return condition.RIGHT.KEY;
227
228
  }
228
229
  // If value is null, then NAME is filled
229
- return (_b = condition.RIGHT.VALUE) !== null && _b !== void 0 ? _b : condition.RIGHT.NAME;
230
+ return String((_b = condition.RIGHT.VALUE) !== null && _b !== void 0 ? _b : condition.RIGHT.NAME);
230
231
  }
231
232
  static getConditions(conditions) {
232
233
  return conditions.map((condition) => {
@@ -14,10 +14,16 @@ export const ConditionBuilderStyles = css `
14
14
  margin: 0;
15
15
  display: flex;
16
16
  justify-content: center;
17
+ height: calc(var(--design-unit) * 9px);
17
18
  }
18
19
 
19
20
  rapid-text-field {
20
21
  width: 100%;
22
+ margin-bottom: 0;
23
+ }
24
+
25
+ rapid-text-field::part(root) {
26
+ height: calc(var(--design-unit) * 9px);
21
27
  }
22
28
 
23
29
  rapid-select {
@@ -69,6 +69,10 @@ const select = css `
69
69
  rapid-multiselect {
70
70
  max-height: 40px;
71
71
  }
72
+
73
+ rapid-multiselect::part(input) {
74
+ height: calc((var(--design-unit) * 9px) - 2px);
75
+ }
72
76
  `;
73
77
  export const DynamicRuleDialogStyles = css `
74
78
  ${top}
@@ -0,0 +1,6 @@
1
+ export const toBoolean = (s) => {
2
+ if (!s) {
3
+ return false;
4
+ }
5
+ return JSON.parse(s.toLowerCase());
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.36",
4
+ "version": "1.0.37",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "workspaces": [
7
7
  "client"