@projectcaluma/ember-distribution 11.0.0-beta.32 → 11.0.0-beta.34
Sign up to get free protection for your applications and to get access to all the features.
- package/addon/components/cd-document-header.hbs +2 -2
- package/addon/components/cd-inquiry-answer-form.hbs +2 -0
- package/addon/components/cd-inquiry-answer-form.js +6 -3
- package/addon/components/cd-inquiry-dialog/inquiry-part.hbs +27 -21
- package/addon/components/cd-inquiry-dialog/inquiry-part.js +20 -0
- package/addon/components/cd-inquiry-dialog.js +7 -1
- package/addon/components/cd-navigation/status-indicator.js +4 -1
- package/addon/config.js +18 -8
- package/addon/gql/mutations/complete-inquiry-work-item.graphql +26 -6
- package/addon/gql/queries/inquiry-answer.graphql +1 -3
- package/addon/gql/queries/inquiry-dialog.graphql +1 -1
- package/addon/gql/queries/inquiry-edit.graphql +0 -2
- package/addon/gql/queries/navigation.graphql +4 -1
- package/addon/services/distribution.js +1 -18
- package/addon/utils/inquiry-answer-status.js +3 -1
- package/addon/utils/inquiry-status.js +39 -2
- package/package.json +8 -8
- package/translations/de.yaml +2 -1
- package/translations/en.yaml +2 -1
- package/translations/fr.yaml +2 -1
@@ -1,11 +1,11 @@
|
|
1
1
|
<div class="uk-text-large uk-flex uk-flex-middle" data-test-document-header>
|
2
|
-
<div class="uk-width-expand">
|
2
|
+
<div class="uk-width-expand uk-flex-inline uk-flex-middle">
|
3
3
|
{{@name}}
|
4
4
|
{{#if @group}}
|
5
5
|
({{group-name @group}})
|
6
6
|
{{/if}}
|
7
7
|
{{#if @status}}
|
8
|
-
<UkLabel @label={{@status}} class="uk-margin-left" />
|
8
|
+
<UkLabel @label={{@status}} class="uk-margin-left uk-text-default" />
|
9
9
|
{{/if}}
|
10
10
|
</div>
|
11
11
|
{{yield}}
|
@@ -92,6 +92,7 @@
|
|
92
92
|
@onClick={{fn
|
93
93
|
(perform this.completeWorkItem)
|
94
94
|
buttonConfig.workItemId
|
95
|
+
buttonConfig.willCompleteInquiry
|
95
96
|
validate
|
96
97
|
}}
|
97
98
|
>{{buttonConfig.label}}</UkButton>
|
@@ -115,6 +116,7 @@
|
|
115
116
|
@onClick={{fn
|
116
117
|
(perform this.completeWorkItem)
|
117
118
|
buttonConfig.workItemId
|
119
|
+
buttonConfig.willCompleteInquiry
|
118
120
|
null
|
119
121
|
}}
|
120
122
|
>{{buttonConfig.label}}</UkButton>
|
@@ -2,7 +2,7 @@ import { action } from "@ember/object";
|
|
2
2
|
import { inject as service } from "@ember/service";
|
3
3
|
import Component from "@glimmer/component";
|
4
4
|
import { tracked } from "@glimmer/tracking";
|
5
|
-
import { queryManager
|
5
|
+
import { queryManager } from "ember-apollo-client";
|
6
6
|
import { dropTask } from "ember-concurrency";
|
7
7
|
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
8
8
|
|
@@ -55,6 +55,7 @@ export default class CdInquiryAnswerFormComponent extends Component {
|
|
55
55
|
isFormButton:
|
56
56
|
edge.node.task.__typename === "CompleteWorkflowFormTask",
|
57
57
|
label: this.intl.t(config.label),
|
58
|
+
willCompleteInquiry: config.willCompleteInquiry ?? false,
|
58
59
|
}
|
59
60
|
: null;
|
60
61
|
})
|
@@ -84,7 +85,7 @@ export default class CdInquiryAnswerFormComponent extends Component {
|
|
84
85
|
}
|
85
86
|
|
86
87
|
@dropTask
|
87
|
-
*completeWorkItem(workItem, validate = () => true) {
|
88
|
+
*completeWorkItem(workItem, willCompleteInquiry, validate = () => true) {
|
88
89
|
try {
|
89
90
|
if (typeof validate === "function" && !(yield validate())) return;
|
90
91
|
|
@@ -95,12 +96,14 @@ export default class CdInquiryAnswerFormComponent extends Component {
|
|
95
96
|
statusQuestion: this.config.inquiry.answer.statusQuestion,
|
96
97
|
buttonTasks: Object.keys(this.config.inquiry.answer.buttons),
|
97
98
|
checkTask: this.config.controls.checkTask,
|
99
|
+
createTask: this.config.controls.createTask,
|
100
|
+
inquiryTask: this.config.inquiry.task,
|
98
101
|
currentGroup: String(this.calumaOptions.currentGroupId),
|
99
102
|
answerInfoQuestions: this.config.inquiry.answer.infoQuestions,
|
103
|
+
willCompleteInquiry,
|
100
104
|
},
|
101
105
|
});
|
102
106
|
|
103
|
-
yield getObservable(this._inquiry.value)?.refetch();
|
104
107
|
yield this.router.transitionTo("inquiry.index");
|
105
108
|
} catch (error) {
|
106
109
|
this.notification.danger(
|
@@ -2,14 +2,15 @@
|
|
2
2
|
<div class="uk-flex uk-flex-middle uk-text-large" data-test-title>
|
3
3
|
{{#if (eq @type "request")}}
|
4
4
|
<UkIcon @icon="forward" class="uk-margin-small-right" />
|
5
|
-
<div
|
5
|
+
<div
|
6
|
+
class="uk-width-expand uk-margin-small-right uk-flex-inline uk-flex-middle"
|
7
|
+
>
|
6
8
|
{{group-name @inquiry.controllingGroups}}
|
7
|
-
{{#if
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<UkLabel @label={{this.answerStatus}} class="uk-margin-left" />
|
9
|
+
{{#if this.status}}
|
10
|
+
<UkLabel
|
11
|
+
@label={{this.status}}
|
12
|
+
class="uk-margin-left uk-text-default"
|
13
|
+
/>
|
13
14
|
{{/if}}
|
14
15
|
</div>
|
15
16
|
{{else if (eq @type "answer")}}
|
@@ -131,20 +132,25 @@
|
|
131
132
|
<span>{{user-name @inquiry.assignedUsers}}</span>
|
132
133
|
</li>
|
133
134
|
{{/if}}
|
134
|
-
|
135
|
-
{{uk-tooltip
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
135
|
+
{{#if (eq @type "answer")}}
|
136
|
+
<li {{uk-tooltip (t "caluma.distribution.inquiry.closed-at")}}>
|
137
|
+
<span>
|
138
|
+
{{format-date @inquiry.closedAt}}
|
139
|
+
{{format-time @inquiry.closedAt hour="2-digit" minute="2-digit"}}
|
140
|
+
</span>
|
141
|
+
</li>
|
142
|
+
{{else if (and (eq @type "request") @inquiry.childCase.createdAt)}}
|
143
|
+
<li {{uk-tooltip (t "caluma.distribution.inquiry.sent-at")}}>
|
144
|
+
<span>
|
145
|
+
{{format-date @inquiry.childCase.createdAt}}
|
146
|
+
{{format-time
|
147
|
+
@inquiry.childCase.createdAt
|
148
|
+
hour="2-digit"
|
149
|
+
minute="2-digit"
|
150
|
+
}}
|
151
|
+
</span>
|
152
|
+
</li>
|
153
|
+
{{/if}}
|
148
154
|
</ul>
|
149
155
|
|
150
156
|
</div>
|
@@ -18,6 +18,7 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
|
|
18
18
|
@service router;
|
19
19
|
@service intl;
|
20
20
|
@service calumaOptions;
|
21
|
+
@service abilities;
|
21
22
|
|
22
23
|
@queryManager apollo;
|
23
24
|
|
@@ -25,6 +26,25 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
|
|
25
26
|
|
26
27
|
@inquiryAnswerStatus answerStatus;
|
27
28
|
|
29
|
+
get status() {
|
30
|
+
if (!this.args.type === "request" || this.args.disabled) {
|
31
|
+
return null;
|
32
|
+
}
|
33
|
+
|
34
|
+
const inquiry = this.args.inquiry;
|
35
|
+
|
36
|
+
if (
|
37
|
+
inquiry.status === "SUSPENDED" &&
|
38
|
+
this.abilities.can("edit inquiry", inquiry)
|
39
|
+
) {
|
40
|
+
return this.intl.t("caluma.distribution.status.draft");
|
41
|
+
} else if (this.abilities.can("answer inquiry", inquiry)) {
|
42
|
+
return this.answerStatus;
|
43
|
+
}
|
44
|
+
|
45
|
+
return null;
|
46
|
+
}
|
47
|
+
|
28
48
|
get date() {
|
29
49
|
const key = this.args.type === "request" ? "createdAt" : "closedAt";
|
30
50
|
|
@@ -24,7 +24,12 @@ export default class CdInquiryDialogComponent extends Component {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
get inquiries() {
|
27
|
-
return this._inquiries.value?.allWorkItems.edges
|
27
|
+
return this._inquiries.value?.allWorkItems.edges
|
28
|
+
.map((edge) => edge.node)
|
29
|
+
.filter(
|
30
|
+
// suspended inquiries should only be visible to its creator
|
31
|
+
(node) => this.currentGroupIsCreator || node.status !== "SUSPENDED"
|
32
|
+
);
|
28
33
|
}
|
29
34
|
|
30
35
|
_inquiries = trackedTask(this, this.fetchDialog, () => [
|
@@ -38,6 +43,7 @@ export default class CdInquiryDialogComponent extends Component {
|
|
38
43
|
*fetchDialog(from, to, caseId, config) {
|
39
44
|
const response = yield this.apollo.watchQuery({
|
40
45
|
query: inquiryDialogQuery,
|
46
|
+
fetchPolicy: "cache-and-network",
|
41
47
|
variables: {
|
42
48
|
from,
|
43
49
|
to,
|
@@ -14,6 +14,9 @@ export default class CdNavigationStatusIndicatorComponent extends Component {
|
|
14
14
|
@inquiryDeadline deadline;
|
15
15
|
|
16
16
|
get showDeadlineIndicator() {
|
17
|
-
return
|
17
|
+
return (
|
18
|
+
["addressed", "controlling"].includes(this.args.type) &&
|
19
|
+
(this.deadline.isOverdue || this.deadline.isWarning)
|
20
|
+
);
|
18
21
|
}
|
19
22
|
}
|
package/addon/config.js
CHANGED
@@ -6,6 +6,7 @@ export const INQUIRY_STATUS = {
|
|
6
6
|
DRAFT: "draft",
|
7
7
|
SKIPPED: "skipped",
|
8
8
|
SENT: "sent",
|
9
|
+
IN_PROGRESS: "in-progress",
|
9
10
|
POSITIVE: "positive",
|
10
11
|
NEGATIVE: "negative",
|
11
12
|
NEEDS_INTERACTION: "needs-interaction",
|
@@ -45,7 +46,12 @@ export default function config(target, property) {
|
|
45
46
|
"confirm-inquiry-answer": {
|
46
47
|
color: "primary",
|
47
48
|
label: "caluma.distribution.answer.buttons.confirm.label",
|
48
|
-
status:
|
49
|
+
status: {
|
50
|
+
label: "caluma.distribution.answer.buttons.confirm.status",
|
51
|
+
color: { addressed: "muted", controlling: "emphasis" },
|
52
|
+
icon: "user",
|
53
|
+
},
|
54
|
+
willCompleteInquiry: true,
|
49
55
|
},
|
50
56
|
"revise-inquiry-answer": {
|
51
57
|
color: "default",
|
@@ -59,8 +65,8 @@ export default function config(target, property) {
|
|
59
65
|
},
|
60
66
|
details: (inquiry) => [
|
61
67
|
{
|
62
|
-
label: "caluma.distribution.inquiry.
|
63
|
-
value: inquiry.createdAt,
|
68
|
+
label: "caluma.distribution.inquiry.sent-at",
|
69
|
+
value: inquiry.childCase?.createdAt,
|
64
70
|
type: "date",
|
65
71
|
},
|
66
72
|
{
|
@@ -68,11 +74,15 @@ export default function config(target, property) {
|
|
68
74
|
value: inquiry.assignedUsers,
|
69
75
|
type: "user",
|
70
76
|
},
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
77
|
+
...(inquiry.closedAt
|
78
|
+
? [
|
79
|
+
{
|
80
|
+
label: "caluma.distribution.inquiry.closed-at",
|
81
|
+
value: inquiry.closedAt,
|
82
|
+
type: "date",
|
83
|
+
},
|
84
|
+
]
|
85
|
+
: []),
|
76
86
|
],
|
77
87
|
},
|
78
88
|
},
|
@@ -4,9 +4,12 @@ mutation CompleteInquiryWorkItem(
|
|
4
4
|
$workItem: ID!
|
5
5
|
$statusQuestion: ID!
|
6
6
|
$buttonTasks: [String]!
|
7
|
-
$checkTask:
|
7
|
+
$checkTask: String!
|
8
|
+
$inquiryTask: ID!
|
9
|
+
$createTask: String!
|
8
10
|
$currentGroup: String!
|
9
11
|
$answerInfoQuestions: [ID]!
|
12
|
+
$willCompleteInquiry: Boolean = false
|
10
13
|
) {
|
11
14
|
completeWorkItem(input: { id: $workItem }) {
|
12
15
|
workItem {
|
@@ -14,22 +17,26 @@ mutation CompleteInquiryWorkItem(
|
|
14
17
|
status
|
15
18
|
case {
|
16
19
|
id
|
20
|
+
status
|
17
21
|
document {
|
18
22
|
id
|
19
23
|
...InquiryAnswer
|
20
24
|
}
|
21
25
|
...InquiryAnswerButtons
|
22
|
-
|
26
|
+
# If the work item that will be completed also completes the inquiry
|
27
|
+
# itself, we need to fetch certain work items that were completed /
|
28
|
+
# canceled in the side effect layer and the inquiry itself
|
29
|
+
parentWorkItem @include(if: $willCompleteInquiry) {
|
23
30
|
id
|
24
31
|
status
|
25
32
|
isRedoable
|
26
|
-
|
27
|
-
|
33
|
+
closedByUser
|
34
|
+
closedAt
|
28
35
|
case {
|
29
36
|
id
|
30
|
-
workItems(
|
37
|
+
controls: workItems(
|
31
38
|
filter: [
|
32
|
-
{
|
39
|
+
{ tasks: [$checkTask, $createTask] }
|
33
40
|
{ addressedGroups: [$currentGroup] }
|
34
41
|
]
|
35
42
|
) {
|
@@ -40,6 +47,19 @@ mutation CompleteInquiryWorkItem(
|
|
40
47
|
}
|
41
48
|
}
|
42
49
|
}
|
50
|
+
inquiries: workItems(
|
51
|
+
filter: [
|
52
|
+
{ task: $inquiryTask }
|
53
|
+
{ controllingGroups: [$currentGroup] }
|
54
|
+
]
|
55
|
+
) {
|
56
|
+
edges {
|
57
|
+
node {
|
58
|
+
id
|
59
|
+
isRedoable
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
43
63
|
}
|
44
64
|
}
|
45
65
|
}
|
@@ -16,7 +16,6 @@ query InquiryAnswer(
|
|
16
16
|
controllingGroups
|
17
17
|
assignedUsers
|
18
18
|
closedByUser
|
19
|
-
createdAt
|
20
19
|
closedAt
|
21
20
|
task {
|
22
21
|
id
|
@@ -29,10 +28,9 @@ query InquiryAnswer(
|
|
29
28
|
childCase {
|
30
29
|
id
|
31
30
|
status
|
31
|
+
createdAt
|
32
32
|
document {
|
33
33
|
id
|
34
|
-
modifiedContentAt
|
35
|
-
modifiedContentByUser
|
36
34
|
}
|
37
35
|
...InquiryAnswerButtons
|
38
36
|
}
|
@@ -6,7 +6,6 @@ fragment DialogInquiry on WorkItem {
|
|
6
6
|
addressedGroups
|
7
7
|
controllingGroups
|
8
8
|
assignedUsers
|
9
|
-
createdAt
|
10
9
|
closedAt
|
11
10
|
status
|
12
11
|
isRedoable
|
@@ -21,6 +20,7 @@ fragment DialogInquiry on WorkItem {
|
|
21
20
|
}
|
22
21
|
childCase {
|
23
22
|
id
|
23
|
+
createdAt
|
24
24
|
...InquiryAnswerButtons
|
25
25
|
document {
|
26
26
|
id
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# import InquiryAnswerStatus from '../fragments/inquiry-answer.graphql'
|
1
|
+
# import InquiryAnswerStatus, InquiryAnswerButtons from '../fragments/inquiry-answer.graphql'
|
2
2
|
# import InquiryRequestDeadline from '../fragments/inquiry-request.graphql'
|
3
3
|
|
4
4
|
fragment NavigationInquiry on WorkItem {
|
@@ -14,8 +14,10 @@ fragment NavigationInquiry on WorkItem {
|
|
14
14
|
id
|
15
15
|
document {
|
16
16
|
id
|
17
|
+
modifiedContentAt
|
17
18
|
...InquiryAnswerStatus
|
18
19
|
}
|
20
|
+
...InquiryAnswerButtons
|
19
21
|
}
|
20
22
|
}
|
21
23
|
|
@@ -25,6 +27,7 @@ query Navigation(
|
|
25
27
|
$deadlineQuestion: ID
|
26
28
|
$currentGroup: String!
|
27
29
|
$caseId: ID!
|
30
|
+
$buttonTasks: [String]!
|
28
31
|
) {
|
29
32
|
controlling: allWorkItems(
|
30
33
|
filter: [
|
@@ -9,7 +9,6 @@ import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
|
9
9
|
import config from "@projectcaluma/ember-distribution/config";
|
10
10
|
import createInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/create-inquiry.graphql";
|
11
11
|
import controlsQuery from "@projectcaluma/ember-distribution/gql/queries/controls.graphql";
|
12
|
-
import inquiryDialogQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-dialog.graphql";
|
13
12
|
import navigationQuery from "@projectcaluma/ember-distribution/gql/queries/navigation.graphql";
|
14
13
|
import uniqueByGroups from "@projectcaluma/ember-distribution/utils/unique-by-groups";
|
15
14
|
|
@@ -75,6 +74,7 @@ export default class DistributionService extends Service {
|
|
75
74
|
currentGroup: String(this.calumaOptions.currentGroupId),
|
76
75
|
statusQuestion: this.config.inquiry.answer.statusQuestion,
|
77
76
|
deadlineQuestion: this.config.inquiry.deadlineQuestion,
|
77
|
+
buttonTasks: Object.keys(this.config.inquiry.answer.buttons),
|
78
78
|
},
|
79
79
|
});
|
80
80
|
|
@@ -107,22 +107,6 @@ export default class DistributionService extends Service {
|
|
107
107
|
// get create inquiry work item to complete
|
108
108
|
const createId = decodeId(this.controls.value?.create.edges[0].node.id);
|
109
109
|
|
110
|
-
// refetch dialog queries of the groups that will have a new inquiry
|
111
|
-
const refetchQueries = groups.map((group) => ({
|
112
|
-
query: inquiryDialogQuery,
|
113
|
-
variables: {
|
114
|
-
from: String(this.calumaOptions.currentGroupId),
|
115
|
-
to: String(group),
|
116
|
-
caseId: this.caseId,
|
117
|
-
task: this.config.inquiry.task,
|
118
|
-
infoQuestion: this.config.inquiry.infoQuestion,
|
119
|
-
deadlineQuestion: this.config.inquiry.deadlineQuestion,
|
120
|
-
statusQuestion: this.config.inquiry.answer.statusQuestion,
|
121
|
-
answerInfoQuestions: this.config.inquiry.answer.infoQuestions,
|
122
|
-
buttonTasks: Object.keys(this.config.inquiry.answer.buttons),
|
123
|
-
},
|
124
|
-
}));
|
125
|
-
|
126
110
|
// create new inquiries
|
127
111
|
yield this.apollo.mutate({
|
128
112
|
mutation: createInquiryMutation,
|
@@ -133,7 +117,6 @@ export default class DistributionService extends Service {
|
|
133
117
|
addressed_groups: groups.map(String),
|
134
118
|
}),
|
135
119
|
},
|
136
|
-
refetchQueries,
|
137
120
|
});
|
138
121
|
|
139
122
|
// refetch navigation and controls data
|
@@ -26,7 +26,9 @@ function decorator(
|
|
26
26
|
this.config.inquiry.answer.buttons
|
27
27
|
).find(([task]) => readyWorkItems.includes(task))?.[1];
|
28
28
|
|
29
|
-
return buttonConfig?.status
|
29
|
+
return buttonConfig?.status
|
30
|
+
? this.intl.t(buttonConfig.status.label ?? buttonConfig.status)
|
31
|
+
: null;
|
30
32
|
},
|
31
33
|
};
|
32
34
|
}
|
@@ -8,6 +8,7 @@ export const ICON_MAP = {
|
|
8
8
|
[INQUIRY_STATUS.DRAFT]: "commenting",
|
9
9
|
[INQUIRY_STATUS.SKIPPED]: "lock",
|
10
10
|
[INQUIRY_STATUS.SENT]: "comment",
|
11
|
+
[INQUIRY_STATUS.IN_PROGRESS]: "file-edit",
|
11
12
|
[INQUIRY_STATUS.POSITIVE]: "check",
|
12
13
|
[INQUIRY_STATUS.NEGATIVE]: "close",
|
13
14
|
[INQUIRY_STATUS.NEEDS_INTERACTION]: "file-text",
|
@@ -17,6 +18,7 @@ export const COLOR_MAP = {
|
|
17
18
|
[INQUIRY_STATUS.DRAFT]: "muted",
|
18
19
|
[INQUIRY_STATUS.SKIPPED]: "muted",
|
19
20
|
[INQUIRY_STATUS.SENT]: "emphasis",
|
21
|
+
[INQUIRY_STATUS.IN_PROGRESS]: { addressed: "muted", controlling: "emphasis" },
|
20
22
|
[INQUIRY_STATUS.POSITIVE]: "success",
|
21
23
|
[INQUIRY_STATUS.NEGATIVE]: "danger",
|
22
24
|
[INQUIRY_STATUS.NEEDS_INTERACTION]: "warning",
|
@@ -41,16 +43,51 @@ function decorator(
|
|
41
43
|
return {
|
42
44
|
get() {
|
43
45
|
const inquiry = get(this, inquiryProperty);
|
44
|
-
const
|
46
|
+
const inquiryType = get(this, inquiryTypeProperty);
|
47
|
+
const isAddressed = inquiryType === "addressed";
|
48
|
+
const isControlling = inquiryType === "controlling";
|
49
|
+
|
45
50
|
const isDraft = isAddressed
|
46
51
|
? inquiry.status === "READY"
|
47
52
|
: inquiry.status === "SUSPENDED";
|
48
53
|
const isSent = !isAddressed && inquiry.status === "READY";
|
49
54
|
const isSkipped = inquiry.status === "SKIPPED";
|
55
|
+
const isInProgress =
|
56
|
+
(isAddressed || isControlling) &&
|
57
|
+
inquiry.status === "READY" &&
|
58
|
+
inquiry.childCase?.document?.modifiedContentAt;
|
59
|
+
|
60
|
+
const buttonConfig = this.config.inquiry.answer.buttons;
|
61
|
+
const inquiryAnswerStatus =
|
62
|
+
buttonConfig &&
|
63
|
+
(isAddressed || isControlling) &&
|
64
|
+
inquiry.status === "READY"
|
65
|
+
? inquiry?.childCase?.workItems.edges
|
66
|
+
.filter((edge) => edge.node.status === "READY")
|
67
|
+
.map((edge) => {
|
68
|
+
const config = buttonConfig[edge.node.task.slug]?.status;
|
69
|
+
if (!config?.icon) {
|
70
|
+
return null;
|
71
|
+
}
|
72
|
+
|
73
|
+
return {
|
74
|
+
...config,
|
75
|
+
label: this.intl.t(config.label),
|
76
|
+
color: config.color[inquiryType] ?? config.color,
|
77
|
+
};
|
78
|
+
})
|
79
|
+
.filter(Boolean)[0]
|
80
|
+
: null;
|
81
|
+
|
82
|
+
if (inquiryAnswerStatus) {
|
83
|
+
return inquiryAnswerStatus;
|
84
|
+
}
|
50
85
|
|
51
86
|
const answer = inquiry.childCase?.document.status.edges[0]?.node;
|
52
87
|
const slug = isSkipped
|
53
88
|
? INQUIRY_STATUS.SKIPPED
|
89
|
+
: isInProgress
|
90
|
+
? INQUIRY_STATUS.IN_PROGRESS
|
54
91
|
: isDraft
|
55
92
|
? INQUIRY_STATUS.DRAFT
|
56
93
|
: isSent
|
@@ -63,7 +100,7 @@ function decorator(
|
|
63
100
|
!isSkipped && !isDraft && !isSent
|
64
101
|
? answer?.selectedOption.label
|
65
102
|
: this.intl.t(`caluma.distribution.status.${slug}`),
|
66
|
-
color: COLOR_MAP[slug],
|
103
|
+
color: COLOR_MAP[slug][inquiryType] ?? COLOR_MAP[slug],
|
67
104
|
icon: ICON_MAP[slug],
|
68
105
|
};
|
69
106
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@projectcaluma/ember-distribution",
|
3
|
-
"version": "11.0.0-beta.
|
3
|
+
"version": "11.0.0-beta.34",
|
4
4
|
"description": "Ember engine for the Caluma distribution module.",
|
5
5
|
"keywords": [
|
6
6
|
"ember-addon",
|
@@ -23,9 +23,9 @@
|
|
23
23
|
"@embroider/macros": "^1.9.0",
|
24
24
|
"@glimmer/component": "^1.1.2",
|
25
25
|
"@glimmer/tracking": "^1.1.2",
|
26
|
-
"@projectcaluma/ember-core": "^11.0.0-beta.
|
27
|
-
"@projectcaluma/ember-form": "^11.0.0-beta.
|
28
|
-
"@projectcaluma/ember-workflow": "^11.0.0-beta.
|
26
|
+
"@projectcaluma/ember-core": "^11.0.0-beta.34",
|
27
|
+
"@projectcaluma/ember-form": "^11.0.0-beta.34",
|
28
|
+
"@projectcaluma/ember-workflow": "^11.0.0-beta.34",
|
29
29
|
"ember-apollo-client": "~4.0.2",
|
30
30
|
"ember-auto-import": "^2.4.3",
|
31
31
|
"ember-can": "^4.2.0",
|
@@ -36,8 +36,8 @@
|
|
36
36
|
"ember-fetch": "^8.1.2",
|
37
37
|
"ember-flatpickr": "^3.2.3",
|
38
38
|
"ember-intl": "^5.7.2",
|
39
|
-
"ember-resources": "^5.
|
40
|
-
"ember-svg-jar": "^2.4.
|
39
|
+
"ember-resources": "^5.5.0",
|
40
|
+
"ember-svg-jar": "^2.4.2",
|
41
41
|
"ember-test-selectors": "^6.0.0",
|
42
42
|
"ember-uikit": "^6.1.0",
|
43
43
|
"graphql": "^15.8.0",
|
@@ -51,7 +51,7 @@
|
|
51
51
|
"@ember/test-helpers": "2.7.0",
|
52
52
|
"@embroider/test-setup": "1.8.3",
|
53
53
|
"@faker-js/faker": "7.6.0",
|
54
|
-
"@projectcaluma/ember-testing": "11.0.0-beta.
|
54
|
+
"@projectcaluma/ember-testing": "11.0.0-beta.34",
|
55
55
|
"broccoli-asset-rev": "3.0.0",
|
56
56
|
"ember-cli": "4.8.0",
|
57
57
|
"ember-cli-code-coverage": "1.0.3",
|
@@ -72,7 +72,7 @@
|
|
72
72
|
"loader.js": "4.7.0",
|
73
73
|
"miragejs": "0.1.45",
|
74
74
|
"npm-run-all": "4.1.5",
|
75
|
-
"qunit": "2.19.
|
75
|
+
"qunit": "2.19.3",
|
76
76
|
"qunit-dom": "2.0.0",
|
77
77
|
"sass": "1.55.0",
|
78
78
|
"webpack": "5.74.0"
|
package/translations/de.yaml
CHANGED
@@ -35,7 +35,7 @@ caluma:
|
|
35
35
|
automatisch gespeichert."
|
36
36
|
|
37
37
|
inquiry:
|
38
|
-
|
38
|
+
sent-at: "Versendet am"
|
39
39
|
closed-at: "Beantwortet am"
|
40
40
|
deadline: "Frist"
|
41
41
|
assigned-user: "Verantwortliche Person"
|
@@ -103,6 +103,7 @@ caluma:
|
|
103
103
|
draft: "Entwurf"
|
104
104
|
skipped: "Vorzeitig beendet"
|
105
105
|
sent: "Versendet"
|
106
|
+
in-progress: "In Bearbeitung"
|
106
107
|
positive: "Positiv"
|
107
108
|
negative: "Negativ"
|
108
109
|
needs-interaction: "Aktion erforderlich"
|
package/translations/en.yaml
CHANGED
@@ -35,7 +35,7 @@ caluma:
|
|
35
35
|
automatically."
|
36
36
|
|
37
37
|
inquiry:
|
38
|
-
|
38
|
+
sent-at: "Sent at"
|
39
39
|
closed-at: "Answered at"
|
40
40
|
deadline: "Deadline"
|
41
41
|
assigned-user: "Assigned user"
|
@@ -103,6 +103,7 @@ caluma:
|
|
103
103
|
draft: "Draft"
|
104
104
|
skipped: "Aborted"
|
105
105
|
sent: "Sent"
|
106
|
+
in-progress: "In Progress"
|
106
107
|
positive: "Positive"
|
107
108
|
negative: "Negative"
|
108
109
|
needs-interaction: "Needs interaction"
|
package/translations/fr.yaml
CHANGED
@@ -35,7 +35,7 @@ caluma:
|
|
35
35
|
automatiquement enregistrées."
|
36
36
|
|
37
37
|
inquiry:
|
38
|
-
|
38
|
+
sent-at: "Envoyé le"
|
39
39
|
closed-at: "Répondu le"
|
40
40
|
deadline: "Délai"
|
41
41
|
assigned-user: "Personne responsable"
|
@@ -103,6 +103,7 @@ caluma:
|
|
103
103
|
draft: "Brouillon"
|
104
104
|
skipped: "Terminé prématurément"
|
105
105
|
sent: "Envoyé"
|
106
|
+
in-progress: "En cours"
|
106
107
|
positive: "Positif"
|
107
108
|
negative: "Negatif"
|
108
109
|
needs-interaction: "Action nécessaire"
|