@projectcaluma/ember-distribution 1.0.0-beta.4 → 1.0.0-beta.5

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [@projectcaluma/ember-distribution-v1.0.0-beta.5](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.4...@projectcaluma/ember-distribution-v1.0.0-beta.5) (2022-03-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **distribution:** fix sorting after group names in navigation ([2299d3b](https://github.com/projectcaluma/ember-caluma/commit/2299d3b0e265204ab6747dbdc6a8b64fc22f247f))
7
+ * **distribution:** redirect to edit form after inquiry creation ([0a2c404](https://github.com/projectcaluma/ember-caluma/commit/0a2c40404fdb1258fb8d51a2809a03b335c7c78a))
8
+
1
9
  # [@projectcaluma/ember-distribution-v1.0.0-beta.4](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.3...@projectcaluma/ember-distribution-v1.0.0-beta.4) (2022-02-16)
2
10
 
3
11
 
@@ -20,10 +20,15 @@ export default class DistributionNavigationComponent extends Component {
20
20
  @tracked groups = [];
21
21
 
22
22
  get inquiries() {
23
- const findGroupName = (ids) =>
24
- this.groups.find((g) =>
25
- ids.includes(g[this.calumaOptions.groupIdentifierProperty])
26
- )?.[this.calumaOptions.groupNameProperty];
23
+ const findGroupName = (identifiers) => {
24
+ const group = this.scheduler.groupCache.find((group) =>
25
+ identifiers
26
+ .map(String)
27
+ .includes(String(group[this.calumaOptions.groupIdentifierProperty]))
28
+ );
29
+
30
+ return group?.[this.calumaOptions.groupNameProperty] ?? "";
31
+ };
27
32
 
28
33
  return Object.entries(this._inquiries.value || []).reduce(
29
34
  (inquiries, [key, objects]) => {
@@ -74,7 +79,7 @@ export default class DistributionNavigationComponent extends Component {
74
79
  ),
75
80
  ];
76
81
 
77
- this.groups = yield this.scheduler.resolve(groupIds, "group");
82
+ yield this.scheduler.resolve(groupIds, "group");
78
83
 
79
84
  return response;
80
85
  }
@@ -1,6 +1,14 @@
1
- <div
2
- class="uk-position-top-right uk-margin-medium-top uk-margin-medium-right uk-flex-inline uk-flex-middle uk-text-{{this.deadline.color}}"
3
- >
4
- {{svg-jar "alarm-outline" height=26 class="uk-margin-small-right"}}
5
- {{format-date this.deadline.value}}
6
- </div>
1
+ {{#if this.deadline.value}}
2
+ <div
3
+ class="uk-position-top-right
4
+ {{if
5
+ this.config.ui.small
6
+ 'uk-margin-top uk-margin-right'
7
+ 'uk-margin-medium-top uk-margin-medium-right'
8
+ }}
9
+ uk-flex-inline uk-flex-middle uk-text-{{this.deadline.color}}"
10
+ >
11
+ {{svg-jar "alarm-outline" height=26 class="uk-margin-small-right"}}
12
+ {{format-date this.deadline.value}}
13
+ </div>
14
+ {{/if}}
@@ -1,5 +1,6 @@
1
1
  <div
2
- class="inquiry-divider uk-flex uk-flex-center uk-flex-middle uk-flex-between uk-margin uk-text-{{this.status.color}}"
2
+ class="inquiry-divider uk-flex uk-flex-center uk-flex-middle uk-flex-between uk-text-{{this.status.color}}
3
+ {{if this.config.ui.small 'inquiry-divider--small' 'uk-margin'}}"
3
4
  >
4
5
  <div class="inquiry-divider__icon uk-flex uk-flex-center uk-flex-middle">
5
6
  {{svg-jar this.status.icon title=this.status.label}}
@@ -8,7 +8,14 @@
8
8
  {{/if}}
9
9
  </p>
10
10
 
11
- <ul class="uk-subnav uk-subnav-divider uk-margin-small-top">
11
+ <ul
12
+ class="uk-subnav uk-subnav-divider
13
+ {{if
14
+ this.config.ui.small
15
+ 'uk-margin-remove-top uk-margin-small-bottom'
16
+ 'uk-margin-small-top'
17
+ }}"
18
+ >
12
19
  <li>
13
20
  <span>
14
21
  {{format-date this.date}}
@@ -31,4 +38,6 @@
31
38
  {{/if}}
32
39
  </ul>
33
40
 
34
- <p class="uk-margin-remove-bottom">{{this.info}}</p>
41
+ {{#if this.info}}
42
+ <p class="uk-margin-remove">{{this.info}}</p>
43
+ {{/if}}
@@ -1,6 +1,10 @@
1
1
  import Component from "@glimmer/component";
2
2
 
3
+ import config from "@projectcaluma/ember-distribution/config";
4
+
3
5
  export default class InquiryDialogInquiryPartComponent extends Component {
6
+ @config config;
7
+
4
8
  get date() {
5
9
  const key = this.args.type === "request" ? "createdAt" : "closedAt";
6
10
 
@@ -1,4 +1,7 @@
1
- <article class="uk-card uk-card-default uk-margin">
1
+ <article
2
+ class="uk-card uk-card-default uk-margin
3
+ {{if this.config.ui.small 'uk-card-small'}}"
4
+ >
2
5
  <div class="uk-card-body">
3
6
  <InquiryDialog::InquiryDeadline @inquiry={{@inquiry}} />
4
7
 
@@ -1,6 +1,10 @@
1
1
  import Component from "@glimmer/component";
2
2
 
3
+ import config from "@projectcaluma/ember-distribution/config";
4
+
3
5
  export default class InquiryDialogInquiryComponent extends Component {
6
+ @config config;
7
+
4
8
  get hasAnswer() {
5
9
  return this.args.inquiry.status === "COMPLETED";
6
10
  }
@@ -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
 
@@ -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";
@@ -63,10 +63,10 @@ export default class InquiryNewFormComponent extends Component {
63
63
  *updateSearch(e) {
64
64
  e.preventDefault();
65
65
 
66
- const { environment } =
67
- getOwner(this).resolveRegistration("config:environment");
68
-
69
- if (environment !== "test") {
66
+ /* istanbul ignore next */
67
+ if (macroCondition(isTesting())) {
68
+ // no timeout
69
+ } else {
70
70
  yield timeout(500);
71
71
  }
72
72
 
@@ -114,10 +114,14 @@ export default class InquiryNewFormComponent extends Component {
114
114
  );
115
115
 
116
116
  // transition to last added inquiry
117
- this.router.transitionTo("inquiry", {
118
- from: navigationData[0].node.controllingGroups[0],
119
- to: navigationData[0].node.addressedGroups[0],
120
- });
117
+ this.router.transitionTo(
118
+ "inquiry.detail.index",
119
+ {
120
+ from: navigationData[0].node.controllingGroups[0],
121
+ to: navigationData[0].node.addressedGroups[0],
122
+ },
123
+ decodeId(navigationData[0].node.id)
124
+ );
121
125
  } catch (e) {
122
126
  this.notification.danger(
123
127
  this.intl.t("caluma.distribution.new.error", {
package/addon/config.js CHANGED
@@ -15,7 +15,7 @@ export default function config(target, property) {
15
15
  get() {
16
16
  return merge(
17
17
  {
18
- ui: { stack: false },
18
+ ui: { stack: false, small: false },
19
19
  controls: {
20
20
  createTask: "create-inquiry",
21
21
  completeTask: "complete-distribution",
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -18,11 +18,12 @@
18
18
  "ember-engines": ">= 0.8"
19
19
  },
20
20
  "dependencies": {
21
+ "@embroider/macros": "^1.5.0",
21
22
  "@glimmer/component": "^1.0.4",
22
23
  "@glimmer/tracking": "^1.0.4",
23
- "@projectcaluma/ember-core": "^11.0.0-beta.4",
24
- "@projectcaluma/ember-form": "^11.0.0-beta.11",
25
- "@projectcaluma/ember-workflow": "^11.0.0-beta.4",
24
+ "@projectcaluma/ember-core": "^11.0.0-beta.5",
25
+ "@projectcaluma/ember-form": "^11.0.0-beta.13",
26
+ "@projectcaluma/ember-workflow": "^11.0.0-beta.5",
26
27
  "ember-apollo-client": "^3.2.0",
27
28
  "ember-auto-import": "^2.4.0",
28
29
  "ember-can": "^4.1.0",
@@ -33,28 +34,28 @@
33
34
  "ember-fetch": "^8.1.1",
34
35
  "ember-intl": "^5.7.2",
35
36
  "ember-pikaday": "^4.0.0",
36
- "ember-resources": "^4.3.1",
37
+ "ember-resources": "^4.4.0",
37
38
  "ember-svg-jar": "^2.3.4",
38
39
  "ember-test-selectors": "^6.0.0",
39
40
  "ember-uikit": "^5.0.0",
40
41
  "graphql": "^15.8.0",
41
42
  "ionicons": "^6.0.1",
42
43
  "lodash.merge": "^4.6.2",
43
- "luxon": "^2.3.0",
44
+ "luxon": "^2.3.1",
44
45
  "tracked-toolbox": "^1.2.3"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@ember/optional-features": "2.0.0",
48
49
  "@ember/test-helpers": "2.6.0",
49
- "@embroider/test-setup": "1.2.0",
50
- "@faker-js/faker": "6.0.0-alpha.6",
51
- "@projectcaluma/ember-testing": "11.0.0-beta.3",
50
+ "@embroider/test-setup": "1.5.0",
51
+ "@faker-js/faker": "6.0.0-beta.0",
52
+ "@projectcaluma/ember-testing": "11.0.0-beta.4",
52
53
  "broccoli-asset-rev": "3.0.0",
53
54
  "ember-cli": "3.28.5",
54
55
  "ember-cli-code-coverage": "1.0.3",
55
56
  "ember-cli-dependency-checker": "3.2.0",
56
57
  "ember-cli-inject-live-reload": "2.1.0",
57
- "ember-cli-mirage": "2.4.0",
58
+ "ember-cli-mirage": "3.0.0-alpha.2",
58
59
  "ember-cli-sass": "10.0.1",
59
60
  "ember-cli-sri": "2.1.1",
60
61
  "ember-cli-terser": "4.0.2",
@@ -71,10 +72,10 @@
71
72
  "loader.js": "4.7.0",
72
73
  "miragejs": "0.1.43",
73
74
  "npm-run-all": "4.1.5",
74
- "qunit": "2.17.2",
75
+ "qunit": "2.18.0",
75
76
  "qunit-dom": "2.0.0",
76
- "sass": "1.49.7",
77
- "webpack": "5.69.0"
77
+ "sass": "1.49.9",
78
+ "webpack": "5.70.0"
78
79
  },
79
80
  "engines": {
80
81
  "node": "12.* || 14.* || >= 16"