@projectcaluma/ember-distribution 11.0.0-beta.30 → 11.0.0-beta.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/addon/components/cd-document-header.hbs +3 -12
  2. package/addon/components/cd-inquiry-answer-form.hbs +136 -76
  3. package/addon/components/cd-inquiry-answer-form.js +20 -2
  4. package/addon/components/cd-inquiry-dialog/inquiry-deadline.hbs +5 -10
  5. package/addon/components/cd-inquiry-dialog/inquiry-deadline.js +14 -0
  6. package/addon/components/cd-inquiry-dialog/inquiry-part.hbs +116 -89
  7. package/addon/components/cd-inquiry-dialog.js +11 -15
  8. package/addon/components/cd-inquiry-edit-form.hbs +0 -3
  9. package/addon/components/cd-inquiry-edit-form.js +2 -2
  10. package/addon/components/cd-inquiry-new-form/bulk-edit.js +9 -6
  11. package/addon/components/cd-navigation/section.hbs +1 -1
  12. package/addon/components/cd-navigation/section.js +5 -13
  13. package/addon/components/cd-navigation.hbs +3 -10
  14. package/addon/config.js +17 -0
  15. package/addon/gql/fragments/inquiry-answer.graphql +57 -0
  16. package/addon/gql/fragments/inquiry-request.graphql +26 -0
  17. package/addon/gql/mutations/complete-inquiry-work-item.graphql +24 -13
  18. package/addon/gql/mutations/reopen-inquiry.graphql +3 -13
  19. package/addon/gql/queries/{control-work-items.graphql → controls.graphql} +1 -1
  20. package/addon/gql/queries/incomplete-inquiries.graphql +1 -1
  21. package/addon/gql/queries/inquiry-answer.graphql +5 -1
  22. package/addon/gql/queries/inquiry-dialog.graphql +31 -2
  23. package/addon/gql/queries/inquiry-form.graphql +1 -1
  24. package/addon/gql/queries/{inquiry-navigation.graphql → navigation.graphql} +24 -6
  25. package/addon/routes/application.js +7 -0
  26. package/addon/routes/index.js +15 -28
  27. package/addon/routes/inquiry/index.js +1 -4
  28. package/addon/routes/new.js +1 -5
  29. package/addon/services/distribution.js +71 -9
  30. package/addon/templates/application.hbs +1 -1
  31. package/addon/templates/inquiry/index.hbs +1 -5
  32. package/addon/templates/new.hbs +0 -1
  33. package/addon/utils/inquiry-deadline.js +3 -1
  34. package/app/styles/_answer-form.scss +4 -0
  35. package/package.json +10 -10
  36. package/translations/de.yaml +10 -1
  37. package/translations/en.yaml +11 -2
  38. package/translations/fr.yaml +10 -1
  39. package/addon/components/cd-navigation.js +0 -53
  40. package/addon/gql/fragments/inquiry.graphql +0 -117
  41. package/addon/modifiers/pikaday.js +0 -2
@@ -1,7 +1,6 @@
1
1
  <CdInquiryNewForm
2
2
  @selectedTypes={{this.selectedTypes}}
3
3
  @search={{this.search}}
4
- @caseId={{@model}}
5
4
  @onChangeSelectedTypes={{fn (mut this.selectedTypes)}}
6
5
  @onChangeSearch={{fn (mut this.search)}}
7
6
  />
@@ -19,7 +19,9 @@ 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 isDone = ["COMPLETED", "SKIPPED"].includes(inquiry.status);
22
+ const isDone = ["COMPLETED", "SKIPPED", "CANCELED"].includes(
23
+ inquiry.status
24
+ );
23
25
 
24
26
  const diff = DateTime.fromISO(value).diffNow("days").days;
25
27
 
@@ -2,3 +2,7 @@
2
2
  border-left: 5px solid $global-border;
3
3
  padding-left: $global-gutter - 5px;
4
4
  }
