@projectcaluma/ember-distribution 12.1.0 → 12.3.0

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.
@@ -16,7 +16,7 @@ export default class DistributionAbility extends Ability {
16
16
  !this.config.ui.readonly &&
17
17
  (this.config.permissions.sendInquiry?.(null) ?? true) &&
18
18
  this.distribution.controls.value?.send.edges.filter(
19
- hasStatus("SUSPENDED")
19
+ hasStatus("SUSPENDED"),
20
20
  ).length > 0
21
21
  );
22
22
  }
@@ -44,7 +44,7 @@ export default class DistributionAbility extends Ability {
44
44
  !this.config.ui.readonly &&
45
45
  (this.config.permissions.completeDistribution?.() ?? true) &&
46
46
  this.distribution.controls.value?.complete.edges.filter(
47
- hasStatus("READY")
47
+ hasStatus("READY"),
48
48
  ).length > 0
49
49
  );
50
50
  }
@@ -91,7 +91,7 @@ export default class InquiryAbility extends Ability {
91
91
  this.model.childCase.workItems.edges.some(
92
92
  (edge) =>
93
93
  edge.node.status === "READY" &&
94
- edge.node.task.__typename === "CompleteWorkflowFormTask"
94
+ edge.node.task.__typename === "CompleteWorkflowFormTask",
95
95
  )
96
96
  );
97
97
  }
@@ -102,7 +102,7 @@ export default class InquiryAbility extends Ability {
102
102
  this.hasCustomPermission(
103
103
  "completeInquiryChildWorkItem",
104
104
  this.model,
105
- this.task
105
+ this.task,
106
106
  )
107
107
  );
108
108
  }
@@ -123,7 +123,7 @@ export default class InquiryAbility extends Ability {
123
123
  this.isReady &&
124
124
  this.isControlling &&
125
125
  DateTime.fromISO(
126
- this.model.document?.deadline.edges[0]?.node.value
126
+ this.model.document?.deadline.edges[0]?.node.value,
127
127
  ).diffNow("days").days <= 0 &&
128
128
  this.hasCustomPermission("sendReminder", this.model)
129
129
  );
@@ -47,7 +47,7 @@ export default class CdInquiryAnswerFormComponent extends Component {
47
47
  return this.abilities.can(
48
48
  "complete child work item of inquiry",
49
49
  this.inquiry,
50
- { task: edge.node.task.slug }
50
+ { task: edge.node.task.slug },
51
51
  )
52
52
  ? {
53
53
  workItemId: decodeId(edge.node.id),
@@ -80,7 +80,7 @@ export default class CdInquiryAnswerFormComponent extends Component {
80
80
  deadlineQuestion: this.config.inquiry.deadlineQuestion,
81
81
  },
82
82
  },
83
- "allWorkItems.edges"
83
+ "allWorkItems.edges",
84
84
  );
85
85
  }
86
86
 
@@ -107,7 +107,7 @@ export default class CdInquiryAnswerFormComponent extends Component {
107
107
  yield this.router.transitionTo("inquiry.index");
108
108
  } catch (error) {
109
109
  this.notification.danger(
110
- this.intl.t("caluma.distribution.answer.complete-error")
110
+ this.intl.t("caluma.distribution.answer.complete-error"),
111
111
  );
112
112
  }
113
113
  }
@@ -63,7 +63,7 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
63
63
  .sort(
64
64
  (a, b) =>
65
65
  questions.indexOf(a.node.question.slug) -
66
- questions.indexOf(b.node.question.slug)
66
+ questions.indexOf(b.node.question.slug),
67
67
  )
68
68
  .map((edge) => ({
69
69
  question: edge.node.question.label,
@@ -90,7 +90,7 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
90
90
  });
91
91
  } catch (error) {
92
92
  this.notification.danger(
93
- this.intl.t("caluma.distribution.withdraw.error")
93
+ this.intl.t("caluma.distribution.withdraw.error"),
94
94
  );
95
95
  }
96
96
  }
@@ -102,7 +102,7 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
102
102
  /* istanbul ignore next */
