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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/addon/abilities/distribution.js +31 -0
  3. package/addon/components/distribution-navigation/controls.hbs +17 -12
  4. package/addon/components/distribution-navigation/controls.js +32 -26
  5. package/addon/components/distribution-navigation/item.hbs +3 -3
  6. package/addon/components/distribution-navigation/item.js +1 -1
  7. package/addon/components/distribution-navigation/section.hbs +8 -6
  8. package/addon/components/distribution-navigation.hbs +1 -1
  9. package/addon/components/distribution-navigation.js +28 -56
  10. package/addon/components/icon-button.hbs +16 -9
  11. package/addon/components/inquiry-answer-form.hbs +33 -31
  12. package/addon/components/inquiry-answer-form.js +1 -1
  13. package/addon/components/inquiry-dialog/inquiry-deadline.hbs +27 -6
  14. package/addon/components/inquiry-dialog/inquiry-deadline.js +4 -0
  15. package/addon/components/inquiry-dialog/inquiry-divider.hbs +2 -1
  16. package/addon/components/inquiry-dialog/inquiry-part.hbs +18 -10
  17. package/addon/components/inquiry-dialog/inquiry-part.js +39 -0
  18. package/addon/components/inquiry-dialog/inquiry.hbs +4 -1
  19. package/addon/components/inquiry-dialog/inquiry.js +4 -0
  20. package/addon/components/inquiry-dialog.hbs +8 -6
  21. package/addon/components/inquiry-dialog.js +25 -2
  22. package/addon/components/inquiry-edit-form.hbs +21 -19
  23. package/addon/components/inquiry-edit-form.js +2 -1
  24. package/addon/components/inquiry-new-form.hbs +113 -101
  25. package/addon/components/inquiry-new-form.js +22 -40
  26. package/addon/components/notfound.hbs +12 -0
  27. package/addon/config.js +1 -0
  28. package/addon/controllers/application.js +7 -0
  29. package/addon/controllers/{distribution/new.js → new.js} +1 -1
  30. package/addon/gql/mutations/withdraw-inquiry.graphql +8 -0
  31. package/addon/gql/queries/control-work-items.graphql +18 -2
  32. package/addon/gql/queries/inquiry-navigation.graphql +2 -0
  33. package/addon/modifiers/pikaday.js +2 -0
  34. package/addon/routes/{distribution.js → application.js} +1 -1
  35. package/addon/routes/{distribution/index.js → index.js} +2 -2
  36. package/addon/routes/inquiry/detail/answer.js +7 -0
  37. package/addon/routes/inquiry/detail/index.js +7 -0
  38. package/addon/routes/{distribution/inquiry → inquiry}/detail.js +1 -1
  39. package/addon/routes/inquiry/index.js +10 -0
  40. package/addon/routes/{distribution/inquiry.js → inquiry.js} +1 -1
  41. package/addon/routes/new.js +7 -0
  42. package/addon/routes/notfound.js +3 -0
  43. package/addon/routes.js +5 -6
  44. package/addon/services/distribution.js +82 -0
  45. package/addon/templates/application.hbs +8 -0
  46. package/addon/templates/index.hbs +11 -0
  47. package/addon/templates/{distribution/inquiry → inquiry}/detail/answer.hbs +0 -0
  48. package/addon/templates/{distribution/inquiry → inquiry}/detail/index.hbs +0 -0
  49. package/addon/templates/{distribution/inquiry → inquiry}/detail.hbs +0 -0
  50. package/addon/templates/{distribution/inquiry → inquiry}/index.hbs +0 -0
  51. package/addon/templates/{distribution/inquiry.hbs → inquiry.hbs} +0 -0
  52. package/addon/templates/{distribution/new.hbs → new.hbs} +0 -0
  53. package/addon/templates/notfound.hbs +1 -0
  54. package/addon/utils/unique-by-groups.js +1 -0
  55. package/app/abilities/distribution.js +1 -0
  56. package/app/components/notfound.js +1 -0
  57. package/app/services/distribution.js +1 -0
  58. package/app/styles/_inquiry-divider.scss +22 -0
  59. package/index.js +14 -13
  60. package/package.json +21 -16
  61. package/public/assets/distribution.svg +1 -0
  62. package/translations/de.yaml +18 -0
  63. package/translations/en.yaml +18 -0
  64. package/translations/fr.yaml +18 -0
  65. package/addon/routes/distribution/inquiry/detail/answer.js +0 -7
  66. package/addon/routes/distribution/inquiry/detail/index.js +0 -7
  67. package/addon/routes/distribution/inquiry/index.js +0 -10
  68. package/addon/routes/distribution/new.js +0 -7
  69. package/addon/templates/distribution.hbs +0 -8
