@projectcaluma/ember-distribution 1.0.0-beta.10 → 1.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@projectcaluma/ember-distribution-v1.0.0-beta.11](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.10...@projectcaluma/ember-distribution-v1.0.0-beta.11) (2022-05-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * **distribution:** add status for skipped inquiries ([1f93c92](https://github.com/projectcaluma/ember-caluma/commit/1f93c92d76b697954ec54aefa12348c84cd0abf9))
7
+
1
8
  # [@projectcaluma/ember-distribution-v1.0.0-beta.10](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-distribution-v1.0.0-beta.9...@projectcaluma/ember-distribution-v1.0.0-beta.10) (2022-05-11)
2
9
 
3
10
 
@@ -14,12 +14,10 @@
14
14
  uk-flex-inline uk-flex-middle"
15
15
  ...attributes
16
16
  >
17
- {{svg-jar
18
- (if this.isWithdrawn "ban-outline" "alarm-outline")
19
- height=26
20
- width=26
17
+ <UkIcon
18
+ @icon={{if this.isWithdrawn "ban" "clock"}}
21
19
  class="uk-margin-small-right"
22
- }}
20
+ />
23
21
  {{#if this.isWithdrawn}}
24
22
  {{t "caluma.distribution.withdraw.status"}}
25
23
  {{else}}
@@ -3,6 +3,6 @@
3
3
  {{if this.config.ui.small 'inquiry-divider--small' 'uk-margin'}}"
4
4
  >
5
5
  <div class="inquiry-divider__icon uk-flex uk-flex-center uk-flex-middle">
6
- {{svg-jar this.status.icon title=this.status.label}}
6
+ <UkIcon @icon={{this.status.icon}} title={{this.status.label}} />
7
7
  </div>
8
8
  </div>
@@ -1,10 +1,10 @@
1
1
  <div class="uk-margin-remove-last-child">
2
2
  <p class="uk-flex uk-flex-middle uk-text-large uk-margin-remove">
3
3
  {{#if (eq @type "request")}}
4
- {{svg-jar "arrow-redo-outline" height=24 class="uk-margin-small-right"}}
4
+ <UkIcon @icon="forward" class="uk-margin-small-right" />
5
5
  {{group-name @inquiry.controllingGroups}}
6
6
  {{else if (eq @type "answer")}}
7
- {{svg-jar "arrow-undo-outline" height=24 class="uk-margin-small-right"}}
7
+ <UkIcon @icon="reply" class="uk-margin-small-right" />
8
8
  {{group-name @inquiry.addressedGroups}}
9
9
  {{/if}}
10
10
  </p>
@@ -5,13 +5,19 @@
5
5
  (and (can "create inquiry of distribution") this.currentGroupIsCreator)
6
6
  }}
7
7
  <div class="uk-text-center uk-margin">
8
- <CdIconButton
9
- @title={{t "caluma.distribution.new.title"}}
10
- @icon="plus"
11
- @loading={{this.createInquiry.isRunning}}
12
- @onClick={{perform this.createInquiry}}
8
+ <button
9
+ type="button"
10
+ class="uk-icon-button"
11
+ title={{t "caluma.distribution.new.title"}}
13
12
  data-test-new-inquiry
14
- />
13
+ {{on "click" (perform this.createInquiry)}}
14
+ >
15
+ {{#if this.createInquiry.isRunning}}
16
+ <UkSpinner @ratio={{0.6}} />
17
+ {{else}}
18
+ <UkIcon @icon="plus" />
19
+ {{/if}}
20
+ </button>
15
21
  </div>
16
22
  {{/if}}
17
23
  <section>
@@ -100,12 +100,10 @@
100
100
  {{group-name group.identifier}}
101
101
  </label>
102
102
  {{#if group.config.icon}}
103
- {{svg-jar
104
- group.config.icon
105
- width="20"
106
- height="20"
107
- class=(concat "uk-text-" group.config.iconColor)
108
- }}
103
+ <UkIcon
104
+ @icon={{group.config.icon}}
105
+ class="uk-text-{{group.config.iconColor}}"
106
+ />
109
107
  {{/if}}
110
108
  </li>
111
109
  {{/each}}
@@ -1,32 +1,41 @@
1
1
  <div class="uk-text-center uk-margin-small-top">
2
2
  {{#if (can "create inquiry of distribution")}}
3
- <CdIconButton
4
- @title={{t "caluma.distribution.new.title"}}
5
- @icon="plus"
3
+ <LinkTo
6
4
  @route="new"
7
- />
5
+ class="uk-icon-button"
6
+ title={{t "caluma.distribution.new.title"}}
7
+ >
8
+ <UkIcon @icon="plus" />
9
+ </LinkTo>
8
10
  {{/if}}
9
11
  {{#if (can "send inquiries of distribution")}}
10
- <CdIconButton
11
- @title={{t "caluma.distribution.send"}}
12
- @icon="paper-plane-outline"
13
- @fromSvgJar={{true}}
14
- @gutterTop={{4}}
15
- @gutterRight={{6}}
16
- @gutterLeft={{4}}
17
- @gutterBottom={{4}}
18
- @onClick={{perform this.sendInquiries}}
19
- @loading={{this.sendInquiries.isRunning}}
12
+ <button
13
+ type="button"
14
+ class="uk-icon-button"
15
+ title={{t "caluma.distribution.send"}}
20
16
  data-test-send-pending-inquiries
21
- />
17
+ {{on "click" (perform this.sendInquiries)}}
18
+ >
19
+ {{#if this.sendInquiries.isRunning}}
20
+ <UkSpinner @ratio={{0.6}} />
21
+ {{else}}
22
+ <UkIcon @icon="comment" />
23
+ {{/if}}
24
+ </button>
22
25
  {{/if}}
23
26
  {{#if (can "complete distribution")}}
24
- <CdIconButton
25
- @icon="lock-closed-outline"
26
- @fromSvgJar={{true}}
27
- @onClick={{perform this.completeDistribution}}
28
- @loading={{this.completeDistribution.isRunning}}
27
+ <button
28
+ type="button"
29
+ class="uk-icon-button"
30
+ title={{t "caluma.distribution.complete"}}
29
31
  data-test-complete-distribution
30
- />
32
+ {{on "click" (perform this.completeDistribution)}}
33
+ >
34
+ {{#if this.completeDistribution.isRunning}}
35
+ <UkSpinner @ratio={{0.6}} />
36
+ {{else}}
37
+ <UkIcon @icon="lock" />
38
+ {{/if}}
39
+ </button>
31
40
  {{/if}}
32
41
  </div>
@@ -26,7 +26,7 @@ export default class CdNavigationControlsComponent extends Component {
26
26
  {
27
27
  query: incompleteInquiriesQuery,
28
28
  variables: {
29
- caseId: this.args.caseId,
29
+ caseId: this.distribution.caseId,
30
30
  task: this.config.inquiry.task,
31
31
  },
32
32
  },
@@ -1,15 +1,18 @@
1
- <li class={{if this.isActive "uk-active"}}>
1
+ <li class="uk-width-auto {{if this.isActive 'uk-active'}}">
2
2
  <LinkTo @route="inquiry" @model={{this.model}}>
3
- <div class="uk-flex uk-flex-middle uk-width-1-1">
4
- <div class="uk-width-expand uk-text-truncate">
5
- {{#if (eq @type "addressed")}}
6
- {{@inquiry.controllingGroupName}}
7
- {{else}}
8
- {{@inquiry.addressedGroupName}}
9
- {{/if}}
10
- </div>
3
+ {{#let
4
+ (if
5
+ (eq @type "addressed")
6
+ @inquiry.controllingGroupName
7
+ @inquiry.addressedGroupName
8
+ )
9
+ as |name|
10
+ }}
11
+ <span class="uk-width-expand uk-text-truncate" title={{name}}>
12
+ {{name}}
13
+ </span>
14
+ {{/let}}
11
15
 
12
- <CdNavigation::StatusIndicator @inquiry={{@inquiry}} @type={{@type}} />
13
- </div>
16
+ <CdNavigation::StatusIndicator @inquiry={{@inquiry}} @type={{@type}} />
14
17
  </LinkTo>
15
18
  </li>
@@ -1,5 +1,5 @@
1
- <li class="uk-margin-small-bottom">
2
- <a href="" class="uk-margin-small-bottom" {{on "click" this.toggle}}>
1
+ <li class="uk-margin-small-bottom uk-width-auto">
2
+ <a href="" {{on "click" this.toggle}}>
3
3
  <span class="uk-width-expand">
4
4
  {{t (concat "caluma.distribution.types." @type)}}
5
5
  </span>
@@ -12,7 +12,7 @@
12
12
 
13
13
  {{#if this.expanded}}
14
14
  {{#if @inquiries.length}}
15
- <ul class="uk-tab uk-tab-left uk-margin-left">
15
+ <ul class="uk-tab uk-tab-left uk-margin-left uk-width-auto">
16
16
  {{#each this.inquiries as |inquiry|}}
17
17
  <CdNavigation::Item @inquiry={{inquiry}} @type={{@type}} />
18
18
  {{/each}}
@@ -20,7 +20,7 @@
20
20
  {{/if}}
21
21
 
22
22
  {{#if (eq @type "controlling")}}
23
- <CdNavigation::Controls @caseId={{@caseId}} />
23
+ <CdNavigation::Controls />
24
24
  {{/if}}
25
25
  {{/if}}
26
26
  </li>
@@ -1,18 +1,13 @@
1
1
  {{#if this.showDeadlineIndicator}}
2
- <div
3
- class="deadline-indicator uk-flex uk-flex-middle uk-flex-center uk-margin-small-left uk-text-{{this.deadline.color}}"
4
- >
5
- {{svg-jar
6
- "notifications-outline"
7
- height=16
8
- width=16
9
- title=(format-date this.deadline.value)
10
- }}
11
- </div>
2
+ <UkIcon
3
+ @icon="clock"
4
+ class="uk-margin-small-right uk-text-{{this.deadline.color}}"
5
+ title={{format-date this.deadline.value}}
6
+ />
12
7
  {{/if}}
13
8
 
14
- <div
15
- class="status-indicator uk-flex uk-flex-middle uk-flex-center uk-margin-small-left uk-text-{{this.status.color}}"
16
- >
17
- {{svg-jar this.status.icon title=this.status.label}}
18
- </div>
9
+ <UkIcon
10
+ @icon={{this.status.icon}}
11
+ class="uk-text-{{this.status.color}}"
12
+ title={{this.status.label}}
13
+ />
@@ -1,14 +1,11 @@
1
- <aside>
2
- <ul class="uk-tab uk-tab-left uk-margin-remove-bottom">
3
- <CdNavigation::Section
4
- @type="controlling"
5
- @inquiries={{this.inquiries.controlling}}
6
- @caseId={{@caseId}}
7
- />
8
- <CdNavigation::Section
9
- @type="addressed"
10
- @inquiries={{this.inquiries.addressed}}
11
- />
12
- <CdNavigation::Section @type="more" @inquiries={{this.inquiries.more}} />
13
- </ul>
14
- </aside>
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>
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",
@@ -60,7 +61,7 @@ export default function config(target, property) {
60
61
  types: {
61
62
  suggestions: {
62
63
  label: "caluma.distribution.new.suggestions",
63
- icon: "bulb-outline",
64
+ icon: "star",
64
65
  iconColor: "warning",
65
66
  },
66
67
  },
@@ -19,18 +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
24
  const { days: diff } = DateTime.fromISO(value).diffNow("days").toObject();
25
25
 
26
- const isOverdue = !isAnswered && diff <= 0;
27
- const isWarning = !isAnswered && diff <= this.config.warningPeriod;
26
+ const isOverdue = !isDone && diff <= 0;
27
+ const isWarning = !isDone && diff <= this.config.warningPeriod;
28
28
 
29
29
  return {
30
30
  value,
31
31
  isOverdue,
32
32
  isWarning,
33
- color: isAnswered
33
+ color: isDone
34
34
  ? "muted"
35
35
  : isOverdue
36
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],
@@ -1,5 +1,3 @@
1
1
  @import "../answer-form";
2
- @import "../icon-button";
3
2
  @import "../inquiry-divider";
4
- @import "../status-indicator";
5
3
  @import "../truncated";
package/index.js CHANGED
@@ -5,11 +5,6 @@ const { buildEngine } = require("ember-engines/lib/engine-addon");
5
5
 
6
6
  const name = require("./package").name;
7
7
 
8
- const ioniconAssets = [
9
- ...require.resolve("ionicons").split("/").slice(0, -1),
10
- "svg",
11
- ].join("/");
12
-
13
8
  const publicAssets = [
14
9
  ...require.resolve(name).split("/").slice(0, -1),
15
10
  "public",
@@ -19,5 +14,5 @@ const publicAssets = [
19
14
  module.exports = buildEngine({
20
15
  name,
21
16
  lazyLoading: { enabled: false },
22
- svgJar: { sourceDirs: [ioniconAssets, publicAssets] },
17
+ svgJar: { sourceDirs: [publicAssets] },
23
18
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -41,7 +41,6 @@
41
41
  "ember-uikit": "^5.1.3",
42
42
  "graphql": "^15.8.0",
43
43
  "graphql-tag": "^2.12.6",
44
- "ionicons": "^6.0.1",
45
44
  "lodash.merge": "^4.6.2",
46
45
  "luxon": "^2.4.0",
47
46
  "tracked-toolbox": "^1.2.3"
@@ -51,7 +50,7 @@
51
50
  "@ember/test-helpers": "2.7.0",
52
51
  "@embroider/test-setup": "1.6.0",
53
52
  "@faker-js/faker": "6.3.1",
54
- "@projectcaluma/ember-testing": "11.0.0-beta.7",
53
+ "@projectcaluma/ember-testing": "11.0.0-beta.8",
55
54
  "broccoli-asset-rev": "3.0.0",
56
55
  "ember-cli": "3.28.5",
57
56
  "ember-cli-code-coverage": "1.0.3",
@@ -72,12 +71,12 @@
72
71
  "ember-source-channel-url": "3.0.0",
73
72
  "ember-try": "2.0.0",
74
73
  "loader.js": "4.7.0",
75
- "miragejs": "0.1.43",
74
+ "miragejs": "0.1.44",
76
75
  "npm-run-all": "4.1.5",
77
76
  "qunit": "2.19.1",
78
77
  "qunit-dom": "2.0.0",
79
78
  "sass": "1.51.0",
80
- "webpack": "5.72.0"
79
+ "webpack": "5.72.1"
81
80
  },
82
81
  "engines": {
83
82
  "node": "12.* || 14.* || >= 16"
@@ -3,6 +3,7 @@ caluma:
3
3
  empty: "Es wurden noch keine Anfragen erstellt."
4
4
  start: "Starten"
5
5
  send: "Offene Anfragen versenden"
6
+ complete: "Zirkulation abschliessen"
6
7
  send-confirm: "Wollen Sie wirklich alle offenen Anfragen versenden?"
7
8
  complete-confirm:
8
9
  "Es gibt noch <b>{count} offene {count, plural, =1 {Anfrage} other {Anfragen}}</b>
@@ -54,6 +55,7 @@ caluma:
54
55
 
55
56
  status:
56
57
  draft: "Entwurf"
58
+ skipped: "Vorzeitig beendet"
57
59
  sent: "Versendet"
58
60
  positive: "Positiv"
59
61
  negative: "Negativ"
@@ -3,6 +3,7 @@ caluma:
3
3
  empty: "No inquiries have been created yet."
4
4
  start: "Start"
5
5
  send: "Send pending inquiries"
6
+ complete: "Complete circulation"
6
7
  send-confirm: "Do you really want to send all pending inquiries?"
7
8
  complete-confirm:
8
9
  "There {count, plural, =1 {is} other {are}} <b>{count} pending
@@ -55,6 +56,7 @@ caluma:
55
56
 
56
57
  status:
57
58
  draft: "Draft"
59
+ skipped: "Aborted"
58
60
  sent: "Sent"
59
61
  positive: "Positive"
60
62
  negative: "Negative"
@@ -3,6 +3,7 @@ caluma:
3
3
  empty: "Aucune demande n'a encore été créée."
4
4
  start: "Lancer"
5
5
  send: "Envoyer les demandes ouvertes"
6
+ complete: "Terminer la circulation"
6
7
  send-confirm: "Voulez-vous vraiment envoyer toutes les demandes ouvertes ?"
7
8
  complete-confirm:
8
9
  "Il y a <b>{count} {count, plural, =1 {demande} other {demandes}} en
@@ -54,6 +55,7 @@ caluma:
54
55
 
55
56
  status:
56
57
  draft: "Brouillon"
58
+ skipped: "Terminé prématurément"
57
59
  sent: "Envoyé"
58
60
  positive: "Positif"
59
61
  negative: "Negatif"
@@ -1,27 +0,0 @@
1
- {{#if @route}}
2
- <LinkTo @route={{@route}} class={{this.class}} title={{@title}} ...attributes>
3
- {{#if @loading}}
4
- <UkSpinner @ratio={{0.6}} />
5
- {{else if @fromSvgJar}}
6
- {{svg-jar @icon title=@title width="20" height="20"}}
7
- {{else}}
8
- <UkIcon @icon={{@icon}} />
9
- {{/if}}
10
- </LinkTo>
11
- {{else}}
12
- <button
13
- type="button"
14
- class={{this.class}}
15
- title={{@title}}
16
- ...attributes
17
- {{on "click" @onClick}}
18
- >
19
- {{#if @loading}}
20
- <UkSpinner @ratio={{0.6}} />
21
- {{else if @fromSvgJar}}
22
- {{svg-jar @icon title=@title width="20" height="20"}}
23
- {{else}}
24
- <UkIcon @icon={{@icon}} />
25
- {{/if}}
26
- </button>
27
- {{/if}}
@@ -1,22 +0,0 @@
1
- import { dasherize } from "@ember/string";
2
- import Component from "@glimmer/component";
3
-
4
- export default class CdIconButtonComponent extends Component {
5
- get class() {
6
- const gutters = [
7
- "gutter",
8
- "gutterTop",
9
- "gutterRight",
10
- "gutterBottom",
11
- "gutterLeft",
12
- ]
13
- .map((arg) =>
14
- this.args[arg]
15
- ? `uk-icon-button--${dasherize(arg)}-${this.args[arg]}`
16
- : null
17
- )
18
- .filter(Boolean);
19
-
20
- return ["uk-icon-button", ...gutters].join(" ");
21
- }
22
- }
@@ -1 +0,0 @@
1
- export { default } from "@projectcaluma/ember-distribution/components/cd-icon-button";
@@ -1,13 +0,0 @@
1
- @import "ember-uikit/variables-theme";
2
-
3
- @for $i from 1 through 8 {
4
- @each $side in "top", "right", "bottom", "left" {
5
- .uk-icon-button--gutter-#{$side}-#{$i} > svg {
6
- margin-#{$side}: #{$i}px !important;
7
- }
8
- }
9
-
10
- .uk-icon-button--gutter-#{$i} > svg {
11
- margin: #{$i}px;
12
- }
13
- }
@@ -1,31 +0,0 @@
1
- @import "ember-uikit/variables-theme";
2
-
3
- $size: $global-small-font-size * 1.2;
4
- $iconSize: $global-small-font-size * 0.9;
5
-
6
- $colors: (
7
- muted: $text-muted-color,
8
- emphasis: $text-emphasis-color,
9
- success: $text-success-color,
10
- danger: $text-danger-color,
11
- warning: $text-warning-color,
12
- );
13
-
14
- .status-indicator {
15
- width: $size;
16
- height: $size;
17
- border-width: 1px;
18
- border-style: solid;
19
-
20
- > svg {
21
- width: $iconSize;
22
- height: $iconSize;
23
- }
24
-
25
- @each $colorName, $color in $colors {
26
- &.uk-text-#{$colorName} {
27
- color: darken($color, 20%);
28
- border-color: $color;
29
- }
30
- }
31
- }