103
103
  if (
104
104
  !(yield confirm(
105
- this.intl.t("caluma.distribution.reopen-inquiry.confirm")
105
+ this.intl.t("caluma.distribution.reopen-inquiry.confirm"),
106
106
  ))
107
107
  ) {
108
108
  return;
@@ -119,7 +119,7 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
119
119
  });
120
120
  } catch (error) {
121
121
  this.notification.danger(
122
- this.intl.t("caluma.distribution.reopen-inquiry.error")
122
+ this.intl.t("caluma.distribution.reopen-inquiry.error"),
123
123
  );
124
124
  }
125
125
  }
@@ -134,11 +134,11 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
134
134
 
135
135
  try {
136
136
  yield this.calumaOptions.sendReminderDistributionInquiry(
137
- decodeId(this.args.inquiry.id)
137
+ decodeId(this.args.inquiry.id),
138
138
  );
139
139
 
140
140
  this.notification.success(
141
- this.intl.t("caluma.distribution.reminder.success")
141
+ this.intl.t("caluma.distribution.reminder.success"),
142
142
  );
143
143
 
144
144
  yield this.apollo.mutate({
@@ -156,7 +156,7 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
156
156
  });
157
157
  } catch (error) {
158
158
  this.notification.danger(
159
- this.intl.t("caluma.distribution.reminder.error")
159
+ this.intl.t("caluma.distribution.reminder.error"),
160
160
  );
161
161
  }
162
162
  }
@@ -28,7 +28,7 @@ export default class CdInquiryDialogComponent extends Component {
28
28
  .map((edge) => edge.node)
29
29
  .filter(
30
30
  // suspended inquiries should only be visible to its creator
31
- (node) => this.currentGroupIsCreator || node.status !== "SUSPENDED"
31
+ (node) => this.currentGroupIsCreator || node.status !== "SUSPENDED",
32
32
  );
33
33
  }
34
34
 
@@ -92,7 +92,7 @@ export default class CdInquiryDialogComponent extends Component {
92
92
  from: this.args.from,
93
93
  to: this.args.to,
94
94
  },
95
- decodeId(this.inquiries[0].id)
95
+ decodeId(this.inquiries[0].id),
96
96
  );
97
97
  }
98
98
  }
@@ -31,7 +31,7 @@ export default class CdInquiryEditFormComponent extends Component {
31
31
  query: inquiryEditQuery,
32
32
  variables: { inquiry },
33
33
  },
34
- "allWorkItems.edges"
34
+ "allWorkItems.edges",
35
35
  );
36
36
  }
37
37
 
@@ -50,7 +50,7 @@ export default class CdInquiryEditFormComponent extends Component {
50
50
  yield this.router.transitionTo("inquiry.index");
51
51
  } catch (error) {
52
52
  this.notification.danger(
53
- this.intl.t("caluma.distribution.edit.send-error")
53
+ this.intl.t("caluma.distribution.edit.send-error"),
54
54
  );
55
55
  }
56
56
  }
@@ -100,7 +100,7 @@ export default class CdInquiryNewFormBulkEditComponent extends Component {
100
100
  const firstCreated = this.distribution.navigation.value.controlling.edges
101
101
  .map((edge) => edge.node)
102
102
  .find((node) =>
103
- node.addressedGroups.includes(String(this.args.selectedGroups[0]))
103
+ node.addressedGroups.includes(String(this.args.selectedGroups[0])),
104
104
  );
105
105
 
106
106
  // transition to inquiry addressed to the first selected group
@@ -110,7 +110,7 @@ export default class CdInquiryNewFormBulkEditComponent extends Component {
110
110
  from: firstCreated.controllingGroups[0],
111
111
  to: firstCreated.addressedGroups[0],
112
112
  },
113
- decodeId(firstCreated.id)
113
+ decodeId(firstCreated.id),
114
114
  );
115
115
  }
116
116
  }
