@projectcaluma/ember-core 14.1.1 → 14.2.0

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.
@@ -4,7 +4,7 @@ import { warn } from "@ember/debug";
4
4
  export function decodeId(str) {
5
5
  try {
6
6
  return window.atob(str).split(":")[1];
7
- } catch (e) {
7
+ } catch {
8
8
  warn(`Attempted to decode ${str} as base64 but failed`, {
9
9
  id: "ember-caluma.decode-id",
10
10
  });
@@ -1,6 +1,7 @@
1
1
  import { assert } from "@ember/debug";
2
2
  import Service, { inject as service } from "@ember/service";
3
3
  import { tracked } from "@glimmer/tracking";
4
+ import { DateTime } from "luxon";
4
5
 
5
6
  import slugify from "@projectcaluma/ember-core/utils/slugify";
6
7
 
@@ -90,6 +91,27 @@ export default class CalumaOptionsService extends Service {
90
91
  */
91
92
  async sendReminderDistributionInquiry() {}
92
93
 
94
+ /**
95
+ * Calculate the default deadline for new inquiries in the distribution
96
+ * module. Per default, this will add the configured default lead time in days
97
+ * to the current date.
98
+ *
99
+ * This may be overwritten by the host app to define more complex logic to
100
+ * calculate said date. E.g. defining a different default deadline depending
101
+ * on which groups were selected.
102
+ *
103
+ * This function may return a promise.
104
+ *
105
+ * @method calculateDistributionDefaultDeadline
106
+ * @param {Number} defaultLeadTime
107
+ * @param {Array<String>} selectedGroups
108
+ * @returns {String} Deadline date formatted as ISO 8601 string
109
+ */
110
+ // eslint-disable-next-line no-unused-vars
111
+ calculateDistributionDefaultDeadline(defaultLeadTime, selectedGroups) {
112
+ return DateTime.now().plus({ days: defaultLeadTime }).toISODate();
113
+ }
114
+
93
115
  groupIdentifierProperty = "id";
94
116
  groupNameProperty = "name";
95
117
  resolveGroups(identifiers) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-core",
3
- "version": "14.1.1",
3
+ "version": "14.2.0",
4
4
  "description": "Ember core addon for working with Caluma.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -37,7 +37,7 @@
37
37
  "@ember/test-helpers": "4.0.4",
38
38
  "@embroider/test-setup": "4.0.0",
39
39
  "@embroider/util": "1.13.2",
40
- "@faker-js/faker": "9.4.0",
40
+ "@faker-js/faker": "9.7.0",
41
41
  "@glimmer/component": "1.1.2",
42
42
  "broccoli-asset-rev": "3.0.0",
43
43
  "ember-cli": "6.1.0",
@@ -49,17 +49,17 @@
49
49
  "ember-cli-sri": "2.1.1",
50
50
  "ember-cli-terser": "4.0.2",
51
51
  "ember-load-initializers": "3.0.1",
52
- "ember-qunit": "9.0.1",
52
+ "ember-qunit": "9.0.2",
53
53
  "ember-resolver": "13.1.0",
54
54
  "ember-source": "6.1.0",
55
55
  "ember-source-channel-url": "3.0.0",
56
- "ember-try": "3.0.0",
56
+ "ember-try": "4.0.0",
57
57
  "loader.js": "4.7.0",
58
- "qunit": "2.23.1",
58
+ "qunit": "2.24.1",
59
59
  "qunit-dom": "3.4.0",
60
- "uikit": "3.22.0",
61
- "webpack": "5.97.1",
62
- "@projectcaluma/ember-testing": "14.1.1"
60
+ "uikit": "3.23.7",
61
+ "webpack": "5.99.8",
62
+ "@projectcaluma/ember-testing": "14.2.0"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "ember-data": "*",