@projectcaluma/ember-distribution 1.0.0-beta.6 → 1.0.0-beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/addon/components/{icon-button.hbs → cd-icon-button.hbs} +0 -0
  3. package/addon/components/{icon-button.js → cd-icon-button.js} +1 -1
  4. package/addon/components/{inquiry-answer-form.hbs → cd-inquiry-answer-form.hbs} +1 -1
  5. package/addon/components/{inquiry-answer-form.js → cd-inquiry-answer-form.js} +1 -1
  6. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-deadline.hbs +1 -0
  7. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-deadline.js +1 -1
  8. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-divider.hbs +0 -0
  9. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-divider.js +1 -1
  10. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-part.hbs +0 -0
  11. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-part.js +1 -1
  12. package/addon/components/cd-inquiry-dialog/inquiry.hbs +16 -0
  13. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry.js +1 -1
  14. package/addon/components/{inquiry-dialog.hbs → cd-inquiry-dialog.hbs} +2 -2
  15. package/addon/components/{inquiry-dialog.js → cd-inquiry-dialog.js} +1 -1
  16. package/addon/components/{inquiry-edit-form.hbs → cd-inquiry-edit-form.hbs} +1 -1
  17. package/addon/components/{inquiry-edit-form.js → cd-inquiry-edit-form.js} +1 -1
  18. package/addon/components/{inquiry-new-form.hbs → cd-inquiry-new-form.hbs} +1 -1
  19. package/addon/components/{inquiry-new-form.js → cd-inquiry-new-form.js} +1 -1
  20. package/addon/components/{distribution-navigation → cd-navigation}/controls.hbs +6 -4
  21. package/addon/components/cd-navigation/controls.js +95 -0
  22. package/addon/components/{distribution-navigation → cd-navigation}/item.hbs +1 -4
  23. package/addon/components/{distribution-navigation → cd-navigation}/item.js +1 -1
  24. package/addon/components/{distribution-navigation → cd-navigation}/section.hbs +2 -2
  25. package/addon/components/{distribution-navigation → cd-navigation}/section.js +1 -1
  26. package/addon/components/{distribution-navigation → cd-navigation}/status-indicator.hbs +2 -1
  27. package/addon/components/{distribution-navigation → cd-navigation}/status-indicator.js +1 -1
  28. package/addon/components/{distribution-navigation.hbs → cd-navigation.hbs} +3 -6
  29. package/addon/components/{distribution-navigation.js → cd-navigation.js} +1 -1
  30. package/addon/components/{notfound.hbs → cd-notfound.hbs} +0 -0
  31. package/addon/gql/mutations/complete-work-item.graphql +8 -0
  32. package/addon/gql/queries/incomplete-inquiries.graphql +13 -0
  33. package/addon/templates/application.hbs +1 -1
  34. package/addon/templates/inquiry/detail/answer.hbs +1 -1
  35. package/addon/templates/inquiry/detail/index.hbs +1 -1
  36. package/addon/templates/inquiry/index.hbs +1 -1
  37. package/addon/templates/new.hbs +1 -1
  38. package/addon/templates/notfound.hbs +1 -1
  39. package/app/components/{inquiry-dialog.js → cd-icon-button.js} +1 -1
  40. package/app/components/{inquiry-dialog/inquiry.js → cd-inquiry-answer-form.js} +1 -1
  41. package/app/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-deadline.js +1 -1
  42. package/app/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-divider.js +1 -1
  43. package/app/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-part.js +1 -1
  44. package/app/components/{distribution-navigation.js → cd-inquiry-dialog/inquiry.js} +1 -1
  45. package/app/components/{inquiry-edit-form.js → cd-inquiry-dialog.js} +1 -1
  46. package/app/components/cd-inquiry-edit-form.js +1 -0
  47. package/app/components/{inquiry-answer-form.js → cd-inquiry-new-form.js} +1 -1
  48. package/app/components/cd-navigation/controls.js +1 -0
  49. package/app/components/{inquiry-new-form.js → cd-navigation/item.js} +1 -1
  50. package/app/components/cd-navigation/section.js +1 -0
  51. package/app/components/{distribution-navigation/item.js → cd-navigation/status-indicator.js} +1 -1
  52. package/app/components/{icon-button.js → cd-navigation.js} +1 -1
  53. package/app/components/{notfound.js → cd-notfound.js} +1 -1
  54. package/package.json +12 -12
  55. package/translations/de.yaml +5 -0
  56. package/translations/en.yaml +6 -0
  57. package/translations/fr.yaml +5 -0
  58. package/addon/components/distribution-navigation/controls.js +0 -51
  59. package/addon/components/inquiry-dialog/inquiry.hbs +0 -16
  60. package/app/components/distribution-navigation/controls.js +0 -1
  61. package/app/components/distribution-navigation/section.js +0 -1
  62. package/app/components/distribution-navigation/status-indicator.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [@projectcaluma/ember-distribution-v1.0.0-beta.7](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.6...@projectcaluma/ember-distribution-v1.0.0-beta.7) (2022-04-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **distribution:** fix status indicator and deadline styling for firefox ([358acb1](https://github.com/projectcaluma/ember-caluma/commit/358acb1f8e23b425bd6e223dc5873e516710ef12))
7
+ * **distribution:** make sure distribution components are prefixed ([d7d98ec](https://github.com/projectcaluma/ember-caluma/commit/d7d98ec291f937f384e2521d4d89c363d8e34f02))
8
+
9
+
10
+ ### Features
11
+
12
+ * **distribution:** enable completing the distribution ([beabe61](https://github.com/projectcaluma/ember-caluma/commit/beabe61bd34025c4785c1e1ba60c59babb3eb6ab))
13
+
1
14
  # [@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
15
 
3
16
 
@@ -1,7 +1,7 @@
1
1
  import { dasherize } from "@ember/string";
2
2
  import Component from "@glimmer/component";
3
3
 
4
- export default class IconButtonComponent extends Component {
4
+ export default class CdIconButtonComponent extends Component {
5
5
  get class() {
6
6
  const gutters = [
7
7
  "gutter",
@@ -44,5 +44,5 @@
44
44
  {{/if}}
45
45
  {{/each}}
46
46
  </:default>
47
- <:notfound><Notfound /></:notfound>
47
+ <:notfound><CdNotfound /></:notfound>
48
48
  </CfContent>
@@ -9,7 +9,7 @@ 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
11
 
12
- export default class InquiryAnswerFormComponent extends Component {
12
+ export default class CdInquiryAnswerFormComponent extends Component {
13
13
  @service intl;
14
14
  @service router;
15
15
  @service notification;
@@ -16,6 +16,7 @@
16
16
  {{svg-jar
17
17
  (if this.isWithdrawn "ban-outline" "alarm-outline")
18
18
  height=26
19
+ width=26
19
20
  class="uk-margin-small-right"
20
21
  }}
21
22
  {{#if this.isWithdrawn}}
@@ -3,7 +3,7 @@ import Component from "@glimmer/component";
3
3
  import config from "@projectcaluma/ember-distribution/config";
4
4
  import inquiryDeadline from "@projectcaluma/ember-distribution/utils/inquiry-deadline";
5
5
 
6
- export default class InquiryDialogInquiryDeadlineComponent extends Component {
6
+ export default class CdInquiryDialogInquiryDeadlineComponent extends Component {
7
7
  @config config;
8
8
 
9
9
  @inquiryDeadline deadline;
@@ -4,7 +4,7 @@ import Component from "@glimmer/component";
4
4
  import config from "@projectcaluma/ember-distribution/config";
5
5
  import inquiryStatus from "@projectcaluma/ember-distribution/utils/inquiry-status";
6
6
 
7
- export default class InquiryDialogInquiryDividerComponent extends Component {
7
+ export default class CdInquiryDialogInquiryDividerComponent extends Component {
8
8
  @service intl;
9
9
 
10
10
  @config config;
@@ -8,7 +8,7 @@ import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
8
8
  import config from "@projectcaluma/ember-distribution/config";
9
9
  import withdrawInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/withdraw-inquiry.graphql";
10
10
 
11
- export default class InquiryDialogInquiryPartComponent extends Component {
11
+ export default class CdInquiryDialogInquiryPartComponent extends Component {
12
12
  @service notification;
13
13
  @service router;
14
14
  @service intl;
@@ -0,0 +1,16 @@
1
+ <article
2
+ class="uk-card uk-card-default uk-margin
3
+ {{if this.config.ui.small 'uk-card-small'}}"
4
+ >
5
+ <div class="uk-card-body">
6
+ <CdInquiryDialog::InquiryDeadline @inquiry={{@inquiry}} />
7
+
8
+ {{#if this.hasAnswer}}
9
+ <CdInquiryDialog::InquiryPart @inquiry={{@inquiry}} @type="answer" />
10
+
11
+ <CdInquiryDialog::InquiryDivider @inquiry={{@inquiry}} />
12
+ {{/if}}
13
+
14
+ <CdInquiryDialog::InquiryPart @inquiry={{@inquiry}} @type="request" />
15
+ </div>
16
+ </article>
@@ -2,7 +2,7 @@ import Component from "@glimmer/component";
2
2
 
3
3
  import config from "@projectcaluma/ember-distribution/config";
4
4
 
5
- export default class InquiryDialogInquiryComponent extends Component {
5
+ export default class CdInquiryDialogInquiryComponent extends Component {
6
6
  @config config;
7
7
 
8
8
  get hasAnswer() {
@@ -3,9 +3,9 @@
3
3
  {{else if this.inquiries.length}}
4
4
  <section>
5
5
  {{#each this.inquiries as |inquiry|}}
6
- <InquiryDialog::Inquiry @inquiry={{inquiry}} />
6
+ <CdInquiryDialog::Inquiry @inquiry={{inquiry}} />
7
7
  {{/each}}
8
8
  </section>
9
9
  {{else}}
10
- <Notfound />
10
+ <CdNotfound />
11
11
  {{/if}}
@@ -7,7 +7,7 @@ import { useTask } from "ember-resources";
7
7
  import config from "@projectcaluma/ember-distribution/config";
8
8
  import inquiryDialogQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-dialog.graphql";
9
9
 
10
- export default class InquiryDialogComponent extends Component {
10
+ export default class CdInquiryDialogComponent extends Component {
11
11
  @service router;
12
12
 
13
13
  @config config;
@@ -25,5 +25,5 @@
25
25
  >{{t "caluma.distribution.edit.send"}}</UkButton>
26
26
  </DocumentValidity>
27
27
  </:default>
28
- <:notfound><Notfound /></:notfound>
28
+ <:notfound><CdNotfound /></:notfound>
29
29
  </CfContent>
@@ -8,7 +8,7 @@ import config from "@projectcaluma/ember-distribution/config";
8
8
  import resumeWorkItemMutation from "@projectcaluma/ember-distribution/gql/mutations/resume-work-item.graphql";
9
9
  import inquiryEditQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-edit.graphql";
10
10
 
11
- export default class InquiryEditFormComponent extends Component {
11
+ export default class CdInquiryEditFormComponent extends Component {
12
12
  @service notification;
13
13
  @service router;
14
14
  @service intl;
@@ -117,5 +117,5 @@
117
117
  </div>
118
118
  {{/if}}
119
119
  {{else}}
120
- <Notfound />
120
+ <CdNotfound />
121
121
  {{/if}}
@@ -19,7 +19,7 @@ const toggle = (value, array) => {
19
19
  return [...set];
20
20
  };
21
21
 
22
- export default class InquiryNewFormComponent extends Component {
22
+ export default class CdInquiryNewFormComponent extends Component {
23
23
  @service calumaOptions;
24
24
  @service notification;
25
25
  @service intl;
@@ -1,9 +1,9 @@
1
1
  <div class="uk-text-center uk-margin-small-top">
2
2
  {{#if (can "create inquiry of distribution")}}
3
- <IconButton @route="new" @icon="plus" />
3
+ <CdIconButton @route="new" @icon="plus" />
4
4
  {{/if}}
5
5
  {{#if (can "send inquiries of distribution")}}
6
- <IconButton
6
+ <CdIconButton
7
7
  @title={{t "caluma.distribution.send"}}
8
8
  @icon="paper-plane-outline"
9
9
  @fromSvgJar={{true}}
@@ -17,10 +17,12 @@
17
17
  />
18
18
  {{/if}}
19
19
  {{#if (can "complete distribution")}}
20
- <IconButton
20
+ <CdIconButton
21
21
  @icon="lock-closed-outline"
22
22
  @fromSvgJar={{true}}
23
- @onClick={{this.noop}}
23
+ @onClick={{perform this.completeDistribution}}
24
+ @loading={{this.completeDistribution.isRunning}}
25
+ data-test-complete-distribution
24
26
  />
25
27
  {{/if}}
26
28
  </div>
@@ -0,0 +1,95 @@
1
+ import { inject as service } from "@ember/service";
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
+ import { gql } from "graphql-tag";
7
+
8
+ import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
9
+ import config from "@projectcaluma/ember-distribution/config";
10
+ import completeWorkItemMutation from "@projectcaluma/ember-distribution/gql/mutations/complete-work-item.graphql";
11
+ import incompleteInquiriesQuery from "@projectcaluma/ember-distribution/gql/queries/incomplete-inquiries.graphql";
12
+
13
+ export default class CdNavigationControlsComponent extends Component {
14
+ @service distribution;
15
+ @service intl;
16
+ @service notification;
17
+ @service router;
18
+
19
+ @queryManager apollo;
20
+ @config config;
21
+
22
+ @dropTask
23
+ *completeDistribution() {
24
+ try {
25
+ const incompleteInquiries = yield this.apollo.query(
26
+ {
27
+ query: incompleteInquiriesQuery,
28
+ variables: {
29
+ caseId: this.args.caseId,
30
+ task: this.config.inquiry.task,
31
+ },
32
+ },
33
+ "allWorkItems.totalCount"
34
+ );
35
+
36
+ if (
37
+ incompleteInquiries > 0 &&
38
+ !(yield confirm(
39
+ this.intl.t("caluma.distribution.complete-confirm", {
40
+ count: incompleteInquiries,
41
+ })
42
+ ))
43
+ ) {
44
+ return;
45
+ }
46
+
47
+ const completeDistributionWorkItem =
48
+ this.distribution.controls.value.complete.edges?.[0]?.node.id;
49
+
50
+ yield this.apollo.mutate({
51
+ mutation: completeWorkItemMutation,
52
+ variables: {
53
+ workItem: completeDistributionWorkItem,
54
+ },
55
+ });
56
+
57
+ yield this.distribution.refetch();
58
+ this.router.transitionTo("index");
59
+ } catch (e) {
60
+ this.notification.danger(
61
+ this.intl.t("caluma.distribution.complete-error")
62
+ );
63
+ }
64
+ }
65
+
66
+ @dropTask
67
+ *sendInquiries() {
68
+ if (!(yield confirm(this.intl.t("caluma.distribution.send-confirm")))) {
69
+ return;
70
+ }
71
+
72
+ try {
73
+ const ids = this.distribution.controls.value.send.edges.map((edge) =>
74
+ decodeId(edge.node.id)
75
+ );
76
+
77
+ const mutations = ids.map(
78
+ (id, index) => `
79
+ sendInquiry${index}: resumeWorkItem(input: { id: "${id}" }) {
80
+ workItem {
81
+ id
82
+ status
83
+ }
84
+ }
85
+ `
86
+ );
87
+
88
+ const mutation = gql`mutation SendInquiries {${mutations.join("\n")}}`;
89
+
90
+ yield this.apollo.mutate({ mutation });
91
+ } catch (e) {
92
+ this.notification.danger(this.intl.t("caluma.distribution.send-error"));
93
+ }
94
+ }
95
+ }
@@ -9,10 +9,7 @@
9
9
  {{/if}}
10
10
  </div>
11
11
 
12
- <DistributionNavigation::StatusIndicator
13
- @inquiry={{@inquiry}}
14
- @type={{@type}}
15
- />
12
+ <CdNavigation::StatusIndicator @inquiry={{@inquiry}} @type={{@type}} />
16
13
  </div>
17
14
  </LinkTo>
18
15
  </li>
@@ -1,7 +1,7 @@
1
1
  import { inject as service } from "@ember/service";
2
2
  import Component from "@glimmer/component";
3
3
 
4
- export default class DistributionNavigationItemComponent extends Component {
4
+ export default class CdNavigationItemComponent extends Component {
5
5
  @service router;
6
6
 
7
7
  get model() {
@@ -14,13 +14,13 @@
14
14
  {{#if @inquiries.length}}
15
15
  <ul class="uk-tab uk-tab-left uk-margin-left">
16
16
  {{#each this.inquiries as |inquiry|}}
17
- <DistributionNavigation::Item @inquiry={{inquiry}} @type={{@type}} />
17
+ <CdNavigation::Item @inquiry={{inquiry}} @type={{@type}} />
18
18
  {{/each}}
19
19
  </ul>
20
20
  {{/if}}
21
21
 
22
22
  {{#if (eq @type "controlling")}}
23
- <DistributionNavigation::Controls @caseId={{@caseId}} />
23
+ <CdNavigation::Controls @caseId={{@caseId}} />
24
24
  {{/if}}
25
25
  {{/if}}
26
26
  </li>
@@ -2,7 +2,7 @@ import { action } from "@ember/object";
2
2
  import Component from "@glimmer/component";
3
3
  import { tracked } from "@glimmer/tracking";
4
4
 
5
- export default class DistributionNavigationSectionComponent extends Component {
5
+ export default class CdNavigationSectionComponent extends Component {
6
6
  @tracked expanded = true;
7
7
 
8
8
  @action
@@ -1,10 +1,11 @@
1
1
  {{#if this.showDeadlineIndicator}}
2
2
  <div
3
- class="deadline-indicator uk-flex-uk-flex-middle uk-flex-center uk-margin-small-left uk-text-{{this.deadline.color}}"
3
+ class="deadline-indicator uk-flex uk-flex-middle uk-flex-center uk-margin-small-left uk-text-{{this.deadline.color}}"
4
4
  >
5
5
  {{svg-jar
6
6
  "notifications-outline"
7
7
  height=16
8
+ width=16
8
9
  title=(format-date this.deadline.value)
9
10
  }}
10
11
  </div>
@@ -5,7 +5,7 @@ import config from "@projectcaluma/ember-distribution/config";
5
5
  import inquiryDeadline from "@projectcaluma/ember-distribution/utils/inquiry-deadline";
6
6
  import inquiryStatus from "@projectcaluma/ember-distribution/utils/inquiry-status";
7
7
 
8
- export default class DistributionNavigationStatusIndicatorComponent extends Component {
8
+ export default class CdNavigationStatusIndicatorComponent extends Component {
9
9
  @service intl;
10
10
 
11
11
  @config config;
@@ -1,17 +1,14 @@
1
1
  <aside>
2
2
  <ul class="uk-tab uk-tab-left uk-margin-remove-bottom">
3
- <DistributionNavigation::Section
3
+ <CdNavigation::Section
4
4
  @type="controlling"
5
5
  @inquiries={{this.inquiries.controlling}}
6
6
  @caseId={{@caseId}}
7
7
  />
8
- <DistributionNavigation::Section
8
+ <CdNavigation::Section
9
9
  @type="addressed"
10
10
  @inquiries={{this.inquiries.addressed}}
11
11
  />
12
- <DistributionNavigation::Section
13
- @type="more"
14
- @inquiries={{this.inquiries.more}}
15
- />
12
+ <CdNavigation::Section @type="more" @inquiries={{this.inquiries.more}} />
16
13
  </ul>
17
14
  </aside>
@@ -5,7 +5,7 @@ import { queryManager } from "ember-apollo-client";
5
5
  import config from "@projectcaluma/ember-distribution/config";
6
6
  import uniqueByGroups from "@projectcaluma/ember-distribution/utils/unique-by-groups";
7
7
 
8
- export default class DistributionNavigationComponent extends Component {
8
+ export default class CdNavigationComponent extends Component {
9
9
  @service("-scheduler") scheduler;
10
10
  @service calumaOptions;
11
11
  @service distribution;
@@ -0,0 +1,8 @@
1
+ mutation CompleteWorkItem($workItem: ID!) {
2
+ completeWorkItem(input: { id: $workItem }) {
3
+ workItem {
4
+ id
5
+ status
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ query InquiryIncomplete($caseId: ID!, $task: ID!) {
2
+ allWorkItems(
3
+ filter: [
4
+ { case: $caseId }
5
+ { task: $task }
6
+ { status: CANCELED, invert: true }
7
+ { status: COMPLETED, invert: true }
8
+ { status: SKIPPED, invert: true }
9
+ ]
10
+ ) {
11
+ totalCount
12
+ }
13
+ }
@@ -1,6 +1,6 @@
1
1
  <div uk-grid class={{if this.config.ui.stack "uk-grid-small"}}>
2
2
  <div class={{if this.config.ui.stack "uk-width-1-1" "uk-width-1-3"}}>
3
- <DistributionNavigation @caseId={{@model}} />
3
+ <CdNavigation @caseId={{@model}} />
4
4
  </div>
5
5
  <div class={{if this.config.ui.stack "uk-width-1-1" "uk-width-2-3"}}>
6
6
  {{outlet}}
@@ -1 +1 @@
1
- <InquiryAnswerForm @inquiry={{@model}} />
1
+ <CdInquiryAnswerForm @inquiry={{@model}} />
@@ -1 +1 @@
1
- <InquiryEditForm @inquiry={{@model}} />
1
+ <CdInquiryEditForm @inquiry={{@model}} />
@@ -1,4 +1,4 @@
1
- <InquiryDialog
1
+ <CdInquiryDialog
2
2
  @from={{@model.from}}
3
3
  @to={{@model.to}}
4
4
  @caseId={{@model.case}}
@@ -1,4 +1,4 @@
1
- <InquiryNewForm
1
+ <CdInquiryNewForm
2
2
  @selectedTypes={{this.selectedTypes}}
3
3
  @search={{this.search}}
4
4
  @caseId={{@model}}
@@ -1 +1 @@
1
- <Notfound />
1
+ <CdNotfound />
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-dialog";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-icon-button";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-dialog/inquiry";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-answer-form";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-dialog/inquiry-deadline";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-dialog/inquiry-deadline";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-dialog/inquiry-divider";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-dialog/inquiry-divider";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-dialog/inquiry-part";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-dialog/inquiry-part";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/distribution-navigation";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-dialog/inquiry";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-edit-form";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-dialog";
@@ -0,0 +1 @@
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-edit-form";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-answer-form";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-inquiry-new-form";
@@ -0,0 +1 @@
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-navigation/controls";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-new-form";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-navigation/item";
@@ -0,0 +1 @@
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-navigation/section";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/distribution-navigation/item";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-navigation/status-indicator";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/icon-button";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-navigation";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/notfound";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-notfound";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -20,14 +20,14 @@
20
20
  "dependencies": {
21
21
  "@ember/string": "^3.0.0",
22
22
  "@embroider/macros": "^1.5.0",
23
- "@glimmer/component": "^1.0.4",
24
- "@glimmer/tracking": "^1.0.4",
23
+ "@glimmer/component": "^1.1.1",
24
+ "@glimmer/tracking": "^1.1.1",
25
25
  "@projectcaluma/ember-core": "^11.0.0-beta.6",
26
- "@projectcaluma/ember-form": "^11.0.0-beta.16",
26
+ "@projectcaluma/ember-form": "^11.0.0-beta.17",
27
27
  "@projectcaluma/ember-workflow": "^11.0.0-beta.6",
28
28
  "ember-apollo-client": "^4.0.2",
29
- "ember-auto-import": "^2.4.0",
30
- "ember-can": "^4.1.0",
29
+ "ember-auto-import": "^2.4.1",
30
+ "ember-can": "^4.2.0",
31
31
  "ember-cli-babel": "^7.26.11",
32
32
  "ember-cli-htmlbars": "^6.0.1",
33
33
  "ember-concurrency": "^2.2.1",
@@ -48,10 +48,10 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@ember/optional-features": "2.0.0",
51
- "@ember/test-helpers": "2.6.0",
51
+ "@ember/test-helpers": "2.7.0",
52
52
  "@embroider/test-setup": "1.5.0",
53
- "@faker-js/faker": "6.0.0",
54
- "@projectcaluma/ember-testing": "11.0.0-beta.5",
53
+ "@faker-js/faker": "6.1.2",
54
+ "@projectcaluma/ember-testing": "11.0.0-beta.6",
55
55
  "broccoli-asset-rev": "3.0.0",
56
56
  "ember-cli": "3.28.5",
57
57
  "ember-cli-code-coverage": "1.0.3",
@@ -74,10 +74,10 @@
74
74
  "loader.js": "4.7.0",
75
75
  "miragejs": "0.1.43",
76
76
  "npm-run-all": "4.1.5",
77
- "qunit": "2.18.0",
77
+ "qunit": "2.18.1",
78
78
  "qunit-dom": "2.0.0",
79
- "sass": "1.49.9",
80
- "webpack": "5.70.0"
79
+ "sass": "1.50.0",
80
+ "webpack": "5.71.0"
81
81
  },
82
82
  "engines": {
83
83
  "node": "12.* || 14.* || >= 16"
@@ -4,7 +4,12 @@ caluma:
4
4
  start: "Starten"
5
5
  send: "Offene Anfragen versenden"
6
6
  send-confirm: "Wollen Sie wirklich alle offenen Anfragen versenden?"
7
+ complete-confirm:
8
+ "Es gibt noch <b>{count} offene {count, plural, =1 {Anfrage} other {Anfragen}}</b>
9
+ in der aktuellen Zirkulation. Wenn Sie die Zirkulation abschliessen, werden
10
+ alle verbleibenden offenen Anfragen abgebrochen. Möchten Sie fortfahren?"
7
11
  send-error: "Fehler beim Versenden der offenen Anfragen"
12
+ complete-error: "Fehler beim Abschliessen der Zirkulation"
8
13
 
9
14
  edit:
10
15
  title: "Anfrage bearbeiten"
@@ -4,7 +4,13 @@ caluma:
4
4
  start: "Start"
5
5
  send: "Send pending inquiries"
6
6
  send-confirm: "Do you really want to send all pending inquiries?"
7
+ complete-confirm:
8
+ "There {count, plural, =1 {is} other {are}} <b>{count} pending
9
+ {count, plural, =1 {inquiry} other {inquiries}}</b> on the current
10
+ distribution. Completing the distribution will cause all remaining
11
+ pending inquiries to be canceled. Would you like to continue?"
7
12
  send-error: "Error while sending pending inquiries"
13
+ complete-error: "Error while completing distribution"
8
14
 
9
15
  edit:
10
16
  title: "Edit inquiry"
@@ -4,7 +4,12 @@ caluma:
4
4
  start: "Lancer"
5
5
  send: "Envoyer les demandes ouvertes"
6
6
  send-confirm: "Voulez-vous vraiment envoyer toutes les demandes ouvertes ?"
7
+ complete-confirm:
8
+ "Il y a <b>{count} {count, plural, =1 {demande} other {demandes}} en
9
+ attente</b> sur la distribution actuelle. Si vous terminez la distribution,
10
+ toutes les demandes en attente seront annulées. Voulez-vous continuer ?"
7
11
  send-error: "Erreur lors de l'envoi des demandes ouvertes"
12
+ complete-error: "Erreur lors de la terminaison de la distribution"
8
13
 
9
14
  edit:
10
15
  title: "Modifier la demande"
@@ -1,51 +0,0 @@
1
- import { action } from "@ember/object";
2
- import { inject as service } from "@ember/service";
3
- import Component from "@glimmer/component";
4
- import { queryManager } from "ember-apollo-client";
5
- import { dropTask } from "ember-concurrency";
6
- import { confirm } from "ember-uikit";
7
- import { gql } from "graphql-tag";
8
-
9
- import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
10
-
11
- export default class DistributionNavigationControlsComponent extends Component {
12
- @service distribution;
13
- @service intl;
14
-
15
- @queryManager apollo;
16
-
17
- @action
18
- noop(e) {
19
- e.preventDefault();
20
- }
21
-
22
- @dropTask
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
- }
50
- }
51
- }
@@ -1,16 +0,0 @@
1
- <article
2
- class="uk-card uk-card-default uk-margin
3
- {{if this.config.ui.small 'uk-card-small'}}"
4
- >
5
- <div class="uk-card-body">
6
- <InquiryDialog::InquiryDeadline @inquiry={{@inquiry}} />
7
-
8
- {{#if this.hasAnswer}}
9
- <InquiryDialog::InquiryPart @inquiry={{@inquiry}} @type="answer" />
10
-
11
- <InquiryDialog::InquiryDivider @inquiry={{@inquiry}} />
12
- {{/if}}
13
-
14
- <InquiryDialog::InquiryPart @inquiry={{@inquiry}} @type="request" />
15
- </div>
16
- </article>
@@ -1 +0,0 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/distribution-navigation/controls";
@@ -1 +0,0 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/distribution-navigation/section";
@@ -1 +0,0 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/distribution-navigation/status-indicator";