@projectcaluma/ember-distribution 1.0.0-beta.3 → 1.0.0-beta.6
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +37 -0
- package/addon/abilities/distribution.js +31 -0
- package/addon/components/distribution-navigation/controls.hbs +17 -12
- package/addon/components/distribution-navigation/controls.js +32 -26
- package/addon/components/distribution-navigation/item.hbs +3 -3
- package/addon/components/distribution-navigation/item.js +1 -1
- package/addon/components/distribution-navigation/section.hbs +8 -6
- package/addon/components/distribution-navigation.hbs +1 -1
- package/addon/components/distribution-navigation.js +28 -56
- package/addon/components/icon-button.hbs +16 -9
- package/addon/components/inquiry-answer-form.hbs +33 -31
- package/addon/components/inquiry-answer-form.js +1 -1
- package/addon/components/inquiry-dialog/inquiry-deadline.hbs +27 -6
- package/addon/components/inquiry-dialog/inquiry-deadline.js +4 -0
- package/addon/components/inquiry-dialog/inquiry-divider.hbs +2 -1
- package/addon/components/inquiry-dialog/inquiry-part.hbs +18 -10
- package/addon/components/inquiry-dialog/inquiry-part.js +39 -0
- package/addon/components/inquiry-dialog/inquiry.hbs +4 -1
- package/addon/components/inquiry-dialog/inquiry.js +4 -0
- package/addon/components/inquiry-dialog.hbs +8 -6
- package/addon/components/inquiry-dialog.js +25 -2
- package/addon/components/inquiry-edit-form.hbs +21 -19
- package/addon/components/inquiry-edit-form.js +2 -1
- package/addon/components/inquiry-new-form.hbs +113 -101
- package/addon/components/inquiry-new-form.js +22 -40
- package/addon/components/notfound.hbs +12 -0
- package/addon/config.js +1 -0
- package/addon/controllers/application.js +7 -0
- package/addon/controllers/{distribution/new.js → new.js} +1 -1
- package/addon/gql/mutations/withdraw-inquiry.graphql +8 -0
- package/addon/gql/queries/control-work-items.graphql +18 -2
- package/addon/gql/queries/inquiry-navigation.graphql +2 -0
- package/addon/modifiers/pikaday.js +2 -0
- package/addon/routes/{distribution.js → application.js} +1 -1
- package/addon/routes/{distribution/index.js → index.js} +2 -2
- package/addon/routes/inquiry/detail/answer.js +7 -0
- package/addon/routes/inquiry/detail/index.js +7 -0
- package/addon/routes/{distribution/inquiry → inquiry}/detail.js +1 -1
- package/addon/routes/inquiry/index.js +10 -0
- package/addon/routes/{distribution/inquiry.js → inquiry.js} +1 -1
- package/addon/routes/new.js +7 -0
- package/addon/routes/notfound.js +3 -0
- package/addon/routes.js +5 -6
- package/addon/services/distribution.js +82 -0
- package/addon/templates/application.hbs +8 -0
- package/addon/templates/index.hbs +11 -0
- package/addon/templates/{distribution/inquiry → inquiry}/detail/answer.hbs +0 -0
- package/addon/templates/{distribution/inquiry → inquiry}/detail/index.hbs +0 -0
- package/addon/templates/{distribution/inquiry → inquiry}/detail.hbs +0 -0
- package/addon/templates/{distribution/inquiry → inquiry}/index.hbs +0 -0
- package/addon/templates/{distribution/inquiry.hbs → inquiry.hbs} +0 -0
- package/addon/templates/{distribution/new.hbs → new.hbs} +0 -0
- package/addon/templates/notfound.hbs +1 -0
- package/addon/utils/unique-by-groups.js +1 -0
- package/app/abilities/distribution.js +1 -0
- package/app/components/notfound.js +1 -0
- package/app/services/distribution.js +1 -0
- package/app/styles/_inquiry-divider.scss +22 -0
- package/index.js +14 -13
- package/package.json +21 -16
- package/public/assets/distribution.svg +1 -0
- package/translations/de.yaml +18 -0
- package/translations/en.yaml +18 -0
- package/translations/fr.yaml +18 -0
- package/addon/routes/distribution/inquiry/detail/answer.js +0 -7
- package/addon/routes/distribution/inquiry/detail/index.js +0 -7
- package/addon/routes/distribution/inquiry/index.js +0 -10
- package/addon/routes/distribution/new.js +0 -7
- package/addon/templates/distribution.hbs +0 -8
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
{{
|
3
|
-
|
4
|
-
|
1
|
+
{{#if this._inquiries.isRunning}}
|
2
|
+
<div class="uk-text-center"><UkSpinner @ratio={{2}} /></div>
|
3
|
+
{{else if this.inquiries.length}}
|
4
|
+
<section>
|
5
5
|
{{#each this.inquiries as |inquiry|}}
|
6
6
|
<InquiryDialog::Inquiry @inquiry={{inquiry}} />
|
7
7
|
{{/each}}
|
8
|
-
|
9
|
-
|
8
|
+
</section>
|
9
|
+
{{else}}
|
10
|
+
<Notfound />
|
11
|
+
{{/if}}
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { inject as service } from "@ember/service";
|
1
2
|
import Component from "@glimmer/component";
|
2
|
-
import { queryManager } from "ember-apollo-client";
|
3
|
+
import { queryManager, getObservable } from "ember-apollo-client";
|
3
4
|
import { dropTask } from "ember-concurrency";
|
4
5
|
import { useTask } from "ember-resources";
|
5
6
|
|
@@ -7,6 +8,8 @@ import config from "@projectcaluma/ember-distribution/config";
|
|
7
8
|
import inquiryDialogQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-dialog.graphql";
|
8
9
|
|
9
10
|
export default class InquiryDialogComponent extends Component {
|
11
|
+
@service router;
|
12
|
+
|
10
13
|
@config config;
|
11
14
|
|
12
15
|
@queryManager apollo;
|
@@ -24,7 +27,7 @@ export default class InquiryDialogComponent extends Component {
|
|
24
27
|
|
25
28
|
@dropTask
|
26
29
|
*fetchDialog() {
|
27
|
-
|
30
|
+
const response = yield this.apollo.watchQuery({
|
28
31
|
query: inquiryDialogQuery,
|
29
32
|
variables: {
|
30
33
|
from: this.args.from,
|
@@ -38,5 +41,25 @@ export default class InquiryDialogComponent extends Component {
|
|
38
41
|
includeNavigationData: true,
|
39
42
|
},
|
40
43
|
});
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Sadly this is necessary to handle what happens after the withdraw task in
|
47
|
+
* the inquiry part component because the mutation triggers a refresh of the
|
48
|
+
* query above in the same runloop instead of the next one. This causes
|
49
|
+
* `this.inquiries` to be recomputed which then triggers a rerender of the
|
50
|
+
* component and therefore cancels the withdraw task before we can do a
|
51
|
+
* transition.
|
52
|
+
*
|
53
|
+
* TODO: If https://github.com/ember-graphql/ember-apollo-client/pull/421 is
|
54
|
+
* merged and released, we can rewrite this into an action that is triggered
|
55
|
+
* in the withdraw task of the child component.
|
56
|
+
*/
|
57
|
+
getObservable(response).subscribe(({ data: { allWorkItems } }) => {
|
58
|
+
if (allWorkItems.edges.every((edge) => edge.node.status === "CANCELED")) {
|
59
|
+
this.router.transitionTo("index");
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
return response;
|
41
64
|
}
|
42
65
|
}
|
@@ -2,26 +2,28 @@
|
|
2
2
|
@documentId={{decode-id this.inquiry.document.id}}
|
3
3
|
@disabled={{cannot "edit inquiry" this.inquiry}}
|
4
4
|
@loading={{this._inquiry.isRunning}}
|
5
|
-
as |content|
|
6
5
|
>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
<:default as |content|>
|
7
|
+
<h1 class="uk-flex uk-flex-middle">
|
8
|
+
{{t "caluma.distribution.edit.title"}}
|
9
|
+
{{#if (eq this.inquiry.status "RUNNING")}}
|
10
|
+
<UkLabel
|
11
|
+
class="uk-margin-left"
|
12
|
+
@label={{t "caluma.distribution.status.draft"}}
|
13
|
+
/>
|
14
|
+
{{/if}}
|
15
|
+
</h1>
|
16
16
|
|
17
|
-
|
17
|
+
<content.form />
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
<DocumentValidity @document={{content.document}} as |isValid validate|>
|
20
|
+
<UkButton
|
21
|
+
@type="submit"
|
22
|
+
@color="primary"
|
23
|
+
@disabled={{or (not isValid) this.send.isRunning}}
|
24
|
+
@onClick={{perform this.send validate}}
|
25
|
+
>{{t "caluma.distribution.edit.send"}}</UkButton>
|
26
|
+
</DocumentValidity>
|
27
|
+
</:default>
|
28
|
+
<:notfound><Notfound /></:notfound>
|
27
29
|
</CfContent>
|
@@ -11,6 +11,7 @@ import inquiryEditQuery from "@projectcaluma/ember-distribution/gql/queries/inqu
|
|
11
11
|
export default class InquiryEditFormComponent extends Component {
|
12
12
|
@service notification;
|
13
13
|
@service router;
|
14
|
+
@service intl;
|
14
15
|
|
15
16
|
@config config;
|
16
17
|
|
@@ -43,7 +44,7 @@ export default class InquiryEditFormComponent extends Component {
|
|
43
44
|
variables: { workItem: this.args.inquiry },
|
44
45
|
});
|
45
46
|
|
46
|
-
yield this.router.transitionTo("
|
47
|
+
yield this.router.transitionTo("inquiry.index");
|
47
48
|
} catch (error) {
|
48
49
|
this.notification.danger(
|
49
50
|
this.intl.t("caluma.distribution.edit.send-error")
|
@@ -1,109 +1,121 @@
|
|
1
|
-
|
1
|
+
{{#if this.controls.workItems.isRunning}}
|
2
|
+
<div class="uk-text-center"><UkSpinner @ratio={{2}} /></div>
|
3
|
+
{{else if (can "create inquiry of distribution")}}
|
4
|
+
<h1>{{t "caluma.distribution.new.title"}}</h1>
|
2
5
|
|
3
|
-
{{#if this.selectedGroups.length}}
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
{{#if this.selectedGroups.length}}
|
7
|
+
<div class="uk-flex uk-flex-middle">
|
8
|
+
<div class="uk-width-expand">
|
9
|
+
<a href="">
|
10
|
+
{{t
|
11
|
+
"caluma.distribution.new.groups"
|
12
|
+
count=this.selectedGroups.length
|
13
|
+
}}
|
14
|
+
</a>
|
15
|
+
<div uk-dropdown class="uk-width-auto">
|
16
|
+
<ul
|
17
|
+
class="uk-list uk-list-bullet uk-margin-remove uk-padding-remove"
|
18
|
+
data-test-selected-groups
|
19
|
+
>
|
20
|
+
{{#each this.selectedGroups as |identifier|}}
|
21
|
+
<li class="uk-text-nowrap">{{group-name identifier}}</li>
|
22
|
+
{{/each}}
|
23
|
+
</ul>
|
24
|
+
</div>
|
25
|
+
{{t
|
26
|
+
"caluma.distribution.new.selected"
|
27
|
+
count=this.selectedGroups.length
|
28
|
+
}}
|
29
|
+
</div>
|
30
|
+
<div>
|
31
|
+
<UkButton
|
32
|
+
@label={{t "caluma.distribution.new.reset"}}
|
33
|
+
@onClick={{this.clearSelectedGroups}}
|
34
|
+
data-test-reset
|
35
|
+
/>
|
36
|
+
<UkButton
|
37
|
+
@color="primary"
|
38
|
+
@label={{t "caluma.distribution.new.create-draft"}}
|
39
|
+
@type="submit"
|
40
|
+
@loading={{this.submit.isRunning}}
|
41
|
+
@disabled={{this.submit.isRunning}}
|
42
|
+
@onClick={{perform this.submit}}
|
43
|
+
data-test-submit
|
44
|
+
/>
|
18
45
|
</div>
|
19
|
-
{{t "caluma.distribution.new.selected" count=this.selectedGroups.length}}
|
20
|
-
</div>
|
21
|
-
<div>
|
22
|
-
<UkButton
|
23
|
-
@label={{t "caluma.distribution.new.reset"}}
|
24
|
-
@onClick={{this.clearSelectedGroups}}
|
25
|
-
data-test-reset
|
26
|
-
/>
|
27
|
-
<UkButton
|
28
|
-
@color="primary"
|
29
|
-
@label={{t "caluma.distribution.new.create-draft"}}
|
30
|
-
@type="submit"
|
31
|
-
@loading={{this.submit.isRunning}}
|
32
|
-
@disabled={{this.submit.isRunning}}
|
33
|
-
@onClick={{perform this.submit}}
|
34
|
-
data-test-submit
|
35
|
-
/>
|
36
46
|
</div>
|
37
|
-
|
38
|
-
|
39
|
-
{{/if}}
|
40
|
-
|
41
|
-
<div class="uk-margin-bottom uk-button-group">
|
42
|
-
{{#each-in this.config.new.types as |slug config|}}
|
43
|
-
{{#unless config.disabled}}
|
44
|
-
<UkButton
|
45
|
-
data-test-type={{slug}}
|
46
|
-
@label={{t config.label}}
|
47
|
-
@color={{if (includes slug @selectedTypes) "primary" "default"}}
|
48
|
-
@onClick={{fn this.updateSelectedTypes slug}}
|
49
|
-
/>
|
50
|
-
{{/unless}}
|
51
|
-
{{/each-in}}
|
52
|
-
</div>
|
47
|
+
<hr />
|
48
|
+
{{/if}}
|
53
49
|
|
54
|
-
<div class="uk-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
</div>
|
50
|
+
<div class="uk-margin-bottom uk-button-group">
|
51
|
+
{{#each-in this.config.new.types as |slug config|}}
|
52
|
+
{{#unless config.disabled}}
|
53
|
+
<UkButton
|
54
|
+
data-test-type={{slug}}
|
55
|
+
@label={{t config.label}}
|
56
|
+
@color={{if (includes slug @selectedTypes) "primary" "default"}}
|
57
|
+
@onClick={{fn this.updateSelectedTypes slug}}
|
58
|
+
/>
|
59
|
+
{{/unless}}
|
60
|
+
{{/each-in}}
|
61
|
+
</div>
|
66
62
|
|
67
|
-
|
68
|
-
|
69
|
-
<
|
63
|
+
<div class="uk-search uk-search-default uk-width-1-1">
|
64
|
+
<span class="uk-search-icon-flip" uk-search-icon></span>
|
65
|
+
<input
|
66
|
+
placeholder={{t "caluma.distribution.new.search"}}
|
67
|
+
aria-label={{t "caluma.distribution.new.search"}}
|
68
|
+
class="uk-search-input"
|
69
|
+
type="search"
|
70
|
+
value={{@search}}
|
71
|
+
data-test-search
|
72
|
+
{{on "input" (perform this.updateSearch)}}
|
73
|
+
/>
|
70
74
|
</div>
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
{{
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
{{
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
75
|
+
|
76
|
+
{{#if this.groups.isRunning}}
|
77
|
+
<div class="uk-text-center uk-margin">
|
78
|
+
<UkSpinner @ratio={{2}} />
|
79
|
+
</div>
|
80
|
+
{{else if this.groups.value.length}}
|
81
|
+
<ul class="uk-list uk-list-striped">
|
82
|
+
{{#each this.groups.value as |group|}}
|
83
|
+
{{! template-lint-disable require-presentational-children }}
|
84
|
+
<li
|
85
|
+
role="checkbox"
|
86
|
+
class="uk-flex uk-flex-between uk-flex-middle"
|
87
|
+
data-test-group={{group.identifier}}
|
88
|
+
{{on "click" (fn this.updateSelectedGroups group.identifier)}}
|
89
|
+
>
|
90
|
+
{{! template-lint-disable no-nested-interactive }}
|
91
|
+
<label for="group-{{group.identifier}}">
|
92
|
+
<input
|
93
|
+
type="checkbox"
|
94
|
+
class="uk-checkbox uk-margin-small-right"
|
95
|
+
checked={{includes group.identifier this.selectedGroups}}
|
96
|
+
id="group-{{group.identifier}}"
|
97
|
+
/>
|
98
|
+
{{group-name group.identifier}}
|
99
|
+
</label>
|
100
|
+
{{#if group.config.icon}}
|
101
|
+
{{svg-jar
|
102
|
+
group.config.icon
|
103
|
+
width="20"
|
104
|
+
height="20"
|
105
|
+
class=(concat "uk-text-" group.config.iconColor)
|
106
|
+
}}
|
107
|
+
{{/if}}
|
108
|
+
</li>
|
109
|
+
{{/each}}
|
110
|
+
</ul>
|
111
|
+
{{else}}
|
112
|
+
<div class="uk-text-center">
|
113
|
+
<UkIcon @icon="search" @ratio={{10}} class="uk-margin-top" />
|
114
|
+
<p class="uk-text-muted">
|
115
|
+
{{t "caluma.distribution.new.empty"}}
|
116
|
+
</p>
|
117
|
+
</div>
|
118
|
+
{{/if}}
|
102
119
|
{{else}}
|
103
|
-
<
|
104
|
-
<UkIcon @icon="search" @ratio={{10}} class="uk-margin-top" />
|
105
|
-
<p class="uk-text-muted">
|
106
|
-
{{t "caluma.distribution.new.empty"}}
|
107
|
-
</p>
|
108
|
-
</div>
|
120
|
+
<Notfound />
|
109
121
|
{{/if}}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { getOwner } from "@ember/application";
|
2
1
|
import { action } from "@ember/object";
|
3
2
|
import { inject as service } from "@ember/service";
|
3
|
+
import { macroCondition, isTesting } from "@embroider/macros";
|
4
4
|
import Component from "@glimmer/component";
|
5
5
|
import { tracked } from "@glimmer/tracking";
|
6
6
|
import { queryManager } from "ember-apollo-client";
|
@@ -10,8 +10,6 @@ import { useTask } from "ember-resources";
|
|
10
10
|
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
11
11
|
import config from "@projectcaluma/ember-distribution/config";
|
12
12
|
import createInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/create-inquiry.graphql";
|
13
|
-
import controlWorkItemsQuery from "@projectcaluma/ember-distribution/gql/queries/control-work-items.graphql";
|
14
|
-
import inquiryNavigationQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-navigation.graphql";
|
15
13
|
|
16
14
|
const toggle = (value, array) => {
|
17
15
|
const set = new Set(array);
|
@@ -26,6 +24,7 @@ export default class InquiryNewFormComponent extends Component {
|
|
26
24
|
@service notification;
|
27
25
|
@service intl;
|
28
26
|
@service router;
|
27
|
+
@service distribution;
|
29
28
|
|
30
29
|
@queryManager apollo;
|
31
30
|
|
@@ -63,10 +62,10 @@ export default class InquiryNewFormComponent extends Component {
|
|
63
62
|
*updateSearch(e) {
|
64
63
|
e.preventDefault();
|
65
64
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
/* istanbul ignore next */
|
66
|
+
if (macroCondition(isTesting())) {
|
67
|
+
// no timeout
|
68
|
+
} else {
|
70
69
|
yield timeout(500);
|
71
70
|
}
|
72
71
|
|
@@ -80,54 +79,37 @@ export default class InquiryNewFormComponent extends Component {
|
|
80
79
|
if (!this.selectedGroups.length) return;
|
81
80
|
|
82
81
|
try {
|
83
|
-
// get create inquiry work item to complete
|
84
|
-
|
85
|
-
|
86
|
-
{
|
87
|
-
query: controlWorkItemsQuery,
|
88
|
-
variables: {
|
89
|
-
caseId: this.args.caseId,
|
90
|
-
currentGroup: String(this.calumaOptions.currentGroupId),
|
91
|
-
createTask: this.config.controls.createTask,
|
92
|
-
completeTask: this.config.controls.completeTask,
|
93
|
-
},
|
94
|
-
},
|
95
|
-
"create.edges"
|
82
|
+
// get create inquiry work item to complete
|
83
|
+
const createId = decodeId(
|
84
|
+
this.distribution.controls.value?.create.edges[0].node.id
|
96
85
|
);
|
97
86
|
|
98
87
|
// create new inquiries
|
99
88
|
yield this.apollo.mutate({
|
100
89
|
mutation: createInquiryMutation,
|
101
90
|
variables: {
|
102
|
-
id:
|
91
|
+
id: createId,
|
103
92
|
context: JSON.stringify({
|
104
93
|
addressed_groups: this.selectedGroups.map(String),
|
105
94
|
}),
|
106
95
|
},
|
107
96
|
});
|
108
97
|
|
109
|
-
// refetch navigation data
|
110
|
-
|
98
|
+
// refetch navigation and controls data
|
99
|
+
yield this.distribution.refetch();
|
100
|
+
|
101
|
+
const lastControlling =
|
102
|
+
this.distribution.navigation.value.controlling.edges[0].node;
|
103
|
+
|
104
|
+
// transition to last added inquiry
|
105
|
+
this.router.transitionTo(
|
106
|
+
"inquiry.detail.index",
|
111
107
|
{
|
112
|
-
|
113
|
-
|
114
|
-
variables: {
|
115
|
-
caseId: this.args.caseId,
|
116
|
-
task: this.config.inquiry.task,
|
117
|
-
currentGroup: String(this.calumaOptions.currentGroupId),
|
118
|
-
statusQuestion: this.config.inquiry.answer.statusQuestion,
|
119
|
-
deadlineQuestion: this.config.inquiry.deadlineQuestion,
|
120
|
-
includeNavigationData: true,
|
121
|
-
},
|
108
|
+
from: lastControlling.controllingGroups[0],
|
109
|
+
to: lastControlling.addressedGroups[0],
|
122
110
|
},
|
123
|
-
|
111
|
+
decodeId(lastControlling.id)
|
124
112
|
);
|
125
|
-
|
126
|
-
// transition to last added inquiry
|
127
|
-
this.router.transitionTo("distribution.inquiry", {
|
128
|
-
from: navigationData[0].node.controllingGroups[0],
|
129
|
-
to: navigationData[0].node.addressedGroups[0],
|
130
|
-
});
|
131
113
|
} catch (e) {
|
132
114
|
this.notification.danger(
|
133
115
|
this.intl.t("caluma.distribution.new.error", {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="uk-text-center">
|
2
|
+
<h1 class="uk-heading-xlarge">
|
3
|
+
{{t "caluma.distribution.notfound.title"}}
|
4
|
+
</h1>
|
5
|
+
<h2 class="uk-heading-small uk-margin-remove-top uk-text-muted">
|
6
|
+
{{t "caluma.distribution.notfound.subtitle"}}
|
7
|
+
</h2>
|
8
|
+
<p class="uk-text-muted">
|
9
|
+
{{t "caluma.distribution.notfound.back"}}
|
10
|
+
<LinkTo @route="index">{{t "caluma.distribution.notfound.link"}}</LinkTo>
|
11
|
+
</p>
|
12
|
+
</div>
|
package/addon/config.js
CHANGED
@@ -3,7 +3,7 @@ import { dedupeTracked, cached } from "tracked-toolbox";
|
|
3
3
|
|
4
4
|
import config from "@projectcaluma/ember-distribution/config";
|
5
5
|
|
6
|
-
export default class
|
6
|
+
export default class NewController extends Controller {
|
7
7
|
@config config;
|
8
8
|
|
9
9
|
queryParams = ["types", "search"];
|
@@ -1,6 +1,7 @@
|
|
1
1
|
query ControlWorkItems(
|
2
2
|
$createTask: ID!
|
3
3
|
$completeTask: ID!
|
4
|
+
$inquiryTask: ID!
|
4
5
|
$caseId: ID!
|
5
6
|
$currentGroup: String!
|
6
7
|
) {
|
@@ -11,11 +12,11 @@ query ControlWorkItems(
|
|
11
12
|
{ status: READY }
|
12
13
|
{ addressedGroups: [$currentGroup] }
|
13
14
|
]
|
14
|
-
first: 1
|
15
15
|
) {
|
16
16
|
edges {
|
17
17
|
node {
|
18
18
|
id
|
19
|
+
status
|
19
20
|
}
|
20
21
|
}
|
21
22
|
}
|
@@ -26,11 +27,26 @@ query ControlWorkItems(
|
|
26
27
|
{ status: READY }
|
27
28
|
{ addressedGroups: [$currentGroup] }
|
28
29
|
]
|
29
|
-
first: 1
|
30
30
|
) {
|
31
31
|
edges {
|
32
32
|
node {
|
33
33
|
id
|
34
|
+
status
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
send: allWorkItems(
|
39
|
+
filter: [
|
40
|
+
{ case: $caseId }
|
41
|
+
{ task: $inquiryTask }
|
42
|
+
{ status: SUSPENDED }
|
43
|
+
{ controllingGroups: [$currentGroup] }
|
44
|
+
]
|
45
|
+
) {
|
46
|
+
edges {
|
47
|
+
node {
|
48
|
+
id
|
49
|
+
status
|
34
50
|
}
|
35
51
|
}
|
36
52
|
}
|
@@ -13,6 +13,7 @@ query InquiryNavigation(
|
|
13
13
|
{ case: $caseId }
|
14
14
|
{ task: $task }
|
15
15
|
{ controllingGroups: [$currentGroup] }
|
16
|
+
{ status: CANCELED, invert: true }
|
16
17
|
]
|
17
18
|
order: [{ attribute: CREATED_AT, direction: DESC }]
|
18
19
|
) {
|
@@ -28,6 +29,7 @@ query InquiryNavigation(
|
|
28
29
|
{ task: $task }
|
29
30
|
{ addressedGroups: [$currentGroup] }
|
30
31
|
{ status: SUSPENDED, invert: true }
|
32
|
+
{ status: CANCELED, invert: true }
|
31
33
|
]
|
32
34
|
order: [{ attribute: CREATED_AT, direction: DESC }]
|
33
35
|
) {
|
@@ -6,7 +6,7 @@ import config from "@projectcaluma/ember-distribution/config";
|
|
6
6
|
import inquiryNavigationQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-navigation.graphql";
|
7
7
|
import uniqueByGroups from "@projectcaluma/ember-distribution/utils/unique-by-groups";
|
8
8
|
|
9
|
-
export default class
|
9
|
+
export default class IndexRoute extends Route {
|
10
10
|
@service router;
|
11
11
|
@service calumaOptions;
|
12
12
|
|
@@ -35,7 +35,7 @@ export default class DistributionIndexRoute extends Route {
|
|
35
35
|
}, {});
|
36
36
|
|
37
37
|
if (models.length) {
|
38
|
-
return this.router.replaceWith("
|
38
|
+
return this.router.replaceWith("inquiry", models[0]);
|
39
39
|
}
|
40
40
|
}
|
41
41
|
}
|