@projectcaluma/ember-distribution 1.0.0-beta.7 → 11.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/addon/abilities/distribution.js +19 -0
- package/addon/abilities/inquiry.js +20 -0
- package/addon/components/cd-document-header.hbs +20 -0
- package/addon/components/cd-inquiry-answer-form.hbs +34 -9
- package/addon/components/cd-inquiry-answer-form.js +30 -12
- package/addon/components/cd-inquiry-dialog/inquiry-deadline.hbs +7 -13
- package/addon/components/cd-inquiry-dialog/inquiry-divider.hbs +1 -1
- package/addon/components/cd-inquiry-dialog/inquiry-part.hbs +107 -44
- package/addon/components/cd-inquiry-dialog/inquiry-part.js +25 -8
- package/addon/components/cd-inquiry-dialog/inquiry.hbs +8 -4
- package/addon/components/cd-inquiry-dialog.hbs +19 -0
- package/addon/components/cd-inquiry-dialog.js +32 -3
- package/addon/components/cd-inquiry-edit-form.hbs +36 -17
- package/addon/components/cd-inquiry-edit-form.js +2 -2
- package/addon/components/cd-inquiry-new-form.hbs +35 -31
- package/addon/components/cd-inquiry-new-form.js +17 -45
- package/addon/components/cd-navigation/controls.hbs +47 -18
- package/addon/components/cd-navigation/controls.js +34 -9
- package/addon/components/cd-navigation/item.hbs +14 -11
- package/addon/components/cd-navigation/section.hbs +4 -4
- package/addon/components/cd-navigation/status-indicator.hbs +10 -15
- package/addon/components/cd-navigation.hbs +11 -14
- package/addon/components/cd-truncated.hbs +8 -0
- package/addon/components/cd-truncated.js +32 -0
- package/addon/config.js +12 -8
- package/addon/controllers/application.js +3 -0
- package/addon/controllers/new.js +1 -1
- package/addon/engine.js +9 -1
- package/addon/gql/fragments/inquiry.graphql +40 -14
- package/addon/gql/mutations/complete-inquiry-work-item.graphql +1 -1
- package/addon/gql/mutations/redo-work-item.graphql +8 -0
- package/addon/gql/queries/control-work-items.graphql +11 -0
- package/addon/gql/queries/inquiry-answer.graphql +17 -12
- package/addon/gql/queries/inquiry-dialog.graphql +3 -2
- package/addon/gql/queries/inquiry-edit.graphql +2 -0
- package/addon/gql/queries/inquiry-navigation.graphql +2 -1
- package/addon/services/distribution.js +42 -4
- package/addon/templates/application.hbs +17 -6
- package/addon/utils/inquiry-answer-status.js +34 -0
- package/addon/utils/inquiry-deadline.js +5 -7
- package/addon/utils/inquiry-status.js +12 -7
- package/app/components/cd-document-header.js +1 -0
- package/app/components/{cd-icon-button.js → cd-truncated.js} +1 -1
- package/app/styles/@projectcaluma/ember-distribution.scss +3 -2
- package/app/styles/_answer-form.scss +4 -0
- package/app/styles/_group-list.scss +7 -0
- package/app/styles/_inquiry-divider.scss +1 -1
- package/app/styles/_truncated.scss +3 -0
- package/app/utils/inquiry-answer-status.js +1 -0
- package/index.js +1 -6
- package/package.json +28 -29
- package/translations/de.yaml +30 -8
- package/translations/en.yaml +31 -9
- package/translations/fr.yaml +31 -9
- package/addon/components/cd-icon-button.hbs +0 -27
- package/addon/components/cd-icon-button.js +0 -22
- package/app/styles/_icon-button.scss +0 -13
- package/app/styles/_status-indicator.scss +0 -31
@@ -2,23 +2,32 @@ import { inject as service } from "@ember/service";
|
|
2
2
|
import Component from "@glimmer/component";
|
3
3
|
import { queryManager, getObservable } from "ember-apollo-client";
|
4
4
|
import { dropTask } from "ember-concurrency";
|
5
|
-
import {
|
5
|
+
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
6
6
|
|
7
|
+
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
7
8
|
import config from "@projectcaluma/ember-distribution/config";
|
8
9
|
import inquiryDialogQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-dialog.graphql";
|
9
10
|
|
10
11
|
export default class CdInquiryDialogComponent extends Component {
|
12
|
+
@service intl;
|
11
13
|
@service router;
|
14
|
+
@service distribution;
|
15
|
+
@service notification;
|
16
|
+
@service calumaOptions;
|
12
17
|
|
13
18
|
@config config;
|
14
19
|
|
15
20
|
@queryManager apollo;
|
16
21
|
|
22
|
+
get currentGroupIsCreator() {
|
23
|
+
return String(this.calumaOptions.currentGroupId) === this.args.from;
|
24
|
+
}
|
25
|
+
|
17
26
|
get inquiries() {
|
18
27
|
return this._inquiries.value?.allWorkItems.edges.map((edge) => edge.node);
|
19
28
|
}
|
20
29
|
|
21
|
-
_inquiries =
|
30
|
+
_inquiries = trackedTask(this, this.fetchDialog, () => [
|
22
31
|
this.args.from,
|
23
32
|
this.args.to,
|
24
33
|
this.args.caseId,
|
@@ -37,7 +46,8 @@ export default class CdInquiryDialogComponent extends Component {
|
|
37
46
|
infoQuestion: this.config.inquiry.infoQuestion,
|
38
47
|
deadlineQuestion: this.config.inquiry.deadlineQuestion,
|
39
48
|
statusQuestion: this.config.inquiry.answer.statusQuestion,
|
40
|
-
|
49
|
+
answerInfoQuestions: this.config.inquiry.answer.infoQuestions,
|
50
|
+
buttonTasks: Object.keys(this.config.inquiry.answer.buttons),
|
41
51
|
includeNavigationData: true,
|
42
52
|
},
|
43
53
|
});
|
@@ -62,4 +72,23 @@ export default class CdInquiryDialogComponent extends Component {
|
|
62
72
|
|
63
73
|
return response;
|
64
74
|
}
|
75
|
+
|
76
|
+
@dropTask
|
77
|
+
*createInquiry(e) {
|
78
|
+
e.preventDefault();
|
79
|
+
|
80
|
+
yield this.distribution.createInquiry.perform([this.args.to]);
|
81
|
+
|
82
|
+
// refetch dialog data
|
83
|
+
yield getObservable(this._inquiries.value).refetch();
|
84
|
+
|
85
|
+
this.router.transitionTo(
|
86
|
+
"inquiry.detail.index",
|
87
|
+
{
|
88
|
+
from: this.args.from,
|
89
|
+
to: this.args.to,
|
90
|
+
},
|
91
|
+
decodeId(this.inquiries[0].id)
|
92
|
+
);
|
93
|
+
}
|
65
94
|
}
|
@@ -4,26 +4,45 @@
|
|
4
4
|
@loading={{this._inquiry.isRunning}}
|
5
5
|
>
|
6
6
|
<:default as |content|>
|
7
|
-
<
|
8
|
-
{{
|
9
|
-
{{
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
{{
|
15
|
-
|
7
|
+
<CdDocumentHeader
|
8
|
+
@name={{content.document.rootForm.raw.name}}
|
9
|
+
@status={{if
|
10
|
+
(eq this.inquiry.status "SUSPENDED")
|
11
|
+
(t "caluma.distribution.status.draft")
|
12
|
+
}}
|
13
|
+
@modifiedAt={{this.inquiry.document.modifiedContentAt}}
|
14
|
+
@modifiedBy={{this.inquiry.document.modifiedContentByUser}}
|
15
|
+
/>
|
16
|
+
|
17
|
+
<hr />
|
18
|
+
{{#if
|
19
|
+
(and
|
20
|
+
(cannot "send inquiry" this.inquiry)
|
21
|
+
(eq this.inquiry.status "SUSPENDED")
|
22
|
+
)
|
23
|
+
}}
|
24
|
+
<div class="uk-alert uk-alert-warning uk-flex uk-flex-middle">
|
25
|
+
<UkIcon @icon="warning" class="uk-margin-small-right" />
|
26
|
+
{{t "caluma.distribution.edit.send-not-allowed"}}
|
27
|
+
{{t "caluma.distribution.not-allowed-hint"}}
|
28
|
+
</div>
|
29
|
+
{{/if}}
|
16
30
|
|
17
31
|
<content.form />
|
18
32
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
33
|
+
{{#if
|
34
|
+
(and (can "edit inquiry" this.inquiry) (can "send inquiry" this.inquiry))
|
35
|
+
}}
|
36
|
+
<DocumentValidity @document={{content.document}} as |isValid validate|>
|
37
|
+
<UkButton
|
38
|
+
@type="submit"
|
39
|
+
@color="primary"
|
40
|
+
@disabled={{or (not isValid) this.send.isRunning}}
|
41
|
+
@onClick={{perform this.send validate}}
|
42
|
+
@loading={{this.send.isRunning}}
|
43
|
+
>{{t "caluma.distribution.edit.send"}}</UkButton>
|
44
|
+
</DocumentValidity>
|
45
|
+
{{/if}}
|
27
46
|
</:default>
|
28
47
|
<:notfound><CdNotfound /></:notfound>
|
29
48
|
</CfContent>
|
@@ -2,7 +2,7 @@ import { inject as service } from "@ember/service";
|
|
2
2
|
import Component from "@glimmer/component";
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
4
4
|
import { dropTask } from "ember-concurrency";
|
5
|
-
import {
|
5
|
+
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
6
6
|
|
7
7
|
import config from "@projectcaluma/ember-distribution/config";
|
8
8
|
import resumeWorkItemMutation from "@projectcaluma/ember-distribution/gql/mutations/resume-work-item.graphql";
|
@@ -17,7 +17,7 @@ export default class CdInquiryEditFormComponent extends Component {
|
|
17
17
|
|
18
18
|
@queryManager apollo;
|
19
19
|
|
20
|
-
_inquiry =
|
20
|
+
_inquiry = trackedTask(this, this.fetchInquiry, () => [this.args.inquiry]);
|
21
21
|
|
22
22
|
get inquiry() {
|
23
23
|
return this._inquiry.value?.[0]?.node;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
{{#if this.controls.workItems.isRunning}}
|
2
2
|
<div class="uk-text-center"><UkSpinner @ratio={{2}} /></div>
|
3
3
|
{{else if (can "create inquiry of distribution")}}
|
4
|
-
<
|
4
|
+
<p class="uk-text-large">{{t "caluma.distribution.new.title"}}</p>
|
5
|
+
|
6
|
+
<hr />
|
5
7
|
|
6
8
|
{{#if this.selectedGroups.length}}
|
7
9
|
<div class="uk-flex uk-flex-middle">
|
@@ -78,36 +80,38 @@
|
|
78
80
|
<UkSpinner @ratio={{2}} />
|
79
81
|
</div>
|
80
82
|
{{else if this.groups.value.length}}
|
81
|
-
<
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
<
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
group.config.icon
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
83
|
+
<table
|
84
|
+
class="uk-table uk-table-striped uk-table-hover uk-table-small uk-table-middle group-list"
|
85
|
+
>
|
86
|
+
<tbody>
|
87
|
+
{{#each this.groups.value as |group|}}
|
88
|
+
{{! template-lint-disable require-presentational-children }}
|
89
|
+
<tr
|
90
|
+
role="checkbox"
|
91
|
+
data-test-group={{group.identifier}}
|
92
|
+
{{on "click" (fn this.updateSelectedGroups group.identifier)}}
|
93
|
+
>
|
94
|
+
<td class="uk-padding-remove-right">
|
95
|
+
{{! template-lint-disable require-input-label no-nested-interactive }}
|
96
|
+
<input
|
97
|
+
type="checkbox"
|
98
|
+
class="uk-checkbox"
|
99
|
+
checked={{includes group.identifier this.selectedGroups}}
|
100
|
+
/>
|
101
|
+
</td>
|
102
|
+
<td class="uk-width-expand">{{group-name group.identifier}}</td>
|
103
|
+
<td class="uk-text-right">
|
104
|
+
{{#if group.config.icon}}
|
105
|
+
<UkIcon
|
106
|
+
@icon={{group.config.icon}}
|
107
|
+
class="uk-display-block uk-text-{{group.config.iconColor}}"
|
108
|
+
/>
|
109
|
+
{{/if}}
|
110
|
+
</td>
|
111
|
+
</tr>
|
112
|
+
{{/each}}
|
113
|
+
</tbody>
|
114
|
+
</table>
|
111
115
|
{{else}}
|
112
116
|
<div class="uk-text-center">
|
113
117
|
<UkIcon @icon="search" @ratio={{10}} class="uk-margin-top" />
|
@@ -5,11 +5,10 @@ import Component from "@glimmer/component";
|
|
5
5
|
import { tracked } from "@glimmer/tracking";
|
6
6
|
import { queryManager } from "ember-apollo-client";
|
7
7
|
import { timeout, restartableTask, dropTask, task } from "ember-concurrency";
|
8
|
-
import {
|
8
|
+
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
9
9
|
|
10
10
|
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
11
11
|
import config from "@projectcaluma/ember-distribution/config";
|
12
|
-
import createInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/create-inquiry.graphql";
|
13
12
|
|
14
13
|
const toggle = (value, array) => {
|
15
14
|
const set = new Set(array);
|
@@ -32,7 +31,7 @@ export default class CdInquiryNewFormComponent extends Component {
|
|
32
31
|
|
33
32
|
@tracked selectedGroups = [];
|
34
33
|
|
35
|
-
groups =
|
34
|
+
groups = trackedTask(this, this.fetchGroups, () => [
|
36
35
|
this.args.selectedTypes,
|
37
36
|
this.args.search,
|
38
37
|
]);
|
@@ -45,9 +44,7 @@ export default class CdInquiryNewFormComponent extends Component {
|
|
45
44
|
}
|
46
45
|
|
47
46
|
@action
|
48
|
-
updateSelectedGroups(identifier
|
49
|
-
e.preventDefault();
|
50
|
-
|
47
|
+
updateSelectedGroups(identifier) {
|
51
48
|
this.selectedGroups = toggle(identifier, this.selectedGroups);
|
52
49
|
}
|
53
50
|
|
@@ -78,45 +75,20 @@ export default class CdInquiryNewFormComponent extends Component {
|
|
78
75
|
|
79
76
|
if (!this.selectedGroups.length) return;
|
80
77
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
},
|
96
|
-
});
|
97
|
-
|
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",
|
107
|
-
{
|
108
|
-
from: lastControlling.controllingGroups[0],
|
109
|
-
to: lastControlling.addressedGroups[0],
|
110
|
-
},
|
111
|
-
decodeId(lastControlling.id)
|
112
|
-
);
|
113
|
-
} catch (e) {
|
114
|
-
this.notification.danger(
|
115
|
-
this.intl.t("caluma.distribution.new.error", {
|
116
|
-
count: this.selectedGroups.length,
|
117
|
-
})
|
118
|
-
);
|
119
|
-
}
|
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
|
+
);
|
120
92
|
}
|
121
93
|
|
122
94
|
@task
|
@@ -1,28 +1,57 @@
|
|
1
1
|
<div class="uk-text-center uk-margin-small-top">
|
2
2
|
{{#if (can "create inquiry of distribution")}}
|
3
|
-
<
|
3
|
+
<LinkTo
|
4
|
+
@route="new"
|
5
|
+
class="uk-icon-button"
|
6
|
+
uk-tooltip={{t "caluma.distribution.new.title"}}
|
7
|
+
data-test-new-inquiry
|
8
|
+
>
|
9
|
+
<UkIcon @icon="plus" />
|
10
|
+
</LinkTo>
|
4
11
|
{{/if}}
|
5
12
|
{{#if (can "send inquiries of distribution")}}
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
@gutterTop={{4}}
|
11
|
-
@gutterRight={{6}}
|
12
|
-
@gutterLeft={{4}}
|
13
|
-
@gutterBottom={{4}}
|
14
|
-
@onClick={{perform this.sendInquiries}}
|
15
|
-
@loading={{this.sendInquiries.isRunning}}
|
13
|
+
<button
|
14
|
+
type="button"
|
15
|
+
class="uk-icon-button"
|
16
|
+
uk-tooltip={{t "caluma.distribution.send"}}
|
16
17
|
data-test-send-pending-inquiries
|
17
|
-
|
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>
|
18
26
|
{{/if}}
|
19
27
|
{{#if (can "complete distribution")}}
|
20
|
-
<
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
@loading={{this.completeDistribution.isRunning}}
|
28
|
+
<button
|
29
|
+
type="button"
|
30
|
+
class="uk-icon-button"
|
31
|
+
uk-tooltip={{t "caluma.distribution.complete"}}
|
25
32
|
data-test-complete-distribution
|
26
|
-
|
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>
|
27
56
|
{{/if}}
|
28
57
|
</div>
|
@@ -8,6 +8,7 @@ import { gql } from "graphql-tag";
|
|
8
8
|
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
9
9
|
import config from "@projectcaluma/ember-distribution/config";
|
10
10
|
import completeWorkItemMutation from "@projectcaluma/ember-distribution/gql/mutations/complete-work-item.graphql";
|
11
|
+
import redoWorkItemMutation from "@projectcaluma/ember-distribution/gql/mutations/redo-work-item.graphql";
|
11
12
|
import incompleteInquiriesQuery from "@projectcaluma/ember-distribution/gql/queries/incomplete-inquiries.graphql";
|
12
13
|
|
13
14
|
export default class CdNavigationControlsComponent extends Component {
|
@@ -26,21 +27,21 @@ export default class CdNavigationControlsComponent extends Component {
|
|
26
27
|
{
|
27
28
|
query: incompleteInquiriesQuery,
|
28
29
|
variables: {
|
29
|
-
caseId: this.
|
30
|
+
caseId: this.distribution.caseId,
|
30
31
|
task: this.config.inquiry.task,
|
31
32
|
},
|
32
33
|
},
|
33
34
|
"allWorkItems.totalCount"
|
34
35
|
);
|
35
36
|
|
36
|
-
|
37
|
-
incompleteInquiries
|
38
|
-
|
39
|
-
this.intl.t("caluma.distribution.complete-confirm", {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
) {
|
37
|
+
const confirmText =
|
38
|
+
incompleteInquiries === 0
|
39
|
+
? this.intl.t("caluma.distribution.complete-confirm-empty")
|
40
|
+
: this.intl.t("caluma.distribution.complete-confirm", {
|
41
|
+
count: incompleteInquiries,
|
42
|
+
});
|
43
|
+
|
44
|
+
if (!(yield confirm(confirmText))) {
|
44
45
|
return;
|
45
46
|
}
|
46
47
|
|
@@ -63,6 +64,30 @@ export default class CdNavigationControlsComponent extends Component {
|
|
63
64
|
}
|
64
65
|
}
|
65
66
|
|
67
|
+
@dropTask
|
68
|
+
*reopenDistribution() {
|
69
|
+
try {
|
70
|
+
if (!(yield confirm(this.intl.t("caluma.distribution.reopen-confirm")))) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
|
74
|
+
const distributionWorkItemId = decodeId(
|
75
|
+
this.distribution.controls.value?.case.edges[0]?.node.parentWorkItem.id
|
76
|
+
);
|
77
|
+
|
78
|
+
yield this.apollo.mutate({
|
79
|
+
mutation: redoWorkItemMutation,
|
80
|
+
variables: {
|
81
|
+
workItem: distributionWorkItemId,
|
82
|
+
},
|
83
|
+
});
|
84
|
+
|
85
|
+
yield this.distribution.refetchControls();
|
86
|
+
} catch (e) {
|
87
|
+
this.notification.danger(this.intl.t("caluma.distribution.reopen-error"));
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
66
91
|
@dropTask
|
67
92
|
*sendInquiries() {
|
68
93
|
if (!(yield confirm(this.intl.t("caluma.distribution.send-confirm")))) {
|
@@ -1,15 +1,18 @@
|
|
1
|
-
<li class={{if this.isActive
|
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
|
-
|
3
|
+
{{#let
|
4
|
+
(if
|
5
|
+
(eq @type "addressed")
|
6
|
+
@inquiry.controllingGroupName
|
7
|
+
@inquiry.addressedGroupName
|
8
|
+
)
|
9
|
+
as |name|
|
10
|
+
}}
|
11
|
+
<span class="uk-width-expand uk-text-truncate" title={{name}}>
|
12
|
+
{{name}}
|
13
|
+
</span>
|
14
|
+
{{/let}}
|
11
15
|
|
12
|
-
|
13
|
-
</div>
|
16
|
+
<CdNavigation::StatusIndicator @inquiry={{@inquiry}} @type={{@type}} />
|
14
17
|
</LinkTo>
|
15
18
|
</li>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<li class="uk-margin-small-bottom">
|
2
|
-
<a href=""
|
1
|
+
<li class="uk-margin-small-bottom uk-width-auto">
|
2
|
+
<a href="" {{on "click" this.toggle}}>
|
3
3
|
<span class="uk-width-expand">
|
4
4
|
{{t (concat "caluma.distribution.types." @type)}}
|
5
5
|
</span>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
{{#if this.expanded}}
|
14
14
|
{{#if @inquiries.length}}
|
15
|
-
<ul class="uk-tab uk-tab-left uk-margin-left">
|
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}}
|
@@ -20,7 +20,7 @@
|
|
20
20
|
{{/if}}
|
21
21
|
|
22
22
|
{{#if (eq @type "controlling")}}
|
23
|
-
<CdNavigation::Controls
|
23
|
+
<CdNavigation::Controls />
|
24
24
|
{{/if}}
|
25
25
|
{{/if}}
|
26
26
|
</li>
|
@@ -1,18 +1,13 @@
|
|
1
1
|
{{#if this.showDeadlineIndicator}}
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
{{
|
6
|
-
|
7
|
-
height=16
|
8
|
-
width=16
|
9
|
-
title=(format-date this.deadline.value)
|
10
|
-
}}
|
11
|
-
</div>
|
2
|
+
<UkIcon
|
3
|
+
@icon="clock"
|
4
|
+
class="uk-margin-small-right uk-text-{{this.deadline.color}}"
|
5
|
+
uk-tooltip={{format-date this.deadline.value}}
|
6
|
+
/>
|
12
7
|
{{/if}}
|
13
8
|
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
{{
|
18
|
-
|
9
|
+
<UkIcon
|
10
|
+
@icon={{this.status.icon}}
|
11
|
+
class="uk-text-{{this.status.color}}"
|
12
|
+
uk-tooltip={{this.status.label}}
|
13
|
+
/>
|
@@ -1,14 +1,11 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<CdNavigation::Section @type="more" @inquiries={{this.inquiries.more}} />
|
13
|
-
</ul>
|
14
|
-
</aside>
|
1
|
+
<ul class="uk-tab uk-tab-left uk-margin-remove-bottom uk-width-auto">
|
2
|
+
<CdNavigation::Section
|
3
|
+
@type="controlling"
|
4
|
+
@inquiries={{this.inquiries.controlling}}
|
5
|
+
/>
|
6
|
+
<CdNavigation::Section
|
7
|
+
@type="addressed"
|
8
|
+
@inquiries={{this.inquiries.addressed}}
|
9
|
+
/>
|
10
|
+
<CdNavigation::Section @type="more" @inquiries={{this.inquiries.more}} />
|
11
|
+
</ul>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { action } from "@ember/object";
|
2
|
+
import Component from "@glimmer/component";
|
3
|
+
import { tracked } from "@glimmer/tracking";
|
4
|
+
|
5
|
+
export default class CdTruncatedComponent extends Component {
|
6
|
+
@tracked expand = false;
|
7
|
+
|
8
|
+
get length() {
|
9
|
+
return parseInt(this.args.length);
|
10
|
+
}
|
11
|
+
|
12
|
+
get displayedText() {
|
13
|
+
if (this.truncate && !this.expand) {
|
14
|
+
// strip input string to the passed length minus 3 to make sure the output
|
15
|
+
// including the 3 dots doesn't exceed the expected length
|
16
|
+
return `${this.args.text.substring(0, this.length - 3).trim()}...`;
|
17
|
+
}
|
18
|
+
|
19
|
+
return this.args.text;
|
20
|
+
}
|
21
|
+
|
22
|
+
get truncate() {
|
23
|
+
return this.args.text.length > this.length;
|
24
|
+
}
|
25
|
+
|
26
|
+
@action
|
27
|
+
toggleExpand(e) {
|
28
|
+
e.preventDefault();
|
29
|
+
|
30
|
+
this.expand = !this.expand;
|
31
|
+
}
|
32
|
+
}
|