@@ -35,7 +35,7 @@ export default class CdInquiryNewFormSelectComponent extends Component {
35
35
  @action
36
36
  updateSelectedGroups(identifier) {
37
37
  this.args.onChangeSelectedGroups(
38
- toggle(identifier, this.args.selectedGroups)
38
+ toggle(identifier, this.args.selectedGroups),
39
39
  );
40
40
  }
41
41
 
@@ -60,7 +60,7 @@ export default class CdInquiryNewFormSelectComponent extends Component {
60
60
 
61
61
  const typedGroups = yield this.calumaOptions.fetchTypedGroups(
62
62
  types,
63
- search
63
+ search,
64
64
  );
65
65
 
66
66
  return Object.entries(typedGroups)
@@ -33,7 +33,7 @@ export default class CdNavigationControlsComponent extends Component {
33
33
  task: this.config.inquiry.task,
34
34
  },
35
35
  },
36
- "allWorkItems.totalCount"
36
+ "allWorkItems.totalCount",
37
37
  );
38
38
 
39
39
  confirmText =
@@ -64,7 +64,7 @@ export default class CdNavigationControlsComponent extends Component {
64
64
  this.router.transitionTo("index");
65
65
  } catch (e) {
66
66
  this.notification.danger(
67
- this.intl.t("caluma.distribution.complete-error")
67
+ this.intl.t("caluma.distribution.complete-error"),
68
68
  );
69
69
  }
70
70
  }
@@ -77,7 +77,7 @@ export default class CdNavigationControlsComponent extends Component {
77
77
  }
78
78
 
79
79
  const distributionWorkItemId = decodeId(
80
- this.distribution.controls.value?.case.edges[0]?.node.parentWorkItem.id
80
+ this.distribution.controls.value?.case.edges[0]?.node.parentWorkItem.id,
81
81
  );
82
82
 
83
83
  yield this.apollo.mutate({
@@ -100,13 +100,13 @@ export default class CdNavigationControlsComponent extends Component {
100
100
  mutation: completeWorkItemMutation,
101
101
  variables: {
102
102
  workItem: decodeId(
103
- this.distribution.controls.value?.check.edges[0]?.node.id
103
+ this.distribution.controls.value?.check.edges[0]?.node.id,
104
104
  ),
105
105
  },
106
106
  });
107
107
  } catch (e) {
108
108
  this.notification.danger(
109
- this.intl.t("caluma.distribution.check-inquiries-error")
109
+ this.intl.t("caluma.distribution.check-inquiries-error"),
110
110
  );
111
111
  }
112
112
  }
@@ -15,7 +15,7 @@ export default class CdNavigationSectionComponent extends Component {
15
15
  this.router.isActive("inquiry", {
16
16
  to: inquiry.addressedGroups[0],
17
17
  from: inquiry.controllingGroups[0],
18
- })
18
+ }),
19
19
  ) !== undefined
20
20
  );
21
21
  }
package/addon/config.js CHANGED
@@ -109,7 +109,7 @@ export default function config(target, property) {
109
109
  hooks: {},
110
110
  enableReminders: true,
111
111
  },
112
- getOwner(this).lookup("service:calumaOptions")?.distribution ?? {}
112
+ getOwner(this).lookup("service:calumaOptions")?.distribution ?? {},
113
113
  );
114
114
  },
115
115
  });
@@ -90,7 +90,7 @@ export default class DistributionService extends Service {
90
90
  ...edge.node.controllingGroups,
91
91
  ]);
92
92
  })
93
- .flat(2)
93
+ .flat(2),
94
94
  ),
95
95
  ];
96
96
 
@@ -125,7 +125,7 @@ export default class DistributionService extends Service {
125
125
  yield this.refetch();
126
126
  } catch (e) {
127
127
  this.notification.danger(
128
- this.intl.t("caluma.distribution.new.error", { count: groups.length })
128
+ this.intl.t("caluma.distribution.new.error", { count: groups.length }),
129
129
  );
130
130
  }
131
131
  }
