@projectcaluma/ember-distribution 12.5.0 → 12.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ export default class DistributionAbility extends Ability {
14
14
  get canSendInquiries() {
15
15
  return (
16
16
  !this.config.ui.readonly &&
17
- (this.config.permissions.sendInquiry?.(null) ?? true) &&
17
+ (this.config.permissions.sendInquiry?.(this.distribution) ?? true) &&
18
18
  this.distribution.controls.value?.send.edges.filter(
19
19
  hasStatus("SUSPENDED"),
20
20
  ).length > 0
@@ -24,7 +24,7 @@ export default class DistributionAbility extends Ability {
24
24
  get canCreateInquiry() {
25
25
  return (
26
26
  !this.config.ui.readonly &&
27
- (this.config.permissions.createInquiry?.() ?? true) &&
27
+ (this.config.permissions.createInquiry?.(this.distribution) ?? true) &&
28
28
  this.distribution.controls.value?.create.edges.filter(hasStatus("READY"))
29
29
  .length > 0
30
30
  );
@@ -33,7 +33,7 @@ export default class DistributionAbility extends Ability {
33
33
  get canCheckInquiries() {
34
34
  return (
35
35
  !this.config.ui.readonly &&
36
- (this.config.permissions.checkInquiries?.() ?? true) &&
36
+ (this.config.permissions.checkInquiries?.(this.distribution) ?? true) &&
37
37
  this.distribution.controls.value?.check.edges.filter(hasStatus("READY"))
38
38
  .length > 0
39
39
  );
@@ -42,7 +42,8 @@ export default class DistributionAbility extends Ability {
42
42
  get canComplete() {
43
43
  return (
44
44
  !this.config.ui.readonly &&
45
- (this.config.permissions.completeDistribution?.() ?? true) &&
45
+ (this.config.permissions.completeDistribution?.(this.distribution) ??
46
+ true) &&
46
47
  this.distribution.controls.value?.complete.edges.filter(
47
48
  hasStatus("READY"),
48
49
  ).length > 0
@@ -52,7 +53,8 @@ export default class DistributionAbility extends Ability {
52
53
  get canReopen() {
53
54
  return (
54
55
  !this.config.ui.readonly &&
55
- (this.config.permissions.reopenDistribution?.() ?? true) &&
56
+ (this.config.permissions.reopenDistribution?.(this.distribution) ??
57
+ true) &&
56
58
  this.distribution.controls.value?.case.edges[0]?.node.parentWorkItem.addressedGroups
57
59
  .map(String)
58
60
  .includes(String(this.calumaOptions.currentGroupId)) &&
@@ -59,7 +59,12 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
59
59
 
60
60
  return this.args.type === "answer"
61
61
  ? this.args.inquiry.childCase.document.info.edges
62
- .filter((edge) => !isEmpty(edge.node.value))
62
+ .filter(
63
+ (edge) =>
64
+ !isEmpty(edge.node.value) ||
65
+ !isEmpty(edge.node.selectedOption) ||
66
+ !isEmpty(edge.node.selectedOptions),
67
+ )
63
68
  .sort(
64
69
  (a, b) =>
65
70
  questions.indexOf(a.node.question.slug) -
@@ -67,7 +72,11 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
67
72
  )
68
73
  .map((edge) => ({
69
74
  question: edge.node.question.label,
70
- value: edge.node.value,
75
+ value: edge.node.selectedOption // single choice answer
76
+ ? edge.node.selectedOption.label
77
+ : edge.node.selectedOptions // multiple choice answer
78
+ ? edge.node.selectedOptions.edges.map((edge) => edge.node.label)
79
+ : edge.node.value, // regular answer
71
80
  }))
72
81
  : null;
73
82
  }
@@ -1,8 +1,16 @@
1
- <p class="cd-truncated" ...attributes>
2
- {{~this.displayedText~}}
3
- {{#if this.truncate}}
4
- <a href="" {{on "click" this.toggleExpand}}>
5
- {{~t (concat "caluma.distribution." (if this.expand "less" "more"))~}}
6
- </a>
7
- {{/if}}
8
- </p>
1
+ {{#if (is-array @text)}}
2
+ <UkList @bullet={{true}} class="uk-margin-remove" ...attributes as |list|>
3
+ {{#each @text as |item|}}
4
+ <list.item>{{item}}</list.item>
5
+ {{/each}}
6
+ </UkList>
7
+ {{else}}
8
+ <p class="cd-truncated" ...attributes>
9
+ {{~this.displayedText~}}
10
+ {{#if this.truncate}}
11
+ <a href="" {{on "click" this.toggleExpand}}>
12
+ {{~t (concat "caluma.distribution." (if this.expand "less" "more"))~}}
13
+ </a>
14
+ {{/if}}
15
+ </p>
16
+ {{/if}}
@@ -52,6 +52,18 @@ fragment InquiryAnswer on Document {
52
52
  }
53
53
  ... on StringAnswer {
54
54
  value
55
+ selectedOption {
56
+ label
57
+ }
58
+ }
59
+ ... on ListAnswer {
60
+ selectedOptions {
61
+ edges {
62
+ node {
63
+ label
64
+ }
65
+ }
66
+ }
55
67
  }
56
68
  }
57
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "12.5.0",
3
+ "version": "12.6.0",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -34,9 +34,9 @@
34
34
  "lodash.merge": "^4.6.2",
35
35
  "luxon": "^3.3.0",
36
36
  "tracked-toolbox": "^2.0.0",
37
- "@projectcaluma/ember-core": "^12.5.0",
38
- "@projectcaluma/ember-form": "^12.5.0",
39
- "@projectcaluma/ember-workflow": "^12.5.0"
37
+ "@projectcaluma/ember-core": "^12.6.0",
38
+ "@projectcaluma/ember-form": "^12.6.0",
39
+ "@projectcaluma/ember-workflow": "^12.6.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@ember/optional-features": "2.0.0",
@@ -65,8 +65,8 @@
65
65
  "qunit-dom": "2.0.0",
66
66
  "sass": "1.66.0",
67
67
  "uikit": "3.16.26",
68
- "webpack": "5.88.2",
69
- "@projectcaluma/ember-testing": "12.5.0"
68
+ "webpack": "5.89.0",
69
+ "@projectcaluma/ember-testing": "12.6.0"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "ember-engines": "^0.9.0",