@projectcaluma/ember-distribution 1.0.0-beta.10 → 1.0.0-beta.13
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +33 -0
- package/addon/components/cd-document-header.hbs +2 -5
- package/addon/components/cd-inquiry-answer-form.hbs +1 -1
- package/addon/components/cd-inquiry-answer-form.js +5 -1
- package/addon/components/cd-inquiry-dialog/inquiry-deadline.hbs +3 -5
- package/addon/components/cd-inquiry-dialog/inquiry-divider.hbs +1 -1
- package/addon/components/cd-inquiry-dialog/inquiry-part.hbs +11 -3
- package/addon/components/cd-inquiry-dialog/inquiry-part.js +3 -0
- package/addon/components/cd-inquiry-dialog.hbs +12 -6
- package/addon/components/cd-inquiry-dialog.js +1 -0
- package/addon/components/cd-inquiry-edit-form.hbs +4 -1
- package/addon/components/cd-inquiry-new-form.hbs +32 -30
- package/addon/components/cd-inquiry-new-form.js +1 -3
- package/addon/components/cd-navigation/controls.hbs +30 -21
- package/addon/components/cd-navigation/controls.js +1 -1
- 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/config.js +9 -6
- package/addon/gql/fragments/inquiry.graphql +20 -4
- package/addon/gql/mutations/complete-inquiry-work-item.graphql +1 -1
- package/addon/gql/queries/inquiry-answer.graphql +3 -12
- package/addon/gql/queries/inquiry-dialog.graphql +2 -1
- package/addon/utils/inquiry-answer-status.js +34 -0
- package/addon/utils/inquiry-deadline.js +4 -4
- package/addon/utils/inquiry-status.js +12 -7
- package/app/styles/@projectcaluma/ember-distribution.scss +1 -2
- package/app/styles/_group-list.scss +7 -0
- package/app/utils/inquiry-answer-status.js +1 -0
- package/index.js +1 -6
- package/package.json +12 -13
- package/translations/de.yaml +15 -4
- package/translations/en.yaml +15 -4
- package/translations/fr.yaml +15 -4
- package/addon/components/cd-icon-button.hbs +0 -27
- package/addon/components/cd-icon-button.js +0 -22
- package/app/components/cd-icon-button.js +0 -1
- package/app/styles/_icon-button.scss +0 -13
- package/app/styles/_status-indicator.scss +0 -31
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,36 @@
|
|
1
|
+
# [@projectcaluma/ember-distribution-v1.0.0-beta.13](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.12...@projectcaluma/ember-distribution-v1.0.0-beta.13) (2022-06-09)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* **caluma:** use new filter syntax of caluma ([7a00c03](https://github.com/projectcaluma/ember-caluma/commit/7a00c03a103933d9e48dd88adb7382441a298742))
|
7
|
+
|
8
|
+
|
9
|
+
### BREAKING CHANGES
|
10
|
+
|
11
|
+
* **caluma:** `ember-caluma` now requires Caluma version >=
|
12
|
+
8.0.0-beta.6
|
13
|
+
|
14
|
+
# [@projectcaluma/ember-distribution-v1.0.0-beta.12](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.11...@projectcaluma/ember-distribution-v1.0.0-beta.12) (2022-06-09)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* **distribution:** fix selection of groups with the checkbox ([9f028dc](https://github.com/projectcaluma/ember-caluma/commit/9f028dc6ec16214249f43e519280397131006e7c))
|
20
|
+
* **distribution:** refetch inquiry answer after work-item completion ([60cfaca](https://github.com/projectcaluma/ember-caluma/commit/60cfaca04d94a44efc4950eeb1aecee767b4eeb5))
|
21
|
+
|
22
|
+
|
23
|
+
### Features
|
24
|
+
|
25
|
+
* **distribution:** add configurable status for unanswered inquiries ([e08247f](https://github.com/projectcaluma/ember-caluma/commit/e08247f6e2b73f859011f4eac7ffff71f101f546))
|
26
|
+
|
27
|
+
# [@projectcaluma/ember-distribution-v1.0.0-beta.11](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.10...@projectcaluma/ember-distribution-v1.0.0-beta.11) (2022-05-13)
|
28
|
+
|
29
|
+
|
30
|
+
### Features
|
31
|
+
|
32
|
+
* **distribution:** add status for skipped inquiries ([1f93c92](https://github.com/projectcaluma/ember-caluma/commit/1f93c92d76b697954ec54aefa12348c84cd0abf9))
|
33
|
+
|
1
34
|
# [@projectcaluma/ember-distribution-v1.0.0-beta.10](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.9...@projectcaluma/ember-distribution-v1.0.0-beta.10) (2022-05-11)
|
2
35
|
|
3
36
|
|
@@ -1,10 +1,7 @@
|
|
1
1
|
<p class="uk-text-large uk-margin-remove">
|
2
2
|
{{@name}}
|
3
|
-
{{#if @
|
4
|
-
<UkLabel
|
5
|
-
@label={{t "caluma.distribution.status.draft"}}
|
6
|
-
class="uk-margin-left"
|
7
|
-
/>
|
3
|
+
{{#if @status}}
|
4
|
+
<UkLabel @label={{@status}} class="uk-margin-left" />
|
8
5
|
{{/if}}
|
9
6
|
</p>
|
10
7
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<div class="uk-position-relative">
|
9
9
|
<CdDocumentHeader
|
10
10
|
@name={{content.document.rootForm.raw.name}}
|
11
|
-
@
|
11
|
+
@status={{if (eq this.inquiry.status "READY") this.answerStatus}}
|
12
12
|
@modifiedAt={{this.inquiry.childCase.document.modifiedContentAt}}
|
13
13
|
@modifiedBy={{this.inquiry.childCase.document.modifiedContentByUser}}
|
14
14
|
/>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { inject as service } from "@ember/service";
|
2
2
|
import Component from "@glimmer/component";
|
3
|
-
import { queryManager } from "ember-apollo-client";
|
3
|
+
import { queryManager, getObservable } from "ember-apollo-client";
|
4
4
|
import { dropTask } from "ember-concurrency";
|
5
5
|
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
6
6
|
|
@@ -8,6 +8,7 @@ import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
|
8
8
|
import config from "@projectcaluma/ember-distribution/config";
|
9
9
|
import completeInquiryWorkItemMutation from "@projectcaluma/ember-distribution/gql/mutations/complete-inquiry-work-item.graphql";
|
10
10
|
import inquiryAnswerQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-answer.graphql";
|
11
|
+
import inquiryAnswerStatus from "@projectcaluma/ember-distribution/utils/inquiry-answer-status";
|
11
12
|
|
12
13
|
export default class CdInquiryAnswerFormComponent extends Component {
|
13
14
|
@service intl;
|
@@ -19,6 +20,8 @@ export default class CdInquiryAnswerFormComponent extends Component {
|
|
19
20
|
|
20
21
|
@queryManager apollo;
|
21
22
|
|
23
|
+
@inquiryAnswerStatus({ inquiryProperty: "inquiry" }) answerStatus;
|
24
|
+
|
22
25
|
_inquiry = trackedTask(this, this.fetchInquiryAnswer, () => [
|
23
26
|
this.args.inquiry,
|
24
27
|
]);
|
@@ -79,6 +82,7 @@ export default class CdInquiryAnswerFormComponent extends Component {
|
|
79
82
|
},
|
80
83
|
});
|
81
84
|
|
85
|
+
yield getObservable(this._inquiry.value)?.refetch();
|
82
86
|
yield this.router.transitionTo("inquiry.index");
|
83
87
|
} catch (error) {
|
84
88
|
this.notification.danger(
|
@@ -14,12 +14,10 @@
|
|
14
14
|
uk-flex-inline uk-flex-middle"
|
15
15
|
...attributes
|
16
16
|
>
|
17
|
-
|
18
|
-
|
19
|
-
height=26
|
20
|
-
width=26
|
17
|
+
<UkIcon
|
18
|
+
@icon={{if this.isWithdrawn "ban" "clock"}}
|
21
19
|
class="uk-margin-small-right"
|
22
|
-
|
20
|
+
/>
|
23
21
|
{{#if this.isWithdrawn}}
|
24
22
|
{{t "caluma.distribution.withdraw.status"}}
|
25
23
|
{{else}}
|
@@ -3,6 +3,6 @@
|
|
3
3
|
{{if this.config.ui.small 'inquiry-divider--small' 'uk-margin'}}"
|
4
4
|
>
|
5
5
|
<div class="inquiry-divider__icon uk-flex uk-flex-center uk-flex-middle">
|
6
|
-
{{
|
6
|
+
<UkIcon @icon={{this.status.icon}} title={{this.status.label}} />
|
7
7
|
</div>
|
8
8
|
</div>
|
@@ -1,10 +1,18 @@
|
|
1
1
|
<div class="uk-margin-remove-last-child">
|
2
|
-
<p
|
2
|
+
<p
|
3
|
+
class="uk-flex uk-flex-middle uk-text-large uk-margin-remove"
|
4
|
+
data-test-title
|
5
|
+
>
|
3
6
|
{{#if (eq @type "request")}}
|
4
|
-
|
7
|
+
<UkIcon @icon="forward" class="uk-margin-small-right" />
|
5
8
|
{{group-name @inquiry.controllingGroups}}
|
9
|
+
{{#if
|
10
|
+
(and (can "answer inquiry" @inquiry) (not @disabled) this.answerStatus)
|
11
|
+
}}
|
12
|
+
<UkLabel @label={{this.answerStatus}} class="uk-margin-left" />
|
13
|
+
{{/if}}
|
6
14
|
{{else if (eq @type "answer")}}
|
7
|
-
|
15
|
+
<UkIcon @icon="reply" class="uk-margin-small-right" />
|
8
16
|
{{group-name @inquiry.addressedGroups}}
|
9
17
|
{{/if}}
|
10
18
|
</p>
|
@@ -8,6 +8,7 @@ import { confirm } from "ember-uikit";
|
|
8
8
|
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
9
9
|
import config from "@projectcaluma/ember-distribution/config";
|
10
10
|
import withdrawInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/withdraw-inquiry.graphql";
|
11
|
+
import inquiryAnswerStatus from "@projectcaluma/ember-distribution/utils/inquiry-answer-status";
|
11
12
|
|
12
13
|
export default class CdInquiryDialogInquiryPartComponent extends Component {
|
13
14
|
@service notification;
|
@@ -18,6 +19,8 @@ export default class CdInquiryDialogInquiryPartComponent extends Component {
|
|
18
19
|
|
19
20
|
@config config;
|
20
21
|
|
22
|
+
@inquiryAnswerStatus answerStatus;
|
23
|
+
|
21
24
|
get date() {
|
22
25
|
const key = this.args.type === "request" ? "createdAt" : "closedAt";
|
23
26
|
|
@@ -5,13 +5,19 @@
|
|
5
5
|
(and (can "create inquiry of distribution") this.currentGroupIsCreator)
|
6
6
|
}}
|
7
7
|
<div class="uk-text-center uk-margin">
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@onClick={{perform this.createInquiry}}
|
8
|
+
<button
|
9
|
+
type="button"
|
10
|
+
class="uk-icon-button"
|
11
|
+
title={{t "caluma.distribution.new.title"}}
|
13
12
|
data-test-new-inquiry
|
14
|
-
|
13
|
+
{{on "click" (perform this.createInquiry)}}
|
14
|
+
>
|
15
|
+
{{#if this.createInquiry.isRunning}}
|
16
|
+
<UkSpinner @ratio={{0.6}} />
|
17
|
+
{{else}}
|
18
|
+
<UkIcon @icon="plus" />
|
19
|
+
{{/if}}
|
20
|
+
</button>
|
15
21
|
</div>
|
16
22
|
{{/if}}
|
17
23
|
<section>
|
@@ -47,6 +47,7 @@ export default class CdInquiryDialogComponent extends Component {
|
|
47
47
|
deadlineQuestion: this.config.inquiry.deadlineQuestion,
|
48
48
|
statusQuestion: this.config.inquiry.answer.statusQuestion,
|
49
49
|
answerInfoQuestions: this.config.inquiry.answer.infoQuestions,
|
50
|
+
buttonTasks: Object.keys(this.config.inquiry.answer.buttons),
|
50
51
|
includeNavigationData: true,
|
51
52
|
},
|
52
53
|
});
|
@@ -6,7 +6,10 @@
|
|
6
6
|
<:default as |content|>
|
7
7
|
<CdDocumentHeader
|
8
8
|
@name={{content.document.rootForm.raw.name}}
|
9
|
-
@
|
9
|
+
@status={{if
|
10
|
+
(eq this.inquiry.status "SUSPENDED")
|
11
|
+
(t "caluma.distribution.status.draft")
|
12
|
+
}}
|
10
13
|
@modifiedAt={{this.inquiry.document.modifiedContentAt}}
|
11
14
|
@modifiedBy={{this.inquiry.document.modifiedContentByUser}}
|
12
15
|
/>
|
@@ -80,36 +80,38 @@
|
|
80
80
|
<UkSpinner @ratio={{2}} />
|
81
81
|
</div>
|
82
82
|
{{else if this.groups.value.length}}
|
83
|
-
<
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
<
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
group.config.icon
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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>
|
113
115
|
{{else}}
|
114
116
|
<div class="uk-text-center">
|
115
117
|
<UkIcon @icon="search" @ratio={{10}} class="uk-margin-top" />
|
@@ -44,9 +44,7 @@ export default class CdInquiryNewFormComponent extends Component {
|
|
44
44
|
}
|
45
45
|
|
46
46
|
@action
|
47
|
-
updateSelectedGroups(identifier
|
48
|
-
e.preventDefault();
|
49
|
-
|
47
|
+
updateSelectedGroups(identifier) {
|
50
48
|
this.selectedGroups = toggle(identifier, this.selectedGroups);
|
51
49
|
}
|
52
50
|
|
@@ -1,32 +1,41 @@
|
|
1
1
|
<div class="uk-text-center uk-margin-small-top">
|
2
2
|
{{#if (can "create inquiry of distribution")}}
|
3
|
-
<
|
4
|
-
@title={{t "caluma.distribution.new.title"}}
|
5
|
-
@icon="plus"
|
3
|
+
<LinkTo
|
6
4
|
@route="new"
|
7
|
-
|
5
|
+
class="uk-icon-button"
|
6
|
+
title={{t "caluma.distribution.new.title"}}
|
7
|
+
>
|
8
|
+
<UkIcon @icon="plus" />
|
9
|
+
</LinkTo>
|
8
10
|
{{/if}}
|
9
11
|
{{#if (can "send inquiries of distribution")}}
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@gutterTop={{4}}
|
15
|
-
@gutterRight={{6}}
|
16
|
-
@gutterLeft={{4}}
|
17
|
-
@gutterBottom={{4}}
|
18
|
-
@onClick={{perform this.sendInquiries}}
|
19
|
-
@loading={{this.sendInquiries.isRunning}}
|
12
|
+
<button
|
13
|
+
type="button"
|
14
|
+
class="uk-icon-button"
|
15
|
+
title={{t "caluma.distribution.send"}}
|
20
16
|
data-test-send-pending-inquiries
|
21
|
-
|
17
|
+
{{on "click" (perform this.sendInquiries)}}
|
18
|
+
>
|
19
|
+
{{#if this.sendInquiries.isRunning}}
|
20
|
+
<UkSpinner @ratio={{0.6}} />
|
21
|
+
{{else}}
|
22
|
+
<UkIcon @icon="comment" />
|
23
|
+
{{/if}}
|
24
|
+
</button>
|
22
25
|
{{/if}}
|
23
26
|
{{#if (can "complete distribution")}}
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
@loading={{this.completeDistribution.isRunning}}
|
27
|
+
<button
|
28
|
+
type="button"
|
29
|
+
class="uk-icon-button"
|
30
|
+
title={{t "caluma.distribution.complete"}}
|
29
31
|
data-test-complete-distribution
|
30
|
-
|
32
|
+
{{on "click" (perform this.completeDistribution)}}
|
33
|
+
>
|
34
|
+
{{#if this.completeDistribution.isRunning}}
|
35
|
+
<UkSpinner @ratio={{0.6}} />
|
36
|
+
{{else}}
|
37
|
+
<UkIcon @icon="lock" />
|
38
|
+
{{/if}}
|
39
|
+
</button>
|
31
40
|
{{/if}}
|
32
41
|
</div>
|
@@ -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
|
+
title={{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
|
+
title={{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>
|
package/addon/config.js
CHANGED
@@ -4,6 +4,7 @@ import { cached } from "tracked-toolbox";
|
|
4
4
|
|
5
5
|
export const INQUIRY_STATUS = {
|
6
6
|
DRAFT: "draft",
|
7
|
+
SKIPPED: "skipped",
|
7
8
|
SENT: "sent",
|
8
9
|
POSITIVE: "positive",
|
9
10
|
NEGATIVE: "negative",
|
@@ -37,20 +38,22 @@ export default function config(target, property) {
|
|
37
38
|
buttons: {
|
38
39
|
"compose-inquiry-answer": {
|
39
40
|
color: "primary",
|
40
|
-
label: "caluma.distribution.answer.
|
41
|
+
label: "caluma.distribution.answer.buttons.compose.label",
|
42
|
+
status: "caluma.distribution.answer.buttons.compose.status",
|
41
43
|
},
|
42
44
|
"confirm-inquiry-answer": {
|
43
45
|
color: "primary",
|
44
|
-
label: "caluma.distribution.answer.confirm",
|
46
|
+
label: "caluma.distribution.answer.buttons.confirm.label",
|
47
|
+
status: "caluma.distribution.answer.buttons.confirm.status",
|
45
48
|
},
|
46
49
|
"revise-inquiry-answer": {
|
47
50
|
color: "default",
|
48
|
-
label: "caluma.distribution.answer.revise",
|
51
|
+
label: "caluma.distribution.answer.buttons.revise.label",
|
49
52
|
},
|
50
53
|
"adjust-inquiry-answer": {
|
51
54
|
color: "primary",
|
52
|
-
label:
|
53
|
-
|
55
|
+
label: "caluma.distribution.answer.buttons.adjust.label",
|
56
|
+
status: "caluma.distribution.answer.buttons.adjust.status",
|
54
57
|
},
|
55
58
|
},
|
56
59
|
},
|
@@ -60,7 +63,7 @@ export default function config(target, property) {
|
|
60
63
|
types: {
|
61
64
|
suggestions: {
|
62
65
|
label: "caluma.distribution.new.suggestions",
|
63
|
-
icon: "
|
66
|
+
icon: "star",
|
64
67
|
iconColor: "warning",
|
65
68
|
},
|
66
69
|
},
|
@@ -1,6 +1,21 @@
|
|
1
|
+
fragment InquiryAnswerButtons on Case {
|
2
|
+
workItems(filter: [{ tasks: $buttonTasks }, { status: READY }]) {
|
3
|
+
edges {
|
4
|
+
node {
|
5
|
+
id
|
6
|
+
status
|
7
|
+
task {
|
8
|
+
id
|
9
|
+
slug
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
1
16
|
fragment InquiryDeadlineDocument on Document {
|
2
17
|
id
|
3
|
-
deadline: answers(question: $deadlineQuestion) {
|
18
|
+
deadline: answers(filter: [{ question: $deadlineQuestion }]) {
|
4
19
|
edges {
|
5
20
|
node {
|
6
21
|
id
|
@@ -14,7 +29,7 @@ fragment InquiryDeadlineDocument on Document {
|
|
14
29
|
|
15
30
|
fragment InquiryStatusDocument on Document {
|
16
31
|
id
|
17
|
-
status: answers(question: $statusQuestion) {
|
32
|
+
status: answers(filter: [{ question: $statusQuestion }]) {
|
18
33
|
edges {
|
19
34
|
node {
|
20
35
|
id
|
@@ -33,7 +48,7 @@ fragment InquiryStatusDocument on Document {
|
|
33
48
|
fragment InquiryRequest on Document {
|
34
49
|
id
|
35
50
|
...InquiryDeadlineDocument
|
36
|
-
info: answers(question: $infoQuestion) {
|
51
|
+
info: answers(filter: [{ question: $infoQuestion }]) {
|
37
52
|
edges {
|
38
53
|
node {
|
39
54
|
id
|
@@ -61,9 +76,10 @@ fragment InquiryDialog on WorkItem {
|
|
61
76
|
}
|
62
77
|
childCase {
|
63
78
|
id
|
79
|
+
...InquiryAnswerButtons
|
64
80
|
document {
|
65
81
|
...InquiryStatusDocument
|
66
|
-
info: answers(questions: $answerInfoQuestions) {
|
82
|
+
info: answers(filter: [{ questions: $answerInfoQuestions }]) {
|
67
83
|
edges {
|
68
84
|
node {
|
69
85
|
id
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#import InquiryDeadlineDocument, InquiryRequest from '../fragments/inquiry.graphql'
|
1
|
+
#import InquiryAnswerButtons, InquiryDeadlineDocument, InquiryRequest from '../fragments/inquiry.graphql'
|
2
2
|
|
3
3
|
query InquiryAnswer(
|
4
4
|
$inquiry: ID!
|
@@ -14,6 +14,7 @@ query InquiryAnswer(
|
|
14
14
|
addressedGroups
|
15
15
|
controllingGroups
|
16
16
|
createdAt
|
17
|
+
closedAt
|
17
18
|
task {
|
18
19
|
id
|
19
20
|
slug
|
@@ -29,17 +30,7 @@ query InquiryAnswer(
|
|
29
30
|
modifiedContentAt
|
30
31
|
modifiedContentByUser
|
31
32
|
}
|
32
|
-
|
33
|
-
edges {
|
34
|
-
node {
|
35
|
-
id
|
36
|
-
task {
|
37
|
-
id
|
38
|
-
slug
|
39
|
-
}
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
33
|
+
...InquiryAnswerButtons
|
43
34
|
}
|
44
35
|
}
|
45
36
|
}
|
@@ -1,7 +1,8 @@
|
|
1
|
-
#import InquiryDialog, InquiryDeadlineDocument, InquiryStatusDocument, InquiryRequest from '../fragments/inquiry.graphql'
|
1
|
+
#import InquiryAnswerButtons, InquiryDialog, InquiryDeadlineDocument, InquiryStatusDocument, InquiryRequest from '../fragments/inquiry.graphql'
|
2
2
|
|
3
3
|
query InquiryDialog(
|
4
4
|
$task: ID!
|
5
|
+
$buttonTasks: [String]!
|
5
6
|
$statusQuestion: ID!
|
6
7
|
$deadlineQuestion: ID!
|
7
8
|
$infoQuestion: ID!
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { assert } from "@ember/debug";
|
2
|
+
import { get } from "@ember/object";
|
3
|
+
|
4
|
+
import { createDecorator } from "@projectcaluma/ember-distribution/-private/decorator";
|
5
|
+
|
6
|
+
function decorator(
|
7
|
+
target,
|
8
|
+
key,
|
9
|
+
desc,
|
10
|
+
{ inquiryProperty = "args.inquiry" } = {}
|
11
|
+
) {
|
12
|
+
assert(
|
13
|
+
`The @projectcaluma/ember-distribution config must be injected in order to use @inquiryAnswerStatus: \`@config config\``,
|
14
|
+
Object.prototype.hasOwnProperty.call(target, "config")
|
15
|
+
);
|
16
|
+
|
17
|
+
return {
|
18
|
+
get() {
|
19
|
+
const inquiry = get(this, inquiryProperty);
|
20
|
+
const readyWorkItems =
|
21
|
+
inquiry.childCase?.workItems.edges
|
22
|
+
.filter((edge) => edge.node.status === "READY")
|
23
|
+
.map((edge) => edge.node.task.slug) ?? [];
|
24
|
+
|
25
|
+
const buttonConfig = Object.entries(
|
26
|
+
this.config.inquiry.answer.buttons
|
27
|
+
).find(([task]) => readyWorkItems.includes(task))?.[1];
|
28
|
+
|
29
|
+
return buttonConfig?.status ? this.intl.t(buttonConfig.status) : null;
|
30
|
+
},
|
31
|
+
};
|
32
|
+
}
|
33
|
+
|
34
|
+
export default createDecorator(decorator);
|
@@ -19,18 +19,18 @@ function decorator(
|
|
19
19
|
get() {
|
20
20
|
const inquiry = get(this, inquiryProperty);
|
21
21
|
const value = inquiry.document?.deadline.edges[0]?.node.value;
|
22
|
-
const
|
22
|
+
const isDone = ["COMPLETED", "SKIPPED"].includes(inquiry.status);
|
23
23
|
|
24
24
|
const { days: diff } = DateTime.fromISO(value).diffNow("days").toObject();
|
25
25
|
|
26
|
-
const isOverdue = !
|
27
|
-
const isWarning = !
|
26
|
+
const isOverdue = !isDone && diff <= 0;
|
27
|
+
const isWarning = !isDone && diff <= this.config.warningPeriod;
|
28
28
|
|
29
29
|
return {
|
30
30
|
value,
|
31
31
|
isOverdue,
|
32
32
|
isWarning,
|
33
|
-
color:
|
33
|
+
color: isDone
|
34
34
|
? "muted"
|
35
35
|
: isOverdue
|
36
36
|
? "danger"
|
@@ -5,15 +5,17 @@ import { createDecorator } from "@projectcaluma/ember-distribution/-private/deco
|
|
5
5
|
import { INQUIRY_STATUS } from "@projectcaluma/ember-distribution/config";
|
6
6
|
|
7
7
|
export const ICON_MAP = {
|
8
|
-
[INQUIRY_STATUS.DRAFT]: "
|
9
|
-
[INQUIRY_STATUS.
|
10
|
-
[INQUIRY_STATUS.
|
11
|
-
[INQUIRY_STATUS.
|
12
|
-
[INQUIRY_STATUS.
|
8
|
+
[INQUIRY_STATUS.DRAFT]: "commenting",
|
9
|
+
[INQUIRY_STATUS.SKIPPED]: "lock",
|
10
|
+
[INQUIRY_STATUS.SENT]: "comment",
|
11
|
+
[INQUIRY_STATUS.POSITIVE]: "check",
|
12
|
+
[INQUIRY_STATUS.NEGATIVE]: "close",
|
13
|
+
[INQUIRY_STATUS.NEEDS_INTERACTION]: "refresh",
|
13
14
|
};
|
14
15
|
|
15
16
|
export const COLOR_MAP = {
|
16
17
|
[INQUIRY_STATUS.DRAFT]: "muted",
|
18
|
+
[INQUIRY_STATUS.SKIPPED]: "muted",
|
17
19
|
[INQUIRY_STATUS.SENT]: "emphasis",
|
18
20
|
[INQUIRY_STATUS.POSITIVE]: "success",
|
19
21
|
[INQUIRY_STATUS.NEGATIVE]: "danger",
|
@@ -44,9 +46,12 @@ function decorator(
|
|
44
46
|
? inquiry.status === "READY"
|
45
47
|
: inquiry.status === "SUSPENDED";
|
46
48
|
const isSent = !isAddressed && inquiry.status === "READY";
|
49
|
+
const isSkipped = inquiry.status === "SKIPPED";
|
47
50
|
|
48
51
|
const answer = inquiry.childCase?.document.status.edges[0]?.node;
|
49
|
-
const slug =
|
52
|
+
const slug = isSkipped
|
53
|
+
? INQUIRY_STATUS.SKIPPED
|
54
|
+
: isDraft
|
50
55
|
? INQUIRY_STATUS.DRAFT
|
51
56
|
: isSent
|
52
57
|
? INQUIRY_STATUS.SENT
|
@@ -55,7 +60,7 @@ function decorator(
|
|
55
60
|
return {
|
56
61
|
slug,
|
57
62
|
label:
|
58
|
-
!isDraft && !isSent
|
63
|
+
!isSkipped && !isDraft && !isSent
|
59
64
|
? answer?.selectedOption.label
|
60
65
|
: this.intl.t(`caluma.distribution.status.${slug}`),
|
61
66
|
color: COLOR_MAP[slug],
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "@projectcaluma/ember-distribution/utils/inquiry-answer-status";
|
package/index.js
CHANGED
@@ -5,11 +5,6 @@ const { buildEngine } = require("ember-engines/lib/engine-addon");
|
|
5
5
|
|
6
6
|
const name = require("./package").name;
|
7
7
|
|
8
|
-
const ioniconAssets = [
|
9
|
-
...require.resolve("ionicons").split("/").slice(0, -1),
|
10
|
-
"svg",
|
11
|
-
].join("/");
|
12
|
-
|
13
8
|
const publicAssets = [
|
14
9
|
...require.resolve(name).split("/").slice(0, -1),
|
15
10
|
"public",
|
@@ -19,5 +14,5 @@ const publicAssets = [
|
|
19
14
|
module.exports = buildEngine({
|
20
15
|
name,
|
21
16
|
lazyLoading: { enabled: false },
|
22
|
-
svgJar: { sourceDirs: [
|
17
|
+
svgJar: { sourceDirs: [publicAssets] },
|
23
18
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@projectcaluma/ember-distribution",
|
3
|
-
"version": "1.0.0-beta.
|
3
|
+
"version": "1.0.0-beta.13",
|
4
4
|
"description": "Ember engine for the Caluma distribution module.",
|
5
5
|
"keywords": [
|
6
6
|
"ember-addon",
|
@@ -19,14 +19,14 @@
|
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
21
|
"@ember/string": "^3.0.0",
|
22
|
-
"@embroider/macros": "^1.
|
22
|
+
"@embroider/macros": "^1.7.1",
|
23
23
|
"@glimmer/component": "^1.1.2",
|
24
24
|
"@glimmer/tracking": "^1.1.2",
|
25
25
|
"@projectcaluma/ember-core": "^11.0.0-beta.7",
|
26
|
-
"@projectcaluma/ember-form": "^11.0.0-beta.
|
26
|
+
"@projectcaluma/ember-form": "^11.0.0-beta.21",
|
27
27
|
"@projectcaluma/ember-workflow": "^11.0.0-beta.7",
|
28
28
|
"ember-apollo-client": "^4.0.2",
|
29
|
-
"ember-auto-import": "^2.4.
|
29
|
+
"ember-auto-import": "^2.4.2",
|
30
30
|
"ember-can": "^4.2.0",
|
31
31
|
"ember-cli-babel": "^7.26.11",
|
32
32
|
"ember-cli-htmlbars": "^6.0.1",
|
@@ -35,23 +35,22 @@
|
|
35
35
|
"ember-fetch": "^8.1.1",
|
36
36
|
"ember-intl": "^5.7.2",
|
37
37
|
"ember-pikaday": "^4.0.0",
|
38
|
-
"ember-resources": "^4.
|
38
|
+
"ember-resources": "^4.8.2",
|
39
39
|
"ember-svg-jar": "^2.3.4",
|
40
40
|
"ember-test-selectors": "^6.0.0",
|
41
41
|
"ember-uikit": "^5.1.3",
|
42
42
|
"graphql": "^15.8.0",
|
43
43
|
"graphql-tag": "^2.12.6",
|
44
|
-
"ionicons": "^6.0.1",
|
45
44
|
"lodash.merge": "^4.6.2",
|
46
45
|
"luxon": "^2.4.0",
|
47
46
|
"tracked-toolbox": "^1.2.3"
|
48
47
|
},
|
49
48
|
"devDependencies": {
|
50
49
|
"@ember/optional-features": "2.0.0",
|
51
|
-
"@ember/test-helpers": "2.
|
52
|
-
"@embroider/test-setup": "1.
|
53
|
-
"@faker-js/faker": "
|
54
|
-
"@projectcaluma/ember-testing": "11.0.0-beta.
|
50
|
+
"@ember/test-helpers": "2.8.1",
|
51
|
+
"@embroider/test-setup": "1.7.1",
|
52
|
+
"@faker-js/faker": "7.2.0",
|
53
|
+
"@projectcaluma/ember-testing": "11.0.0-beta.9",
|
55
54
|
"broccoli-asset-rev": "3.0.0",
|
56
55
|
"ember-cli": "3.28.5",
|
57
56
|
"ember-cli-code-coverage": "1.0.3",
|
@@ -72,12 +71,12 @@
|
|
72
71
|
"ember-source-channel-url": "3.0.0",
|
73
72
|
"ember-try": "2.0.0",
|
74
73
|
"loader.js": "4.7.0",
|
75
|
-
"miragejs": "0.1.
|
74
|
+
"miragejs": "0.1.45",
|
76
75
|
"npm-run-all": "4.1.5",
|
77
76
|
"qunit": "2.19.1",
|
78
77
|
"qunit-dom": "2.0.0",
|
79
|
-
"sass": "1.
|
80
|
-
"webpack": "5.
|
78
|
+
"sass": "1.52.3",
|
79
|
+
"webpack": "5.73.0"
|
81
80
|
},
|
82
81
|
"engines": {
|
83
82
|
"node": "12.* || 14.* || >= 16"
|
package/translations/de.yaml
CHANGED
@@ -3,6 +3,7 @@ caluma:
|
|
3
3
|
empty: "Es wurden noch keine Anfragen erstellt."
|
4
4
|
start: "Starten"
|
5
5
|
send: "Offene Anfragen versenden"
|
6
|
+
complete: "Zirkulation abschliessen"
|
6
7
|
send-confirm: "Wollen Sie wirklich alle offenen Anfragen versenden?"
|
7
8
|
complete-confirm:
|
8
9
|
"Es gibt noch <b>{count} offene {count, plural, =1 {Anfrage} other {Anfragen}}</b>
|
@@ -28,14 +29,23 @@ caluma:
|
|
28
29
|
|
29
30
|
answer:
|
30
31
|
link: "Beantworten"
|
31
|
-
release-for-review: "Zur Kontrolle freigeben"
|
32
|
-
release-adjustment-for-review: "Anpassung zur Kontrolle freigeben"
|
33
|
-
confirm: "Bestätigen"
|
34
|
-
revise: "Überarbeiten"
|
35
32
|
|
36
33
|
complete-error: "Fehler beim Abschliessen der Aufgabe"
|
37
34
|
complete-not-allowed: "Sie sind nicht berechtigt diese Antwort zu versenden."
|
38
35
|
|
36
|
+
buttons:
|
37
|
+
compose:
|
38
|
+
label: "Zur Kontrolle freigeben"
|
39
|
+
status: "In Bearbeitung"
|
40
|
+
adjust:
|
41
|
+
label: "Anpassung zur Kontrolle freigeben"
|
42
|
+
status: "In Überarbeitung"
|
43
|
+
confirm:
|
44
|
+
label: "Bestätigen"
|
45
|
+
status: "In Prüfung"
|
46
|
+
revise:
|
47
|
+
label: "Überarbeiten"
|
48
|
+
|
39
49
|
new:
|
40
50
|
title: "Neue Anfrage"
|
41
51
|
search: "Suchen..."
|
@@ -54,6 +64,7 @@ caluma:
|
|
54
64
|
|
55
65
|
status:
|
56
66
|
draft: "Entwurf"
|
67
|
+
skipped: "Vorzeitig beendet"
|
57
68
|
sent: "Versendet"
|
58
69
|
positive: "Positiv"
|
59
70
|
negative: "Negativ"
|
package/translations/en.yaml
CHANGED
@@ -3,6 +3,7 @@ caluma:
|
|
3
3
|
empty: "No inquiries have been created yet."
|
4
4
|
start: "Start"
|
5
5
|
send: "Send pending inquiries"
|
6
|
+
complete: "Complete circulation"
|
6
7
|
send-confirm: "Do you really want to send all pending inquiries?"
|
7
8
|
complete-confirm:
|
8
9
|
"There {count, plural, =1 {is} other {are}} <b>{count} pending
|
@@ -29,14 +30,23 @@ caluma:
|
|
29
30
|
|
30
31
|
answer:
|
31
32
|
link: "Answer"
|
32
|
-
release-for-review: "Release for review"
|
33
|
-
release-adjustment-for-review: "Release adjustment for review"
|
34
|
-
confirm: "Confirm"
|
35
|
-
revise: "Revise"
|
36
33
|
|
37
34
|
complete-error: "Error while completing the work item"
|
38
35
|
complete-not-allowed: "You are not allowed to send this inquiry answer."
|
39
36
|
|
37
|
+
buttons:
|
38
|
+
compose:
|
39
|
+
label: "Release for review"
|
40
|
+
status: "In progress"
|
41
|
+
adjust:
|
42
|
+
label: "Release adjustment for review"
|
43
|
+
status: "In revision"
|
44
|
+
confirm:
|
45
|
+
label: "Confirm"
|
46
|
+
status: "In review"
|
47
|
+
revise:
|
48
|
+
label: "Revise"
|
49
|
+
|
40
50
|
new:
|
41
51
|
title: "New inquiry"
|
42
52
|
search: "Search..."
|
@@ -55,6 +65,7 @@ caluma:
|
|
55
65
|
|
56
66
|
status:
|
57
67
|
draft: "Draft"
|
68
|
+
skipped: "Aborted"
|
58
69
|
sent: "Sent"
|
59
70
|
positive: "Positive"
|
60
71
|
negative: "Negative"
|
package/translations/fr.yaml
CHANGED
@@ -3,6 +3,7 @@ caluma:
|
|
3
3
|
empty: "Aucune demande n'a encore été créée."
|
4
4
|
start: "Lancer"
|
5
5
|
send: "Envoyer les demandes ouvertes"
|
6
|
+
complete: "Terminer la circulation"
|
6
7
|
send-confirm: "Voulez-vous vraiment envoyer toutes les demandes ouvertes ?"
|
7
8
|
complete-confirm:
|
8
9
|
"Il y a <b>{count} {count, plural, =1 {demande} other {demandes}} en
|
@@ -28,14 +29,23 @@ caluma:
|
|
28
29
|
|
29
30
|
answer:
|
30
31
|
link: "Répondre"
|
31
|
-
release-for-review: "Valider pour vérification"
|
32
|
-
release-adjustment-for-review: "Valider la révision pour vérification"
|
33
|
-
confirm: "Confirmer"
|
34
|
-
revise: "Réviser"
|
35
32
|
|
36
33
|
complete-error: "Erreur lors de la clôture de la tâche"
|
37
34
|
complete-not-allowed: "Vous n'êtes pas autorisé à envoyer cette réponse."
|
38
35
|
|
36
|
+
buttons:
|
37
|
+
compose:
|
38
|
+
label: "Valider pour vérification"
|
39
|
+
status: "En cours"
|
40
|
+
adjust:
|
41
|
+
label: "Valider la révision pour vérification"
|
42
|
+
status: "En révision"
|
43
|
+
confirm:
|
44
|
+
label: "Confirmer"
|
45
|
+
status: "En examen"
|
46
|
+
revise:
|
47
|
+
label: "Réviser"
|
48
|
+
|
39
49
|
new:
|
40
50
|
title: "Nouvelle demande"
|
41
51
|
search: "Chercher..."
|
@@ -54,6 +64,7 @@ caluma:
|
|
54
64
|
|
55
65
|
status:
|
56
66
|
draft: "Brouillon"
|
67
|
+
skipped: "Terminé prématurément"
|
57
68
|
sent: "Envoyé"
|
58
69
|
positive: "Positif"
|
59
70
|
negative: "Negatif"
|
@@ -1,27 +0,0 @@
|
|
1
|
-
{{#if @route}}
|
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}}
|
10
|
-
</LinkTo>
|
11
|
-
{{else}}
|
12
|
-
<button
|
13
|
-
type="button"
|
14
|
-
class={{this.class}}
|
15
|
-
title={{@title}}
|
16
|
-
...attributes
|
17
|
-
{{on "click" @onClick}}
|
18
|
-
>
|
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}}
|
26
|
-
</button>
|
27
|
-
{{/if}}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { dasherize } from "@ember/string";
|
2
|
-
import Component from "@glimmer/component";
|
3
|
-
|
4
|
-
export default class CdIconButtonComponent extends Component {
|
5
|
-
get class() {
|
6
|
-
const gutters = [
|
7
|
-
"gutter",
|
8
|
-
"gutterTop",
|
9
|
-
"gutterRight",
|
10
|
-
"gutterBottom",
|
11
|
-
"gutterLeft",
|
12
|
-
]
|
13
|
-
.map((arg) =>
|
14
|
-
this.args[arg]
|
15
|
-
? `uk-icon-button--${dasherize(arg)}-${this.args[arg]}`
|
16
|
-
: null
|
17
|
-
)
|
18
|
-
.filter(Boolean);
|
19
|
-
|
20
|
-
return ["uk-icon-button", ...gutters].join(" ");
|
21
|
-
}
|
22
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export { default } from "@projectcaluma/ember-distribution/components/cd-icon-button";
|
@@ -1,13 +0,0 @@
|
|
1
|
-
@import "ember-uikit/variables-theme";
|
2
|
-
|
3
|
-
@for $i from 1 through 8 {
|
4
|
-
@each $side in "top", "right", "bottom", "left" {
|
5
|
-
.uk-icon-button--gutter-#{$side}-#{$i} > svg {
|
6
|
-
margin-#{$side}: #{$i}px !important;
|
7
|
-
}
|
8
|
-
}
|
9
|
-
|
10
|
-
.uk-icon-button--gutter-#{$i} > svg {
|
11
|
-
margin: #{$i}px;
|
12
|
-
}
|
13
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
@import "ember-uikit/variables-theme";
|
2
|
-
|
3
|
-
$size: $global-small-font-size * 1.2;
|
4
|
-
$iconSize: $global-small-font-size * 0.9;
|
5
|
-
|
6
|
-
$colors: (
|
7
|
-
muted: $text-muted-color,
|
8
|
-
emphasis: $text-emphasis-color,
|
9
|
-
success: $text-success-color,
|
10
|
-
danger: $text-danger-color,
|
11
|
-
warning: $text-warning-color,
|
12
|
-
);
|
13
|
-
|
14
|
-
.status-indicator {
|
15
|
-
width: $size;
|
16
|
-
height: $size;
|
17
|
-
border-width: 1px;
|
18
|
-
border-style: solid;
|
19
|
-
|
20
|
-
> svg {
|
21
|
-
width: $iconSize;
|
22
|
-
height: $iconSize;
|
23
|
-
}
|
24
|
-
|
25
|
-
@each $colorName, $color in $colors {
|
26
|
-
&.uk-text-#{$colorName} {
|
27
|
-
color: darken($color, 20%);
|
28
|
-
border-color: $color;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}
|