@@ -136,7 +136,7 @@ export default class DistributionService extends Service {
136
136
  const group = this.scheduler.groupCache.find((group) =>
137
137
  identifiers
138
138
  .map(String)
139
- .includes(String(group[this.calumaOptions.groupIdentifierProperty]))
139
+ .includes(String(group[this.calumaOptions.groupIdentifierProperty])),
140
140
  );
141
141
 
142
142
  return group?.[this.calumaOptions.groupNameProperty] ?? "";
@@ -157,9 +157,9 @@ export default class DistributionService extends Service {
157
157
  // can sort by them
158
158
  addressedGroupName: findGroupName(edge.node.addressedGroups),
159
159
  controllingGroupName: findGroupName(
160
- edge.node.controllingGroups
160
+ edge.node.controllingGroups,
161
161
  ),
162
- }))
162
+ })),
163
163
  ).sort((a, b) => {
164
164
  const sortProperty =
165
165
  key === "addressed"
@@ -171,7 +171,7 @@ export default class DistributionService extends Service {
171
171
  : [],
172
172
  };
173
173
  },
174
- {}
174
+ {},
175
175
  );
176
176
  }
177
177
 
@@ -184,7 +184,7 @@ export default class DistributionService extends Service {
184
184
  if (
185
185
  ids.length &&
186
186
  !(yield confirm(
187
- this.intl.t("caluma.distribution.send-confirm", { count: ids.length })
187
+ this.intl.t("caluma.distribution.send-confirm", { count: ids.length }),
188
188
  ))
189
189
  ) {
190
190
  return;
@@ -199,7 +199,7 @@ export default class DistributionService extends Service {
199
199
  status
200
200
  }
201
201
  }
202
- `
202
+ `,
203
203
  );
204
204
 
205
205
  const mutation = gql`mutation SendInquiries {${mutations.join("\n")}}`;
