@projectcaluma/ember-distribution 1.0.0-beta.2 → 1.0.0-beta.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +38 -0
- package/addon/abilities/distribution.js +29 -0
- package/addon/components/distribution-navigation/controls.hbs +14 -12
- package/addon/components/distribution-navigation/controls.js +0 -36
- package/addon/components/distribution-navigation/item.hbs +1 -1
- 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 +10 -5
- 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 +14 -6
- package/addon/components/inquiry-dialog/inquiry-divider.hbs +2 -1
- package/addon/components/inquiry-dialog/inquiry-part.hbs +13 -10
- package/addon/components/inquiry-dialog/inquiry-part.js +4 -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-edit-form.hbs +21 -19
- package/addon/components/inquiry-edit-form.js +2 -1
- package/addon/components/inquiry-new-form.hbs +113 -102
- package/addon/components/inquiry-new-form.js +20 -20
- 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/queries/control-work-items.graphql +18 -2
- 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/caluma-distribution-controls.js +37 -0
- package/addon/templates/application.hbs +8 -0
- package/addon/templates/index.hbs +8 -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/inquiry-deadline.js +5 -6
- package/app/abilities/distribution.js +1 -0
- package/app/components/notfound.js +1 -0
- package/app/services/caluma-distribution-controls.js +1 -0
- package/app/styles/_inquiry-divider.scss +22 -0
- package/package.json +18 -15
- package/translations/de.yaml +9 -0
- package/translations/en.yaml +9 -0
- package/translations/fr.yaml +9 -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,41 @@
|
|
1
|
+
# [@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)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* **distribution:** fix sorting after group names in navigation ([2299d3b](https://github.com/projectcaluma/ember-caluma/commit/2299d3b0e265204ab6747dbdc6a8b64fc22f247f))
|
7
|
+
* **distribution:** redirect to edit form after inquiry creation ([0a2c404](https://github.com/projectcaluma/ember-caluma/commit/0a2c40404fdb1258fb8d51a2809a03b335c7c78a))
|
8
|
+
|
9
|
+
# [@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)
|
10
|
+
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
* **distribution:** show controls if no inquiries exist yet ([5c73b6d](https://github.com/projectcaluma/ember-caluma/commit/5c73b6d0a870fd0e34d96af3fa34095733fe9fd9))
|
15
|
+
* **pikaday:** add pikaday modifier reexport in engines ([c13d302](https://github.com/projectcaluma/ember-caluma/commit/c13d3021bb8fe82e1245a60182af01287c507697))
|
16
|
+
|
17
|
+
|
18
|
+
### Features
|
19
|
+
|
20
|
+
* **distribution:** add config variable to stack the UI ([2ad285a](https://github.com/projectcaluma/ember-caluma/commit/2ad285a24bf5fb45d15fe237e3f420dd1f1d94f2))
|
21
|
+
* **distribution:** add index page when no inquiries exist ([689089c](https://github.com/projectcaluma/ember-caluma/commit/689089c8f28146a33346f382fe69e7ca1b588d97))
|
22
|
+
* **distribution:** add proper 404 handling ([73e62e6](https://github.com/projectcaluma/ember-caluma/commit/73e62e671a9425fc549d7057dd653d1dc59883aa))
|
23
|
+
* **distribution:** remove distribution top level route ([6f396da](https://github.com/projectcaluma/ember-caluma/commit/6f396daf2881f07cdddaac6c7ca784db2b8777d3))
|
24
|
+
|
25
|
+
# [@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)
|
26
|
+
|
27
|
+
|
28
|
+
### Bug Fixes
|
29
|
+
|
30
|
+
* **deps:** remove moment altogether and update ember-pikday ([b2f7fa2](https://github.com/projectcaluma/ember-caluma/commit/b2f7fa28fa076897addd36e5964c926c671508ff))
|
31
|
+
* **distribution:** replace moment with luxon ([80f6b9a](https://github.com/projectcaluma/ember-caluma/commit/80f6b9a984113a5870a1a9ffbcc8e1700cb33190))
|
32
|
+
|
33
|
+
|
34
|
+
### BREAKING CHANGES
|
35
|
+
|
36
|
+
* **deps:** The host app now needs to opt-in to use the default
|
37
|
+
pikaday styles: https://github.com/adopted-ember-addons/ember-pikaday#styles
|
38
|
+
|
1
39
|
# [@projectcaluma/ember-distribution-v1.0.0-beta.2](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.1...@projectcaluma/ember-distribution-v1.0.0-beta.2) (2022-02-01)
|
2
40
|
|
3
41
|
|
@@ -0,0 +1,29 @@
|
|
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("caluma-distribution-controls") controls;
|
8
|
+
|
9
|
+
get canSendInquiries() {
|
10
|
+
return (
|
11
|
+
this.controls.workItems.value?.send.edges.filter(hasStatus("SUSPENDED"))
|
12
|
+
.length > 0
|
13
|
+
);
|
14
|
+
}
|
15
|
+
|
16
|
+
get canCreateInquiry() {
|
17
|
+
return (
|
18
|
+
this.controls.workItems.value?.create.edges.filter(hasStatus("READY"))
|
19
|
+
.length > 0
|
20
|
+
);
|
21
|
+
}
|
22
|
+
|
23
|
+
get canComplete() {
|
24
|
+
return (
|
25
|
+
this.controls.workItems.value?.complete.edges.filter(hasStatus("READY"))
|
26
|
+
.length > 0
|
27
|
+
);
|
28
|
+
}
|
29
|
+
}
|
@@ -1,17 +1,19 @@
|
|
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
|
+
@icon="paper-plane-outline"
|
8
|
+
@fromSvgJar={{true}}
|
9
|
+
@gutterTop={{4}}
|
10
|
+
@gutterRight={{6}}
|
11
|
+
@gutterLeft={{4}}
|
12
|
+
@gutterBottom={{4}}
|
13
|
+
@onClick={{this.noop}}
|
14
|
+
/>
|
15
|
+
{{/if}}
|
16
|
+
{{#if (can "complete distribution")}}
|
15
17
|
<IconButton
|
16
18
|
@icon="lock-closed-outline"
|
17
19
|
@fromSvgJar={{true}}
|
@@ -1,45 +1,9 @@
|
|
1
1
|
import { action } from "@ember/object";
|
2
|
-
import { inject as service } from "@ember/service";
|
3
2
|
import Component from "@glimmer/component";
|
4
|
-
import { queryManager } from "ember-apollo-client";
|
5
|
-
import { dropTask } from "ember-concurrency";
|
6
|
-
import { useTask } from "ember-resources";
|
7
|
-
|
8
|
-
import config from "@projectcaluma/ember-distribution/config";
|
9
|
-
import controlWorkItemsQuery from "@projectcaluma/ember-distribution/gql/queries/control-work-items.graphql";
|
10
3
|
|
11
4
|
export default class DistributionNavigationControlsComponent extends Component {
|
12
|
-
@service calumaOptions;
|
13
|
-
|
14
|
-
@queryManager apollo;
|
15
|
-
|
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
5
|
@action
|
29
6
|
noop(e) {
|
30
7
|
e.preventDefault();
|
31
8
|
}
|
32
|
-
|
33
|
-
@dropTask
|
34
|
-
*fetchWorkItems() {
|
35
|
-
return yield this.apollo.watchQuery({
|
36
|
-
query: controlWorkItemsQuery,
|
37
|
-
variables: {
|
38
|
-
caseId: this.args.caseId,
|
39
|
-
currentGroup: String(this.calumaOptions.currentGroupId),
|
40
|
-
createTask: this.config.controls.createTask,
|
41
|
-
completeTask: this.config.controls.completeTask,
|
42
|
-
},
|
43
|
-
});
|
44
|
-
}
|
45
9
|
}
|
@@ -1,5 +1,5 @@
|
|
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")}}
|
@@ -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}} />
|
@@ -20,10 +20,15 @@ export default class DistributionNavigationComponent extends Component {
|
|
20
20
|
@tracked groups = [];
|
21
21
|
|
22
22
|
get inquiries() {
|
23
|
-
const findGroupName = (
|
24
|
-
this.
|
25
|
-
|
26
|
-
|
23
|
+
const findGroupName = (identifiers) => {
|
24
|
+
const group = this.scheduler.groupCache.find((group) =>
|
25
|
+
identifiers
|
26
|
+
.map(String)
|
27
|
+
.includes(String(group[this.calumaOptions.groupIdentifierProperty]))
|
28
|
+
);
|
29
|
+
|
30
|
+
return group?.[this.calumaOptions.groupNameProperty] ?? "";
|
31
|
+
};
|
27
32
|
|
28
33
|
return Object.entries(this._inquiries.value || []).reduce(
|
29
34
|
(inquiries, [key, objects]) => {
|
@@ -74,7 +79,7 @@ export default class DistributionNavigationComponent extends Component {
|
|
74
79
|
),
|
75
80
|
];
|
76
81
|
|
77
|
-
|
82
|
+
yield this.scheduler.resolve(groupIds, "group");
|
78
83
|
|
79
84
|
return response;
|
80
85
|
}
|
@@ -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,14 @@
|
|
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
|
+
uk-flex-inline uk-flex-middle uk-text-{{this.deadline.color}}"
|
10
|
+
>
|
11
|
+
{{svg-jar "alarm-outline" height=26 class="uk-margin-small-right"}}
|
12
|
+
{{format-date this.deadline.value}}
|
13
|
+
</div>
|
14
|
+
{{/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,20 @@
|
|
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>
|
27
31
|
{{/if}}
|
28
32
|
{{#if (can "answer inquiry" @inquiry)}}
|
29
33
|
<li>
|
30
|
-
<LinkTo
|
31
|
-
@route="distribution.inquiry.detail.answer"
|
32
|
-
@model={{decode-id @inquiry.id}}
|
33
|
-
>
|
34
|
+
<LinkTo @route="inquiry.detail.answer" @model={{decode-id @inquiry.id}}>
|
34
35
|
{{t "caluma.distribution.answer.link"}}
|
35
36
|
</LinkTo>
|
36
37
|
</li>
|
37
38
|
{{/if}}
|
38
39
|
</ul>
|
39
40
|
|
40
|
-
|
41
|
+
{{#if this.info}}
|
42
|
+
<p class="uk-margin-remove">{{this.info}}</p>
|
43
|
+
{{/if}}
|
@@ -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 InquiryDialogInquiryPartComponent extends Component {
|
6
|
+
@config config;
|
7
|
+
|
4
8
|
get date() {
|
5
9
|
const key = this.args.type === "request" ? "createdAt" : "closedAt";
|
6
10
|
|
@@ -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
|
}
|
@@ -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}}
|
@@ -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")
|