@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
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,40 @@
|
|
1
|
+
# [@projectcaluma/ember-distribution-v1.0.0-beta.6](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.5...@projectcaluma/ember-distribution-v1.0.0-beta.6) (2022-03-24)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* **embroider:** add missing dependency on @ember/string ([3a6e6bb](https://github.com/projectcaluma/ember-caluma/commit/3a6e6bb39a8c1a40a2ae00b3d4ea00606a755e25))
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* **distribution:** add functionality to send all pending inquiries ([d769953](https://github.com/projectcaluma/ember-caluma/commit/d769953d5a0ea196943426c8499ba87b77a42e61))
|
12
|
+
* **distribution:** add functionality to withdraw an inquiry ([c278895](https://github.com/projectcaluma/ember-caluma/commit/c2788957c0fb228c167ca9236fda4850717f5817))
|
13
|
+
|
14
|
+
# [@projectcaluma/ember-distribution-v1.0.0-beta.5](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.4...@projectcaluma/ember-distribution-v1.0.0-beta.5) (2022-03-11)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* **distribution:** fix sorting after group names in navigation ([2299d3b](https://github.com/projectcaluma/ember-caluma/commit/2299d3b0e265204ab6747dbdc6a8b64fc22f247f))
|
20
|
+
* **distribution:** redirect to edit form after inquiry creation ([0a2c404](https://github.com/projectcaluma/ember-caluma/commit/0a2c40404fdb1258fb8d51a2809a03b335c7c78a))
|
21
|
+
|
22
|
+
# [@projectcaluma/ember-distribution-v1.0.0-beta.4](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.3...@projectcaluma/ember-distribution-v1.0.0-beta.4) (2022-02-16)
|
23
|
+
|
24
|
+
|
25
|
+
### Bug Fixes
|
26
|
+
|
27
|
+
* **distribution:** show controls if no inquiries exist yet ([5c73b6d](https://github.com/projectcaluma/ember-caluma/commit/5c73b6d0a870fd0e34d96af3fa34095733fe9fd9))
|
28
|
+
* **pikaday:** add pikaday modifier reexport in engines ([c13d302](https://github.com/projectcaluma/ember-caluma/commit/c13d3021bb8fe82e1245a60182af01287c507697))
|
29
|
+
|
30
|
+
|
31
|
+
### Features
|
32
|
+
|
33
|
+
* **distribution:** add config variable to stack the UI ([2ad285a](https://github.com/projectcaluma/ember-caluma/commit/2ad285a24bf5fb45d15fe237e3f420dd1f1d94f2))
|
34
|
+
* **distribution:** add index page when no inquiries exist ([689089c](https://github.com/projectcaluma/ember-caluma/commit/689089c8f28146a33346f382fe69e7ca1b588d97))
|
35
|
+
* **distribution:** add proper 404 handling ([73e62e6](https://github.com/projectcaluma/ember-caluma/commit/73e62e671a9425fc549d7057dd653d1dc59883aa))
|
36
|
+
* **distribution:** remove distribution top level route ([6f396da](https://github.com/projectcaluma/ember-caluma/commit/6f396daf2881f07cdddaac6c7ca784db2b8777d3))
|
37
|
+
|
1
38
|
# [@projectcaluma/ember-distribution-v1.0.0-beta.3](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.2...@projectcaluma/ember-distribution-v1.0.0-beta.3) (2022-02-07)
|
2
39
|
|
3
40
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { inject as service } from "@ember/service";
|
2
|
+
import { Ability } from "ember-can";
|
3
|
+
|
4
|
+
const hasStatus = (status) => (edge) => edge.node.status === status;
|
5
|
+
|
6
|
+
export default class DistributionAbility extends Ability {
|
7
|
+
@service distribution;
|
8
|
+
|
9
|
+
get canSendInquiries() {
|
10
|
+
return (
|
11
|
+
this.distribution.controls.value?.send.edges.filter(
|
12
|
+
hasStatus("SUSPENDED")
|
13
|
+
).length > 0
|
14
|
+
);
|
15
|
+
}
|
16
|
+
|
17
|
+
get canCreateInquiry() {
|
18
|
+
return (
|
19
|
+
this.distribution.controls.value?.create.edges.filter(hasStatus("READY"))
|
20
|
+
.length > 0
|
21
|
+
);
|
22
|
+
}
|
23
|
+
|
24
|
+
get canComplete() {
|
25
|
+
return (
|
26
|
+
this.distribution.controls.value?.complete.edges.filter(
|
27
|
+
hasStatus("READY")
|
28
|
+
).length > 0
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
@@ -1,17 +1,22 @@
|
|
1
1
|
<div class="uk-text-center uk-margin-small-top">
|
2
|
-
{{#if
|
3
|
-
<IconButton @route="
|
2
|
+
{{#if (can "create inquiry of distribution")}}
|
3
|
+
<IconButton @route="new" @icon="plus" />
|
4
4
|
{{/if}}
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
{{#if (can "send inquiries of distribution")}}
|
6
|
+
<IconButton
|
7
|
+
@title={{t "caluma.distribution.send"}}
|
8
|
+
@icon="paper-plane-outline"
|
9
|
+
@fromSvgJar={{true}}
|
10
|
+
@gutterTop={{4}}
|
11
|
+
@gutterRight={{6}}
|
12
|
+
@gutterLeft={{4}}
|
13
|
+
@gutterBottom={{4}}
|
14
|
+
@onClick={{perform this.sendInquiries}}
|
15
|
+
@loading={{this.sendInquiries.isRunning}}
|
16
|
+
data-test-send-pending-inquiries
|
17
|
+
/>
|
18
|
+
{{/if}}
|
19
|
+
{{#if (can "complete distribution")}}
|
15
20
|
<IconButton
|
16
21
|
@icon="lock-closed-outline"
|
17
22
|
@fromSvgJar={{true}}
|
@@ -3,43 +3,49 @@ import { inject as service } from "@ember/service";
|
|
3
3
|
import Component from "@glimmer/component";
|
4
4
|
import { queryManager } from "ember-apollo-client";
|
5
5
|
import { dropTask } from "ember-concurrency";
|
6
|
-
import {
|
6
|
+
import { confirm } from "ember-uikit";
|
7
|
+
import { gql } from "graphql-tag";
|
7
8
|
|
8
|
-
import
|
9
|
-
import controlWorkItemsQuery from "@projectcaluma/ember-distribution/gql/queries/control-work-items.graphql";
|
9
|
+
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
10
10
|
|
11
11
|
export default class DistributionNavigationControlsComponent extends Component {
|
12
|
-
@service
|
12
|
+
@service distribution;
|
13
|
+
@service intl;
|
13
14
|
|
14
15
|
@queryManager apollo;
|
15
16
|
|
16
|
-
@config config;
|
17
|
-
|
18
|
-
workItems = useTask(this, this.fetchWorkItems, () => []);
|
19
|
-
|
20
|
-
get canCreate() {
|
21
|
-
return this.workItems.value?.create.edges.length > 0;
|
22
|
-
}
|
23
|
-
|
24
|
-
get canComplete() {
|
25
|
-
return this.workItems.value?.complete.edges.length > 0;
|
26
|
-
}
|
27
|
-
|
28
17
|
@action
|
29
18
|
noop(e) {
|
30
19
|
e.preventDefault();
|
31
20
|
}
|
32
21
|
|
33
22
|
@dropTask
|
34
|
-
*
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
23
|
+
*sendInquiries() {
|
24
|
+
if (!(yield confirm(this.intl.t("caluma.distribution.send-confirm")))) {
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
|
28
|
+
try {
|
29
|
+
const ids = this.distribution.controls.value.send.edges.map((edge) =>
|
30
|
+
decodeId(edge.node.id)
|
31
|
+
);
|
32
|
+
|
33
|
+
const mutations = ids.map(
|
34
|
+
(id, index) => `
|
35
|
+
sendInquiry${index}: resumeWorkItem(input: { id: "${id}" }) {
|
36
|
+
workItem {
|
37
|
+
id
|
38
|
+
status
|
39
|
+
}
|
40
|
+
}
|
41
|
+
`
|
42
|
+
);
|
43
|
+
|
44
|
+
const mutation = gql`mutation SendInquiries {${mutations.join("\n")}}`;
|
45
|
+
|
46
|
+
yield this.apollo.mutate({ mutation });
|
47
|
+
} catch (e) {
|
48
|
+
this.notification.danger(this.intl.t("caluma.distribution.send-error"));
|
49
|
+
}
|
44
50
|
}
|
45
51
|
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<li class={{if this.isActive "uk-active"}}>
|
2
|
-
<LinkTo @route="
|
2
|
+
<LinkTo @route="inquiry" @model={{this.model}}>
|
3
3
|
<div class="uk-flex uk-flex-middle uk-width-1-1">
|
4
4
|
<div class="uk-width-expand uk-text-truncate">
|
5
5
|
{{#if (eq @type "addressed")}}
|
6
|
-
{{
|
6
|
+
{{@inquiry.controllingGroupName}}
|
7
7
|
{{else}}
|
8
|
-
{{
|
8
|
+
{{@inquiry.addressedGroupName}}
|
9
9
|
{{/if}}
|
10
10
|
</div>
|
11
11
|
|
@@ -10,12 +10,14 @@
|
|
10
10
|
{{/if}}
|
11
11
|
</a>
|
12
12
|
|
13
|
-
{{#if
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
{{#if this.expanded}}
|
14
|
+
{{#if @inquiries.length}}
|
15
|
+
<ul class="uk-tab uk-tab-left uk-margin-left">
|
16
|
+
{{#each this.inquiries as |inquiry|}}
|
17
|
+
<DistributionNavigation::Item @inquiry={{inquiry}} @type={{@type}} />
|
18
|
+
{{/each}}
|
19
|
+
</ul>
|
20
|
+
{{/if}}
|
19
21
|
|
20
22
|
{{#if (eq @type "controlling")}}
|
21
23
|
<DistributionNavigation::Controls @caseId={{@caseId}} />
|
@@ -1,81 +1,53 @@
|
|
1
1
|
import { inject as service } from "@ember/service";
|
2
2
|
import Component from "@glimmer/component";
|
3
|
-
import { tracked } from "@glimmer/tracking";
|
4
3
|
import { queryManager } from "ember-apollo-client";
|
5
|
-
import { restartableTask } from "ember-concurrency";
|
6
|
-
import { useTask } from "ember-resources";
|
7
4
|
|
8
5
|
import config from "@projectcaluma/ember-distribution/config";
|
9
|
-
import inquiryNavigationQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-navigation.graphql";
|
10
6
|
import uniqueByGroups from "@projectcaluma/ember-distribution/utils/unique-by-groups";
|
11
7
|
|
12
8
|
export default class DistributionNavigationComponent extends Component {
|
13
|
-
@service calumaOptions;
|
14
9
|
@service("-scheduler") scheduler;
|
10
|
+
@service calumaOptions;
|
11
|
+
@service distribution;
|
15
12
|
|
16
13
|
@config config;
|
17
14
|
|
18
15
|
@queryManager apollo;
|
19
16
|
|
20
|
-
@tracked groups = [];
|
21
|
-
|
22
17
|
get inquiries() {
|
23
|
-
const findGroupName = (
|
24
|
-
this.
|
25
|
-
|
26
|
-
|
18
|
+
const findGroupName = (identifiers) => {
|
19
|
+
const group = this.scheduler.groupCache.find((group) =>
|
20
|
+
identifiers
|
21
|
+
.map(String)
|
22
|
+
.includes(String(group[this.calumaOptions.groupIdentifierProperty]))
|
23
|
+
);
|
27
24
|
|
28
|
-
|
25
|
+
return group?.[this.calumaOptions.groupNameProperty] ?? "";
|
26
|
+
};
|
27
|
+
|
28
|
+
return Object.entries(this.distribution.navigation.value ?? {}).reduce(
|
29
29
|
(inquiries, [key, objects]) => {
|
30
30
|
return {
|
31
31
|
...inquiries,
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
// Don't return any data until the internal scheduler has cached
|
33
|
+
// groups since we don't want to render empty navigation items
|
34
|
+
[key]: this.scheduler.groupCache.length
|
35
|
+
? uniqueByGroups(
|
36
|
+
objects.edges.map((edge) => ({
|
37
|
+
...edge.node,
|
38
|
+
// Populate the work item with the names of the involved
|
39
|
+
// groups so the <DistributionNavigation::Section /> component
|
40
|
+
// can sort by them
|
41
|
+
addressedGroupName: findGroupName(edge.node.addressedGroups),
|
42
|
+
controllingGroupName: findGroupName(
|
43
|
+
edge.node.controllingGroups
|
44
|
+
),
|
45
|
+
}))
|
46
|
+
)
|
47
|
+
: [],
|
39
48
|
};
|
40
49
|
},
|
41
50
|
{}
|
42
51
|
);
|
43
52
|
}
|
44
|
-
|
45
|
-
_inquiries = useTask(this, this.fetchInquiries, () => [
|
46
|
-
this.args.caseId,
|
47
|
-
this.config,
|
48
|
-
]);
|
49
|
-
|
50
|
-
@restartableTask
|
51
|
-
*fetchInquiries() {
|
52
|
-
const response = yield this.apollo.watchQuery({
|
53
|
-
query: inquiryNavigationQuery,
|
54
|
-
variables: {
|
55
|
-
caseId: this.args.caseId,
|
56
|
-
task: this.config.inquiry.task,
|
57
|
-
currentGroup: String(this.calumaOptions.currentGroupId),
|
58
|
-
statusQuestion: this.config.inquiry.answer.statusQuestion,
|
59
|
-
deadlineQuestion: this.config.inquiry.deadlineQuestion,
|
60
|
-
includeNavigationData: true,
|
61
|
-
},
|
62
|
-
});
|
63
|
-
|
64
|
-
const groupIds = [
|
65
|
-
...new Set(
|
66
|
-
Object.values(response)
|
67
|
-
.map((inquiries) => {
|
68
|
-
return inquiries.edges.map((edge) => [
|
69
|
-
...edge.node.addressedGroups,
|
70
|
-
...edge.node.controllingGroups,
|
71
|
-
]);
|
72
|
-
})
|
73
|
-
.flat(2)
|
74
|
-
),
|
75
|
-
];
|
76
|
-
|
77
|
-
this.groups = yield this.scheduler.resolve(groupIds, "group");
|
78
|
-
|
79
|
-
return response;
|
80
|
-
}
|
81
53
|
}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
{{#if @route}}
|
2
|
-
<LinkTo
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
<LinkTo @route={{@route}} class={{this.class}} title={{@title}} ...attributes>
|
3
|
+
{{#if @loading}}
|
4
|
+
<UkSpinner @ratio={{0.6}} />
|
5
|
+
{{else if @fromSvgJar}}
|
6
|
+
{{svg-jar @icon title=@title width="20" height="20"}}
|
7
|
+
{{else}}
|
8
|
+
<UkIcon @icon={{@icon}} />
|
9
|
+
{{/if}}
|
9
10
|
</LinkTo>
|
10
11
|
{{else}}
|
11
12
|
<button
|
12
13
|
type="button"
|
13
14
|
class={{this.class}}
|
14
|
-
|
15
|
+
title={{@title}}
|
15
16
|
...attributes
|
16
17
|
{{on "click" @onClick}}
|
17
18
|
>
|
18
|
-
{{#if @
|
19
|
+
{{#if @loading}}
|
20
|
+
<UkSpinner @ratio={{0.6}} />
|
21
|
+
{{else if @fromSvgJar}}
|
22
|
+
{{svg-jar @icon title=@title width="20" height="20"}}
|
23
|
+
{{else}}
|
24
|
+
<UkIcon @icon={{@icon}} />
|
25
|
+
{{/if}}
|
19
26
|
</button>
|
20
27
|
{{/if}}
|
@@ -2,45 +2,47 @@
|
|
2
2
|
@documentId={{decode-id this.inquiry.childCase.document.id}}
|
3
3
|
@disabled={{cannot "edit answer form of 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.answer.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
|
-
|
19
|
+
{{#each this.buttons as |buttonConfig|}}
|
20
|
+
{{#if buttonConfig.isFormButton}}
|
21
|
+
<DocumentValidity @document={{content.document}} as |isValid validate|>
|
22
|
+
<UkButton
|
23
|
+
@type="submit"
|
24
|
+
@color={{buttonConfig.color}}
|
25
|
+
@disabled={{or (not isValid) this.completeWorkItem.isRunning}}
|
26
|
+
@onClick={{fn
|
27
|
+
(perform this.completeWorkItem)
|
28
|
+
buttonConfig.workItemId
|
29
|
+
validate
|
30
|
+
}}
|
31
|
+
>{{buttonConfig.label}}</UkButton>
|
32
|
+
</DocumentValidity>
|
33
|
+
{{else}}
|
22
34
|
<UkButton
|
23
|
-
@type="
|
35
|
+
@type="button"
|
24
36
|
@color={{buttonConfig.color}}
|
25
|
-
@disabled={{
|
37
|
+
@disabled={{this.completeWorkItem.isRunning}}
|
26
38
|
@onClick={{fn
|
27
39
|
(perform this.completeWorkItem)
|
28
40
|
buttonConfig.workItemId
|
29
|
-
|
41
|
+
null
|
30
42
|
}}
|
31
43
|
>{{buttonConfig.label}}</UkButton>
|
32
|
-
|
33
|
-
{{
|
34
|
-
|
35
|
-
|
36
|
-
@color={{buttonConfig.color}}
|
37
|
-
@disabled={{this.completeWorkItem.isRunning}}
|
38
|
-
@onClick={{fn
|
39
|
-
(perform this.completeWorkItem)
|
40
|
-
buttonConfig.workItemId
|
41
|
-
null
|
42
|
-
}}
|
43
|
-
>{{buttonConfig.label}}</UkButton>
|
44
|
-
{{/if}}
|
45
|
-
{{/each}}
|
44
|
+
{{/if}}
|
45
|
+
{{/each}}
|
46
|
+
</:default>
|
47
|
+
<:notfound><Notfound /></:notfound>
|
46
48
|
</CfContent>
|
@@ -65,7 +65,7 @@ export default class InquiryAnswerFormComponent extends Component {
|
|
65
65
|
},
|
66
66
|
});
|
67
67
|
|
68
|
-
yield this.router.transitionTo("
|
68
|
+
yield this.router.transitionTo("inquiry.index");
|
69
69
|
} catch (error) {
|
70
70
|
this.notification.danger(
|
71
71
|
this.intl.t("caluma.distribution.answer.complete-error")
|
@@ -1,6 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
{{#if this.deadline.value}}
|
2
|
+
<div
|
3
|
+
class="uk-position-top-right
|
4
|
+
{{if
|
5
|
+
this.config.ui.small
|
6
|
+
'uk-margin-top uk-margin-right'
|
7
|
+
'uk-margin-medium-top uk-margin-medium-right'
|
8
|
+
}}
|
9
|
+
{{if
|
10
|
+
this.isWithdrawn
|
11
|
+
'uk-text-muted'
|
12
|
+
(concat 'uk-text-' this.deadline.color)
|
13
|
+
}}
|
14
|
+
uk-flex-inline uk-flex-middle"
|
15
|
+
>
|
16
|
+
{{svg-jar
|
17
|
+
(if this.isWithdrawn "ban-outline" "alarm-outline")
|
18
|
+
height=26
|
19
|
+
class="uk-margin-small-right"
|
20
|
+
}}
|
21
|
+
{{#if this.isWithdrawn}}
|
22
|
+
{{t "caluma.distribution.withdraw.status"}}
|
23
|
+
{{else}}
|
24
|
+
{{format-date this.deadline.value}}
|
25
|
+
{{/if}}
|
26
|
+
</div>
|
27
|
+
{{/if}}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<div
|
2
|
-
class="inquiry-divider uk-flex uk-flex-center uk-flex-middle uk-flex-between uk-
|
2
|
+
class="inquiry-divider uk-flex uk-flex-center uk-flex-middle uk-flex-between uk-text-{{this.status.color}}
|
3
|
+
{{if this.config.ui.small 'inquiry-divider--small' 'uk-margin'}}"
|
3
4
|
>
|
4
5
|
<div class="inquiry-divider__icon uk-flex uk-flex-center uk-flex-middle">
|
5
6
|
{{svg-jar this.status.icon title=this.status.label}}
|
@@ -8,7 +8,14 @@
|
|
8
8
|
{{/if}}
|
9
9
|
</p>
|
10
10
|
|
11
|
-
<ul
|
11
|
+
<ul
|
12
|
+
class="uk-subnav uk-subnav-divider
|
13
|
+
{{if
|
14
|
+
this.config.ui.small
|
15
|
+
'uk-margin-remove-top uk-margin-small-bottom'
|
16
|
+
'uk-margin-small-top'
|
17
|
+
}}"
|
18
|
+
>
|
12
19
|
<li>
|
13
20
|
<span>
|
14
21
|
{{format-date this.date}}
|
@@ -17,24 +24,25 @@
|
|
17
24
|
</li>
|
18
25
|
{{#if (can "edit inquiry" @inquiry)}}
|
19
26
|
<li>
|
20
|
-
<LinkTo
|
21
|
-
@route="distribution.inquiry.detail.index"
|
22
|
-
@model={{decode-id @inquiry.id}}
|
23
|
-
>
|
27
|
+
<LinkTo @route="inquiry.detail.index" @model={{decode-id @inquiry.id}}>
|
24
28
|
{{t "caluma.distribution.edit.link"}}
|
25
29
|
</LinkTo>
|
26
30
|
</li>
|
31
|
+
<li>
|
32
|
+
<a href="" {{on "click" (perform this.withdraw)}} data-test-withdraw>
|
33
|
+
{{t "caluma.distribution.withdraw.link"}}
|
34
|
+
</a>
|
35
|
+
</li>
|
27
36
|
{{/if}}
|
28
37
|
{{#if (can "answer inquiry" @inquiry)}}
|
29
38
|
<li>
|
30
|
-
<LinkTo
|
31
|
-
@route="distribution.inquiry.detail.answer"
|
32
|
-
@model={{decode-id @inquiry.id}}
|
33
|
-
>
|
39
|
+
<LinkTo @route="inquiry.detail.answer" @model={{decode-id @inquiry.id}}>
|
34
40
|
{{t "caluma.distribution.answer.link"}}
|
35
41
|
</LinkTo>
|
36
42
|
</li>
|
37
43
|
{{/if}}
|
38
44
|
</ul>
|
39
45
|
|
40
|
-
|
46
|
+
{{#if this.info}}
|
47
|
+
<p class="uk-margin-remove">{{this.info}}</p>
|
48
|
+
{{/if}}
|
@@ -1,6 +1,22 @@
|
|
1
|
+
import { inject as service } from "@ember/service";
|
1
2
|
import Component from "@glimmer/component";
|
3
|
+
import { queryManager } from "ember-apollo-client";
|
4
|
+
import { dropTask } from "ember-concurrency";
|
5
|
+
import { confirm } from "ember-uikit";
|
6
|
+
|
7
|
+
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
8
|
+
import config from "@projectcaluma/ember-distribution/config";
|
9
|
+
import withdrawInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/withdraw-inquiry.graphql";
|
2
10
|
|
3
11
|
export default class InquiryDialogInquiryPartComponent extends Component {
|
12
|
+
@service notification;
|
13
|
+
@service router;
|
14
|
+
@service intl;
|
15
|
+
|
16
|
+
@queryManager apollo;
|
17
|
+
|
18
|
+
@config config;
|
19
|
+
|
4
20
|
get date() {
|
5
21
|
const key = this.args.type === "request" ? "createdAt" : "closedAt";
|
6
22
|
|
@@ -17,4 +33,27 @@ export default class InquiryDialogInquiryPartComponent extends Component {
|
|
17
33
|
|
18
34
|
return document.info.edges[0]?.node.value;
|
19
35
|
}
|
36
|
+
|
37
|
+
@dropTask
|
38
|
+
*withdraw(e) {
|
39
|
+
e.preventDefault();
|
40
|
+
|
41
|
+
/* istanbul ignore next */
|
42
|
+
if (!(yield confirm(this.intl.t("caluma.distribution.withdraw.confirm")))) {
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
|
46
|
+
try {
|
47
|
+
yield this.apollo.mutate({
|
48
|
+
mutation: withdrawInquiryMutation,
|
49
|
+
variables: {
|
50
|
+
workItem: decodeId(this.args.inquiry.id),
|
51
|
+
},
|
52
|
+
});
|
53
|
+
} catch (error) {
|
54
|
+
this.notification.danger(
|
55
|
+
this.intl.t("caluma.distribution.withdraw.error")
|
56
|
+
);
|
57
|
+
}
|
58
|
+
}
|
20
59
|
}
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import Component from "@glimmer/component";
|
2
2
|
|
3
|
+
import config from "@projectcaluma/ember-distribution/config";
|
4
|
+
|
3
5
|
export default class InquiryDialogInquiryComponent extends Component {
|
6
|
+
@config config;
|
7
|
+
|
4
8
|
get hasAnswer() {
|
5
9
|
return this.args.inquiry.status === "COMPLETED";
|
6
10
|
}
|