@projectcaluma/ember-distribution 1.0.0-beta.1 → 1.0.0-beta.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/addon/abilities/distribution.js +41 -0
  3. package/addon/abilities/inquiry.js +20 -0
  4. package/addon/components/cd-document-header.hbs +17 -0
  5. package/addon/components/cd-inquiry-answer-form.hbs +78 -0
  6. package/addon/components/{inquiry-answer-form.js → cd-inquiry-answer-form.js} +32 -14
  7. package/addon/components/cd-inquiry-dialog/inquiry-deadline.hbs +27 -0
  8. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-deadline.js +5 -1
  9. package/addon/components/cd-inquiry-dialog/inquiry-divider.hbs +8 -0
  10. package/addon/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-divider.js +1 -1
  11. package/addon/components/cd-inquiry-dialog/inquiry-part.hbs +109 -0
  12. package/addon/components/cd-inquiry-dialog/inquiry-part.js +69 -0
  13. package/addon/components/cd-inquiry-dialog/inquiry.hbs +16 -0
  14. package/addon/components/cd-inquiry-dialog/inquiry.js +11 -0
  15. package/addon/components/cd-inquiry-dialog.hbs +30 -0
  16. package/addon/components/cd-inquiry-dialog.js +94 -0
  17. package/addon/components/cd-inquiry-edit-form.hbs +44 -0
  18. package/addon/components/{inquiry-edit-form.js → cd-inquiry-edit-form.js} +5 -4
  19. package/addon/components/cd-inquiry-new-form.hbs +125 -0
  20. package/addon/components/cd-inquiry-new-form.js +114 -0
  21. package/addon/components/cd-navigation/controls.hbs +41 -0
  22. package/addon/components/cd-navigation/controls.js +95 -0
  23. package/addon/components/cd-navigation/item.hbs +18 -0
  24. package/addon/components/{distribution-navigation → cd-navigation}/item.js +2 -2
  25. package/addon/components/cd-navigation/section.hbs +26 -0
  26. package/addon/components/{distribution-navigation → cd-navigation}/section.js +1 -1
  27. package/addon/components/cd-navigation/status-indicator.hbs +13 -0
  28. package/addon/components/{distribution-navigation → cd-navigation}/status-indicator.js +1 -1
  29. package/addon/components/cd-navigation.hbs +11 -0
  30. package/addon/components/cd-navigation.js +53 -0
  31. package/addon/components/cd-notfound.hbs +12 -0
  32. package/addon/components/cd-truncated.hbs +8 -0
  33. package/addon/components/cd-truncated.js +32 -0
  34. package/addon/config.js +12 -7
  35. package/addon/controllers/application.js +10 -0
  36. package/addon/controllers/{distribution/new.js → new.js} +2 -2
  37. package/addon/engine.js +7 -1
  38. package/addon/gql/fragments/inquiry.graphql +37 -12
  39. package/addon/gql/mutations/complete-work-item.graphql +8 -0
  40. package/addon/gql/mutations/withdraw-inquiry.graphql +8 -0
  41. package/addon/gql/queries/control-work-items.graphql +18 -2
  42. package/addon/gql/queries/incomplete-inquiries.graphql +13 -0
  43. package/addon/gql/queries/inquiry-answer.graphql +17 -12
  44. package/addon/gql/queries/inquiry-dialog.graphql +3 -2
  45. package/addon/gql/queries/inquiry-edit.graphql +2 -0
  46. package/addon/gql/queries/inquiry-navigation.graphql +4 -1
  47. package/addon/modifiers/pikaday.js +2 -0
  48. package/addon/routes/{distribution.js → application.js} +1 -1
  49. package/addon/routes/{distribution/index.js → index.js} +2 -2
  50. package/addon/routes/inquiry/detail/answer.js +7 -0
  51. package/addon/routes/inquiry/detail/index.js +7 -0
  52. package/addon/routes/{distribution/inquiry → inquiry}/detail.js +1 -1
  53. package/addon/routes/inquiry/index.js +10 -0
  54. package/addon/routes/{distribution/inquiry.js → inquiry.js} +1 -1
  55. package/addon/routes/new.js +7 -0
  56. package/addon/routes/notfound.js +3 -0
  57. package/addon/routes.js +5 -6
  58. package/addon/services/distribution.js +112 -0
  59. package/addon/templates/application.hbs +18 -0
  60. package/addon/templates/index.hbs +11 -0
  61. package/addon/templates/inquiry/detail/answer.hbs +1 -0
  62. package/addon/templates/inquiry/detail/index.hbs +1 -0
  63. package/addon/templates/{distribution/inquiry → inquiry}/detail.hbs +0 -0
  64. package/addon/templates/{distribution/inquiry → inquiry}/index.hbs +1 -1
  65. package/addon/templates/{distribution/inquiry.hbs → inquiry.hbs} +0 -0
  66. package/addon/templates/{distribution/new.hbs → new.hbs} +1 -1
  67. package/addon/templates/notfound.hbs +1 -0
  68. package/addon/utils/inquiry-answer-status.js +34 -0
  69. package/addon/utils/inquiry-deadline.js +6 -9
  70. package/addon/utils/inquiry-status.js +12 -7
  71. package/addon/utils/unique-by-groups.js +1 -0
  72. package/app/abilities/distribution.js +1 -0
  73. package/app/components/cd-document-header.js +1 -0
  74. package/app/components/{inquiry-dialog/inquiry.js → cd-inquiry-answer-form.js} +1 -1
  75. package/app/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-deadline.js +1 -1
  76. package/app/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-divider.js +1 -1
  77. package/app/components/{inquiry-dialog → cd-inquiry-dialog}/inquiry-part.js +1 -1
  78. package/app/components/{distribution-navigation.js → cd-inquiry-dialog/inquiry.js} +1 -1
  79. package/app/components/{inquiry-edit-form.js → cd-inquiry-dialog.js} +1 -1
  80. package/app/components/cd-inquiry-edit-form.js +1 -0
  81. package/app/components/{inquiry-answer-form.js → cd-inquiry-new-form.js} +1 -1
  82. package/app/components/cd-navigation/controls.js +1 -0
  83. package/app/components/cd-navigation/item.js +1 -0
  84. package/app/components/cd-navigation/section.js +1 -0
  85. package/app/components/{distribution-navigation/item.js → cd-navigation/status-indicator.js} +1 -1
  86. package/app/components/{inquiry-dialog.js → cd-navigation.js} +1 -1
  87. package/app/components/{icon-button.js → cd-notfound.js} +1 -1
  88. package/app/components/{inquiry-new-form.js → cd-truncated.js} +1 -1
  89. package/app/services/distribution.js +1 -0
  90. package/app/styles/@projectcaluma/ember-distribution.scss +3 -2
  91. package/app/styles/_answer-form.scss +4 -0
  92. package/app/styles/_group-list.scss +7 -0
  93. package/app/styles/_inquiry-divider.scss +22 -0
  94. package/app/styles/_truncated.scss +3 -0
  95. package/app/utils/inquiry-answer-status.js +1 -0
  96. package/index.js +10 -14
  97. package/package.json +31 -27
  98. package/public/assets/distribution.svg +1 -0
  99. package/translations/de.yaml +49 -8
  100. package/translations/en.yaml +50 -8
  101. package/translations/fr.yaml +49 -8
  102. package/addon/components/distribution-navigation/controls.hbs +0 -21
  103. package/addon/components/distribution-navigation/controls.js +0 -45
  104. package/addon/components/distribution-navigation/item.hbs +0 -18
  105. package/addon/components/distribution-navigation/section.hbs +0 -24
  106. package/addon/components/distribution-navigation/status-indicator.hbs +0 -17
  107. package/addon/components/distribution-navigation.hbs +0 -17
  108. package/addon/components/distribution-navigation.js +0 -81
  109. package/addon/components/icon-button.hbs +0 -20
  110. package/addon/components/icon-button.js +0 -22
  111. package/addon/components/inquiry-answer-form.hbs +0 -46
  112. package/addon/components/inquiry-dialog/inquiry-deadline.hbs +0 -6
  113. package/addon/components/inquiry-dialog/inquiry-divider.hbs +0 -7
  114. package/addon/components/inquiry-dialog/inquiry-part.hbs +0 -40
  115. package/addon/components/inquiry-dialog/inquiry-part.js +0 -20
  116. package/addon/components/inquiry-dialog/inquiry.hbs +0 -13
  117. package/addon/components/inquiry-dialog/inquiry.js +0 -7
  118. package/addon/components/inquiry-dialog.hbs +0 -9
  119. package/addon/components/inquiry-dialog.js +0 -42
  120. package/addon/components/inquiry-edit-form.hbs +0 -27
  121. package/addon/components/inquiry-new-form.hbs +0 -110
  122. package/addon/components/inquiry-new-form.js +0 -154
  123. package/addon/routes/distribution/inquiry/detail/answer.js +0 -7
  124. package/addon/routes/distribution/inquiry/detail/index.js +0 -7
  125. package/addon/routes/distribution/inquiry/index.js +0 -10
  126. package/addon/routes/distribution/new.js +0 -7
  127. package/addon/templates/distribution/inquiry/detail/answer.hbs +0 -1
  128. package/addon/templates/distribution/inquiry/detail/index.hbs +0 -1
  129. package/addon/templates/distribution.hbs +0 -8
  130. package/app/components/distribution-navigation/controls.js +0 -1
  131. package/app/components/distribution-navigation/section.js +0 -1
  132. package/app/components/distribution-navigation/status-indicator.js +0 -1
  133. package/app/styles/_icon-button.scss +0 -13
  134. package/app/styles/_status-indicator.scss +0 -31