5
+
6
+ .inquiry-answer-form__side-bar {
7
+ max-width: 25%;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "11.0.0-beta.30",
3
+ "version": "11.0.0-beta.31",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -10,7 +10,7 @@
10
10
  "homepage": "https://docs.caluma.io/ember-caluma",
11
11
  "repository": "github:projectcaluma/ember-caluma",
12
12
  "scripts": {
13
- "test": "npm-run-all test:*",
13
+ "test": "npm-run-all --print-name \"lint\" \"test:*\"",
14
14
  "test:ember": "ember test",
15
15
  "test:ember-compatibility": "ember try:each"
16
16
  },
@@ -23,9 +23,9 @@
23
23
  "@embroider/macros": "^1.9.0",
24
24
  "@glimmer/component": "^1.1.2",
25
25
  "@glimmer/tracking": "^1.1.2",
26
- "@projectcaluma/ember-core": "^11.0.0-beta.30",
27
- "@projectcaluma/ember-form": "^11.0.0-beta.30",
28
- "@projectcaluma/ember-workflow": "^11.0.0-beta.30",
26
+ "@projectcaluma/ember-core": "^11.0.0-beta.31",
27
+ "@projectcaluma/ember-form": "^11.0.0-beta.31",
28
+ "@projectcaluma/ember-workflow": "^11.0.0-beta.31",
29
29
  "ember-apollo-client": "~4.0.2",
30
30
  "ember-auto-import": "^2.4.3",
31
31
  "ember-can": "^4.2.0",
@@ -34,10 +34,10 @@
34
34
  "ember-concurrency": "^2.3.7",
35
35
  "ember-engines-router-service": "^0.3.0",
36
36
  "ember-fetch": "^8.1.2",
37
+ "ember-flatpickr": "^3.2.3",
37
38
  "ember-intl": "^5.7.2",
38
- "ember-pikaday": "^4.0.0",
39
39
  "ember-resources": "^5.4.0",
40
- "ember-svg-jar": "^2.4.0",
40
+ "ember-svg-jar": "^2.4.1",
41
41
  "ember-test-selectors": "^6.0.0",
42
42
  "ember-uikit": "^6.1.0",
43
43
  "graphql": "^15.8.0",
@@ -51,9 +51,9 @@
51
51
  "@ember/test-helpers": "2.7.0",
52
52
  "@embroider/test-setup": "1.8.3",
53
53
  "@faker-js/faker": "7.6.0",
54
- "@projectcaluma/ember-testing": "11.0.0-beta.30",
54
+ "@projectcaluma/ember-testing": "11.0.0-beta.31",
55
55
  "broccoli-asset-rev": "3.0.0",
56
- "ember-cli": "4.7.0",
56
+ "ember-cli": "4.8.0",
57
57
  "ember-cli-code-coverage": "1.0.3",
58
58
  "ember-cli-dependency-checker": "3.3.1",
59
59
  "ember-cli-inject-live-reload": "2.1.0",
@@ -78,7 +78,7 @@
78
78
  "webpack": "5.74.0"
79
79
  },
80
80
  "engines": {
81
- "node": "14.* || >= 16"
81
+ "node": "14.* || 16.* || >= 18"
82
82
  },
83
83
  "ember": {
84
84
  "edition": "octane"
@@ -29,12 +29,17 @@ caluma:
29
29
  more: "mehr"
30
30
  less: "weniger"
31
31
 
32
- last-modified: "Zuletzt bearbeitet von {user} am {date} um {time}"
33
32
  details: "Details"
34
33
  not-allowed-hint:
35
34
  "Sie können jedoch das Formular bearbeiten und die Eingabedaten werden
36
35
  automatisch gespeichert."
37
36
 
37
+ inquiry:
38
+ created-at: "Erstellt am"
39
+ closed-at: "Beantwortet am"
40
+ deadline: "Frist"
41
+ assigned-user: "Verantwortliche Person"
42
+
38
43
  edit:
39
44
  link: "Bearbeiten"
40
45
  send: "Aktuelle Anfrage versenden"
@@ -64,6 +69,10 @@ caluma:
64
69
  revise:
65
70
  label: "Überarbeiten"
66
71
 
72
+ details:
73
+ show: "Details anzeigen"
74
+ hide: "Details verstecken"
75
+
67
76
  new:
68
77
  title: "Neue Anfrage"
69
78
  search: "Suchen..."
@@ -8,7 +8,7 @@ caluma:
8
8
  reopen: "Reopen circulation"
9
9
  check-inquiries: "Mark inquiries as checked"
10
10
  send-confirm:
11
- "Do you really want to send <b>{other, plural, =1 {one pending inquiry}
11
+ "Do you really want to send <b>{count, plural, =1 {one pending inquiry}
12
12
  other {{count} pending inquiries}}</b>?"
13
13
  complete-confirm:
14
14
  "There {count, plural, =1 {is <b>one pending inquiry} other {are
@@ -29,12 +29,17 @@ caluma:
29
29
  more: "more"
30
30
  less: "less"
31
31
 
32
- last-modified: "Last modified by {user} on {date} at {time}"
33
32
  details: "Details"
34
33
  not-allowed-hint:
35
34
  "However, you can edit the form and the input will be saved
36
35
  automatically."
37
36
 
37
+ inquiry:
38
+ created-at: "Created at"
39
+ closed-at: "Answered at"
40
+ deadline: "Deadline"
41
+ assigned-user: "Assigned user"
42
+
38
43
  edit:
39
44
  link: "Edit"
40
45
  send: "Send current inquiry"
@@ -64,6 +69,10 @@ caluma:
64
69
  revise:
65
70
  label: "Revise"
66
71
 
72
+ details:
73
+ show: "Show details"
74
+ hide: "Hide details"
75
+
67
76
  new:
68
77
  title: "New inquiry"
69
78
  search: "Search..."
@@ -29,12 +29,17 @@ caluma:
29
29
  more: "plus"
30
30
  less: "moins"
31
31
 
32
- last-modified: "Dernière modification par {user} le {date} à {time}"
33
32
  details: "Détails"
34
33
  not-allowed-hint:
35
34
  "Vous pouvez toutefois modifier le formulaire et les données seront
36
35
  automatiquement enregistrées."
37
36
 
37
+ inquiry:
38
+ created-at: "Créé le"
39
+ closed-at: "Répondu le"
40
+ deadline: "Délai"
41
+ assigned-user: "Personne responsable"
42
+
38
43
  edit:
39
44
  link: "Modifier"
40
45
  send: "Envoyer la demande actuelle"
@@ -64,6 +69,10 @@ caluma:
64
69
  revise:
65
70
  label: "Réviser"
66
71
 
72
+ details:
73
+ show: "Afficher les détails"
74
+ hide: "Cacher les détails"
75
+
67
76
  new:
68
77
  title: "Nouvelle demande"
69
78
  search: "Chercher..."
@@ -1,53 +0,0 @@
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
- }
@@ -1,117 +0,0 @@
1
- fragment InquiryAnswerButtons on Case {
2
- workItems(filter: [{ tasks: $buttonTasks }, { status: READY }]) {
3
- edges {
4
- node {
5
- id
6
- status
7
- task {
8
- id
9
- slug
10
- }
11
- }
12
- }
13
- }
14
- }
15
-
16
- fragment InquiryDeadlineDocument on Document {
17
- id
18
- deadline: answers(filter: [{ question: $deadlineQuestion }]) {
19
- edges {
20
- node {
21
- id
22
- ... on DateAnswer {
23
- value
24
- }
25
- }
26
- }
27
- }
28
- }
29
-
30
- fragment InquiryStatusDocument on Document {
31
- id
32
- status: answers(filter: [{ question: $statusQuestion }]) {
33
- edges {
34
- node {
35
- id
36
- ... on StringAnswer {
37
- value
38
- selectedOption {
39
- slug
40
- label
41
- }
42
- }
43
- }
44
- }
45
- }
46
- }
47
-
48
- fragment InquiryRequest on Document {
49
- id
50
- ...InquiryDeadlineDocument
51
- info: answers(filter: [{ question: $infoQuestion }]) {
52
- edges {
53
- node {
54
- id
55
- ... on StringAnswer {
56
- value
57
- }
58
- }
59
- }
60
- }
61
- }
62
-
63
- fragment InquiryDialog on WorkItem {
64
- id
65
- addressedGroups
66
- controllingGroups
67
- createdAt
68
- closedAt
69
- status
70
- isRedoable
71
- task {
72
- id
73
- slug
74
- }
75
- meta
76
- document {
77
- ...InquiryRequest
78
- }
79
- childCase {
80
- id
81
- ...InquiryAnswerButtons
82
- document {
83
- ...InquiryStatusDocument
84
- info: answers(filter: [{ questions: $answerInfoQuestions }]) {
85
- edges {
86
- node {
87
- id
88
- question {
89
- id
90
- label
91
- slug
92
- }
93
- ... on StringAnswer {
94
- value
95
- }
96
- }
97
- }
98
- }
99
- }
100
- }
101
- }
102
-
103
- fragment Inquiry on WorkItem {
104
- id
105
- status
106
- addressedGroups
107
- controllingGroups
108
- document @include(if: $includeNavigationData) {
109
- ...InquiryDeadlineDocument
110
- }
111
- childCase @include(if: $includeNavigationData) {
112
- id
113
- document {
114
- ...InquiryStatusDocument
115
- }
116
- }
117
- }
@@ -1,2 +0,0 @@
1
- import "ember-pikaday/pikaday.css";
2
- export { default } from "ember-pikaday/modifiers/pikaday";