@projectcaluma/ember-distribution 14.4.4 → 14.5.1

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/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # ![ember-caluma](https://user-images.githubusercontent.com/6150577/137114875-8b9edb83-92ba-4b3a-ba6e-2e5f86afdcc5.png)
2
+
3
+ [![Test](https://github.com/projectcaluma/ember-caluma/workflows/Test/badge.svg)](https://github.com/projectcaluma/ember-caluma/actions?query=workflow%3ATest)
4
+ [![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=RFNMT2hyTnRjNVZkUitkWUl2d3BWK21KbnU3MU1tTGpHS2tOVHVCU1RrZz0tLXJjZ1J5VEZ6ZmtJWVpFdHpDRnREcFE9PQ==--3034affde596526379b7a0a19798a7ba1f79154c)](https://automate.browserstack.com/public-build/RFNMT2hyTnRjNVZkUitkWUl2d3BWK21KbnU3MU1tTGpHS2tOVHVCU1RrZz0tLXJjZ1J5VEZ6ZmtJWVpFdHpDRnREcFE9PQ==--3034affde596526379b7a0a19798a7ba1f79154c)
5
+ [![Codecov](https://codecov.io/gh/projectcaluma/ember-caluma/branch/main/graph/badge.svg)](https://codecov.io/gh/projectcaluma/ember-caluma)
6
+ [![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
7
+ [![License: LGPL-3.0](https://img.shields.io/badge/License-LGPL--3.0-blue.svg)](https://spdx.org/licenses/LGPL-3.0-or-later.html)
8
+
9
+ The Ember.js addons for [Caluma](https://caluma.io) - a collaborative form editing service.
10
+
11
+ ## Browser support
12
+
13
+ | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari-ios/safari-ios_48x48.png) |
14
+ | :-------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: |
15
+ | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
16
+
17
+ ## Compatibility
18
+
19
+ `@projectcaluma/ember-*` packages are guaranteed to work with the following LTS versions of Ember.js:
20
+
21
+ - 5.4
22
+ - 4.12
23
+
24
+ ## Documentation
25
+
26
+ You can find the interactive documentation [here](https://docs.caluma.io/ember-caluma).
27
+
28
+ ## Contributing
29
+
30
+ ### Installation
31
+
32
+ - `git clone git@github.com:projectcaluma/ember-caluma`
33
+ - `cd ember-caluma`
34
+ - `pnpm install`
35
+
36
+ ### Linting
37
+
38
+ - `pnpm lint`
39
+
40
+ ### Running tests
41
+
42
+ - `pnpm --filter @projectcaluma/ember-[package] exec ember test` – Runs the test suite on the current Ember version
43
+ - `pnpm --filter @projectcaluma/ember-[package] exec ember test --server` – Runs the test suite in "watch mode"
44
+ - `pnpm --filter @projectcaluma/ember-[package] exec ember try:each` – Runs the test suite against multiple Ember versions
45
+
46
+ Cross-browser testing provided by:
47
+
48
+ <a href="https://browserstack.com"><img alt="BrowserStack" src="https://user-images.githubusercontent.com/6150577/69328224-24f1d680-0c4f-11ea-8b02-5670334923a3.png" height="50"></a>
49
+
50
+ ### Running the dummy application
51
+
52
+ #### With a mocked [Mirage.js](https://github.com/miragejs/ember-cli-mirage) backend
53
+
54
+ - `pnpm start`
55
+ - Visit the dummy application at [http://localhost:4200](http://localhost:4200).
56
+
57
+ #### With a dockerized [Caluma](https://github.com/projectcaluma/caluma) backend
58
+
59
+ - `docker compose up -d`
60
+ - `pnpm start-proxy`
61
+ - Visit the dummy application at [http://localhost:4200](http://localhost:4200).
62
+
63
+ ### Updating the schema
64
+
65
+ The addon includes a mirage server for mocking Caluma's GraphQL API, which is generated from the GraphQL schema definition. If the upstream GraphQL schema changed you can update the addon by running
66
+
67
+ ```bash
68
+ docker compose up -d
69
+ pnpm update-schema
70
+ pnpm update-possible-types
71
+ ```
72
+
73
+ ### Releasing
74
+
75
+ To release a new version, head over to [Actions](https://github.com/projectcaluma/ember-caluma/actions?query=workflow%3ARelease) and trigger a workflow run.
76
+ This will automatically check if a new version can be released, generate a changelog, draft a release and publish it on NPM.
77
+
78
+ ## License
79
+
80
+ This project is licensed under the [LGPL-3.0-or-later license](LICENSE).
81
+
82
+ For further information on our license choice, you can read up on the [corresponding GitHub issue](https://github.com/projectcaluma/ember-caluma/issues/613).
@@ -1,6 +1,7 @@
1
1
  import { getOwner } from "@ember/application";
2
2
  import { action } from "@ember/object";
3
3
  import { guidFor } from "@ember/object/internals";
4
+ import { next } from "@ember/runloop";
4
5
  import { inject as service } from "@ember/service";
5
6
  import Component from "@glimmer/component";
6
7
  import { queryManager } from "ember-apollo-client";
@@ -99,11 +100,13 @@ export default class CdInquiryNewFormBulkEditComponent extends Component {
99
100
  answers: this.answers,
100
101
  });
101
102
 
103
+ next(this, "transitionToFirstInquiryOfGroup", this.args.selectedGroups[0]);
104
+ }
105
+
106
+ transitionToFirstInquiryOfGroup(group) {
102
107
  const firstCreated = this.distribution.navigation.value.controlling.edges
103
108
  .map((edge) => edge.node)
104
- .find((node) =>
105
- node.addressedGroups.includes(String(this.args.selectedGroups[0])),
106
- );
109
+ .find((node) => node.addressedGroups.includes(String(group)));
107
110
 
108
111
  // transition to inquiry addressed to the first selected group
109
112
  this.router.transitionTo(
@@ -9,8 +9,23 @@
9
9
  />
10
10
  {{/if}}
11
11
 
12
- <UkIcon
13
- @icon={{this.status.icon}}
14
- class="uk-text-{{this.status.color}}"
15
- {{uk-tooltip this.status.label pos=(if this.config.ui.stack "left" "top")}}
16
- />
12
+ <div class="uk-position-relative uk-flex uk-flex-middle">
13
+ <UkIcon
14
+ @icon={{this.status.icon}}
15
+ class="uk-text-{{this.status.color}}"
16
+ {{uk-tooltip this.status.label pos=(if this.config.ui.stack "left" "top")}}
17
+ />
18
+ {{#if this.showPendingIndicator}}
19
+ <span
20
+ class="pending-indicator"
21
+ {{uk-tooltip
22
+ (t
23
+ "caluma.distribution.pending-indicator"
24
+ completed=@inquiry.answeredCount
25
+ all=@inquiry.totalCount
26
+ )
27
+ }}
28
+ >
29
+ </span>
30
+ {{/if}}
31
+ </div>
@@ -19,4 +19,11 @@ export default class CdNavigationStatusIndicatorComponent extends Component {
19
19
  (this.deadline.isOverdue || this.deadline.isWarning)
20
20
  );
21
21
  }
22
+
23
+ get showPendingIndicator() {
24
+ return (
25
+ this.args.inquiry.totalCount > 1 &&
26
+ this.args.inquiry.totalCount !== this.args.inquiry.answeredCount
27
+ );
28
+ }
22
29
  }
@@ -1,15 +1,33 @@
1
1
  export default function uniqueByGroups(workItems) {
2
+ const relevantWorkItems = workItems
3
+ .filter((workItem) => workItem.status !== "CANCELED")
4
+ .map((workItem) => ({
5
+ ...workItem,
6
+ identifier: JSON.stringify({
7
+ from: workItem.controllingGroups,
8
+ to: workItem.addressedGroups,
9
+ }),
10
+ }));
11
+
2
12
  return [
3
13
  ...new Map(
4
- workItems
5
- .filter((workItem) => workItem.status !== "CANCELED")
14
+ relevantWorkItems
6
15
  .map((workItem) => {
16
+ const workItemsWithSameIdentifier = relevantWorkItems.filter(
17
+ (otherWorkItem) =>
18
+ otherWorkItem.identifier === workItem.identifier &&
19
+ otherWorkItem.status !== "SUSPENDED",
20
+ );
21
+
7
22
  return [
8
- JSON.stringify({
9
- from: workItem.controllingGroups,
10
- to: workItem.addressedGroups,
11
- }),
12
- workItem,
23
+ workItem.identifier,
24
+ {
25
+ ...workItem,
26
+ totalCount: workItemsWithSameIdentifier.length,
27
+ answeredCount: workItemsWithSameIdentifier.filter((wi) =>
28
+ ["COMPLETED", "SKIPPED"].includes(wi.status),
29
+ ).length,
30
+ },
13
31
  ];
14
32
  })
15
33
  .reverse(),
@@ -2,3 +2,4 @@
2
2
  @import "../group-list";
3
3
  @import "../inquiry-divider";
4
4
  @import "../truncated";
5
+ @import "../pending-indicator";
@@ -0,0 +1,28 @@
1
+ $hitbox-size: 12px;
2
+ $indicator-size: 6px;
3
+
4
+ .pending-indicator {
5
+ position: absolute;
6
+ left: 0;
7
+ top: 0;
8
+ z-index: 1;
9
+ width: $hitbox-size;
10
+ height: $hitbox-size;
11
+ transform: translate(
12
+ calc(-50% - #{$indicator-size / 2}),
13
+ calc(-50% - #{$indicator-size / 2})
14
+ );
15
+
16
+ &::before {
17
+ content: "";
18
+ position: absolute;
19
+ background-color: #c00;
20
+ display: block;
21
+ width: $indicator-size;
22
+ height: $indicator-size;
23
+ border-radius: 50%;
24
+ top: 50%;
25
+ left: 50%;
26
+ transform: translate(-50%, -50%);
27
+ }
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-distribution",
3
- "version": "14.4.4",
3
+ "version": "14.5.1",
4
4
  "description": "Ember engine for the Caluma distribution module.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -16,7 +16,7 @@
16
16
  "@embroider/macros": "^1.16.10",
17
17
  "@glimmer/component": "^1.1.2",
18
18
  "@glimmer/tracking": "^1.1.2",
19
- "ember-apollo-client": "~4.0.2",
19
+ "ember-apollo-client": "^5.0.0",
20
20
  "ember-auto-import": "^2.10.0",
21
21
  "ember-can": "^7.0.0",
22
22
  "ember-cli-babel": "^8.2.0",
@@ -39,9 +39,9 @@
39
39
  "luxon": "^3.5.0",
40
40
  "reactiveweb": "^1.3.0",
41
41
  "tracked-toolbox": "^2.0.0",
42
- "@projectcaluma/ember-workflow": "^14.4.4",
43
- "@projectcaluma/ember-core": "^14.4.4",
44
- "@projectcaluma/ember-form": "^14.4.4"
42
+ "@projectcaluma/ember-core": "^14.5.1",
43
+ "@projectcaluma/ember-form": "^14.5.1",
44
+ "@projectcaluma/ember-workflow": "^14.5.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@ember/optional-features": "2.2.0",
@@ -70,7 +70,7 @@
70
70
  "sass": "1.93.2",
71
71
  "uikit": "3.23.13",
72
72
  "webpack": "5.101.3",
73
- "@projectcaluma/ember-testing": "14.4.4"
73
+ "@projectcaluma/ember-testing": "14.5.1"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "ember-engines": "^0.11.0",
@@ -8,6 +8,7 @@ caluma:
8
8
  skip: "Zirkulation überspringen"
9
9
  reopen: "Zirkulation wiedereröffnen"
10
10
  check-inquiries: "Stellungnahmen als geprüft markieren"
11
+ pending-indicator: "{completed} von {all} Stellungnahmen beantwortet"
11
12
  send-confirm:
12
13
  "Wollen Sie wirklich <b>{count, plural, =1 {eine offene Anfrage} other
13
14
  {{count} offene Anfragen}}</b> versenden?"
@@ -8,6 +8,7 @@ caluma:
8
8
  skip: "Skip circulation"
9
9
  reopen: "Reopen circulation"
10
10
  check-inquiries: "Mark inquiries as checked"
11
+ pending-indicator: "{completed} of {all} inquiries were answered"
11
12
  send-confirm:
12
13
  "Do you really want to send <b>{count, plural, =1 {one pending inquiry}
13
14
  other {{count} pending inquiries}}</b>?"
@@ -8,6 +8,7 @@ caluma:
8
8
  skip: "Sauter la procédure de circulation"
9
9
  reopen: "Réouvrir la procédure de circulation"
10
10
  check-inquiries: "Marquer les prises de position comme vérifiées"
11
+ pending-indicator: "{completed} réponse sur {all} avis"
11
12
  send-confirm:
12
13
  "Voulez-vous vraiment envoyer <b>{count, plural, =1 {une demande ouverte}
13
14
  other {{count} demandes ouvertes}}</b> ?"
@@ -8,6 +8,7 @@ caluma:
8
8
  skip: "Ignora circolazione"
9
9
  reopen: "Riavvia circolazione"
10
10
  check-inquiries: "Segna le prese di posizione come verificate"
11
+ pending-indicator: "{completed} su {all} risposte fornite"
11
12
  send-confirm: "Inviare davvero <b>{count, plural, =1 {una richiesta in corso} other {{count} richieste in corso}}</b>?"
12
13
  complete-confirm: "Nella circolazione attuale <b>{count, plural, =1 {vi è una richiesta in corso} other {vi sono {count} richieste in corso}}</b. Concludendo la circolazione vengono interrotte tutte le rimanenti richieste in corso. Desidera continuare?"
13
14
  complete-confirm-empty: "Concludere davvero la circolazione?"