@@ -1,9 +1,11 @@
1
- <section>
2
- {{#if this._inquiries.isRunning}}
3
- <div class="uk-text-center"><UkSpinner @ratio={{2}} /></div>
4
- {{else}}
1
+ {{#if this._inquiries.isRunning}}
2
+ <div class="uk-text-center"><UkSpinner @ratio={{2}} /></div>
3
+ {{else if this.inquiries.length}}
4
+ <section>
5
5
  {{#each this.inquiries as |inquiry|}}
6
6
  <InquiryDialog::Inquiry @inquiry={{inquiry}} />
7
7
  {{/each}}
8
- {{/if}}
9
- </section>
8
+ </section>
9
+ {{else}}
10
+ <Notfound />
11
+ {{/if}}
@@ -1,5 +1,6 @@
1
+ import { inject as service } from "@ember/service";
1
2
  import Component from "@glimmer/component";
2
- import { queryManager } from "ember-apollo-client";
3
+ import { queryManager, getObservable } from "ember-apollo-client";
3
4
  import { dropTask } from "ember-concurrency";
4
5
  import { useTask } from "ember-resources";
5
6
 
@@ -7,6 +8,8 @@ import config from "@projectcaluma/ember-distribution/config";
7
8
  import inquiryDialogQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-dialog.graphql";
8
9
 
9
10
  export default class InquiryDialogComponent extends Component {
11
+ @service router;
12
+
10
13
  @config config;
11
14
 
12
15
  @queryManager apollo;
@@ -24,7 +27,7 @@ export default class InquiryDialogComponent extends Component {
24
27
 
25
28
  @dropTask
26
29
  *fetchDialog() {
27
- return yield this.apollo.watchQuery({
30
+ const response = yield this.apollo.watchQuery({
28
31
  query: inquiryDialogQuery,
29
32
  variables: {
30
33
  from: this.args.from,
@@ -38,5 +41,25 @@ export default class InquiryDialogComponent extends Component {
38
41
  includeNavigationData: true,
39
42
  },
40
43
  });
44
+
45
+ /**
46
+ * Sadly this is necessary to handle what happens after the withdraw task in
47
+ * the inquiry part component because the mutation triggers a refresh of the
48
+ * query above in the same runloop instead of the next one. This causes
49
+ * `this.inquiries` to be recomputed which then triggers a rerender of the
50
+ * component and therefore cancels the withdraw task before we can do a
51
+ * transition.
52
+ *
53
+ * TODO: If https://github.com/ember-graphql/ember-apollo-client/pull/421 is
54
+ * merged and released, we can rewrite this into an action that is triggered
55
+ * in the withdraw task of the child component.
56
+ */
57
+ getObservable(response).subscribe(({ data: { allWorkItems } }) => {
58
+ if (allWorkItems.edges.every((edge) => edge.node.status === "CANCELED")) {
59
+ this.router.transitionTo("index");
60
+ }
61
+ });
62
+
63
+ return response;
41
64
  }
42
65
  }
@@ -2,26 +2,28 @@
2
2
  @documentId={{decode-id this.inquiry.document.id}}
3
3
  @disabled={{cannot "edit inquiry" this.inquiry}}
4
4
  @loading={{this._inquiry.isRunning}}
5
- as |content|
6
5
  >
7
- <h1 class="uk-flex uk-flex-middle">
8
- {{t "caluma.distribution.edit.title"}}
9
- {{#if (eq this.inquiry.status "RUNNING")}}
10
- <UkLabel
11
- class="uk-margin-left"
12
- @label={{t "caluma.distribution.status.draft"}}
13
- />
14
- {{/if}}
15
- </h1>
6
+ <:default as |content|>
7
+ <h1 class="uk-flex uk-flex-middle">
8
+ {{t "caluma.distribution.edit.title"}}
9
+ {{#if (eq this.inquiry.status "RUNNING")}}
10
+ <UkLabel
11
+ class="uk-margin-left"
12
+ @label={{t "caluma.distribution.status.draft"}}
13
+ />
14
+ {{/if}}
15
+ </h1>
16
16
 
17
- <content.form />
17
+ <content.form />
18
18
 
19
- <DocumentValidity @document={{content.document}} as |isValid validate|>
20
- <UkButton
21
- @type="submit"
22
- @color="primary"
23
- @disabled={{or (not isValid) this.send.isRunning}}
24
- @onClick={{perform this.send validate}}
25
- >{{t "caluma.distribution.edit.send"}}</UkButton>
26
- </DocumentValidity>
19
+ <DocumentValidity @document={{content.document}} as |isValid validate|>
20
+ <UkButton
21
+ @type="submit"
22
+ @color="primary"
23
+ @disabled={{or (not isValid) this.send.isRunning}}
24
+ @onClick={{perform this.send validate}}
25
+ >{{t "caluma.distribution.edit.send"}}</UkButton>
26
+ </DocumentValidity>
27
+ </:default>
28
+ <:notfound><Notfound /></:notfound>
27
29
  </CfContent>
@@ -11,6 +11,7 @@ import inquiryEditQuery from "@projectcaluma/ember-distribution/gql/queries/inqu
11
11
  export default class InquiryEditFormComponent extends Component {
12
12
  @service notification;
13
13
  @service router;
14
+ @service intl;
14
15
 
15
16
  @config config;
16
17
 
@@ -43,7 +44,7 @@ export default class InquiryEditFormComponent extends Component {
43
44
  variables: { workItem: this.args.inquiry },
44
45
  });
45
46
 
46
- yield this.router.transitionTo("distribution.inquiry.index");
47
+ yield this.router.transitionTo("inquiry.index");
47
48
  } catch (error) {
48
49
  this.notification.danger(
49
50
  this.intl.t("caluma.distribution.edit.send-error")
@@ -1,109 +1,121 @@
1
- <h1>{{t "caluma.distribution.new.title"}}</h1>
1
+ {{#if this.controls.workItems.isRunning}}
2
+ <div class="uk-text-center"><UkSpinner @ratio={{2}} /></div>
3
+ {{else if (can "create inquiry of distribution")}}
4
+ <h1>{{t "caluma.distribution.new.title"}}</h1>
2
5
 
3
- {{#if this.selectedGroups.length}}
4
- <div class="uk-flex uk-flex-middle">
5
- <div class="uk-width-expand">
6
- <button type="button" class="uk-link uk-text-light">
7
- {{t "caluma.distribution.new.groups" count=this.selectedGroups.length}}
8
- </button>
9
- <div uk-dropdown class="uk-width-auto">
10
- <ul
11
- class="uk-list uk-list-bullet uk-margin-remove uk-padding-remove"
12
- data-test-selected-groups
13
- >
14
- {{#each this.selectedGroups as |identifier|}}
15
- <li class="uk-text-nowrap">{{group-name identifier}}</li>
16
- {{/each}}
17
- </ul>
6
+ {{#if this.selectedGroups.length}}
7
+ <div class="uk-flex uk-flex-middle">
8
+ <div class="uk-width-expand">
9
+ <a href="">
10
+ {{t
11
+ "caluma.distribution.new.groups"
12
+ count=this.selectedGroups.length
13
+ }}
14
+ </a>
15
+ <div uk-dropdown class="uk-width-auto">
16
+ <ul
17
+ class="uk-list uk-list-bullet uk-margin-remove uk-padding-remove"
18
+ data-test-selected-groups
19
+ >
20
+ {{#each this.selectedGroups as |identifier|}}
21
+ <li class="uk-text-nowrap">{{group-name identifier}}</li>
22
+ {{/each}}
23
+ </ul>
24
+ </div>
25
+ {{t
26
+ "caluma.distribution.new.selected"
27
+ count=this.selectedGroups.length
28
+ }}
29
+ </div>
30
+ <div>
31
+ <UkButton
32
+ @label={{t "caluma.distribution.new.reset"}}
33
+ @onClick={{this.clearSelectedGroups}}
34
+ data-test-reset
35
+ />
36
+ <UkButton
37
+ @color="primary"
38
+ @label={{t "caluma.distribution.new.create-draft"}}
39
+ @type="submit"
40
+ @loading={{this.submit.isRunning}}
41
+ @disabled={{this.submit.isRunning}}
42
+ @onClick={{perform this.submit}}
43
+ data-test-submit
44
+ />
18
45
  </div>
19
- {{t "caluma.distribution.new.selected" count=this.selectedGroups.length}}
20
- </div>
21
- <div>
22
- <UkButton
23
- @label={{t "caluma.distribution.new.reset"}}
24
- @onClick={{this.clearSelectedGroups}}
25
- data-test-reset
26
- />
27
- <UkButton
28
- @color="primary"
29
- @label={{t "caluma.distribution.new.create-draft"}}
30
- @type="submit"
31
- @loading={{this.submit.isRunning}}
32
- @disabled={{this.submit.isRunning}}
33
- @onClick={{perform this.submit}}
34
- data-test-submit
35
- />
36
46
  </div>
37
- </div>
38
- <hr />
39
- {{/if}}
40
-
41
- <div class="uk-margin-bottom uk-button-group">
42
- {{#each-in this.config.new.types as |slug config|}}
43
- {{#unless config.disabled}}
44
- <UkButton
45
- data-test-type={{slug}}
46
- @label={{t config.label}}
47
- @color={{if (includes slug @selectedTypes) "primary" "default"}}
48
- @onClick={{fn this.updateSelectedTypes slug}}
49
- />
50
- {{/unless}}
51
- {{/each-in}}
52
- </div>
47
+ <hr />
48
+ {{/if}}
53
49
 
54
- <div class="uk-search uk-search-default uk-width-1-1">
55
- <span class="uk-search-icon-flip" uk-search-icon></span>
56
- <input
57
- placeholder={{t "caluma.distribution.new.search"}}
58
- aria-label={{t "caluma.distribution.new.search"}}
59
- class="uk-search-input"
60
- type="search"
61
- value={{@search}}
62
- data-test-search
63
- {{on "input" (perform this.updateSearch)}}
64
- />
65
- </div>
50
+ <div class="uk-margin-bottom uk-button-group">
51
+ {{#each-in this.config.new.types as |slug config|}}
52
+ {{#unless config.disabled}}
53
+ <UkButton
54
+ data-test-type={{slug}}
55
+ @label={{t config.label}}
56
+ @color={{if (includes slug @selectedTypes) "primary" "default"}}
57
+ @onClick={{fn this.updateSelectedTypes slug}}
58
+ />
59
+ {{/unless}}
60
+ {{/each-in}}
61
+ </div>
66
62
 
67
- {{#if this.groups.isRunning}}
68
- <div class="uk-text-center uk-margin">
69
- <UkSpinner @ratio={{2}} />
63
+ <div class="uk-search uk-search-default uk-width-1-1">
64
+ <span class="uk-search-icon-flip" uk-search-icon></span>
65
+ <input
66
+ placeholder={{t "caluma.distribution.new.search"}}
67
+ aria-label={{t "caluma.distribution.new.search"}}
68
+ class="uk-search-input"
69
+ type="search"
70
+ value={{@search}}
71
+ data-test-search
72
+ {{on "input" (perform this.updateSearch)}}
73
+ />
70
74
  </div>
71
- {{else if this.groups.value.length}}
72
- <ul class="uk-list uk-list-striped">
73
- {{#each this.groups.value as |group|}}
74
- {{! template-lint-disable require-presentational-children }}
75
- <li
76
- role="checkbox"
77
- class="uk-flex uk-flex-between uk-flex-middle"
78
- data-test-group={{group.identifier}}
79
- {{on "click" (fn this.updateSelectedGroups group.identifier)}}
80
- >
81
- {{! template-lint-disable no-nested-interactive }}
82
- <label for="group-{{group.identifier}}">
83
- <input
84
- type="checkbox"
85
- class="uk-checkbox uk-margin-small-right"
86
- checked={{includes group.identifier this.selectedGroups}}
87
- id="group-{{group.identifier}}"
88
- />
89
- {{group-name group.identifier}}
90
- </label>
91
- {{#if group.config.icon}}
92
- {{svg-jar
93
- group.config.icon
94
- width="20"
95
- height="20"
96
- class=(concat "uk-text-" group.config.iconColor)
97
- }}
98
- {{/if}}
99
- </li>
100
- {{/each}}
101
- </ul>
75
+
76
+ {{#if this.groups.isRunning}}
77
+ <div class="uk-text-center uk-margin">
78
+ <UkSpinner @ratio={{2}} />
79
+ </div>
80
+ {{else if this.groups.value.length}}
81
+ <ul class="uk-list uk-list-striped">
82
+ {{#each this.groups.value as |group|}}
83
+ {{! template-lint-disable require-presentational-children }}
84
+ <li
85
+ role="checkbox"
86
+ class="uk-flex uk-flex-between uk-flex-middle"
87
+ data-test-group={{group.identifier}}
88
+ {{on "click" (fn this.updateSelectedGroups group.identifier)}}
89
+ >
90
+ {{! template-lint-disable no-nested-interactive }}
91
+ <label for="group-{{group.identifier}}">
92
+ <input
93
+ type="checkbox"
94
+ class="uk-checkbox uk-margin-small-right"
95
+ checked={{includes group.identifier this.selectedGroups}}
96
+ id="group-{{group.identifier}}"
97
+ />
98
+ {{group-name group.identifier}}
99
+ </label>
100
+ {{#if group.config.icon}}
101
+ {{svg-jar
102
+ group.config.icon
103
+ width="20"
104
+ height="20"
105
+ class=(concat "uk-text-" group.config.iconColor)
106
+ }}
107
+ {{/if}}
108
+ </li>
109
+ {{/each}}
110
+ </ul>
111
+ {{else}}
112
+ <div class="uk-text-center">
113
+ <UkIcon @icon="search" @ratio={{10}} class="uk-margin-top" />
114
+ <p class="uk-text-muted">
115
+ {{t "caluma.distribution.new.empty"}}
116
+ </p>
117
+ </div>
118
+ {{/if}}
102
119
  {{else}}
103
- <div class="uk-text-center">
104
- <UkIcon @icon="search" @ratio={{10}} class="uk-margin-top" />
105
- <p class="uk-text-muted">
106
- {{t "caluma.distribution.new.empty"}}
107
- </p>
108
- </div>
120
+ <Notfound />
109
121
  {{/if}}
@@ -1,6 +1,6 @@
1
- import { getOwner } from "@ember/application";
2
1
  import { action } from "@ember/object";
3
2
  import { inject as service } from "@ember/service";
3
+ import { macroCondition, isTesting } from "@embroider/macros";
4
4
  import Component from "@glimmer/component";
5
5
  import { tracked } from "@glimmer/tracking";
6
6
  import { queryManager } from "ember-apollo-client";
@@ -10,8 +10,6 @@ import { useTask } from "ember-resources";
10
10
  import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
11
11
  import config from "@projectcaluma/ember-distribution/config";
12
12
  import createInquiryMutation from "@projectcaluma/ember-distribution/gql/mutations/create-inquiry.graphql";
13
- import controlWorkItemsQuery from "@projectcaluma/ember-distribution/gql/queries/control-work-items.graphql";
14
- import inquiryNavigationQuery from "@projectcaluma/ember-distribution/gql/queries/inquiry-navigation.graphql";
15
13
 
16
14
  const toggle = (value, array) => {
17
15
  const set = new Set(array);
@@ -26,6 +24,7 @@ export default class InquiryNewFormComponent extends Component {
26
24
  @service notification;
27
25
  @service intl;
28
26
  @service router;
27
+ @service distribution;
29
28
 
30
29
  @queryManager apollo;
31
30
 
@@ -63,10 +62,10 @@ export default class InquiryNewFormComponent extends Component {
63
62
  *updateSearch(e) {
64
63
  e.preventDefault();
65
64
 
66
- const { environment } =
67
- getOwner(this).resolveRegistration("config:environment");
68
-
69
- if (environment !== "test") {
65
+ /* istanbul ignore next */
66
+ if (macroCondition(isTesting())) {
67
+ // no timeout
68
+ } else {
70
69
  yield timeout(500);
71
70
  }
72
71
 
@@ -80,54 +79,37 @@ export default class InquiryNewFormComponent extends Component {
80
79
  if (!this.selectedGroups.length) return;
81
80
 
82
81
  try {
83
- // get create inquiry work item to complete, this will not trigger a
84
- // network request since it's already fetch in the controls
85
- const controlsData = yield this.apollo.watchQuery(
86
- {
87
- query: controlWorkItemsQuery,
88
- variables: {
89
- caseId: this.args.caseId,
90
- currentGroup: String(this.calumaOptions.currentGroupId),
91
- createTask: this.config.controls.createTask,
92
- completeTask: this.config.controls.completeTask,
93
- },
94
- },
95
- "create.edges"
82
+ // get create inquiry work item to complete
83
+ const createId = decodeId(
84
+ this.distribution.controls.value?.create.edges[0].node.id
96
85
  );
97
86
 
98
87
  // create new inquiries
99
88
  yield this.apollo.mutate({
100
89
  mutation: createInquiryMutation,
101
90
  variables: {
102
- id: decodeId(controlsData[0].node.id),
91
+ id: createId,
103
92
  context: JSON.stringify({
104
93
  addressed_groups: this.selectedGroups.map(String),
105
94
  }),
106
95
  },
107
96
  });
108
97
 
109
- // refetch navigation data
110
- const navigationData = yield this.apollo.query(
98
+ // refetch navigation and controls data
99
+ yield this.distribution.refetch();
100
+
101
+ const lastControlling =
102
+ this.distribution.navigation.value.controlling.edges[0].node;
103
+
104
+ // transition to last added inquiry
105
+ this.router.transitionTo(
106
+ "inquiry.detail.index",
111
107
  {
112
- query: inquiryNavigationQuery,
113
- fetchPolicy: "network-only",
114
- variables: {
115
- caseId: this.args.caseId,
116
- task: this.config.inquiry.task,
117
- currentGroup: String(this.calumaOptions.currentGroupId),
118
- statusQuestion: this.config.inquiry.answer.statusQuestion,
119
- deadlineQuestion: this.config.inquiry.deadlineQuestion,
120
- includeNavigationData: true,
121
- },
108
+ from: lastControlling.controllingGroups[0],
109
+ to: lastControlling.addressedGroups[0],
122
110
  },
123
- "controlling.edges"
111
+ decodeId(lastControlling.id)
124
112
  );
125
-
126
- // transition to last added inquiry
127
- this.router.transitionTo("distribution.inquiry", {
128
- from: navigationData[0].node.controllingGroups[0],
129
- to: navigationData[0].node.addressedGroups[0],
130
- });
131
113
  } catch (e) {
132
114
  this.notification.danger(
133
115
  this.intl.t("caluma.distribution.new.error", {
@@ -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>
package/addon/config.js CHANGED
@@ -15,6 +15,7 @@ export default function config(target, property) {
15
15
  get() {
16
16
  return merge(
17
17
  {
18
+ ui: { stack: false, small: false },
18
19
  controls: {
19
20
  createTask: "create-inquiry",
20
21
  completeTask: "complete-distribution",
@@ -0,0 +1,7 @@
1
+ import Controller from "@ember/controller";
2
+
3
+ import config from "@projectcaluma/ember-distribution/config";
4
+
5
+ export default class ApplicationController extends Controller {
6
+ @config config;
7
+ }
@@ -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"];
@@ -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
  }
@@ -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
  ) {
@@ -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
+ }