@@ -0,0 +1,112 @@
1
+ import { getOwner } from "@ember/application";
2
+ import Service, { inject as service } from "@ember/service";
3
+ import { queryManager, getObservable } from "ember-apollo-client";
4
+ import { dropTask } from "ember-concurrency";
5
+ import { trackedTask } from "ember-resources/util/ember-concurrency";
6
+
7
+ import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
8
+ import config from "@projectcaluma/ember-distribution/config";
9
+ import createInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/create-inquiry.graphql";
10
+ import controlWorkItemsQuery from "@projectcaluma/ember-distribution/gql/queries/control-work-items.graphql";
11
+ import inquiryNavigationQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-navigation.graphql";
12
+
13
+ export default class DistributionService extends Service {
14
+ @service("-scheduler") scheduler;
15
+ @service calumaOptions;
16
+ @service router;
17
+ @service intl;
18
+ @service notification;
19
+
20
+ @queryManager apollo;
21
+
22
+ @config config;
23
+
24
+ get caseId() {
25
+ return getOwner(this).lookup("route:application").currentModel;
26
+ }
27
+
28
+ controls = trackedTask(this, this.fetchControls, () => [this.caseId]);
29
+ navigation = trackedTask(this, this.fetchNavigation, () => [this.caseId]);
30
+
31
+ async refetch() {
32
+ await getObservable(this.controls.value)?.refetch();
33
+ await getObservable(this.navigation.value)?.refetch();
34
+ }
35
+
36
+ @dropTask
37
+ *fetchControls(caseId) {
38
+ return yield this.apollo.watchQuery({
39
+ query: controlWorkItemsQuery,
40
+ variables: {
41
+ caseId,
42
+ currentGroup: String(this.calumaOptions.currentGroupId),
43
+ createTask: this.config.controls.createTask,
44
+ completeTask: this.config.controls.completeTask,
45
+ inquiryTask: this.config.inquiry.task,
46
+ },
47
+ });
48
+ }
49
+
50
+ @dropTask
51
+ *fetchNavigation(caseId) {
52
+ const response = yield this.apollo.watchQuery({
53
+ query: inquiryNavigationQuery,
54
+ variables: {
55
+ caseId,
56
+ task: this.config.inquiry.task,
57
+ currentGroup: String(this.calumaOptions.currentGroupId),
58
+ statusQuestion: this.config.inquiry.answer.statusQuestion,
59
+ deadlineQuestion: this.config.inquiry.deadlineQuestion,
60
+ includeNavigationData: true,
61
+ },
62
+ });
63
+
64
+ getObservable(response).subscribe(({ data }) => {
65
+ const groupIds = [
66
+ ...new Set(
67
+ Object.values(data)
68
+ .map((inquiries) => {
69
+ return inquiries.edges.map((edge) => [
70
+ ...edge.node.addressedGroups,
71
+ ...edge.node.controllingGroups,
72
+ ]);
73
+ })
74
+ .flat(2)
75
+ ),
76
+ ];
77
+
78
+ // Resolve all involved groups with the scheduler each time the query is
79
+ // updated. This will only trigger requests for new groups that are not in
80
+ // the cache.
81
+ this.scheduler.resolve(groupIds, "group");
82
+ });
83
+
84
+ return response;
85
+ }
86
+
87
+ @dropTask
88
+ *createInquiry(groups) {
89
+ try {
90
+ // get create inquiry work item to complete
91
+ const createId = decodeId(this.controls.value?.create.edges[0].node.id);
92
+
93
+ // create new inquiries
94
+ yield this.apollo.mutate({
95
+ mutation: createInquiryMutation,
96
+ variables: {
97
+ id: createId,
98
+ context: JSON.stringify({
99
+ addressed_groups: groups.map(String),
100
+ }),
101
+ },
102
+ });
103
+
104
+ // refetch navigation and controls data
105
+ yield this.refetch();
106
+ } catch (e) {
107
+ this.notification.danger(
108
+ this.intl.t("caluma.distribution.new.error", { count: groups.length })
109
+ );
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,18 @@
1
+ {{#if
2
+ (or
3
+ this.distribution.navigation.isRunning this.distribution.controls.isRunning
4
+ )
5
+ }}
6
+ <div class="uk-text-center">
7
+ <UkSpinner @ratio={{2}} />
8
+ </div>
9
+ {{else}}
10
+ <div uk-grid class={{if this.config.ui.stack "uk-grid-small"}}>
11
+ <div class={{if this.config.ui.stack "uk-width-1-1" "uk-width-1-3"}}>
12
+ <CdNavigation @caseId={{@model}} />
13
+ </div>
14
+ <div class={{if this.config.ui.stack "uk-width-1-1" "uk-width-2-3"}}>
15
+ {{outlet}}
16
+ </div>
17
+ </div>
18
+ {{/if}}
@@ -0,0 +1,11 @@
1
+ <div class="uk-text-center uk-text-muted">
2
+ {{svg-jar "distribution" class="uk-inline" width=200}}
3
+ <p class="uk-margin-medium uk-margin-remove-horizontal">
4
+ {{t "caluma.distribution.empty"}}
5
+ </p>
6
+ {{#if (can "create inquiry of distribution")}}
7
+ <LinkTo @route="new" class="uk-button uk-button-primary">
8
+ {{t "caluma.distribution.start"}}
9
+ </LinkTo>
10
+ {{/if}}
11
+ </div>
@@ -0,0 +1 @@
1
+ <CdInquiryAnswerForm @inquiry={{@model}} />
@@ -0,0 +1 @@
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}}
@@ -0,0 +1 @@
1
+ <CdNotfound />
@@ -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);
@@ -1,6 +1,6 @@
1
1
  import { assert } from "@ember/debug";
2
2
  import { get } from "@ember/object";
3
- import moment from "moment";
3
+ import { DateTime } from "luxon";
4
4
 
5
5
  import { createDecorator } from "@projectcaluma/ember-distribution/-private/decorator";
6
6
 
@@ -19,21 +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 isAnswered = inquiry.status === "COMPLETED";
22
+ const isDone = ["COMPLETED", "SKIPPED"].includes(inquiry.status);
23
23
 
24
- const deadline = moment.utc(value);
25
- const now = moment.utc();
24
+ const { days: diff } = DateTime.fromISO(value).diffNow("days").toObject();
26
25
 
27
- const isOverdue = !isAnswered && now.isAfter(deadline, "day");
28
- const isWarning =
29
- !isAnswered &&
30
- now.add(this.config.warningPeriod, "days").isAfter(deadline, "day");
26
+ const isOverdue = !isDone && diff <= 0;
27
+ const isWarning = !isDone && diff <= this.config.warningPeriod;
31
28
 
32
29
  return {
33
30
  value,
34
31
  isOverdue,
35
32
  isWarning,
36
- color: isAnswered
33
+ color: isDone
37
34
  ? "muted"
38
35
  : isOverdue
39
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]: "pencil-outline",
9
- [INQUIRY_STATUS.SENT]: "paper-plane-outline",
10
- [INQUIRY_STATUS.POSITIVE]: "checkmark-outline",
11
- [INQUIRY_STATUS.NEGATIVE]: "close-outline",
12
- [INQUIRY_STATUS.NEEDS_INTERACTION]: "repeat-outline",
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 = isDraft
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],
@@ -2,6 +2,7 @@ export default function uniqueByGroups(workItems) {
2
2
  return [
3
3
  ...new Map(
4
4
  workItems
5
+ .filter((workItem) => workItem.status !== "CANCELED")
5
6
  .map((workItem) => {
6
7
  return [
7
8
  JSON.stringify({
@@ -0,0 +1 @@
1
+ export { default } from "@projectcaluma/ember-distribution/abilities/distribution";
@@ -0,0 +1 @@
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-document-header";
@@ -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";
@@ -0,0 +1 @@
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/inquiry-dialog";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-navigation";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/icon-button";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-notfound";
@@ -1 +1 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/inquiry-new-form";
1
+ export { default } from "@projectcaluma/ember-distribution/components/cd-truncated";
@@ -0,0 +1 @@
1
+ export { default } from "@projectcaluma/ember-distribution/services/distribution";
@@ -1,3 +1,4 @@
1
- @import "../icon-button";
1
+ @import "../answer-form";
2
+ @import "../group-list";
2
3
  @import "../inquiry-divider";
3
- @import "../status-indicator";
4
+ @import "../truncated";
@@ -0,0 +1,4 @@
1
+ .inquiry-answer-form__request {
2
+ border-left: 5px solid $global-border;
3
+ padding-left: $global-gutter - 5px;
4
+ }
@@ -0,0 +1,7 @@
1
+ .group-list tr {
2
+ cursor: pointer;
3
+
4
+ > td:last-of-type svg {
5
+ min-width: 20px;
6
+ }
7
+ }
@@ -3,6 +3,9 @@
3
3
  $size: 36px;
4
4
  $iconSize: $size * 0.6;
5
5
 
6
+ $sizeSmall: 24px;
7
+ $iconSizeSmall: $sizeSmall * 0.6;
8
+
6
9
  $colors: (
7
10
  muted: $text-muted-color,
8
11
  emphasis: $text-emphasis-color,
@@ -47,3 +50,22 @@ $colors: (
47
50
  }
48
51
  }
49
52
  }
53
+ .inquiry-divider--small {
54
+ &::before,
55
+ &::after {
56
+ height: 1px;
57
+ width: calc(50% - #{$sizeSmall * 0.5});
58
+ }
59
+
60
+ .inquiry-divider__icon {
61
+ width: $sizeSmall;
62
+ height: $sizeSmall;
63
+
64
+ border-width: 1px;
65
+
66
+ > svg {
67
+ width: $iconSizeSmall;
68
+ height: $iconSizeSmall;
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,3 @@
1
+ .cd-truncated {
2
+ white-space: pre-line;
3
+ }
@@ -0,0 +1 @@
1
+ export { default } from "@projectcaluma/ember-distribution/utils/inquiry-answer-status";
package/index.js CHANGED
@@ -3,20 +3,16 @@
3
3
  // eslint-disable-next-line node/no-unpublished-require
4
4
  const { buildEngine } = require("ember-engines/lib/engine-addon");
5
5
 
6
- const ioniconsBase = require
7
- .resolve("ionicons")
8
- .split("/")
9
- .slice(0, -1)
10
- .join("/");
6
+ const name = require("./package").name;
11
7
 
12
- module.exports = buildEngine({
13
- name: require("./package").name,
14
-
15
- lazyLoading: {
16
- enabled: false,
17
- },
8
+ const publicAssets = [
9
+ ...require.resolve(name).split("/").slice(0, -1),
10
+ "public",
11
+ "assets",
12
+ ].join("/");
18
13
 
19
- svgJar: {
20
- sourceDirs: [`${ioniconsBase}/svg`],
21
- },
14
+ module.exports = buildEngine({
15
+ name,
16
+ lazyLoading: { enabled: false },
17
+ svgJar: { sourceDirs: [publicAssets] },
22
18
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -18,61 +18,65 @@
18
18
  "ember-engines": ">= 0.8"
19
19
  },
20
20
  "dependencies": {
21
- "@glimmer/component": "^1.0.4",
22
- "@glimmer/tracking": "^1.0.4",
23
- "@projectcaluma/ember-core": "^11.0.0-beta.2",
24
- "@projectcaluma/ember-form": "^11.0.0-beta.2",
25
- "@projectcaluma/ember-workflow": "^11.0.0-beta.1",
26
- "ember-apollo-client": "^3.2.0",
27
- "ember-auto-import": "^2.3.0",
28
- "ember-can": "^4.1.0",
21
+ "@ember/string": "^3.0.0",
22
+ "@embroider/macros": "^1.7.1",
23
+ "@glimmer/component": "^1.1.2",
24
+ "@glimmer/tracking": "^1.1.2",
25
+ "@projectcaluma/ember-core": "^11.0.0-beta.7",
26
+ "@projectcaluma/ember-form": "^11.0.0-beta.20",
27
+ "@projectcaluma/ember-workflow": "^11.0.0-beta.7",
28
+ "ember-apollo-client": "^4.0.2",
29
+ "ember-auto-import": "^2.4.2",
30
+ "ember-can": "^4.2.0",
29
31
  "ember-cli-babel": "^7.26.11",
30
32
  "ember-cli-htmlbars": "^6.0.1",
31
- "ember-concurrency": "^2.2.0",
33
+ "ember-concurrency": "^2.2.1",
32
34
  "ember-engines-router-service": "^0.3.0",
33
35
  "ember-fetch": "^8.1.1",
34
36
  "ember-intl": "^5.7.2",
35
- "ember-resources": "^4.1.3",
37
+ "ember-pikaday": "^4.0.0",
38
+ "ember-resources": "^4.8.2",
36
39
  "ember-svg-jar": "^2.3.4",
37
40
  "ember-test-selectors": "^6.0.0",
38
- "ember-uikit": "^4.0.0",
41
+ "ember-uikit": "^5.1.3",
39
42
  "graphql": "^15.8.0",
40
- "ionicons": "^6.0.0",
43
+ "graphql-tag": "^2.12.6",
41
44
  "lodash.merge": "^4.6.2",
42
- "moment": "^2.29.1",
45
+ "luxon": "^2.4.0",
43
46
  "tracked-toolbox": "^1.2.3"
44
47
  },
45
48
  "devDependencies": {
46
49
  "@ember/optional-features": "2.0.0",
47
- "@ember/test-helpers": "2.6.0",
48
- "@embroider/test-setup": "0.50.2",
49
- "@faker-js/faker": "6.0.0-alpha.3",
50
- "@projectcaluma/ember-testing": "10.2.0-beta.2",
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.8",
51
54
  "broccoli-asset-rev": "3.0.0",
52
55
  "ember-cli": "3.28.5",
53
- "ember-cli-dependency-checker": "3.2.0",
56
+ "ember-cli-code-coverage": "1.0.3",
57
+ "ember-cli-dependency-checker": "3.3.1",
54
58
  "ember-cli-inject-live-reload": "2.1.0",
55
- "ember-cli-mirage": "2.3.1",
56
- "ember-cli-sass": "10.0.1",
59
+ "ember-cli-mirage": "3.0.0-alpha.3",
60
+ "ember-cli-sass": "11.0.1",
57
61
  "ember-cli-sri": "2.1.1",
58
62
  "ember-cli-terser": "4.0.2",
59
63
  "ember-disable-prototype-extensions": "1.1.3",
60
- "ember-engines": "0.8.20",
64
+ "ember-engines": "0.8.22",
61
65
  "ember-export-application-global": "2.0.1",
62
66
  "ember-load-initializers": "2.1.2",
63
67
  "ember-maybe-import-regenerator": "1.0.0",
64
68
  "ember-qunit": "5.1.5",
65
69
  "ember-resolver": "8.0.3",
66
- "ember-source": "3.28.8",
70
+ "ember-source": "3.28.9",
67
71
  "ember-source-channel-url": "3.0.0",
68
72
  "ember-try": "2.0.0",
69
73
  "loader.js": "4.7.0",
70
- "miragejs": "0.1.43",
74
+ "miragejs": "0.1.45",
71
75
  "npm-run-all": "4.1.5",
72
- "qunit": "2.17.2",
76
+ "qunit": "2.19.1",
73
77
  "qunit-dom": "2.0.0",
74
- "sass": "1.48.0",
75
- "webpack": "5.66.0"
78
+ "sass": "1.52.3",
79
+ "webpack": "5.73.0"
76
80
  },
77
81
  "engines": {
78
82
  "node": "12.* || 14.* || >= 16"
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 512 512" viewBox="0 0 512 512"><path d="M477.867 102.4c-18.825 0-34.133 15.309-34.133 34.133s15.309 34.133 34.133 34.133S512 155.358 512 136.533c0-18.824-15.309-34.133-34.133-34.133zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067 0-9.412 7.654-17.067 17.067-17.067s17.067 7.654 17.067 17.067c-.001 9.413-7.655 17.067-17.067 17.067zM34.133 384C15.309 384 0 399.309 0 418.133s15.309 34.133 34.133 34.133c18.825 0 34.133-15.309 34.133-34.133S52.958 384 34.133 384zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067s7.654-17.067 17.067-17.067c9.412 0 17.067 7.654 17.067 17.067S43.546 435.2 34.133 435.2z"/><path d="m461.321 113.186-73.617-35.541c-4.25-2.057-9.344-.265-11.392 3.977-2.048 4.241-.265 9.344 3.977 11.392l73.617 35.541c1.195.58 2.458.853 3.703.853 3.174 0 6.221-1.775 7.688-4.83 2.048-4.241.265-9.344-3.976-11.392zM384 443.733c-18.825 0-34.133 15.309-34.133 34.133S365.175 512 384 512c18.825 0 34.133-15.309 34.133-34.133S402.825 443.733 384 443.733zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067S374.588 460.8 384 460.8c9.412 0 17.067 7.654 17.067 17.067s-7.655 17.066-17.067 17.066z"/><path d="m367.454 454.52-73.617-35.541c-4.25-2.057-9.344-.273-11.392 3.977-2.048 4.241-.265 9.344 3.977 11.392l73.617 35.541c1.195.58 2.458.853 3.703.853 3.174 0 6.221-1.775 7.689-4.83 2.047-4.242.264-9.344-3.977-11.392zM256 230.4c-18.825 0-34.133 15.309-34.133 34.133 0 18.825 15.309 34.133 34.133 34.133 18.825 0 34.133-15.309 34.133-34.133 0-18.824-15.308-34.133-34.133-34.133zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067 0-9.412 7.654-17.067 17.067-17.067 9.412 0 17.067 7.654 17.067 17.067S265.412 281.6 256 281.6z"/><path d="m240.998 242.142-56.55-44.075c-3.721-2.876-9.079-2.236-11.981 1.485-2.893 3.721-2.236 9.079 1.485 11.981l56.55 44.075c1.562 1.212 3.405 1.801 5.24 1.801 2.543 0 5.052-1.126 6.741-3.285 2.893-3.722 2.236-9.081-1.485-11.982zM409.6 221.867c-51.755 0-93.867 42.112-93.867 93.867s42.112 93.867 93.867 93.867 93.867-42.112 93.867-93.867-42.112-93.867-93.867-93.867zm0 170.666c-42.351 0-76.8-34.449-76.8-76.8s34.449-76.8 76.8-76.8 76.8 34.449 76.8 76.8-34.449 76.8-76.8 76.8z"/><path d="M409.6 256c-18.825 0-34.133 15.309-34.133 34.133 0 18.825 15.309 34.133 34.133 34.133 18.825 0 34.133-15.309 34.133-34.133S428.425 256 409.6 256zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067 0-9.412 7.654-17.067 17.067-17.067 9.412 0 17.067 7.654 17.067 17.067S419.012 307.2 409.6 307.2zM434.355 341.333h-49.51c-14.583 0-26.445 11.546-26.445 25.728v22.494c0 3.046 1.621 5.862 4.258 7.39C376.96 405.222 393.19 409.6 409.6 409.6s32.64-4.378 46.942-12.655c2.637-1.519 4.258-4.344 4.258-7.381V367.07c0-14.191-11.861-25.737-26.445-25.737zm9.378 43.136c-21.239 10.581-47.027 10.581-68.267 0V367.07c0-4.779 4.207-8.67 9.378-8.67h49.51c5.171 0 9.378 3.891 9.378 8.67v17.399zM204.8 324.267c-51.755 0-93.867 42.112-93.867 93.867S153.045 512 204.8 512s93.867-42.112 93.867-93.867-42.112-93.866-93.867-93.866zm0 170.666c-42.351 0-76.8-34.449-76.8-76.8s34.449-76.8 76.8-76.8 76.8 34.449 76.8 76.8-34.449 76.8-76.8 76.8z"/><path d="M204.8 358.4c-18.825 0-34.133 15.309-34.133 34.133 0 18.825 15.309 34.133 34.133 34.133s34.133-15.309 34.133-34.133c0-18.824-15.308-34.133-34.133-34.133zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067 0-9.412 7.654-17.067 17.067-17.067 9.412 0 17.067 7.654 17.067 17.067S214.212 409.6 204.8 409.6zM229.555 443.733h-49.51c-14.583 0-26.445 11.546-26.445 25.728v22.494c0 3.046 1.621 5.862 4.258 7.39C172.16 507.622 188.39 512 204.8 512s32.64-4.378 46.942-12.655c2.637-1.519 4.258-4.343 4.258-7.381V469.47c0-14.191-11.861-25.737-26.445-25.737zm9.378 43.136c-21.24 10.581-47.027 10.581-68.267 0V469.47c0-4.779 4.207-8.67 9.378-8.67h49.51c5.171 0 9.378 3.891 9.378 8.67v17.399zM93.867 110.933C42.112 110.933 0 153.045 0 204.8s42.112 93.867 93.867 93.867 93.867-42.112 93.867-93.867c-.001-51.755-42.113-93.867-93.867-93.867zm0 170.667c-42.351 0-76.8-34.449-76.8-76.8s34.449-76.8 76.8-76.8 76.8 34.449 76.8 76.8-34.449 76.8-76.8 76.8z"/><path d="M93.867 145.067c-18.825 0-34.133 15.309-34.133 34.133s15.309 34.133 34.133 34.133c18.825 0 34.133-15.309 34.133-34.133s-15.309-34.133-34.133-34.133zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067s7.654-17.067 17.067-17.067c9.412 0 17.067 7.654 17.067 17.067s-7.655 17.067-17.067 17.067zM118.622 230.4h-49.51c-14.583 0-26.445 11.546-26.445 25.728v22.494c0 3.046 1.621 5.862 4.258 7.39 14.302 8.277 30.532 12.655 46.942 12.655s32.64-4.378 46.942-12.655c2.637-1.519 4.258-4.344 4.258-7.381v-22.494c0-14.191-11.862-25.737-26.445-25.737zM128 273.536c-21.239 10.581-47.027 10.581-68.267 0v-17.399c0-4.779 4.207-8.67 9.378-8.67h49.51c5.171 0 9.378 3.891 9.378 8.67v17.399zM298.667 0C246.912 0 204.8 42.112 204.8 93.867s42.112 93.867 93.867 93.867 93.867-42.112 93.867-93.867C392.533 42.112 350.421 0 298.667 0zm0 170.667c-42.351 0-76.8-34.449-76.8-76.8s34.449-76.8 76.8-76.8 76.8 34.449 76.8 76.8-34.449 76.8-76.8 76.8z"/><path d="M298.667 34.133c-18.825 0-34.133 15.309-34.133 34.133s15.309 34.133 34.133 34.133S332.8 87.091 332.8 68.267s-15.309-34.134-34.133-34.134zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067 0-9.412 7.654-17.067 17.067-17.067s17.067 7.654 17.067 17.067c-.001 9.413-7.655 17.067-17.067 17.067zM323.422 119.467h-49.51c-14.583 0-26.445 11.546-26.445 25.728v22.494c0 3.046 1.621 5.862 4.258 7.39 14.302 8.277 30.532 12.655 46.942 12.655s32.64-4.378 46.942-12.655c2.637-1.519 4.258-4.344 4.258-7.381v-22.494c0-14.192-11.862-25.737-26.445-25.737zm9.378 43.136c-21.239 10.581-47.027 10.581-68.267 0v-17.399c0-4.779 4.207-8.67 9.378-8.67h49.51c5.171 0 9.378 3.891 9.378 8.67v17.399zM219.827 88.311c-3.063-3.567-8.448-3.994-12.032-.93l-59.136 50.603c-3.584 3.063-4.002 8.448-.939 12.032 1.69 1.971 4.079 2.987 6.485 2.987 1.963 0 3.934-.674 5.547-2.057l59.136-50.603c3.585-3.063 4.003-8.448.939-12.032z"/><path d="m407.893 225.289-51.2-68.267c-2.825-3.78-8.175-4.523-11.947-1.707-3.772 2.825-4.531 8.175-1.707 11.938l51.2 68.267c1.681 2.236 4.241 3.413 6.835 3.413 1.775 0 3.576-.555 5.112-1.707 3.772-2.824 4.532-8.174 1.707-11.937zM337.86 343.953c-2.825-3.772-8.175-4.531-11.947-1.707l-47.667 35.746c-3.772 2.825-4.531 8.175-1.707 11.938 1.681 2.236 4.241 3.413 6.835 3.413 1.783 0 3.575-.563 5.112-1.707l47.667-35.746c3.772-2.823 4.532-8.174 1.707-11.937zM119.467 409.6H59.733c-4.71 0-8.533 3.814-8.533 8.533s3.823 8.533 8.533 8.533h59.733c4.71 0 8.533-3.814 8.533-8.533s-3.822-8.533-8.532-8.533zM93.867 0C75.042 0 59.733 15.309 59.733 34.133c0 18.825 15.309 34.133 34.133 34.133 18.825 0 34.133-15.309 34.133-34.133C128 15.309 112.691 0 93.867 0zm0 51.2c-9.412 0-17.067-7.654-17.067-17.067 0-9.412 7.654-17.067 17.067-17.067 9.412 0 17.067 7.654 17.067 17.067-.001 9.413-7.655 17.067-17.067 17.067z"/><path d="M93.867 51.2c-4.71 0-8.533 3.814-8.533 8.533v59.733c0 4.719 3.823 8.533 8.533 8.533 4.71 0 8.533-3.814 8.533-8.533V59.733c0-4.719-3.823-8.533-8.533-8.533z"/></svg>