@projectcaluma/ember-distribution 11.0.0-beta.28 → 11.0.0-beta.30
Sign up to get free protection for your applications and to get access to all the features.
- package/addon/abilities/distribution.js +13 -0
- package/addon/abilities/inquiry.js +2 -2
- package/addon/components/cd-document-header.hbs +3 -0
- package/addon/components/cd-inquiry-answer-form.hbs +28 -5
- package/addon/components/cd-inquiry-dialog.js +0 -30
- package/addon/components/cd-inquiry-edit-form.hbs +21 -1
- package/addon/components/cd-inquiry-new-form/bulk-edit.hbs +20 -0
- package/addon/components/cd-inquiry-new-form/bulk-edit.js +113 -0
- package/addon/components/cd-inquiry-new-form/select.hbs +71 -0
- package/addon/components/cd-inquiry-new-form/select.js +76 -0
- package/addon/components/cd-inquiry-new-form.hbs +29 -86
- package/addon/components/cd-inquiry-new-form.js +1 -100
- package/addon/components/cd-navigation/controls.hbs +112 -56
- package/addon/components/cd-navigation/controls.js +48 -21
- package/addon/components/cd-navigation/item.hbs +22 -11
- package/addon/components/cd-navigation/section.hbs +15 -19
- package/addon/components/cd-navigation/section.js +18 -2
- package/addon/components/cd-navigation/status-indicator.hbs +5 -2
- package/addon/components/cd-navigation.hbs +6 -4
- package/addon/config.js +2 -0
- package/addon/gql/queries/control-work-items.graphql +18 -0
- package/addon/gql/queries/inquiry-edit.graphql +1 -0
- package/addon/gql/queries/inquiry-form.graphql +26 -0
- package/addon/services/distribution.js +11 -1
- package/addon/templates/application.hbs +7 -5
- package/addon/templates/index.hbs +1 -5
- package/app/components/cd-inquiry-new-form/bulk-edit.js +1 -0
- package/app/components/cd-inquiry-new-form/select.js +1 -0
- package/package.json +20 -21
- package/translations/de.yaml +25 -9
- package/translations/en.yaml +25 -10
- package/translations/fr.yaml +27 -11
@@ -1,114 +1,15 @@
|
|
1
1
|
import { action } from "@ember/object";
|
2
|
-
import { inject as service } from "@ember/service";
|
3
|
-
import { macroCondition, isTesting } from "@embroider/macros";
|
4
2
|
import Component from "@glimmer/component";
|
5
3
|
import { tracked } from "@glimmer/tracking";
|
6
|
-
import { queryManager } from "ember-apollo-client";
|
7
|
-
import { timeout, restartableTask, dropTask, task } from "ember-concurrency";
|
8
|
-
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
9
|
-
|
10
|
-
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
11
|
-
import config from "@projectcaluma/ember-distribution/config";
|
12
|
-
|
13
|
-
const toggle = (value, array) => {
|
14
|
-
const set = new Set(array);
|
15
|
-
|
16
|
-
set.delete(value) || set.add(value);
|
17
|
-
|
18
|
-
return [...set];
|
19
|
-
};
|
20
4
|
|
21
5
|
export default class CdInquiryNewFormComponent extends Component {
|
22
|
-
@
|
23
|
-
@service notification;
|
24
|
-
@service intl;
|
25
|
-
@service router;
|
26
|
-
@service distribution;
|
27
|
-
|
28
|
-
@queryManager apollo;
|
29
|
-
|
30
|
-
@config config;
|
31
|
-
|
6
|
+
@tracked edit = false;
|
32
7
|
@tracked selectedGroups = [];
|
33
8
|
|
34
|
-
groups = trackedTask(this, this.fetchGroups, () => [
|
35
|
-
this.args.selectedTypes,
|
36
|
-
this.args.search,
|
37
|
-
]);
|
38
|
-
|
39
|
-
@action
|
40
|
-
updateSelectedTypes(type, e) {
|
41
|
-
e.preventDefault();
|
42
|
-
|
43
|
-
this.args.onChangeSelectedTypes(toggle(type, this.args.selectedTypes));
|
44
|
-
}
|
45
|
-
|
46
|
-
@action
|
47
|
-
updateSelectedGroups(identifier) {
|
48
|
-
this.selectedGroups = toggle(identifier, this.selectedGroups);
|
49
|
-
}
|
50
|
-
|
51
9
|
@action
|
52
10
|
clearSelectedGroups(e) {
|
53
11
|
e.preventDefault();
|
54
12
|
|
55
13
|
this.selectedGroups = [];
|
56
14
|
}
|
57
|
-
|
58
|
-
@restartableTask
|
59
|
-
*updateSearch(e) {
|
60
|
-
e.preventDefault();
|
61
|
-
|
62
|
-
/* istanbul ignore next */
|
63
|
-
if (macroCondition(isTesting())) {
|
64
|
-
// no timeout
|
65
|
-
} else {
|
66
|
-
yield timeout(500);
|
67
|
-
}
|
68
|
-
|
69
|
-
this.args.onChangeSearch(e.target.value);
|
70
|
-
}
|
71
|
-
|
72
|
-
@dropTask
|
73
|
-
*submit(e) {
|
74
|
-
e.preventDefault();
|
75
|
-
|
76
|
-
if (!this.selectedGroups.length) return;
|
77
|
-
|
78
|
-
yield this.distribution.createInquiry.perform(this.selectedGroups);
|
79
|
-
|
80
|
-
const lastControlling =
|
81
|
-
this.distribution.navigation.value.controlling.edges[0].node;
|
82
|
-
|
83
|
-
// transition to last added inquiry
|
84
|
-
this.router.transitionTo(
|
85
|
-
"inquiry.detail.index",
|
86
|
-
{
|
87
|
-
from: lastControlling.controllingGroups[0],
|
88
|
-
to: lastControlling.addressedGroups[0],
|
89
|
-
},
|
90
|
-
decodeId(lastControlling.id)
|
91
|
-
);
|
92
|
-
}
|
93
|
-
|
94
|
-
@task
|
95
|
-
*fetchGroups(types, search) {
|
96
|
-
// https://github.com/ember-cli/eslint-plugin-ember/issues/1413
|
97
|
-
yield Promise.resolve();
|
98
|
-
|
99
|
-
const typedGroups = yield this.calumaOptions.fetchTypedGroups(
|
100
|
-
types,
|
101
|
-
search
|
102
|
-
);
|
103
|
-
|
104
|
-
return Object.entries(typedGroups)
|
105
|
-
.flatMap(([type, groups]) => {
|
106
|
-
return groups.map((group) => ({
|
107
|
-
identifier: group[this.calumaOptions.groupIdentifierProperty],
|
108
|
-
name: group[this.calumaOptions.groupNameProperty],
|
109
|
-
config: this.config.new.types[type],
|
110
|
-
}));
|
111
|
-
})
|
112
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
113
|
-
}
|
114
15
|
}
|
@@ -1,57 +1,113 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
{{#if
|
2
|
+
(or
|
3
|
+
(can "send inquiries of distribution")
|
4
|
+
(can "create inquiry of distribution")
|
5
|
+
(can "complete distribution")
|
6
|
+
(can "reopen distribution")
|
7
|
+
)
|
8
|
+
}}
|
9
|
+
{{#if @useButtons}}
|
10
|
+
{{#if (can "create inquiry of distribution")}}
|
11
|
+
<LinkTo
|
12
|
+
@route="new"
|
13
|
+
class="uk-button uk-button-primary"
|
14
|
+
data-test-new-inquiry
|
15
|
+
>
|
16
|
+
{{t "caluma.distribution.start"}}
|
17
|
+
</LinkTo>
|
18
|
+
{{/if}}
|
19
|
+
{{#if (can "complete distribution")}}
|
20
|
+
<UkButton
|
21
|
+
@onClick={{perform this.completeDistribution}}
|
22
|
+
@label={{t "caluma.distribution.skip"}}
|
23
|
+
@loading={{this.completeDistribution.isRunning}}
|
24
|
+
@disabled={{this.completeDistribution.isRunning}}
|
25
|
+
data-test-complete-distribution
|
26
|
+
/>
|
27
|
+
{{/if}}
|
28
|
+
{{#if (can "reopen distribution")}}
|
29
|
+
<UkButton
|
30
|
+
@onClick={{perform this.reopenDistribution}}
|
31
|
+
@label={{t "caluma.distribution.reopen"}}
|
32
|
+
@loading={{this.reopenDistribution.isRunning}}
|
33
|
+
@disabled={{this.reopenDistribution.isRunning}}
|
34
|
+
data-test-reopen-distribution
|
35
|
+
/>
|
36
|
+
{{/if}}
|
37
|
+
{{else}}
|
38
|
+
<li class="uk-margin-small">
|
39
|
+
<div class="uk-text-center">
|
40
|
+
{{#if (can "send inquiries of distribution")}}
|
41
|
+
<button
|
42
|
+
type="button"
|
43
|
+
class="uk-icon-button uk-button-primary"
|
44
|
+
{{uk-tooltip (t "caluma.distribution.send")}}
|
45
|
+
data-test-send-pending-inquiries
|
46
|
+
{{on "click" (perform this.sendInquiries)}}
|
47
|
+
>
|
48
|
+
{{#if this.sendInquiries.isRunning}}
|
49
|
+
<UkSpinner @ratio={{0.6}} />
|
50
|
+
{{else}}
|
51
|
+
<UkIcon @icon="comment" />
|
52
|
+
{{/if}}
|
53
|
+
</button>
|
54
|
+
{{/if}}
|
55
|
+
{{#if (can "create inquiry of distribution")}}
|
56
|
+
<LinkTo
|
57
|
+
@route="new"
|
58
|
+
class="uk-icon-button"
|
59
|
+
{{uk-tooltip (t "caluma.distribution.new.title")}}
|
60
|
+
data-test-new-inquiry
|
61
|
+
>
|
62
|
+
<UkIcon @icon="plus" />
|
63
|
+
</LinkTo>
|
64
|
+
{{/if}}
|
65
|
+
{{#if (can "check inquiries of distribution")}}
|
66
|
+
<button
|
67
|
+
type="button"
|
68
|
+
class="uk-icon-button"
|
69
|
+
{{uk-tooltip (t "caluma.distribution.check-inquiries")}}
|
70
|
+
data-test-check-inquiries
|
71
|
+
{{on "click" (perform this.checkInquiries)}}
|
72
|
+
>
|
73
|
+
{{#if this.checkInquiries.isRunning}}
|
74
|
+
<UkSpinner @ratio={{0.6}} />
|
75
|
+
{{else}}
|
76
|
+
<UkIcon @icon="check" />
|
77
|
+
{{/if}}
|
78
|
+
</button>
|
79
|
+
{{/if}}
|
80
|
+
{{#if (can "complete distribution")}}
|
81
|
+
<button
|
82
|
+
type="button"
|
83
|
+
class="uk-icon-button"
|
84
|
+
{{uk-tooltip (t "caluma.distribution.complete")}}
|
85
|
+
data-test-complete-distribution
|
86
|
+
{{on "click" (perform this.completeDistribution)}}
|
87
|
+
>
|
88
|
+
{{#if this.completeDistribution.isRunning}}
|
89
|
+
<UkSpinner @ratio={{0.6}} />
|
90
|
+
{{else}}
|
91
|
+
<UkIcon @icon="lock" />
|
92
|
+
{{/if}}
|
93
|
+
</button>
|
94
|
+
{{/if}}
|
95
|
+
{{#if (can "reopen distribution")}}
|
96
|
+
<button
|
97
|
+
type="button"
|
98
|
+
class="uk-icon-button"
|
99
|
+
{{uk-tooltip (t "caluma.distribution.reopen")}}
|
100
|
+
data-test-reopen-distribution
|
101
|
+
{{on "click" (perform this.reopenDistribution)}}
|
102
|
+
>
|
103
|
+
{{#if this.reopenDistribution.isRunning}}
|
104
|
+
<UkSpinner @ratio={{0.6}} />
|
105
|
+
{{else}}
|
106
|
+
<UkIcon @icon="refresh" />
|
107
|
+
{{/if}}
|
108
|
+
</button>
|
109
|
+
{{/if}}
|
110
|
+
</div>
|
111
|
+
</li>
|
11
112
|
{{/if}}
|
12
|
-
|
13
|
-
<button
|
14
|
-
type="button"
|
15
|
-
class="uk-icon-button"
|
16
|
-
{{uk-tooltip (t "caluma.distribution.send")}}
|
17
|
-
data-test-send-pending-inquiries
|
18
|
-
{{on "click" (perform this.sendInquiries)}}
|
19
|
-
>
|
20
|
-
{{#if this.sendInquiries.isRunning}}
|
21
|
-
<UkSpinner @ratio={{0.6}} />
|
22
|
-
{{else}}
|
23
|
-
<UkIcon @icon="comment" />
|
24
|
-
{{/if}}
|
25
|
-
</button>
|
26
|
-
{{/if}}
|
27
|
-
{{#if (can "complete distribution")}}
|
28
|
-
<button
|
29
|
-
type="button"
|
30
|
-
class="uk-icon-button"
|
31
|
-
{{uk-tooltip (t "caluma.distribution.complete")}}
|
32
|
-
data-test-complete-distribution
|
33
|
-
{{on "click" (perform this.completeDistribution)}}
|
34
|
-
>
|
35
|
-
{{#if this.completeDistribution.isRunning}}
|
36
|
-
<UkSpinner @ratio={{0.6}} />
|
37
|
-
{{else}}
|
38
|
-
<UkIcon @icon="lock" />
|
39
|
-
{{/if}}
|
40
|
-
</button>
|
41
|
-
{{/if}}
|
42
|
-
{{#if (can "reopen distribution")}}
|
43
|
-
<button
|
44
|
-
type="button"
|
45
|
-
class="uk-icon-button"
|
46
|
-
{{uk-tooltip (t "caluma.distribution.reopen")}}
|
47
|
-
data-test-reopen-distribution
|
48
|
-
{{on "click" (perform this.reopenDistribution)}}
|
49
|
-
>
|
50
|
-
{{#if this.reopenDistribution.isRunning}}
|
51
|
-
<UkSpinner @ratio={{0.6}} />
|
52
|
-
{{else}}
|
53
|
-
<UkIcon @icon="refresh" />
|
54
|
-
{{/if}}
|
55
|
-
</button>
|
56
|
-
{{/if}}
|
57
|
-
</div>
|
113
|
+
{{/if}}
|
@@ -23,23 +23,27 @@ export default class CdNavigationControlsComponent extends Component {
|
|
23
23
|
@dropTask
|
24
24
|
*completeDistribution() {
|
25
25
|
try {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
let confirmText = this.intl.t("caluma.distribution.skip-confirm");
|
27
|
+
|
28
|
+
if (this.distribution.hasInquiries) {
|
29
|
+
const incompleteInquiries = yield this.apollo.query(
|
30
|
+
{
|
31
|
+
query: incompleteInquiriesQuery,
|
32
|
+
variables: {
|
33
|
+
caseId: this.distribution.caseId,
|
34
|
+
task: this.config.inquiry.task,
|
35
|
+
},
|
32
36
|
},
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
"allWorkItems.totalCount"
|
38
|
+
);
|
39
|
+
|
40
|
+
confirmText =
|
41
|
+
incompleteInquiries === 0
|
42
|
+
? this.intl.t("caluma.distribution.complete-confirm-empty")
|
43
|
+
: this.intl.t("caluma.distribution.complete-confirm", {
|
44
|
+
count: incompleteInquiries,
|
45
|
+
});
|
46
|
+
}
|
43
47
|
|
44
48
|
if (!(yield confirm(confirmText))) {
|
45
49
|
return;
|
@@ -92,15 +96,20 @@ export default class CdNavigationControlsComponent extends Component {
|
|
92
96
|
|
93
97
|
@dropTask
|
94
98
|
*sendInquiries() {
|
95
|
-
|
99
|
+
const ids = this.distribution.controls.value.send.edges
|
100
|
+
.filter((edge) => edge.node.status === "SUSPENDED")
|
101
|
+
.map((edge) => decodeId(edge.node.id));
|
102
|
+
|
103
|
+
if (
|
104
|
+
ids.length &&
|
105
|
+
!(yield confirm(
|
106
|
+
this.intl.t("caluma.distribution.send-confirm", { count: ids.length })
|
107
|
+
))
|
108
|
+
) {
|
96
109
|
return;
|
97
110
|
}
|
98
111
|
|
99
112
|
try {
|
100
|
-
const ids = this.distribution.controls.value.send.edges.map((edge) =>
|
101
|
-
decodeId(edge.node.id)
|
102
|
-
);
|
103
|
-
|
104
113
|
const mutations = ids.map(
|
105
114
|
(id, index) => `
|
106
115
|
sendInquiry${index}: resumeWorkItem(input: { id: "${id}" }) {
|
@@ -119,4 +128,22 @@ export default class CdNavigationControlsComponent extends Component {
|
|
119
128
|
this.notification.danger(this.intl.t("caluma.distribution.send-error"));
|
120
129
|
}
|
121
130
|
}
|
131
|
+
|
132
|
+
@dropTask
|
133
|
+
*checkInquiries() {
|
134
|
+
try {
|
135
|
+
yield this.apollo.mutate({
|
136
|
+
mutation: completeWorkItemMutation,
|
137
|
+
variables: {
|
138
|
+
workItem: decodeId(
|
139
|
+
this.distribution.controls.value?.check.edges[0]?.node.id
|
140
|
+
),
|
141
|
+
},
|
142
|
+
});
|
143
|
+
} catch (e) {
|
144
|
+
this.notification.danger(
|
145
|
+
this.intl.t("caluma.distribution.check-inquiries-error")
|
146
|
+
);
|
147
|
+
}
|
148
|
+
}
|
122
149
|
}
|
@@ -1,17 +1,28 @@
|
|
1
1
|
<li class="uk-width-auto {{if this.isActive 'uk-active'}}">
|
2
2
|
<LinkTo @route="inquiry" @model={{this.model}}>
|
3
|
-
{{#
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
{{
|
3
|
+
{{#if (eq @type "addressed")}}
|
4
|
+
<span
|
5
|
+
class="uk-width-expand uk-text-truncate"
|
6
|
+
title={{t
|
7
|
+
"caluma.distribution.attention-to"
|
8
|
+
subject=@inquiry.controllingGroupName
|
9
|
+
abbr=false
|
10
|
+
}}
|
11
|
+
>
|
12
|
+
{{t
|
13
|
+
"caluma.distribution.attention-to"
|
14
|
+
subject=@inquiry.controllingGroupName
|
15
|
+
abbr=true
|
16
|
+
}}
|
13
17
|
</span>
|
14
|
-
{{
|
18
|
+
{{else}}
|
19
|
+
<span
|
20
|
+
class="uk-width-expand uk-text-truncate"
|
21
|
+
title={{@inquiry.addressedGroupName}}
|
22
|
+
>
|
23
|
+
{{@inquiry.addressedGroupName}}
|
24
|
+
</span>
|
25
|
+
{{/if}}
|
15
26
|
|
16
27
|
<CdNavigation::StatusIndicator @inquiry={{@inquiry}} @type={{@type}} />
|
17
28
|
</LinkTo>
|
@@ -1,26 +1,22 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
{{#if @inquiries.length}}
|
2
|
+
<li class="uk-margin-small uk-width-auto {{if this.isActive 'uk-active'}}">
|
3
|
+
<a href="" {{on "click" this.toggle}}>
|
4
|
+
<span class="uk-width-expand">
|
5
|
+
{{t (concat "caluma.distribution.types." @type)}}
|
6
|
+
</span>
|
7
|
+
{{#if this.expanded}}
|
8
|
+
<UkIcon @icon="chevron-down" />
|
9
|
+
{{else}}
|
10
|
+
<UkIcon @icon="chevron-right" />
|
11
|
+
{{/if}}
|
12
|
+
</a>
|
12
13
|
|
13
|
-
|
14
|
-
{{#if @inquiries.length}}
|
14
|
+
{{#if this.expanded}}
|
15
15
|
<ul class="uk-tab uk-tab-left uk-margin-left uk-width-auto">
|
16
16
|
{{#each this.inquiries as |inquiry|}}
|
17
17
|
<CdNavigation::Item @inquiry={{inquiry}} @type={{@type}} />
|
18
18
|
{{/each}}
|
19
19
|
</ul>
|
20
20
|
{{/if}}
|
21
|
-
|
22
|
-
|
23
|
-
<CdNavigation::Controls />
|
24
|
-
{{/if}}
|
25
|
-
{{/if}}
|
26
|
-
</li>
|
21
|
+
</li>
|
22
|
+
{{/if}}
|
@@ -1,10 +1,24 @@
|
|
1
1
|
import { action } from "@ember/object";
|
2
|
+
import { inject as service } from "@ember/service";
|
2
3
|
import Component from "@glimmer/component";
|
3
4
|
import { tracked } from "@glimmer/tracking";
|
4
5
|
|
5
6
|
export default class CdNavigationSectionComponent extends Component {
|
7
|
+
@service router;
|
8
|
+
|
6
9
|
@tracked expanded = true;
|
7
10
|
|
11
|
+
get isActive() {
|
12
|
+
return (
|
13
|
+
this.inquiries.find((inquiry) =>
|
14
|
+
this.router.isActive("inquiry", {
|
15
|
+
to: inquiry.addressedGroups[0],
|
16
|
+
from: inquiry.controllingGroups[0],
|
17
|
+
})
|
18
|
+
) !== undefined
|
19
|
+
);
|
20
|
+
}
|
21
|
+
|
8
22
|
@action
|
9
23
|
toggle(e) {
|
10
24
|
e.preventDefault();
|
@@ -18,8 +32,10 @@ export default class CdNavigationSectionComponent extends Component {
|
|
18
32
|
? "controllingGroupName"
|
19
33
|
: "addressedGroupName";
|
20
34
|
|
21
|
-
return
|
22
|
-
|
35
|
+
return (
|
36
|
+
this.args.inquiries?.sort((a, b) =>
|
37
|
+
a[sortProperty].localeCompare(b[sortProperty])
|
38
|
+
) ?? []
|
23
39
|
);
|
24
40
|
}
|
25
41
|
}
|
@@ -2,12 +2,15 @@
|
|
2
2
|
<UkIcon
|
3
3
|
@icon="clock"
|
4
4
|
class="uk-margin-small-right uk-text-{{this.deadline.color}}"
|
5
|
-
{{uk-tooltip
|
5
|
+
{{uk-tooltip
|
6
|
+
(format-date this.deadline.value)
|
7
|
+
pos=(if this.config.ui.stack "left" "top")
|
8
|
+
}}
|
6
9
|
/>
|
7
10
|
{{/if}}
|
8
11
|
|
9
12
|
<UkIcon
|
10
13
|
@icon={{this.status.icon}}
|
11
14
|
class="uk-text-{{this.status.color}}"
|
12
|
-
{{uk-tooltip this.status.label}}
|
15
|
+
{{uk-tooltip this.status.label pos=(if this.config.ui.stack "left" "top")}}
|
13
16
|
/>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<ul class="uk-tab uk-tab-left uk-margin-remove-bottom uk-width-auto">
|
2
|
-
<CdNavigation::
|
3
|
-
|
4
|
-
@inquiries={{this.inquiries.controlling}}
|
5
|
-
/>
|
2
|
+
<CdNavigation::Controls />
|
3
|
+
|
6
4
|
<CdNavigation::Section
|
7
5
|
@type="addressed"
|
8
6
|
@inquiries={{this.inquiries.addressed}}
|
9
7
|
/>
|
8
|
+
<CdNavigation::Section
|
9
|
+
@type="controlling"
|
10
|
+
@inquiries={{this.inquiries.controlling}}
|
11
|
+
/>
|
10
12
|
<CdNavigation::Section @type="more" @inquiries={{this.inquiries.more}} />
|
11
13
|
</ul>
|
package/addon/config.js
CHANGED
@@ -20,6 +20,7 @@ export default function config(target, property) {
|
|
20
20
|
controls: {
|
21
21
|
createTask: "create-inquiry",
|
22
22
|
completeTask: "complete-distribution",
|
23
|
+
checkTask: "check-inquiries",
|
23
24
|
},
|
24
25
|
warningPeriod: 3,
|
25
26
|
inquiry: {
|
@@ -59,6 +60,7 @@ export default function config(target, property) {
|
|
59
60
|
},
|
60
61
|
},
|
61
62
|
new: {
|
63
|
+
defaultDeadlineLeadTime: 30,
|
62
64
|
defaultTypes: ["suggestions"],
|
63
65
|
types: {
|
64
66
|
suggestions: {
|
@@ -2,6 +2,7 @@ query ControlWorkItems(
|
|
2
2
|
$createTask: ID!
|
3
3
|
$completeTask: ID!
|
4
4
|
$inquiryTask: ID!
|
5
|
+
$checkTask: ID!
|
5
6
|
$caseId: ID!
|
6
7
|
$currentGroup: String!
|
7
8
|
) {
|
@@ -50,6 +51,22 @@ query ControlWorkItems(
|
|
50
51
|
}
|
51
52
|
}
|
52
53
|
}
|
54
|
+
check: allWorkItems(
|
55
|
+
filter: [
|
56
|
+
{ case: $caseId }
|
57
|
+
{ task: $checkTask }
|
58
|
+
{ status: READY }
|
59
|
+
{ hasDeadline: true }
|
60
|
+
{ addressedGroups: [$currentGroup] }
|
61
|
+
]
|
62
|
+
) {
|
63
|
+
edges {
|
64
|
+
node {
|
65
|
+
id
|
66
|
+
status
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
53
70
|
case: allCases(filter: [{ id: $caseId }]) {
|
54
71
|
edges {
|
55
72
|
node {
|
@@ -57,6 +74,7 @@ query ControlWorkItems(
|
|
57
74
|
parentWorkItem {
|
58
75
|
id
|
59
76
|
isRedoable
|
77
|
+
addressedGroups
|
60
78
|
}
|
61
79
|
}
|
62
80
|
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#import FieldQuestion, FieldTableQuestion, SimpleQuestion from '@projectcaluma/ember-form/gql/fragments/field.graphql'
|
2
|
+
|
3
|
+
query InquiryForm($inquiryTask: String!) {
|
4
|
+
allTasks(filter: [{ slug: $inquiryTask }], first: 1) {
|
5
|
+
edges {
|
6
|
+
node {
|
7
|
+
id
|
8
|
+
... on CompleteTaskFormTask {
|
9
|
+
form {
|
10
|
+
id
|
11
|
+
slug
|
12
|
+
name
|
13
|
+
meta
|
14
|
+
questions {
|
15
|
+
edges {
|
16
|
+
node {
|
17
|
+
...FieldQuestion
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
@@ -25,6 +25,14 @@ export default class DistributionService extends Service {
|
|
25
25
|
return getOwner(this).lookup("route:application").currentModel;
|
26
26
|
}
|
27
27
|
|
28
|
+
get hasInquiries() {
|
29
|
+
return (
|
30
|
+
this.navigation.value?.addressed.edges.length > 0 ||
|
31
|
+
this.navigation.value?.controlling.edges.length > 0 ||
|
32
|
+
this.navigation.value?.more.edges.length > 0
|
33
|
+
);
|
34
|
+
}
|
35
|
+
|
28
36
|
controls = trackedTask(this, this.fetchControls, () => [this.caseId]);
|
29
37
|
navigation = trackedTask(this, this.fetchNavigation, () => [this.caseId]);
|
30
38
|
|
@@ -51,6 +59,7 @@ export default class DistributionService extends Service {
|
|
51
59
|
createTask: this.config.controls.createTask,
|
52
60
|
completeTask: this.config.controls.completeTask,
|
53
61
|
inquiryTask: this.config.inquiry.task,
|
62
|
+
checkTask: this.config.controls.checkTask,
|
54
63
|
},
|
55
64
|
});
|
56
65
|
}
|
@@ -93,7 +102,7 @@ export default class DistributionService extends Service {
|
|
93
102
|
}
|
94
103
|
|
95
104
|
@dropTask
|
96
|
-
*createInquiry(groups) {
|
105
|
+
*createInquiry(groups, context = {}) {
|
97
106
|
try {
|
98
107
|
// get create inquiry work item to complete
|
99
108
|
const createId = decodeId(this.controls.value?.create.edges[0].node.id);
|
@@ -104,6 +113,7 @@ export default class DistributionService extends Service {
|
|
104
113
|
variables: {
|
105
114
|
id: createId,
|
106
115
|
context: JSON.stringify({
|
116
|
+
...context,
|
107
117
|
addressed_groups: groups.map(String),
|
108
118
|
}),
|
109
119
|
},
|
@@ -8,11 +8,13 @@
|
|
8
8
|
</div>
|
9
9
|
{{else}}
|
10
10
|
<div uk-grid class={{if this.config.ui.stack "uk-grid-small"}}>
|
11
|
-
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
{{#if this.distribution.hasInquiries}}
|
12
|
+
<div class={{if this.config.ui.stack "uk-width-1-1" "uk-width-1-3"}}>
|
13
|
+
<CdNavigation @caseId={{@model}} />
|
14
|
+
</div>
|
15
|
+
{{#if this.config.ui.stack}}<div class="uk-width-1-1"><hr /></div>{{/if}}
|
16
|
+
{{/if}}
|
17
|
+
<div class="uk-width-expand">
|
16
18
|
{{outlet}}
|
17
19
|
</div>
|
18
20
|
</div>
|