@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
@@ -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;
@@ -0,0 +1,11 @@
1
+ <ul class="uk-tab uk-tab-left uk-margin-remove-bottom uk-width-auto">
2
+ <CdNavigation::Section
3
+ @type="controlling"
4
+ @inquiries={{this.inquiries.controlling}}
5
+ />
6
+ <CdNavigation::Section
7
+ @type="addressed"
8
+ @inquiries={{this.inquiries.addressed}}
9
+ />
10
+ <CdNavigation::Section @type="more" @inquiries={{this.inquiries.more}} />
11
+ </ul>
@@ -0,0 +1,53 @@
1
+ import { inject as service } from "@ember/service";
2
+ import Component from "@glimmer/component";
3
+ import { queryManager } from "ember-apollo-client";
4
+
5
+ import config from "@projectcaluma/ember-distribution/config";
6
+ import uniqueByGroups from "@projectcaluma/ember-distribution/utils/unique-by-groups";
7
+
8
+ export default class CdNavigationComponent extends Component {
9
+ @service("-scheduler") scheduler;
10
+ @service calumaOptions;
11
+ @service distribution;
12
+
13
+ @config config;
14
+
15
+ @queryManager apollo;
16
+
17
+ get inquiries() {
18
+ const findGroupName = (identifiers) => {
19
+ const group = this.scheduler.groupCache.find((group) =>
20
+ identifiers
21
+ .map(String)
22
+ .includes(String(group[this.calumaOptions.groupIdentifierProperty]))
23
+ );
24
+
25
+ return group?.[this.calumaOptions.groupNameProperty] ?? "";
26
+ };
27
+
28
+ return Object.entries(this.distribution.navigation.value ?? {}).reduce(
29
+ (inquiries, [key, objects]) => {
30
+ return {
31
+ ...inquiries,
32
+ // Don't return any data until the internal scheduler has cached
33
+ // groups since we don't want to render empty navigation items
34
+ [key]: this.scheduler.groupCache.length
35
+ ? uniqueByGroups(
36
+ objects.edges.map((edge) => ({
37
+ ...edge.node,
38
+ // Populate the work item with the names of the involved
39
+ // groups so the <DistributionNavigation::Section /> component
40
+ // can sort by them
41
+ addressedGroupName: findGroupName(edge.node.addressedGroups),
42
+ controllingGroupName: findGroupName(
43
+ edge.node.controllingGroups
44
+ ),
45
+ }))
46
+ )
47
+ : [],
48
+ };
49
+ },
50
+ {}
51
+ );
52
+ }
53
+ }
@@ -0,0 +1,12 @@
1
+ <div class="uk-text-center">
2
+ <h1 class="uk-heading-xlarge">
3
+ {{t "caluma.distribution.notfound.title"}}
4
+ </h1>
5
+ <h2 class="uk-heading-small uk-margin-remove-top uk-text-muted">
6
+ {{t "caluma.distribution.notfound.subtitle"}}
7
+ </h2>
8
+ <p class="uk-text-muted">
9
+ {{t "caluma.distribution.notfound.back"}}
10
+ <LinkTo @route="index">{{t "caluma.distribution.notfound.link"}}</LinkTo>
11
+ </p>
12
+ </div>
@@ -0,0 +1,8 @@
1
+ <p class="cd-truncated" ...attributes>
2
+ {{~this.displayedText~}}
3
+ {{#if this.truncate}}
4
+ <a href="" {{on "click" this.toggleExpand}}>
5
+ {{~t (concat "caluma.distribution." (if this.expand "less" "more"))~}}
6
+ </a>
7
+ {{/if}}
8
+ </p>
@@ -0,0 +1,32 @@
1
+ import { action } from "@ember/object";
2
+ import Component from "@glimmer/component";
3
+ import { tracked } from "@glimmer/tracking";
4
+
5
+ export default class CdTruncatedComponent extends Component {
6
+ @tracked expand = false;
7
+
8
+ get length() {
9
+ return parseInt(this.args.length);
10
+ }
11
+
12
+ get displayedText() {
13
+ if (this.truncate && !this.expand) {
14
+ // strip input string to the passed length minus 3 to make sure the output
15
+ // including the 3 dots doesn't exceed the expected length
16
+ return `${this.args.text.substring(0, this.length - 3).trim()}...`;
17
+ }
18
+
19
+ return this.args.text;
20
+ }
21
+
22
+ get truncate() {
23
+ return this.args.text.length > this.length;
24
+ }
25
+
26
+ @action
27
+ toggleExpand(e) {
28
+ e.preventDefault();
29
+
30
+ this.expand = !this.expand;
31
+ }
32
+ }
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",
@@ -15,6 +16,7 @@ export default function config(target, property) {
15
16
  get() {
16
17
  return merge(
17
18
  {
19
+ ui: { stack: false, small: false, readonly: false },
18
20
  controls: {
19
21
  createTask: "create-inquiry",
20
22
  completeTask: "complete-distribution",
@@ -26,7 +28,7 @@ export default function config(target, property) {
26
28
  infoQuestion: "inquiry-remark",
27
29
  answer: {
28
30
  statusQuestion: "inquiry-answer-status",
29
- infoQuestion: "inquiry-answer-reason",
31
+ infoQuestions: ["inquiry-answer-reason"],
30
32
  statusMapping: {
31
33
  "inquiry-answer-status-positive": INQUIRY_STATUS.POSITIVE,
32
34
  "inquiry-answer-status-negative": INQUIRY_STATUS.NEGATIVE,
@@ -36,20 +38,22 @@ export default function config(target, property) {
36
38
  buttons: {
37
39
  "compose-inquiry-answer": {
38
40
  color: "primary",
39
- label: "caluma.distribution.answer.release-for-review",
41
+ label: "caluma.distribution.answer.buttons.compose.label",
42
+ status: "caluma.distribution.answer.buttons.compose.status",
40
43
  },
41
44
  "confirm-inquiry-answer": {
42
45
  color: "primary",
43
- label: "caluma.distribution.answer.confirm",
46
+ label: "caluma.distribution.answer.buttons.confirm.label",
47
+ status: "caluma.distribution.answer.buttons.confirm.status",
44
48
  },
45
49
  "revise-inquiry-answer": {
46
50
  color: "default",
47
- label: "caluma.distribution.answer.revise",
51
+ label: "caluma.distribution.answer.buttons.revise.label",
48
52
  },
49
53
  "adjust-inquiry-answer": {
50
54
  color: "primary",
51
- label:
52
- "caluma.distribution.answer.release-adjustment-for-review",
55
+ label: "caluma.distribution.answer.buttons.adjust.label",
56
+ status: "caluma.distribution.answer.buttons.adjust.status",
53
57
  },
54
58
  },
55
59
  },
@@ -59,11 +63,12 @@ export default function config(target, property) {
59
63
  types: {
60
64
  suggestions: {
61
65
  label: "caluma.distribution.new.suggestions",
62
- icon: "bulb-outline",
66
+ icon: "star",
63
67
  iconColor: "warning",
64
68
  },
65
69
  },
66
70
  },
71
+ permissions: {},
67
72
  },
68
73
  getOwner(this).lookup("service:calumaOptions")?.distribution ?? {}
69
74
  );
@@ -0,0 +1,10 @@
1
+ import Controller from "@ember/controller";
2
+ import { inject as service } from "@ember/service";
3
+
4
+ import config from "@projectcaluma/ember-distribution/config";
5
+
6
+ export default class ApplicationController extends Controller {
7
+ @config config;
8
+
9
+ @service distribution;
10
+ }
@@ -3,7 +3,7 @@ import { dedupeTracked, cached } from "tracked-toolbox";
3
3
 
4
4
  import config from "@projectcaluma/ember-distribution/config";
5
5
 
6
- export default class DistributionNewController extends Controller {
6
+ export default class NewController extends Controller {
7
7
  @config config;
8
8
 
9
9
  queryParams = ["types", "search"];
@@ -13,7 +13,7 @@ export default class DistributionNewController extends Controller {
13
13
 
14
14
  @cached
15
15
  get selectedTypes() {
16
- return this.types.split(",");
16
+ return this.types.split(",").filter(Boolean);
17
17
  }
18
18
 
19
19
  set selectedTypes(value) {
package/addon/engine.js CHANGED
@@ -11,7 +11,13 @@ export default class DistributionEngine extends Engine {
11
11
  Resolver = Resolver;
12
12
 
13
13
  dependencies = {
14
- services: ["apollo", "notification", "intl", "caluma-options"],
14
+ services: [
15
+ "apollo",
16
+ "notification",
17
+ "intl",
18
+ "caluma-options",
19
+ "store", // this is just in case that a custom form widget uses the store
20
+ ],
15
21
  };
16
22
  }
17
23
 
@@ -1,3 +1,18 @@
1
+ fragment InquiryAnswerButtons on Case {
2
+ workItems(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
18
  deadline: answers(question: $deadlineQuestion) {
@@ -30,6 +45,21 @@ fragment InquiryStatusDocument on Document {
30
45
  }
31
46
  }
32
47
 
48
+ fragment InquiryRequest on Document {
49
+ id
50
+ ...InquiryDeadlineDocument
51
+ info: answers(question: $infoQuestion) {
52
+ edges {
53
+ node {
54
+ id
55
+ ... on StringAnswer {
56
+ value
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+
33
63
  fragment InquiryDialog on WorkItem {
34
64
  id
35
65
  addressedGroups
@@ -42,26 +72,21 @@ fragment InquiryDialog on WorkItem {
42
72
  slug
43
73
  }
44
74
  document {
45
- ...InquiryDeadlineDocument
46
- info: answers(question: $infoQuestion) {
47
- edges {
48
- node {
49
- id
50
- ... on StringAnswer {
51
- value
52
- }
53
- }
54
- }
55
- }
75
+ ...InquiryRequest
56
76
  }
57
77
  childCase {
58
78
  id
79
+ ...InquiryAnswerButtons
59
80
  document {
60
81
  ...InquiryStatusDocument
61
- info: answers(question: $answerInfoQuestion) {
82
+ info: answers(questions: $answerInfoQuestions) {
62
83
  edges {
63
84
  node {
64
85
  id
86
+ question {
87
+ id
88
+ label
89
+ }
65
90
  ... on StringAnswer {
66
91
  value
67
92
  }
@@ -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,8 @@
1
+ mutation WithdrawInquiry($workItem: ID!) {
2
+ cancelWorkItem(input: { id: $workItem }) {
3
+ workItem {
4
+ id
5
+ status
6
+ }
7
+ }
8
+ }
@@ -1,6 +1,7 @@
1
1
  query ControlWorkItems(
2
2
  $createTask: ID!
3
3
  $completeTask: ID!
4
+ $inquiryTask: ID!
4
5
  $caseId: ID!
5
6
  $currentGroup: String!
6
7
  ) {
@@ -11,11 +12,11 @@ query ControlWorkItems(
11
12
  { status: READY }
12
13
  { addressedGroups: [$currentGroup] }
13
14
  ]
14
- first: 1
15
15
  ) {
16
16
  edges {
17
17
  node {
18
18
  id
19
+ status
19
20
  }
20
21
  }
21
22
  }
@@ -26,11 +27,26 @@ query ControlWorkItems(
26
27
  { status: READY }
27
28
  { addressedGroups: [$currentGroup] }
28
29
  ]
29
- first: 1
30
30
  ) {
31
31
  edges {
32
32
  node {
33
33
  id
34
+ status
35
+ }
36
+ }
37
+ }
38
+ send: allWorkItems(
39
+ filter: [
40
+ { case: $caseId }
41
+ { task: $inquiryTask }
42
+ { status: SUSPENDED }
43
+ { controllingGroups: [$currentGroup] }
44
+ ]
45
+ ) {
46
+ edges {
47
+ node {
48
+ id
49
+ status
34
50
  }
35
51
  }
36
52
  }
@@ -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,31 +1,36 @@
1
- query InquiryAnswer($inquiry: ID!, $buttonTasks: [String]!) {
1
+ #import InquiryAnswerButtons, InquiryDeadlineDocument, InquiryRequest from '../fragments/inquiry.graphql'
2
+
3
+ query InquiryAnswer(
4
+ $inquiry: ID!
5
+ $buttonTasks: [String]!
6
+ $infoQuestion: ID!
7
+ $deadlineQuestion: ID!
8
+ ) {
2
9
  allWorkItems(filter: [{ id: $inquiry }]) {
3
10
  edges {
4
11
  node {
5
12
  id
6
13
  status
7
14
  addressedGroups
15
+ controllingGroups
16
+ createdAt
17
+ closedAt
8
18
  task {
9
19
  id
10
20
  slug
11
21
  }
22
+ document {
23
+ ...InquiryRequest
24
+ }
12
25
  childCase {
13
26
  id
14
27
  status
15
28
  document {
16
29
  id
30
+ modifiedContentAt
31
+ modifiedContentByUser
17
32
  }
18
- workItems(tasks: $buttonTasks, status: READY) {
19
- edges {
20
- node {
21
- id
22
- task {
23
- id
24
- slug
25
- }
26
- }
27
- }
28
- }
33
+ ...InquiryAnswerButtons
29
34
  }
30
35
  }
31
36
  }
@@ -1,11 +1,12 @@
1
- #import InquiryDialog, InquiryDeadlineDocument, InquiryStatusDocument 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!
8
- $answerInfoQuestion: ID!
9
+ $answerInfoQuestions: [ID]!
9
10
  $from: [String]!
10
11
  $to: [String]!
11
12
  $caseId: ID!
@@ -11,6 +11,8 @@ query InquiryEdit($inquiry: ID!) {
11
11
  }
12
12
  document {
13
13
  id
14
+ modifiedContentAt
15
+ modifiedContentByUser
14
16
  }
15
17
  }
16
18
  }
@@ -13,6 +13,7 @@ query InquiryNavigation(
13
13
  { case: $caseId }
14
14
  { task: $task }
15
15
  { controllingGroups: [$currentGroup] }
16
+ { status: CANCELED, invert: true }
16
17
  ]
17
18
  order: [{ attribute: CREATED_AT, direction: DESC }]
18
19
  ) {
@@ -28,6 +29,7 @@ query InquiryNavigation(
28
29
  { task: $task }
29
30
  { addressedGroups: [$currentGroup] }
30
31
  { status: SUSPENDED, invert: true }
32
+ { status: CANCELED, invert: true }
31
33
  ]
32
34
  order: [{ attribute: CREATED_AT, direction: DESC }]
33
35
  ) {
@@ -43,7 +45,8 @@ query InquiryNavigation(
43
45
  { task: $task }
44
46
  { controllingGroups: [$currentGroup], invert: true }
45
47
  { addressedGroups: [$currentGroup], invert: true }
46
- { status: COMPLETED }
48
+ { status: SUSPENDED, invert: true }
49
+ { status: CANCELED, invert: true }
47
50
  ]
48
51
  order: [{ attribute: CREATED_AT, direction: DESC }]
49
52
  ) {
@@ -0,0 +1,2 @@
1
+ import "ember-pikaday/pikaday.css";
2
+ export { default } from "ember-pikaday/modifiers/pikaday";
@@ -1,6 +1,6 @@
1
1
  import Route from "@ember/routing/route";
2
2
 
3
- export default class DistributionRoute extends Route {
3
+ export default class ApplicationRoute extends Route {
4
4
  model(params) {
5
5
  return params.case;
6
6
  }
@@ -6,7 +6,7 @@ import config from "@projectcaluma/ember-distribution/config";
6
6
  import inquiryNavigationQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-navigation.graphql";
7
7
  import uniqueByGroups from "@projectcaluma/ember-distribution/utils/unique-by-groups";
8
8
 
9
- export default class DistributionIndexRoute extends Route {
9
+ export default class IndexRoute extends Route {
10
10
  @service router;
11
11
  @service calumaOptions;
12
12
 
@@ -35,7 +35,7 @@ export default class DistributionIndexRoute extends Route {
35
35
  }, {});
36
36
 
37
37
  if (models.length) {
38
- return this.router.replaceWith("distribution.inquiry", models[0]);
38
+ return this.router.replaceWith("inquiry", models[0]);
39
39
  }
40
40
  }
41
41
  }
@@ -0,0 +1,7 @@
1
+ import Route from "@ember/routing/route";
2
+
3
+ export default class InquiryDetailAnswerRoute extends Route {
4
+ model() {
5
+ return this.modelFor("inquiry.detail");
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ import Route from "@ember/routing/route";
2
+
3
+ export default class InquiryDetailIndexRoute extends Route {
4
+ model() {
5
+ return this.modelFor("inquiry.detail");
6
+ }
7
+ }
@@ -1,6 +1,6 @@
1
1
  import Route from "@ember/routing/route";
2
2
 
3
- export default class DistributionInquiryDetailRoute extends Route {
3
+ export default class InquiryDetailRoute extends Route {
4
4
  model({ inquiry }) {
5
5
  return inquiry;
6
6
  }
@@ -0,0 +1,10 @@
1
+ import Route from "@ember/routing/route";
2
+
3
+ export default class InquiryIndexRoute extends Route {
4
+ model() {
5
+ return {
6
+ ...this.modelFor("inquiry"),
7
+ case: this.modelFor("application"),
8
+ };
9
+ }
10
+ }
@@ -1,6 +1,6 @@
1
1
  import Route from "@ember/routing/route";
2
2
 
3
- export default class DistributionInquiryRoute extends Route {
3
+ export default class InquiryRoute extends Route {
4
4
  model({ from, to }) {
5
5
  return { from, to };
6
6
  }
@@ -0,0 +1,7 @@
1
+ import Route from "@ember/routing/route";
2
+
3
+ export default class NewRoute extends Route {
4
+ model() {
5
+ return this.modelFor("application");
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ import Route from "@ember/routing/route";
2
+
3
+ export default class NotfoundRoute extends Route {}
package/addon/routes.js CHANGED
@@ -1,12 +1,11 @@
1
1
  import buildRoutes from "ember-engines/routes";
2
2
 
3
3
  export default buildRoutes(function () {
4
- this.route("distribution", { path: "/case/:case" }, function () {
5
- this.route("new");
6
- this.route("inquiry", { path: "/from/:from/to/:to" }, function () {
7
- this.route("detail", { path: "/detail/:inquiry" }, function () {
8
- this.route("answer");
9
- });
4
+ this.route("new");
5
+ this.route("inquiry", { path: "/from/:from/to/:to" }, function () {
6
+ this.route("detail", { path: "/:inquiry" }, function () {
7
+ this.route("answer");
10
8
  });
11
9
  });
10
+ this.route("notfound", { path: "/*path" });
12
11
  });