@@ -7,11 +7,11 @@ function decorator(
7
7
  target,
8
8
  key,
9
9
  desc,
10
- { inquiryProperty = "args.inquiry" } = {}
10
+ { inquiryProperty = "args.inquiry" } = {},
11
11
  ) {
12
12
  assert(
13
13
  `The @projectcaluma/ember-distribution config must be injected in order to use @inquiryAnswerStatus: \`@config config\``,
14
- Object.prototype.hasOwnProperty.call(target, "config")
14
+ Object.prototype.hasOwnProperty.call(target, "config"),
15
15
  );
16
16
 
17
17
  return {
@@ -23,7 +23,7 @@ function decorator(
23
23
  .map((edge) => edge.node.task.slug) ?? [];
24
24
 
25
25
  const buttonConfig = Object.entries(
26
- this.config.inquiry.answer.buttons
26
+ this.config.inquiry.answer.buttons,
27
27
  ).find(([task]) => readyWorkItems.includes(task))?.[1];
28
28
 
29
29
  return buttonConfig?.status
@@ -8,11 +8,11 @@ function decorator(
8
8
  target,
9
9
  key,
10
10
  desc,
11
- { inquiryProperty = "args.inquiry" } = {}
11
+ { inquiryProperty = "args.inquiry" } = {},
12
12
  ) {
13
13
  assert(
14
14
  `The @projectcaluma/ember-distribution config must be injected in order to use @inquiryDeadline: \`@config config\``,
15
- Object.prototype.hasOwnProperty.call(target, "config")
15
+ Object.prototype.hasOwnProperty.call(target, "config"),
16
16
  );
17
17
 
18
18
  return {
@@ -20,7 +20,7 @@ function decorator(
20
20
  const inquiry = get(this, inquiryProperty);
21
21
  const value = inquiry.document?.deadline.edges[0]?.node.value;
22
22
  const isDone = ["COMPLETED", "SKIPPED", "CANCELED"].includes(
23
- inquiry.status
23
+ inquiry.status,
24
24
  );
25
25
 
26
26
  const diff = DateTime.fromISO(value).diffNow("days").days;
@@ -8,16 +8,16 @@ function decorator(
8
8
  target,
9
9
  key,
10
10
  desc,
11
- { inquiryProperty = "args.inquiry", inquiryTypeProperty = "args.type" } = {}
11
+ { inquiryProperty = "args.inquiry", inquiryTypeProperty = "args.type" } = {},
12
12
  ) {
13
13
  assert(
14
14
  `The @projectcaluma/ember-distribution config must be injected in order to use @inquiryStatus: \`@config config\``,
15
- Object.prototype.hasOwnProperty.call(target, "config")
15
+ Object.prototype.hasOwnProperty.call(target, "config"),
16
16
  );
17
17
 
18
18
  assert(
19
19
  `The intl service must be injected in order to use @inquiryStatus: \`@service intl\``,
20
- Object.prototype.hasOwnProperty.call(target, "intl")
20
+ Object.prototype.hasOwnProperty.call(target, "intl"),
21
21
  );
22
22
 
23
23
  return {
@@ -12,7 +12,7 @@ export default function uniqueByGroups(workItems) {
12
12
  workItem,
13
13
  ];
14
14
  })
15
- .reverse()
15
+ .reverse(),
16
16
  ).values(),
17
17
  ];
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "12.1.0",
3
+ "version": "12.3.0",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@ember/legacy-built-in-components": "^0.4.2",
14
14
  "@ember/string": "^3.1.1",
15
- "@embroider/macros": "^1.11.1",
15
+ "@embroider/macros": "^1.13.0",
16
16
  "@glimmer/component": "^1.1.2",
17
17
  "@glimmer/tracking": "^1.1.2",
18
18
  "ember-apollo-client": "~4.0.2",
@@ -20,13 +20,13 @@
20
20
  "ember-can": "^4.2.0",
21
21
  "ember-cli-babel": "^7.26.11",
22
22
  "ember-cli-htmlbars": "^6.2.0",
23
- "ember-concurrency": "^2.3.7",
23
+ "ember-concurrency": "^3.0.0",
24
24
  "ember-engines-router-service": "^0.3.0",
25
25
  "ember-fetch": "^8.1.2",
26
26
  "ember-flatpickr": "^4.0.0",
27
27
  "ember-intl": "^5.7.2",
28
- "ember-resources": "^5.6.4",
29
- "ember-svg-jar": "^2.4.2",
28
+ "ember-resources": "^6.3.1",
29
+ "ember-svg-jar": "^2.4.3",
30
30
  "ember-test-selectors": "^6.0.0",
31
31
  "ember-uikit": "^8.0.0",
32
32
  "graphql": "^15.8.0",
@@ -34,13 +34,13 @@
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.1.0",
38
- "@projectcaluma/ember-form": "^12.1.0",
39
- "@projectcaluma/ember-workflow": "^12.1.0"
37
+ "@projectcaluma/ember-core": "^12.3.0",
38
+ "@projectcaluma/ember-form": "^12.3.0",
39
+ "@projectcaluma/ember-workflow": "^12.3.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@ember/optional-features": "2.0.0",
43
- "@ember/test-helpers": "3.1.0",
43
+ "@ember/test-helpers": "3.2.0",
44
44
  "@embroider/test-setup": "3.0.1",
45
45
  "@faker-js/faker": "8.0.2",
46
46
  "broccoli-asset-rev": "3.0.0",
@@ -55,18 +55,18 @@
55
55
  "ember-engines": "0.9.0",
56
56
  "ember-load-initializers": "2.1.2",
57
57
  "ember-qunit": "7.0.0",
58
- "ember-resolver": "10.1.1",
59
- "ember-source": "4.12.0",
58
+ "ember-resolver": "11.0.0",
59
+ "ember-source": "4.12.3",
60
60
  "ember-source-channel-url": "3.0.0",
61
61
  "ember-try": "2.0.0",
62
62
  "loader.js": "4.7.0",
63
63
  "miragejs": "0.1.47",
64
64
  "qunit": "2.19.4",
65
65
  "qunit-dom": "2.0.0",
66
- "sass": "1.63.4",
67
- "uikit": "3.16.22",
68
- "webpack": "5.87.0",
69
- "@projectcaluma/ember-testing": "12.1.0"
66
+ "sass": "1.66.0",
67
+ "uikit": "3.16.23",
68
+ "webpack": "5.88.2",
69
+ "@projectcaluma/ember-testing": "12.3.0"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "ember-engines": "^0.9.0",