@overmap-ai/core 1.0.65-org-projs-only.0 → 1.0.65-procedures.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.
- package/dist/enums/access.d.ts +8 -0
- package/dist/enums/attachments.d.ts +7 -0
- package/dist/enums/index.d.ts +3 -0
- package/dist/enums/issue.d.ts +9 -0
- package/dist/enums/licenses.d.ts +14 -0
- package/dist/overmap-core.js +1444 -684
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1440 -680
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/base.d.ts +1 -1
- package/dist/sdk/globals.d.ts +2 -2
- package/dist/sdk/sdk.d.ts +3 -3
- package/dist/sdk/services/AgentService.d.ts +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +3 -2
- package/dist/sdk/services/AssetProcedureCompletionService.d.ts +11 -0
- package/dist/sdk/services/AssetProcedureInstanceService.d.ts +10 -0
- package/dist/sdk/services/AssetProcedureService.d.ts +10 -0
- package/dist/sdk/services/AssetService.d.ts +5 -6
- package/dist/sdk/services/AssetStageCompletionService.d.ts +6 -12
- package/dist/sdk/services/AssetStageService.d.ts +6 -5
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +3 -2
- package/dist/sdk/services/AssetTypeService.d.ts +4 -4
- package/dist/sdk/services/BaseApiService.d.ts +1 -1
- package/dist/sdk/services/BaseAttachmentService.d.ts +3 -2
- package/dist/sdk/services/BaseAuthService.d.ts +1 -1
- package/dist/sdk/services/BaseService.d.ts +2 -2
- package/dist/sdk/services/BaseUploadService.d.ts +2 -2
- package/dist/sdk/services/CategoryService.d.ts +3 -3
- package/dist/sdk/services/DocumentAttachmentService.d.ts +3 -2
- package/dist/sdk/services/DocumentService.d.ts +2 -2
- package/dist/sdk/services/EmailDomainsService.d.ts +1 -1
- package/dist/sdk/services/EmailVerificationService.d.ts +1 -1
- package/dist/sdk/services/FileService.d.ts +1 -1
- package/dist/sdk/services/FormService.d.ts +3 -2
- package/dist/sdk/services/FormSubmissionService.d.ts +2 -3
- package/dist/sdk/services/GeoImageService.d.ts +2 -2
- package/dist/sdk/services/IssueAttachmentService.d.ts +3 -2
- package/dist/sdk/services/IssueCommentService.d.ts +2 -2
- package/dist/sdk/services/IssueService.d.ts +2 -2
- package/dist/sdk/services/IssueTypeService.d.ts +2 -2
- package/dist/sdk/services/IssueUpdateService.d.ts +1 -1
- package/dist/sdk/services/JWTAuthService.d.ts +2 -2
- package/dist/sdk/services/LicenseService.d.ts +1 -1
- package/dist/sdk/services/OrganizationAccessService.d.ts +1 -1
- package/dist/sdk/services/OrganizationService.d.ts +1 -1
- package/dist/sdk/services/ProjectAccessService.d.ts +1 -1
- package/dist/sdk/services/ProjectAttachmentService.d.ts +3 -2
- package/dist/sdk/services/ProjectFileService.d.ts +2 -3
- package/dist/sdk/services/ProjectService.d.ts +1 -2
- package/dist/sdk/services/TeamService.d.ts +2 -2
- package/dist/sdk/services/UserService.d.ts +2 -2
- package/dist/sdk/services/WorkspaceService.d.ts +3 -5
- package/dist/sdk/services/index.d.ts +3 -0
- package/dist/store/slices/assetProcedureCompletionSlice.d.ts +54 -0
- package/dist/store/slices/assetProcedureInstanceSlice.d.ts +54 -0
- package/dist/store/slices/assetProcedureSlice.d.ts +53 -0
- package/dist/store/slices/assetStageCompletionSlice.d.ts +42 -12
- package/dist/store/slices/assetStageSlice.d.ts +22 -11
- package/dist/store/slices/assetTypeSlice.d.ts +27 -3
- package/dist/store/slices/formSlice.d.ts +2 -0
- package/dist/store/slices/index.d.ts +3 -0
- package/dist/store/slices/userSlice.d.ts +13 -33
- package/dist/store/store.d.ts +4 -1
- package/dist/typings/models/access.d.ts +2 -9
- package/dist/typings/models/agents.d.ts +1 -1
- package/dist/typings/models/assets.d.ts +26 -15
- package/dist/typings/models/attachments.d.ts +2 -9
- package/dist/typings/models/base.d.ts +5 -4
- package/dist/typings/models/categories.d.ts +3 -3
- package/dist/typings/models/documents.d.ts +1 -1
- package/dist/typings/models/emailDomain.d.ts +1 -1
- package/dist/typings/models/emailVerification.d.ts +2 -2
- package/dist/typings/models/forms.d.ts +3 -2
- package/dist/typings/models/geoImages.d.ts +3 -3
- package/dist/typings/models/issueTypes.d.ts +2 -2
- package/dist/typings/models/issues.d.ts +2 -10
- package/dist/typings/models/license.d.ts +3 -16
- package/dist/typings/models/organizations.d.ts +1 -1
- package/dist/typings/models/projects.d.ts +6 -4
- package/dist/typings/models/store.d.ts +4 -1
- package/dist/typings/models/teams.d.ts +3 -3
- package/dist/typings/models/users.d.ts +1 -1
- package/dist/typings/models/workspace.d.ts +3 -3
- package/dist/typings/store.d.ts +1 -1
- package/dist/utils/colors.d.ts +0 -2
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -7,19 +7,19 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
var _a;
|
|
8
8
|
import { DepGraph } from "dependency-graph";
|
|
9
9
|
import { v4 } from "uuid";
|
|
10
|
+
import { saveAs } from "file-saver";
|
|
11
|
+
import React, { useRef, useEffect } from "react";
|
|
12
|
+
import ColorCls from "color";
|
|
13
|
+
import { gray, gold, brown, yellow, amber, orange, red, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, jade, grass, lime, mint, sky } from "@radix-ui/colors";
|
|
10
14
|
import { offline as offline$1 } from "@redux-offline/redux-offline";
|
|
11
15
|
import offlineConfig from "@redux-offline/redux-offline/lib/defaults";
|
|
12
16
|
import localforage from "localforage";
|
|
13
17
|
import createMigration from "redux-persist-migrate";
|
|
14
|
-
import { createSlice, createSelector, combineReducers } from "@reduxjs/toolkit";
|
|
18
|
+
import { createSlice, createSelector, combineReducers, createNextState } from "@reduxjs/toolkit";
|
|
15
19
|
import request from "superagent";
|
|
16
|
-
import {
|
|
17
|
-
import React, { useRef, useEffect } from "react";
|
|
18
|
-
import ColorCls from "color";
|
|
19
|
-
import { gray, gold, brown, yellow, amber, orange, red, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, jade, grass, lime, mint, sky } from "@radix-ui/colors";
|
|
20
|
+
import { unsafeShowToast } from "@overmap-ai/blocks";
|
|
20
21
|
import { RESET_STATE } from "@redux-offline/redux-offline/lib/constants";
|
|
21
22
|
import jwtDecode from "jwt-decode";
|
|
22
|
-
import { unsafeShowToast } from "@overmap-ai/blocks";
|
|
23
23
|
import { openDB } from "idb";
|
|
24
24
|
var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
25
25
|
HttpMethod2["GET"] = "GET";
|
|
@@ -29,6 +29,14 @@ var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
|
29
29
|
HttpMethod2["DELETE"] = "DELETE";
|
|
30
30
|
return HttpMethod2;
|
|
31
31
|
})(HttpMethod || {});
|
|
32
|
+
var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
|
|
33
|
+
AttachmentModel2["Issue"] = "issue";
|
|
34
|
+
AttachmentModel2["Asset"] = "asset";
|
|
35
|
+
AttachmentModel2["AssetType"] = "asset_type";
|
|
36
|
+
AttachmentModel2["Project"] = "project";
|
|
37
|
+
AttachmentModel2["Document"] = "document";
|
|
38
|
+
return AttachmentModel2;
|
|
39
|
+
})(AttachmentModel || {});
|
|
32
40
|
var IssuePriority = /* @__PURE__ */ ((IssuePriority2) => {
|
|
33
41
|
IssuePriority2[IssuePriority2["LOWEST"] = 0] = "LOWEST";
|
|
34
42
|
IssuePriority2[IssuePriority2["LOW"] = 2] = "LOW";
|
|
@@ -43,6 +51,43 @@ var IssueStatus = /* @__PURE__ */ ((IssueStatus2) => {
|
|
|
43
51
|
IssueStatus2[IssueStatus2["DONE"] = 4] = "DONE";
|
|
44
52
|
return IssueStatus2;
|
|
45
53
|
})(IssueStatus || {});
|
|
54
|
+
var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
|
|
55
|
+
IssueUpdateChange2["STATUS"] = "status";
|
|
56
|
+
IssueUpdateChange2["PRIORITY"] = "priority";
|
|
57
|
+
IssueUpdateChange2["CATEGORY"] = "category";
|
|
58
|
+
IssueUpdateChange2["DESCRIPTION"] = "description";
|
|
59
|
+
IssueUpdateChange2["TITLE"] = "title";
|
|
60
|
+
IssueUpdateChange2["ASSIGNED_TO"] = "assigned_to";
|
|
61
|
+
IssueUpdateChange2["DUE_DATE"] = "due_date";
|
|
62
|
+
return IssueUpdateChange2;
|
|
63
|
+
})(IssueUpdateChange || {});
|
|
64
|
+
var ProjectAccessLevel = /* @__PURE__ */ ((ProjectAccessLevel2) => {
|
|
65
|
+
ProjectAccessLevel2[ProjectAccessLevel2["BASIC"] = 0] = "BASIC";
|
|
66
|
+
ProjectAccessLevel2[ProjectAccessLevel2["ADMIN"] = 2] = "ADMIN";
|
|
67
|
+
return ProjectAccessLevel2;
|
|
68
|
+
})(ProjectAccessLevel || {});
|
|
69
|
+
var OrganizationAccessLevel = /* @__PURE__ */ ((OrganizationAccessLevel2) => {
|
|
70
|
+
OrganizationAccessLevel2[OrganizationAccessLevel2["BASIC"] = 0] = "BASIC";
|
|
71
|
+
OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
|
|
72
|
+
return OrganizationAccessLevel2;
|
|
73
|
+
})(OrganizationAccessLevel || {});
|
|
74
|
+
var PaddleCheckoutEvent = /* @__PURE__ */ ((PaddleCheckoutEvent2) => {
|
|
75
|
+
PaddleCheckoutEvent2["COMPLETED"] = "checkout.completed";
|
|
76
|
+
PaddleCheckoutEvent2["CLOSED"] = "checkout.closed";
|
|
77
|
+
return PaddleCheckoutEvent2;
|
|
78
|
+
})(PaddleCheckoutEvent || {});
|
|
79
|
+
var LicenseLevel = /* @__PURE__ */ ((LicenseLevel2) => {
|
|
80
|
+
LicenseLevel2[LicenseLevel2["PRO"] = 0] = "PRO";
|
|
81
|
+
return LicenseLevel2;
|
|
82
|
+
})(LicenseLevel || {});
|
|
83
|
+
var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
84
|
+
LicenseStatus2[LicenseStatus2["ACTIVE"] = 0] = "ACTIVE";
|
|
85
|
+
LicenseStatus2[LicenseStatus2["PAUSED"] = 2] = "PAUSED";
|
|
86
|
+
LicenseStatus2[LicenseStatus2["CANCELLED"] = 4] = "CANCELLED";
|
|
87
|
+
LicenseStatus2[LicenseStatus2["INACTIVE"] = 6] = "INACTIVE";
|
|
88
|
+
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
89
|
+
return LicenseStatus2;
|
|
90
|
+
})(LicenseStatus || {});
|
|
46
91
|
class OutboxCoordinator {
|
|
47
92
|
constructor() {
|
|
48
93
|
__publicField(this, "graph");
|
|
@@ -285,130 +330,6 @@ class APIError extends Error {
|
|
|
285
330
|
this.options = options;
|
|
286
331
|
}
|
|
287
332
|
}
|
|
288
|
-
class DeferredPromise {
|
|
289
|
-
constructor() {
|
|
290
|
-
__publicField(this, _a, "Promise");
|
|
291
|
-
__publicField(this, "_promise");
|
|
292
|
-
__publicField(this, "_resolve");
|
|
293
|
-
__publicField(this, "_reject");
|
|
294
|
-
__publicField(this, "_state", "pending");
|
|
295
|
-
this._resolve = null;
|
|
296
|
-
this._reject = null;
|
|
297
|
-
this._promise = new Promise((resolve, reject) => {
|
|
298
|
-
this._resolve = resolve;
|
|
299
|
-
this._reject = reject;
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
get state() {
|
|
303
|
-
return this._state;
|
|
304
|
-
}
|
|
305
|
-
then(onFulfilled, onRejected) {
|
|
306
|
-
return this._promise.then(onFulfilled, onRejected);
|
|
307
|
-
}
|
|
308
|
-
catch(onRejected) {
|
|
309
|
-
return this._promise.catch(onRejected);
|
|
310
|
-
}
|
|
311
|
-
resolve(value) {
|
|
312
|
-
if (!this._resolve)
|
|
313
|
-
throw new Error("No resolve callback");
|
|
314
|
-
this._resolve(value);
|
|
315
|
-
this._state = "fulfilled";
|
|
316
|
-
}
|
|
317
|
-
reject(reason) {
|
|
318
|
-
if (!this._reject)
|
|
319
|
-
throw reason;
|
|
320
|
-
this._reject(reason);
|
|
321
|
-
this._state = "rejected";
|
|
322
|
-
}
|
|
323
|
-
finally(_onFinally) {
|
|
324
|
-
throw new Error("`finally` not implemented");
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
_a = Symbol.toStringTag;
|
|
328
|
-
var randomString = function randomString2() {
|
|
329
|
-
return Math.random().toString(36).substring(7).split("").join(".");
|
|
330
|
-
};
|
|
331
|
-
({
|
|
332
|
-
INIT: "@@redux/INIT" + randomString(),
|
|
333
|
-
REPLACE: "@@redux/REPLACE" + randomString(),
|
|
334
|
-
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
|
335
|
-
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
function compose() {
|
|
339
|
-
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
340
|
-
funcs[_key] = arguments[_key];
|
|
341
|
-
}
|
|
342
|
-
if (funcs.length === 0) {
|
|
343
|
-
return function(arg) {
|
|
344
|
-
return arg;
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
if (funcs.length === 1) {
|
|
348
|
-
return funcs[0];
|
|
349
|
-
}
|
|
350
|
-
return funcs.reduce(function(a, b) {
|
|
351
|
-
return function() {
|
|
352
|
-
return a(b.apply(void 0, arguments));
|
|
353
|
-
};
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
const VERSION_REDUCER_KEY$1 = "versioning";
|
|
357
|
-
const latestVersion = () => migrations.length - 1;
|
|
358
|
-
const initialVersioning = (state) => {
|
|
359
|
-
state[VERSION_REDUCER_KEY$1] = { version: latestVersion() };
|
|
360
|
-
return state;
|
|
361
|
-
};
|
|
362
|
-
const signOut = () => {
|
|
363
|
-
return initialVersioning({});
|
|
364
|
-
};
|
|
365
|
-
const createOutboxState = (state) => {
|
|
366
|
-
if (state.outboxReducer) {
|
|
367
|
-
state.outboxReducer.deletedRequests = [];
|
|
368
|
-
}
|
|
369
|
-
return state;
|
|
370
|
-
};
|
|
371
|
-
const wrapMigration = (migrator) => (state) => {
|
|
372
|
-
var _a2;
|
|
373
|
-
if (state === void 0) {
|
|
374
|
-
state = {};
|
|
375
|
-
}
|
|
376
|
-
if (((_a2 = state[VERSION_REDUCER_KEY$1]) == null ? void 0 : _a2.version) === latestVersion())
|
|
377
|
-
return state;
|
|
378
|
-
return migrator(state);
|
|
379
|
-
};
|
|
380
|
-
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
381
|
-
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
382
|
-
const initialState$B = {
|
|
383
|
-
accessToken: "",
|
|
384
|
-
refreshToken: "",
|
|
385
|
-
isLoggedIn: false
|
|
386
|
-
};
|
|
387
|
-
const authSlice = createSlice({
|
|
388
|
-
name: "auth",
|
|
389
|
-
initialState: initialState$B,
|
|
390
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
391
|
-
reducers: {
|
|
392
|
-
setTokens: (state, action) => {
|
|
393
|
-
state.accessToken = action.payload.accessToken;
|
|
394
|
-
state.refreshToken = action.payload.refreshToken;
|
|
395
|
-
},
|
|
396
|
-
clearTokens: (state) => {
|
|
397
|
-
state.accessToken = "";
|
|
398
|
-
state.refreshToken = "";
|
|
399
|
-
},
|
|
400
|
-
setLoggedIn: (state, action) => {
|
|
401
|
-
if (!action.payload) {
|
|
402
|
-
authSlice.caseReducers.clearTokens(state);
|
|
403
|
-
}
|
|
404
|
-
state.isLoggedIn = action.payload;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
const { setTokens, clearTokens, setLoggedIn } = authSlice.actions;
|
|
409
|
-
const selectAccessToken = (state) => state.authReducer.accessToken;
|
|
410
|
-
const selectIsLoggedIn = (state) => state.authReducer.isLoggedIn;
|
|
411
|
-
const authReducer = authSlice.reducer;
|
|
412
333
|
const coordinatesToLiteral = (coordinates) => {
|
|
413
334
|
return { lng: coordinates[0], lat: coordinates[1] };
|
|
414
335
|
};
|
|
@@ -753,19 +674,6 @@ const Colors = {
|
|
|
753
674
|
mint: mint.mint9,
|
|
754
675
|
sky: sky.sky9
|
|
755
676
|
};
|
|
756
|
-
const AssetStageColors = {
|
|
757
|
-
indigo: indigo.indigo9,
|
|
758
|
-
red: red.red9,
|
|
759
|
-
violet: violet.violet9,
|
|
760
|
-
yellow: yellow.yellow9,
|
|
761
|
-
jade: jade.jade9,
|
|
762
|
-
cyan: cyan.cyan9,
|
|
763
|
-
gold: gold.gold9,
|
|
764
|
-
orange: orange.orange9,
|
|
765
|
-
lime: lime.lime9,
|
|
766
|
-
sky: sky.sky9,
|
|
767
|
-
pink: pink.pink9
|
|
768
|
-
};
|
|
769
677
|
const defaultBadgeColor = "#868686";
|
|
770
678
|
const generateBadgeColors = (rawColor) => {
|
|
771
679
|
const color = ColorCls(rawColor);
|
|
@@ -774,9 +682,6 @@ const generateBadgeColors = (rawColor) => {
|
|
|
774
682
|
const textColor = color.hex() === safety.hex() ? "#000000" : "#FFFFFF";
|
|
775
683
|
return { backgroundColor, textColor };
|
|
776
684
|
};
|
|
777
|
-
function getStageColor(index) {
|
|
778
|
-
return Object.values(AssetStageColors)[index % Object.keys(AssetStageColors).length];
|
|
779
|
-
}
|
|
780
685
|
const getLocalDateString = memoize((date) => {
|
|
781
686
|
if (!date)
|
|
782
687
|
return "";
|
|
@@ -793,12 +698,164 @@ const today = /* @__PURE__ */ new Date();
|
|
|
793
698
|
const isToday = (date) => {
|
|
794
699
|
return new Date(date).toDateString() === today.toDateString();
|
|
795
700
|
};
|
|
796
|
-
const getLocalRelativeDateString = memoize((date, min, max) => {
|
|
797
|
-
const days = Math.round((new Date(date).getTime() - today.getTime()) / msInDay);
|
|
798
|
-
if (days < min || days > max)
|
|
799
|
-
return getLocalDateString(date);
|
|
800
|
-
return relative.format(days, "days");
|
|
701
|
+
const getLocalRelativeDateString = memoize((date, min, max) => {
|
|
702
|
+
const days = Math.round((new Date(date).getTime() - today.getTime()) / msInDay);
|
|
703
|
+
if (days < min || days > max)
|
|
704
|
+
return getLocalDateString(date);
|
|
705
|
+
return relative.format(days, "days");
|
|
706
|
+
});
|
|
707
|
+
class DeferredPromise {
|
|
708
|
+
constructor() {
|
|
709
|
+
__publicField(this, _a, "Promise");
|
|
710
|
+
__publicField(this, "_promise");
|
|
711
|
+
__publicField(this, "_resolve");
|
|
712
|
+
__publicField(this, "_reject");
|
|
713
|
+
__publicField(this, "_state", "pending");
|
|
714
|
+
this._resolve = null;
|
|
715
|
+
this._reject = null;
|
|
716
|
+
this._promise = new Promise((resolve, reject) => {
|
|
717
|
+
this._resolve = resolve;
|
|
718
|
+
this._reject = reject;
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
get state() {
|
|
722
|
+
return this._state;
|
|
723
|
+
}
|
|
724
|
+
then(onFulfilled, onRejected) {
|
|
725
|
+
return this._promise.then(onFulfilled, onRejected);
|
|
726
|
+
}
|
|
727
|
+
catch(onRejected) {
|
|
728
|
+
return this._promise.catch(onRejected);
|
|
729
|
+
}
|
|
730
|
+
resolve(value) {
|
|
731
|
+
if (!this._resolve)
|
|
732
|
+
throw new Error("No resolve callback");
|
|
733
|
+
this._resolve(value);
|
|
734
|
+
this._state = "fulfilled";
|
|
735
|
+
}
|
|
736
|
+
reject(reason) {
|
|
737
|
+
if (!this._reject)
|
|
738
|
+
throw reason;
|
|
739
|
+
this._reject(reason);
|
|
740
|
+
this._state = "rejected";
|
|
741
|
+
}
|
|
742
|
+
finally(_onFinally) {
|
|
743
|
+
throw new Error("`finally` not implemented");
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
_a = Symbol.toStringTag;
|
|
747
|
+
var randomString = function randomString2() {
|
|
748
|
+
return Math.random().toString(36).substring(7).split("").join(".");
|
|
749
|
+
};
|
|
750
|
+
({
|
|
751
|
+
INIT: "@@redux/INIT" + randomString(),
|
|
752
|
+
REPLACE: "@@redux/REPLACE" + randomString(),
|
|
753
|
+
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
|
754
|
+
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
function compose() {
|
|
758
|
+
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
759
|
+
funcs[_key] = arguments[_key];
|
|
760
|
+
}
|
|
761
|
+
if (funcs.length === 0) {
|
|
762
|
+
return function(arg) {
|
|
763
|
+
return arg;
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
if (funcs.length === 1) {
|
|
767
|
+
return funcs[0];
|
|
768
|
+
}
|
|
769
|
+
return funcs.reduce(function(a, b) {
|
|
770
|
+
return function() {
|
|
771
|
+
return a(b.apply(void 0, arguments));
|
|
772
|
+
};
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
const VERSION_REDUCER_KEY$1 = "versioning";
|
|
776
|
+
const latestVersion = () => migrations.length - 1;
|
|
777
|
+
const initialVersioning = (state) => {
|
|
778
|
+
state[VERSION_REDUCER_KEY$1] = { version: latestVersion() };
|
|
779
|
+
return state;
|
|
780
|
+
};
|
|
781
|
+
const signOut = () => {
|
|
782
|
+
return initialVersioning({});
|
|
783
|
+
};
|
|
784
|
+
const createOutboxState = (state) => {
|
|
785
|
+
if (state.outboxReducer) {
|
|
786
|
+
state.outboxReducer.deletedRequests = [];
|
|
787
|
+
}
|
|
788
|
+
return state;
|
|
789
|
+
};
|
|
790
|
+
const wrapMigration = (migrator) => (state) => {
|
|
791
|
+
var _a2;
|
|
792
|
+
if (state === void 0) {
|
|
793
|
+
state = {};
|
|
794
|
+
}
|
|
795
|
+
if (((_a2 = state[VERSION_REDUCER_KEY$1]) == null ? void 0 : _a2.version) === latestVersion())
|
|
796
|
+
return state;
|
|
797
|
+
return migrator(state);
|
|
798
|
+
};
|
|
799
|
+
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
800
|
+
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
801
|
+
let clientStore;
|
|
802
|
+
function setClientStore(store) {
|
|
803
|
+
clientStore = store;
|
|
804
|
+
}
|
|
805
|
+
function getClientStore() {
|
|
806
|
+
return clientStore;
|
|
807
|
+
}
|
|
808
|
+
let clientSDK;
|
|
809
|
+
function setClientSDK(sdkCtor) {
|
|
810
|
+
clientSDK = sdkCtor;
|
|
811
|
+
}
|
|
812
|
+
function getClientSDK() {
|
|
813
|
+
return clientSDK;
|
|
814
|
+
}
|
|
815
|
+
const CLASS_NAME_TO_SERVICE = {};
|
|
816
|
+
class BaseService {
|
|
817
|
+
constructor(sdk) {
|
|
818
|
+
__publicField(this, "client");
|
|
819
|
+
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
820
|
+
this.client = sdk;
|
|
821
|
+
}
|
|
822
|
+
async enqueueRequest(requestDetails) {
|
|
823
|
+
return this.client.enqueueRequest(requestDetails, this.host, this.constructor.name);
|
|
824
|
+
}
|
|
825
|
+
dispatch(action) {
|
|
826
|
+
this.client.store.dispatch(action);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
const initialState$E = {
|
|
830
|
+
accessToken: "",
|
|
831
|
+
refreshToken: "",
|
|
832
|
+
isLoggedIn: false
|
|
833
|
+
};
|
|
834
|
+
const authSlice = createSlice({
|
|
835
|
+
name: "auth",
|
|
836
|
+
initialState: initialState$E,
|
|
837
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$E)),
|
|
838
|
+
reducers: {
|
|
839
|
+
setTokens: (state, action) => {
|
|
840
|
+
state.accessToken = action.payload.accessToken;
|
|
841
|
+
state.refreshToken = action.payload.refreshToken;
|
|
842
|
+
},
|
|
843
|
+
clearTokens: (state) => {
|
|
844
|
+
state.accessToken = "";
|
|
845
|
+
state.refreshToken = "";
|
|
846
|
+
},
|
|
847
|
+
setLoggedIn: (state, action) => {
|
|
848
|
+
if (!action.payload) {
|
|
849
|
+
authSlice.caseReducers.clearTokens(state);
|
|
850
|
+
}
|
|
851
|
+
state.isLoggedIn = action.payload;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
801
854
|
});
|
|
855
|
+
const { setTokens, clearTokens, setLoggedIn } = authSlice.actions;
|
|
856
|
+
const selectAccessToken = (state) => state.authReducer.accessToken;
|
|
857
|
+
const selectIsLoggedIn = (state) => state.authReducer.isLoggedIn;
|
|
858
|
+
const authReducer = authSlice.reducer;
|
|
802
859
|
function createModelAdapter(computeModelId) {
|
|
803
860
|
const addOne = (state, action) => {
|
|
804
861
|
const id = computeModelId(action.payload);
|
|
@@ -865,11 +922,11 @@ function createModelAdapter(computeModelId) {
|
|
|
865
922
|
};
|
|
866
923
|
}
|
|
867
924
|
const categoryAdapter = createModelAdapter((category) => category.offline_id);
|
|
868
|
-
const initialState$
|
|
925
|
+
const initialState$D = categoryAdapter.getInitialState({});
|
|
869
926
|
const categorySlice = createSlice({
|
|
870
927
|
name: "categories",
|
|
871
|
-
initialState: initialState$
|
|
872
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
928
|
+
initialState: initialState$D,
|
|
929
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$D)),
|
|
873
930
|
reducers: {
|
|
874
931
|
initializeCategories: categoryAdapter.initialize,
|
|
875
932
|
addCategory: categoryAdapter.addOne,
|
|
@@ -913,11 +970,11 @@ const selectIssueCountOfCategory = (categoryId) => (state) => {
|
|
|
913
970
|
};
|
|
914
971
|
const categoryReducer = categorySlice.reducer;
|
|
915
972
|
const assetAdapter = createModelAdapter((asset) => asset.offline_id);
|
|
916
|
-
const initialState$
|
|
973
|
+
const initialState$C = assetAdapter.getInitialState({});
|
|
917
974
|
const assetSlice = createSlice({
|
|
918
975
|
name: "assets",
|
|
919
|
-
initialState: initialState$
|
|
920
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
976
|
+
initialState: initialState$C,
|
|
977
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$C)),
|
|
921
978
|
reducers: {
|
|
922
979
|
initializeAssets: assetAdapter.initialize,
|
|
923
980
|
addAsset: assetAdapter.addOne,
|
|
@@ -969,11 +1026,11 @@ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
|
969
1026
|
};
|
|
970
1027
|
const assetReducer = assetSlice.reducer;
|
|
971
1028
|
const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
972
|
-
const initialState$
|
|
1029
|
+
const initialState$B = assetAttachmentAdapter.getInitialState({});
|
|
973
1030
|
const assetAttachmentSlice = createSlice({
|
|
974
1031
|
name: "assetAttachments",
|
|
975
|
-
initialState: initialState$
|
|
976
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1032
|
+
initialState: initialState$B,
|
|
1033
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
|
|
977
1034
|
reducers: {
|
|
978
1035
|
initializeAssetAttachments: assetAttachmentAdapter.initialize,
|
|
979
1036
|
addAssetAttachment: assetAttachmentAdapter.addOne,
|
|
@@ -1031,78 +1088,98 @@ const selectAttachmentsOfAssetByType = restructureCreateSelectorWithArgs(
|
|
|
1031
1088
|
)
|
|
1032
1089
|
);
|
|
1033
1090
|
const assetAttachmentReducer = assetAttachmentSlice.reducer;
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
|
|
1091
|
+
const assetStageCompletionAdapter = createModelAdapter(
|
|
1092
|
+
(stageCompletion) => stageCompletion.offline_id
|
|
1093
|
+
);
|
|
1094
|
+
const initialState$A = assetStageCompletionAdapter.getInitialState({});
|
|
1037
1095
|
const assetStageCompletionSlice = createSlice({
|
|
1038
1096
|
name: "assetStageCompletions",
|
|
1039
|
-
initialState: initialState$
|
|
1040
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1097
|
+
initialState: initialState$A,
|
|
1098
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
|
|
1041
1099
|
reducers: {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
},
|
|
1050
|
-
addStageCompletions: (state, action) => {
|
|
1051
|
-
for (const [assetId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
|
|
1052
|
-
if (Object.keys(stageIdToCompletionDateMapping).length === 0)
|
|
1053
|
-
throw new Error(`Encountered empty stageIdToCompletionDateMapping argument for asset ${assetId}`);
|
|
1054
|
-
let thisAssetCompletions = state.completionsByAssetId[assetId];
|
|
1055
|
-
if (thisAssetCompletions === void 0) {
|
|
1056
|
-
thisAssetCompletions = {};
|
|
1057
|
-
}
|
|
1058
|
-
for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
|
|
1059
|
-
thisAssetCompletions[stageId] = completionDate;
|
|
1060
|
-
}
|
|
1061
|
-
state.completionsByAssetId[assetId] = thisAssetCompletions;
|
|
1062
|
-
}
|
|
1063
|
-
},
|
|
1064
|
-
removeStageCompletions: (state, action) => {
|
|
1065
|
-
for (const completion of action.payload) {
|
|
1066
|
-
const thisAssetCompletions = state.completionsByAssetId[completion.asset];
|
|
1067
|
-
if (!thisAssetCompletions || !(completion.stage in thisAssetCompletions)) {
|
|
1068
|
-
console.warn(
|
|
1069
|
-
"Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
|
|
1070
|
-
);
|
|
1071
|
-
continue;
|
|
1072
|
-
}
|
|
1073
|
-
delete thisAssetCompletions[completion.stage];
|
|
1074
|
-
}
|
|
1075
|
-
},
|
|
1076
|
-
setStageCompletions: (state, action) => {
|
|
1077
|
-
state.completionsByAssetId = action.payload;
|
|
1078
|
-
}
|
|
1100
|
+
initializeAssetStageCompletions: assetStageCompletionAdapter.initialize,
|
|
1101
|
+
addAssetStageCompletion: assetStageCompletionAdapter.addOne,
|
|
1102
|
+
addAssetStageCompletions: assetStageCompletionAdapter.addMany,
|
|
1103
|
+
updateAssetStageCompletion: assetStageCompletionAdapter.updateOne,
|
|
1104
|
+
updateAssetStageCompletions: assetStageCompletionAdapter.updateMany,
|
|
1105
|
+
deleteAssetStageCompletion: assetStageCompletionAdapter.deleteOne,
|
|
1106
|
+
deleteAssetStageCompletions: assetStageCompletionAdapter.deleteMany
|
|
1079
1107
|
}
|
|
1080
1108
|
});
|
|
1081
|
-
const {
|
|
1082
|
-
|
|
1083
|
-
|
|
1109
|
+
const {
|
|
1110
|
+
initializeAssetStageCompletions,
|
|
1111
|
+
addAssetStageCompletion,
|
|
1112
|
+
addAssetStageCompletions,
|
|
1113
|
+
updateAssetStageCompletion,
|
|
1114
|
+
updateAssetStageCompletions,
|
|
1115
|
+
deleteAssetStageCompletion,
|
|
1116
|
+
deleteAssetStageCompletions
|
|
1117
|
+
} = assetStageCompletionSlice.actions;
|
|
1118
|
+
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1119
|
+
const selectAssetStageCompletionMapping = (state) => {
|
|
1120
|
+
return state.assetStageCompletionReducer.instances;
|
|
1084
1121
|
};
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
|
|
1122
|
+
const selectCompletedStagesByAssetProcedureCompletion = createSelector(
|
|
1123
|
+
[selectAssetStageCompletionMapping],
|
|
1124
|
+
(completedStagesMapping) => {
|
|
1125
|
+
const completedStagesByAsset = {};
|
|
1126
|
+
for (const stageCompletion of Object.values(completedStagesMapping)) {
|
|
1127
|
+
const { asset_procedure_completion, stage, submitted_at } = stageCompletion;
|
|
1128
|
+
if (!completedStagesByAsset[asset_procedure_completion])
|
|
1129
|
+
completedStagesByAsset[asset_procedure_completion] = {};
|
|
1130
|
+
completedStagesByAsset[asset_procedure_completion][stage] = submitted_at;
|
|
1131
|
+
}
|
|
1132
|
+
return completedStagesByAsset;
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
const selectCompletedStageIdsOfAssetProcedureCompletion = restructureCreateSelectorWithArgs(
|
|
1136
|
+
createSelector([selectAssetStageCompletionMapping, (_state, id) => id], (completedStages, id) => {
|
|
1137
|
+
return Object.keys(completedStages[id] ?? {});
|
|
1138
|
+
})
|
|
1139
|
+
);
|
|
1140
|
+
const selectAssetStageCompletionById = (id) => (state) => {
|
|
1141
|
+
return state.assetStageCompletionReducer.instances[id];
|
|
1142
|
+
};
|
|
1143
|
+
const selectAssetStageCompletionsByIds = restructureCreateSelectorWithArgs(
|
|
1144
|
+
createSelector([selectAssetStageCompletionMapping, (_, ids) => ids], (stageCompletionMapping, ids) => {
|
|
1145
|
+
const stageCompletionIdsSet = new Set(ids);
|
|
1146
|
+
return fallbackToEmptyArray(
|
|
1147
|
+
Object.values(stageCompletionMapping).filter(
|
|
1148
|
+
(stageCompletion) => stageCompletionIdsSet.has(stageCompletion.offline_id)
|
|
1149
|
+
)
|
|
1150
|
+
);
|
|
1088
1151
|
})
|
|
1089
1152
|
);
|
|
1090
|
-
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1091
1153
|
const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
|
|
1092
|
-
const initialState$
|
|
1154
|
+
const initialState$z = assetStageAdapter.getInitialState({});
|
|
1093
1155
|
const assetStageSlice = createSlice({
|
|
1094
1156
|
name: "assetStages",
|
|
1095
|
-
initialState: initialState$
|
|
1096
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1157
|
+
initialState: initialState$z,
|
|
1158
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
|
|
1097
1159
|
reducers: {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1160
|
+
initializeAssetStages: assetStageAdapter.initialize,
|
|
1161
|
+
setAssetStage: assetStageAdapter.setOne,
|
|
1162
|
+
setAssetStages: assetStageAdapter.setMany,
|
|
1163
|
+
addAssetStage: assetStageAdapter.addOne,
|
|
1164
|
+
addAssetStages: assetStageAdapter.addMany,
|
|
1165
|
+
updateAssetStage: assetStageAdapter.updateOne,
|
|
1166
|
+
updateAssetStages: assetStageAdapter.updateMany,
|
|
1167
|
+
deleteAssetStage: assetStageAdapter.deleteOne,
|
|
1168
|
+
deleteAssetStages: assetStageAdapter.deleteMany
|
|
1104
1169
|
}
|
|
1105
1170
|
});
|
|
1171
|
+
const {
|
|
1172
|
+
initializeAssetStages,
|
|
1173
|
+
setAssetStage,
|
|
1174
|
+
setAssetStages,
|
|
1175
|
+
addAssetStage,
|
|
1176
|
+
addAssetStages,
|
|
1177
|
+
updateAssetStage,
|
|
1178
|
+
updateAssetStages,
|
|
1179
|
+
deleteAssetStage,
|
|
1180
|
+
deleteAssetStages
|
|
1181
|
+
} = assetStageSlice.actions;
|
|
1182
|
+
const assetStageReducer = assetStageSlice.reducer;
|
|
1106
1183
|
const selectStageMapping = (state) => state.assetStageReducer.instances;
|
|
1107
1184
|
const selectAssetStageById = (id) => (state) => {
|
|
1108
1185
|
return state.assetStageReducer.instances[id];
|
|
@@ -1110,40 +1187,20 @@ const selectAssetStageById = (id) => (state) => {
|
|
|
1110
1187
|
const selectAssetStages = createSelector([selectStageMapping], (stageMapping) => {
|
|
1111
1188
|
return Object.values(stageMapping);
|
|
1112
1189
|
});
|
|
1113
|
-
const
|
|
1114
|
-
createSelector([
|
|
1115
|
-
const
|
|
1116
|
-
const ret = {};
|
|
1117
|
-
for (const stage of stages) {
|
|
1118
|
-
if (assetTypeIdsSet.has(stage.asset_type)) {
|
|
1119
|
-
if (!ret[stage.asset_type]) {
|
|
1120
|
-
ret[stage.asset_type] = [];
|
|
1121
|
-
}
|
|
1122
|
-
ret[stage.asset_type].push(stage);
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
for (const key in ret) {
|
|
1126
|
-
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
1127
|
-
}
|
|
1128
|
-
return ret;
|
|
1129
|
-
})
|
|
1130
|
-
);
|
|
1131
|
-
const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
1132
|
-
createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
|
|
1133
|
-
const assetTypeStagesMapping = {};
|
|
1190
|
+
const selectAssetStagesMappingOfAssetProcedure = restructureCreateSelectorWithArgs(
|
|
1191
|
+
createSelector([selectStageMapping, (_state, id) => id], (stagesMapping, id) => {
|
|
1192
|
+
const assetStageMapping = {};
|
|
1134
1193
|
for (const [stageId, stage] of Object.entries(stagesMapping)) {
|
|
1135
|
-
if (stage.
|
|
1136
|
-
|
|
1194
|
+
if (stage.asset_procedure === id) {
|
|
1195
|
+
assetStageMapping[stageId] = stage;
|
|
1137
1196
|
}
|
|
1138
1197
|
}
|
|
1139
|
-
return
|
|
1198
|
+
return assetStageMapping;
|
|
1140
1199
|
})
|
|
1141
1200
|
);
|
|
1142
|
-
const
|
|
1143
|
-
createSelector([selectAssetStages, (_state,
|
|
1144
|
-
return fallbackToEmptyArray(
|
|
1145
|
-
stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority)
|
|
1146
|
-
);
|
|
1201
|
+
const selectAssetStagesOfAssetProcedure = restructureCreateSelectorWithArgs(
|
|
1202
|
+
createSelector([selectAssetStages, (_state, id) => id], (stages, id) => {
|
|
1203
|
+
return fallbackToEmptyArray(stages.filter((stage) => stage.asset_procedure === id));
|
|
1147
1204
|
})
|
|
1148
1205
|
);
|
|
1149
1206
|
const selectAssetStagesByIds = restructureCreateSelectorWithArgs(
|
|
@@ -1175,21 +1232,35 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
|
1175
1232
|
return ret;
|
|
1176
1233
|
})
|
|
1177
1234
|
);
|
|
1178
|
-
const { initializeStages, setStage, addStages, updateStages, removeStages, updateStage } = assetStageSlice.actions;
|
|
1179
|
-
const assetStageReducer = assetStageSlice.reducer;
|
|
1180
1235
|
const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
|
|
1181
|
-
const initialState$
|
|
1236
|
+
const initialState$y = assetTypeAdapter.getInitialState({});
|
|
1182
1237
|
const assetTypeSlice = createSlice({
|
|
1183
1238
|
name: "assetTypes",
|
|
1184
|
-
initialState: initialState$
|
|
1185
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1239
|
+
initialState: initialState$y,
|
|
1240
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
|
|
1186
1241
|
reducers: {
|
|
1187
1242
|
initializeAssetTypes: assetTypeAdapter.initialize,
|
|
1243
|
+
setAssetType: assetTypeAdapter.setOne,
|
|
1244
|
+
setAssetTypes: assetTypeAdapter.setMany,
|
|
1188
1245
|
addAssetType: assetTypeAdapter.addOne,
|
|
1189
|
-
|
|
1246
|
+
addAssetTypes: assetTypeAdapter.addMany,
|
|
1247
|
+
updateAssetType: assetTypeAdapter.updateOne,
|
|
1248
|
+
updateAssetTypes: assetTypeAdapter.updateMany,
|
|
1249
|
+
deleteAssetType: assetTypeAdapter.deleteOne,
|
|
1250
|
+
deleteAssetTypes: assetTypeAdapter.deleteMany
|
|
1190
1251
|
}
|
|
1191
1252
|
});
|
|
1192
|
-
const {
|
|
1253
|
+
const {
|
|
1254
|
+
initializeAssetTypes,
|
|
1255
|
+
setAssetType,
|
|
1256
|
+
setAssetTypes,
|
|
1257
|
+
addAssetType,
|
|
1258
|
+
addAssetTypes,
|
|
1259
|
+
updateAssetType,
|
|
1260
|
+
updateAssetTypes,
|
|
1261
|
+
deleteAssetType,
|
|
1262
|
+
deleteAssetTypes
|
|
1263
|
+
} = assetTypeSlice.actions;
|
|
1193
1264
|
const selectAssetTypesMapping = (state) => state.assetTypeReducer.instances;
|
|
1194
1265
|
const selectAssetTypes = createSelector(
|
|
1195
1266
|
[selectAssetTypesMapping],
|
|
@@ -1219,11 +1290,11 @@ const assetTypeReducer = assetTypeSlice.reducer;
|
|
|
1219
1290
|
const assetTypeAttachmentAdapter = createModelAdapter(
|
|
1220
1291
|
(attachment) => attachment.offline_id
|
|
1221
1292
|
);
|
|
1222
|
-
const initialState$
|
|
1293
|
+
const initialState$x = assetTypeAttachmentAdapter.getInitialState({});
|
|
1223
1294
|
const assetTypeAttachmentSlice = createSlice({
|
|
1224
1295
|
name: "assetTypeAttachments",
|
|
1225
|
-
initialState: initialState$
|
|
1226
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1296
|
+
initialState: initialState$x,
|
|
1297
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1227
1298
|
reducers: {
|
|
1228
1299
|
initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
|
|
1229
1300
|
addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
|
|
@@ -1282,10 +1353,10 @@ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
|
1282
1353
|
);
|
|
1283
1354
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1284
1355
|
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1285
|
-
const initialState$
|
|
1356
|
+
const initialState$w = workspaceAdapter.getInitialState({});
|
|
1286
1357
|
const workspaceSlice = createSlice({
|
|
1287
1358
|
name: "workspace",
|
|
1288
|
-
initialState: initialState$
|
|
1359
|
+
initialState: initialState$w,
|
|
1289
1360
|
reducers: {
|
|
1290
1361
|
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1291
1362
|
setWorkspaces: workspaceAdapter.setMany,
|
|
@@ -1317,14 +1388,14 @@ const selectPermittedWorkspaceIds = createSelector(
|
|
|
1317
1388
|
const workspaceReducer = workspaceSlice.reducer;
|
|
1318
1389
|
const maxRecentIssues = 10;
|
|
1319
1390
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1320
|
-
const initialState$
|
|
1391
|
+
const initialState$v = issueAdapter.getInitialState({
|
|
1321
1392
|
recentIssueIds: []
|
|
1322
1393
|
});
|
|
1323
1394
|
const issueSlice = createSlice({
|
|
1324
1395
|
name: "issues",
|
|
1325
|
-
initialState: initialState$
|
|
1396
|
+
initialState: initialState$v,
|
|
1326
1397
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1327
|
-
Object.assign(state, initialState$
|
|
1398
|
+
Object.assign(state, initialState$v);
|
|
1328
1399
|
}),
|
|
1329
1400
|
reducers: {
|
|
1330
1401
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1480,12 +1551,12 @@ const selectRecentIssuesAsSearchResults = createSelector(
|
|
|
1480
1551
|
);
|
|
1481
1552
|
const issueReducer = issueSlice.reducer;
|
|
1482
1553
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1483
|
-
const initialState$
|
|
1554
|
+
const initialState$u = issueTypeAdapter.getInitialState({});
|
|
1484
1555
|
const issueTypeSlice = createSlice({
|
|
1485
1556
|
name: "issueTypes",
|
|
1486
|
-
initialState: initialState$
|
|
1557
|
+
initialState: initialState$u,
|
|
1487
1558
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1488
|
-
Object.assign(state, initialState$
|
|
1559
|
+
Object.assign(state, initialState$u);
|
|
1489
1560
|
}),
|
|
1490
1561
|
reducers: {
|
|
1491
1562
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1542,15 +1613,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
|
1542
1613
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1543
1614
|
};
|
|
1544
1615
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1545
|
-
const initialState$
|
|
1616
|
+
const initialState$t = {
|
|
1546
1617
|
s3Urls: {}
|
|
1547
1618
|
};
|
|
1548
1619
|
const msPerHour = 1e3 * 60 * 60;
|
|
1549
1620
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1550
1621
|
const fileSlice = createSlice({
|
|
1551
1622
|
name: "file",
|
|
1552
|
-
initialState: initialState$
|
|
1553
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1623
|
+
initialState: initialState$t,
|
|
1624
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$t)),
|
|
1554
1625
|
reducers: {
|
|
1555
1626
|
setUploadUrl: (state, action) => {
|
|
1556
1627
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1577,73 +1648,14 @@ const selectUploadUrl = (sha1) => (state) => {
|
|
|
1577
1648
|
return url;
|
|
1578
1649
|
};
|
|
1579
1650
|
const fileReducer = fileSlice.reducer;
|
|
1580
|
-
|
|
1581
|
-
ProjectAccessLevel2[ProjectAccessLevel2["BASIC"] = 0] = "BASIC";
|
|
1582
|
-
ProjectAccessLevel2[ProjectAccessLevel2["ADMIN"] = 2] = "ADMIN";
|
|
1583
|
-
return ProjectAccessLevel2;
|
|
1584
|
-
})(ProjectAccessLevel || {});
|
|
1585
|
-
var OrganizationAccessLevel = /* @__PURE__ */ ((OrganizationAccessLevel2) => {
|
|
1586
|
-
OrganizationAccessLevel2[OrganizationAccessLevel2["BASIC"] = 0] = "BASIC";
|
|
1587
|
-
OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
|
|
1588
|
-
return OrganizationAccessLevel2;
|
|
1589
|
-
})(OrganizationAccessLevel || {});
|
|
1590
|
-
var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
|
|
1591
|
-
AttachmentModel2["Issue"] = "issue";
|
|
1592
|
-
AttachmentModel2["Asset"] = "asset";
|
|
1593
|
-
AttachmentModel2["AssetType"] = "asset_type";
|
|
1594
|
-
AttachmentModel2["Project"] = "project";
|
|
1595
|
-
AttachmentModel2["Document"] = "document";
|
|
1596
|
-
return AttachmentModel2;
|
|
1597
|
-
})(AttachmentModel || {});
|
|
1598
|
-
var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
|
|
1599
|
-
IssueUpdateChange2["STATUS"] = "status";
|
|
1600
|
-
IssueUpdateChange2["PRIORITY"] = "priority";
|
|
1601
|
-
IssueUpdateChange2["CATEGORY"] = "category";
|
|
1602
|
-
IssueUpdateChange2["DESCRIPTION"] = "description";
|
|
1603
|
-
IssueUpdateChange2["TITLE"] = "title";
|
|
1604
|
-
IssueUpdateChange2["ASSIGNED_TO"] = "assigned_to";
|
|
1605
|
-
IssueUpdateChange2["DUE_DATE"] = "due_date";
|
|
1606
|
-
return IssueUpdateChange2;
|
|
1607
|
-
})(IssueUpdateChange || {});
|
|
1608
|
-
var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
|
|
1609
|
-
VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
|
|
1610
|
-
VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
|
|
1611
|
-
VerificationCodeType2[VerificationCodeType2["PROJECT_INVITE"] = 4] = "PROJECT_INVITE";
|
|
1612
|
-
VerificationCodeType2[VerificationCodeType2["ORGANIZATION_INVITE"] = 6] = "ORGANIZATION_INVITE";
|
|
1613
|
-
VerificationCodeType2[VerificationCodeType2["ADD_EMAIL_DOMAIN"] = 8] = "ADD_EMAIL_DOMAIN";
|
|
1614
|
-
VerificationCodeType2[VerificationCodeType2["RESET_PASSWORD"] = 10] = "RESET_PASSWORD";
|
|
1615
|
-
return VerificationCodeType2;
|
|
1616
|
-
})(VerificationCodeType || {});
|
|
1617
|
-
var PaddleCheckoutEvent = /* @__PURE__ */ ((PaddleCheckoutEvent2) => {
|
|
1618
|
-
PaddleCheckoutEvent2["COMPLETED"] = "checkout.completed";
|
|
1619
|
-
PaddleCheckoutEvent2["CLOSED"] = "checkout.closed";
|
|
1620
|
-
return PaddleCheckoutEvent2;
|
|
1621
|
-
})(PaddleCheckoutEvent || {});
|
|
1622
|
-
var LicenseLevel = /* @__PURE__ */ ((LicenseLevel2) => {
|
|
1623
|
-
LicenseLevel2[LicenseLevel2["PRO"] = 0] = "PRO";
|
|
1624
|
-
return LicenseLevel2;
|
|
1625
|
-
})(LicenseLevel || {});
|
|
1626
|
-
var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
1627
|
-
LicenseStatus2[LicenseStatus2["ACTIVE"] = 0] = "ACTIVE";
|
|
1628
|
-
LicenseStatus2[LicenseStatus2["PAUSED"] = 2] = "PAUSED";
|
|
1629
|
-
LicenseStatus2[LicenseStatus2["CANCELLED"] = 4] = "CANCELLED";
|
|
1630
|
-
LicenseStatus2[LicenseStatus2["INACTIVE"] = 6] = "INACTIVE";
|
|
1631
|
-
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1632
|
-
return LicenseStatus2;
|
|
1633
|
-
})(LicenseStatus || {});
|
|
1634
|
-
const initialState$p = {
|
|
1651
|
+
const initialState$s = {
|
|
1635
1652
|
users: {},
|
|
1636
|
-
currentUser:
|
|
1637
|
-
id: 0,
|
|
1638
|
-
username: "",
|
|
1639
|
-
email: "",
|
|
1640
|
-
profile: { file: null, file_sha1: null, favourite_project_ids: [], tour_step: -1 }
|
|
1641
|
-
}
|
|
1653
|
+
currentUser: null
|
|
1642
1654
|
};
|
|
1643
1655
|
const userSlice = createSlice({
|
|
1644
1656
|
name: "users",
|
|
1645
|
-
initialState: initialState$
|
|
1646
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1657
|
+
initialState: initialState$s,
|
|
1658
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
|
|
1647
1659
|
reducers: {
|
|
1648
1660
|
setUsers: (state, action) => {
|
|
1649
1661
|
const usersMapping = {};
|
|
@@ -1661,6 +1673,8 @@ const userSlice = createSlice({
|
|
|
1661
1673
|
state.currentUser = action.payload;
|
|
1662
1674
|
},
|
|
1663
1675
|
setProfilePicture: (state, action) => {
|
|
1676
|
+
if (!state.currentUser)
|
|
1677
|
+
return;
|
|
1664
1678
|
state.currentUser.profile.file = action.payload.file ?? null;
|
|
1665
1679
|
state.currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
|
|
1666
1680
|
const currentUser = state.users[state.currentUser.id];
|
|
@@ -1670,32 +1684,12 @@ const userSlice = createSlice({
|
|
|
1670
1684
|
currentUser.profile.file = action.payload.file ?? null;
|
|
1671
1685
|
currentUser.profile.file_sha1 = action.payload.file_sha1 ?? null;
|
|
1672
1686
|
},
|
|
1673
|
-
addFavouriteProjectId: (state, action) => {
|
|
1674
|
-
state.currentUser.profile.favourite_project_ids.push(action.payload);
|
|
1675
|
-
},
|
|
1676
|
-
removeFavouriteProjectId: (state, action) => {
|
|
1677
|
-
state.currentUser.profile.favourite_project_ids = state.currentUser.profile.favourite_project_ids.filter(
|
|
1678
|
-
(id) => id !== action.payload
|
|
1679
|
-
);
|
|
1680
|
-
},
|
|
1681
|
-
setTourStep: (state, action) => {
|
|
1682
|
-
state.currentUser.profile.tour_step = action.payload;
|
|
1683
|
-
},
|
|
1684
1687
|
removeUser: (state, action) => {
|
|
1685
1688
|
delete state.users[action.payload];
|
|
1686
1689
|
}
|
|
1687
1690
|
}
|
|
1688
1691
|
});
|
|
1689
|
-
const {
|
|
1690
|
-
setCurrentUser,
|
|
1691
|
-
setProfilePicture,
|
|
1692
|
-
setUsers,
|
|
1693
|
-
addUsers,
|
|
1694
|
-
addFavouriteProjectId,
|
|
1695
|
-
removeFavouriteProjectId,
|
|
1696
|
-
setTourStep,
|
|
1697
|
-
removeUser
|
|
1698
|
-
} = userSlice.actions;
|
|
1692
|
+
const { setCurrentUser, setProfilePicture, setUsers, addUsers, removeUser } = userSlice.actions;
|
|
1699
1693
|
const userReducer = userSlice.reducer;
|
|
1700
1694
|
const selectCurrentUser = (state) => state.userReducer.currentUser;
|
|
1701
1695
|
const selectUsersMapping = (state) => state.userReducer.users;
|
|
@@ -1716,15 +1710,14 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1716
1710
|
return fallbackToEmptyArray(users);
|
|
1717
1711
|
})
|
|
1718
1712
|
);
|
|
1719
|
-
const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
|
|
1720
1713
|
const organizationAccessAdapter = createModelAdapter(
|
|
1721
1714
|
(organizationAccess) => organizationAccess.offline_id
|
|
1722
1715
|
);
|
|
1723
|
-
const initialState$
|
|
1716
|
+
const initialState$r = organizationAccessAdapter.getInitialState({});
|
|
1724
1717
|
const organizationAccessSlice = createSlice({
|
|
1725
1718
|
name: "organizationAccess",
|
|
1726
|
-
initialState: initialState$
|
|
1727
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1719
|
+
initialState: initialState$r,
|
|
1720
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1728
1721
|
reducers: {
|
|
1729
1722
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1730
1723
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1742,7 +1735,7 @@ const selectActiveOrganizationAccess = createSelector(
|
|
|
1742
1735
|
[selectCurrentUser, selectOrganizationAccesses],
|
|
1743
1736
|
(currentUser, organizationAccesses) => {
|
|
1744
1737
|
const activeOrganizationAccess = Object.values(organizationAccesses).find(
|
|
1745
|
-
(organizationAccess) => organizationAccess.user === currentUser.id
|
|
1738
|
+
(organizationAccess) => organizationAccess.user === (currentUser == null ? void 0 : currentUser.id)
|
|
1746
1739
|
);
|
|
1747
1740
|
return activeOrganizationAccess ?? null;
|
|
1748
1741
|
}
|
|
@@ -1761,11 +1754,11 @@ const selectOrganizationAccessUserMapping = (state) => {
|
|
|
1761
1754
|
};
|
|
1762
1755
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1763
1756
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1764
|
-
const initialState$
|
|
1757
|
+
const initialState$q = licenseAdapter.getInitialState({});
|
|
1765
1758
|
const licenseSlice = createSlice({
|
|
1766
1759
|
name: "license",
|
|
1767
|
-
initialState: initialState$
|
|
1768
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1760
|
+
initialState: initialState$q,
|
|
1761
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1769
1762
|
reducers: {
|
|
1770
1763
|
initializeLicences: licenseAdapter.initialize,
|
|
1771
1764
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1790,11 +1783,11 @@ const selectLicensesForProjectsMapping = createSelector(
|
|
|
1790
1783
|
);
|
|
1791
1784
|
const licenseReducer = licenseSlice.reducer;
|
|
1792
1785
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1793
|
-
const initialState$
|
|
1786
|
+
const initialState$p = projectAccessAdapter.getInitialState({});
|
|
1794
1787
|
const projectAccessSlice = createSlice({
|
|
1795
1788
|
name: "projectAccess",
|
|
1796
|
-
initialState: initialState$
|
|
1797
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1789
|
+
initialState: initialState$p,
|
|
1790
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1798
1791
|
reducers: {
|
|
1799
1792
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1800
1793
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1835,14 +1828,14 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1835
1828
|
return projectAccesses;
|
|
1836
1829
|
};
|
|
1837
1830
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1838
|
-
const initialState$
|
|
1831
|
+
const initialState$o = {
|
|
1839
1832
|
projects: {},
|
|
1840
1833
|
activeProjectId: null
|
|
1841
1834
|
};
|
|
1842
1835
|
const projectSlice = createSlice({
|
|
1843
1836
|
name: "projects",
|
|
1844
|
-
initialState: initialState$
|
|
1845
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1837
|
+
initialState: initialState$o,
|
|
1838
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1846
1839
|
reducers: {
|
|
1847
1840
|
setProjects: (state, action) => {
|
|
1848
1841
|
const projectsMap = {};
|
|
@@ -1932,9 +1925,9 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1932
1925
|
[selectCurrentUser, selectProjectUsersAsMapping, selectProjectAccessUserMapping],
|
|
1933
1926
|
(currentUser, userMapping, projectAccessMapping) => {
|
|
1934
1927
|
return Object.values(userMapping).sort((userA, userB) => {
|
|
1935
|
-
if (userA.id === currentUser.id) {
|
|
1928
|
+
if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
1936
1929
|
return -1;
|
|
1937
|
-
} else if (userB.id === currentUser.id) {
|
|
1930
|
+
} else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
1938
1931
|
return 1;
|
|
1939
1932
|
}
|
|
1940
1933
|
const projectAccessesA = projectAccessMapping[userA.id];
|
|
@@ -1949,13 +1942,13 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1949
1942
|
});
|
|
1950
1943
|
}
|
|
1951
1944
|
);
|
|
1952
|
-
const initialState$
|
|
1945
|
+
const initialState$n = {
|
|
1953
1946
|
organizations: {}
|
|
1954
1947
|
};
|
|
1955
1948
|
const organizationSlice = createSlice({
|
|
1956
1949
|
name: "organizations",
|
|
1957
|
-
initialState: initialState$
|
|
1958
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1950
|
+
initialState: initialState$n,
|
|
1951
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1959
1952
|
reducers: {
|
|
1960
1953
|
setOrganizations: (state, action) => {
|
|
1961
1954
|
for (const org of action.payload) {
|
|
@@ -2011,9 +2004,9 @@ const selectSortedOrganizationUsers = createSelector(
|
|
|
2011
2004
|
[selectCurrentUser, selectOrganizationUsersAsMapping, selectOrganizationAccessUserMapping],
|
|
2012
2005
|
(currentUser, userMapping, organizationAccessMapping) => {
|
|
2013
2006
|
return Object.values(userMapping).sort((userA, userB) => {
|
|
2014
|
-
if (userA.id === currentUser.id) {
|
|
2007
|
+
if (userA.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
2015
2008
|
return -1;
|
|
2016
|
-
} else if (userB.id === currentUser.id) {
|
|
2009
|
+
} else if (userB.id === (currentUser == null ? void 0 : currentUser.id)) {
|
|
2017
2010
|
return 1;
|
|
2018
2011
|
}
|
|
2019
2012
|
const organizationAccessesA = organizationAccessMapping[userA.id];
|
|
@@ -2046,14 +2039,14 @@ const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
|
2046
2039
|
}
|
|
2047
2040
|
};
|
|
2048
2041
|
};
|
|
2049
|
-
const initialState$
|
|
2042
|
+
const initialState$m = {
|
|
2050
2043
|
deletedRequests: [],
|
|
2051
2044
|
latestRetryTime: 0
|
|
2052
2045
|
};
|
|
2053
2046
|
const outboxSlice = createSlice({
|
|
2054
2047
|
name: "outbox",
|
|
2055
|
-
initialState: initialState$
|
|
2056
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2048
|
+
initialState: initialState$m,
|
|
2049
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
2057
2050
|
reducers: {
|
|
2058
2051
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2059
2052
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2085,15 +2078,15 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
|
|
|
2085
2078
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2086
2079
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2087
2080
|
const outboxReducer = outboxSlice.reducer;
|
|
2088
|
-
const initialState$
|
|
2081
|
+
const initialState$l = {
|
|
2089
2082
|
projectFiles: {},
|
|
2090
2083
|
activeProjectFileId: null,
|
|
2091
2084
|
isImportingProjectFile: false
|
|
2092
2085
|
};
|
|
2093
2086
|
const projectFileSlice = createSlice({
|
|
2094
2087
|
name: "projectFiles",
|
|
2095
|
-
initialState: initialState$
|
|
2096
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2088
|
+
initialState: initialState$l,
|
|
2089
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
2097
2090
|
reducers: {
|
|
2098
2091
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2099
2092
|
for (let fileObj of action.payload) {
|
|
@@ -2180,11 +2173,11 @@ const selectProjectFileById = (id) => (state) => {
|
|
|
2180
2173
|
};
|
|
2181
2174
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2182
2175
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2183
|
-
const initialState$
|
|
2176
|
+
const initialState$k = projectAttachmentAdapter.getInitialState({});
|
|
2184
2177
|
const projectAttachmentSlice = createSlice({
|
|
2185
2178
|
name: "projectAttachments",
|
|
2186
|
-
initialState: initialState$
|
|
2187
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2179
|
+
initialState: initialState$k,
|
|
2180
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2188
2181
|
reducers: {
|
|
2189
2182
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2190
2183
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2239,12 +2232,12 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
|
2239
2232
|
)
|
|
2240
2233
|
);
|
|
2241
2234
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2242
|
-
const initialState$
|
|
2235
|
+
const initialState$j = {
|
|
2243
2236
|
isRehydrated: false
|
|
2244
2237
|
};
|
|
2245
2238
|
const rehydratedSlice = createSlice({
|
|
2246
2239
|
name: "rehydrated",
|
|
2247
|
-
initialState: initialState$
|
|
2240
|
+
initialState: initialState$j,
|
|
2248
2241
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2249
2242
|
reducers: {
|
|
2250
2243
|
setRehydrated: (state, action) => {
|
|
@@ -2269,11 +2262,11 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
|
2269
2262
|
}
|
|
2270
2263
|
};
|
|
2271
2264
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2272
|
-
const initialState$
|
|
2265
|
+
const initialState$i = formRevisionAdapter.getInitialState({});
|
|
2273
2266
|
const formRevisionsSlice = createSlice({
|
|
2274
2267
|
name: "formRevisions",
|
|
2275
|
-
initialState: initialState$
|
|
2276
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2268
|
+
initialState: initialState$i,
|
|
2269
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2277
2270
|
reducers: {
|
|
2278
2271
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2279
2272
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2345,11 +2338,11 @@ const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping
|
|
|
2345
2338
|
});
|
|
2346
2339
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2347
2340
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2348
|
-
const initialState$
|
|
2341
|
+
const initialState$h = formAdapter.getInitialState({});
|
|
2349
2342
|
const formSlice = createSlice({
|
|
2350
2343
|
name: "forms",
|
|
2351
|
-
initialState: initialState$
|
|
2352
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2344
|
+
initialState: initialState$h,
|
|
2345
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
|
|
2353
2346
|
reducers: {
|
|
2354
2347
|
initializeForms: formAdapter.initialize,
|
|
2355
2348
|
setForm: formAdapter.setOne,
|
|
@@ -2375,18 +2368,29 @@ const selectFilteredForms = restructureCreateSelectorWithArgs(
|
|
|
2375
2368
|
(_state, search) => search
|
|
2376
2369
|
],
|
|
2377
2370
|
(formsMapping, revisions, search) => {
|
|
2378
|
-
const { searchTerm, maxResults, organization } = search;
|
|
2371
|
+
const { searchTerm, maxResults, favorites, organization } = search;
|
|
2372
|
+
const favoriteMatches = [];
|
|
2379
2373
|
const regularMatches = [];
|
|
2380
2374
|
for (const [formId, form] of Object.entries(formsMapping)) {
|
|
2375
|
+
if (favorites !== void 0 && form.favorite != favorites)
|
|
2376
|
+
continue;
|
|
2381
2377
|
if (Number.isInteger(organization) && organization !== form.organization) {
|
|
2382
2378
|
continue;
|
|
2383
2379
|
}
|
|
2384
2380
|
const latestRevision = _selectLatestFormRevision(revisions, formId);
|
|
2385
2381
|
if (latestRevision.title.toLowerCase().includes(searchTerm.toLowerCase())) {
|
|
2386
|
-
|
|
2382
|
+
if (form.favorite) {
|
|
2383
|
+
favoriteMatches.push({ ...form, latestRevision });
|
|
2384
|
+
} else {
|
|
2385
|
+
regularMatches.push({ ...form, latestRevision });
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
if (favoriteMatches.length >= maxResults) {
|
|
2389
|
+
break;
|
|
2387
2390
|
}
|
|
2388
2391
|
}
|
|
2389
|
-
|
|
2392
|
+
const maxRegularMatches = maxResults - favoriteMatches.length;
|
|
2393
|
+
return [...favoriteMatches, ...regularMatches.slice(0, maxRegularMatches)];
|
|
2390
2394
|
},
|
|
2391
2395
|
// as the argument is an object, we check the first level of properties for equality
|
|
2392
2396
|
{ memoizeOptions: { equalityCheck: shallowEqual } }
|
|
@@ -2418,11 +2422,11 @@ const selectGeneralFormCount = createSelector([selectFormMapping], (formsMapping
|
|
|
2418
2422
|
return Object.values(formsMapping).filter((form) => !form.asset_type).length;
|
|
2419
2423
|
});
|
|
2420
2424
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2421
|
-
const initialState$
|
|
2425
|
+
const initialState$g = submissionAdapter.getInitialState({});
|
|
2422
2426
|
const formSubmissionSlice = createSlice({
|
|
2423
2427
|
name: "formSubmissions",
|
|
2424
|
-
initialState: initialState$
|
|
2425
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2428
|
+
initialState: initialState$g,
|
|
2429
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2426
2430
|
reducers: {
|
|
2427
2431
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2428
2432
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2634,11 +2638,11 @@ const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
|
2634
2638
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2635
2639
|
(attachment) => attachment.offline_id
|
|
2636
2640
|
);
|
|
2637
|
-
const initialState$
|
|
2641
|
+
const initialState$f = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2638
2642
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2639
2643
|
name: "formSubmissionAttachments",
|
|
2640
|
-
initialState: initialState$
|
|
2641
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2644
|
+
initialState: initialState$f,
|
|
2645
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2642
2646
|
reducers: {
|
|
2643
2647
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2644
2648
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2690,11 +2694,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2690
2694
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2691
2695
|
(attachment) => attachment.offline_id
|
|
2692
2696
|
);
|
|
2693
|
-
const initialState$
|
|
2697
|
+
const initialState$e = formRevisionAttachmentAdapter.getInitialState({});
|
|
2694
2698
|
const formRevisionAttachmentSlice = createSlice({
|
|
2695
2699
|
name: "formRevisionAttachments",
|
|
2696
|
-
initialState: initialState$
|
|
2697
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2700
|
+
initialState: initialState$e,
|
|
2701
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2698
2702
|
reducers: {
|
|
2699
2703
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2700
2704
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2733,10 +2737,10 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2733
2737
|
);
|
|
2734
2738
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2735
2739
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2736
|
-
const initialState$
|
|
2740
|
+
const initialState$d = emailDomainAdapter.getInitialState({});
|
|
2737
2741
|
const emailDomainsSlice = createSlice({
|
|
2738
2742
|
name: "emailDomains",
|
|
2739
|
-
initialState: initialState$
|
|
2743
|
+
initialState: initialState$d,
|
|
2740
2744
|
reducers: {
|
|
2741
2745
|
initializeEmailDomains: emailDomainAdapter.initialize,
|
|
2742
2746
|
addEmailDomain: emailDomainAdapter.addOne,
|
|
@@ -2757,14 +2761,14 @@ const selectEmailDomainsOfOrganization = restructureCreateSelectorWithArgs(
|
|
|
2757
2761
|
)
|
|
2758
2762
|
);
|
|
2759
2763
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
2760
|
-
const initialState$
|
|
2764
|
+
const initialState$c = {
|
|
2761
2765
|
documents: {}
|
|
2762
2766
|
};
|
|
2763
2767
|
const documentSlice = createSlice({
|
|
2764
2768
|
name: "documents",
|
|
2765
|
-
initialState: initialState$
|
|
2769
|
+
initialState: initialState$c,
|
|
2766
2770
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2767
|
-
Object.assign(state, initialState$
|
|
2771
|
+
Object.assign(state, initialState$c);
|
|
2768
2772
|
}),
|
|
2769
2773
|
reducers: {
|
|
2770
2774
|
setDocuments: (state, action) => {
|
|
@@ -2953,11 +2957,11 @@ const selectRootDocuments = createSelector(
|
|
|
2953
2957
|
);
|
|
2954
2958
|
const documentsReducer = documentSlice.reducer;
|
|
2955
2959
|
const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2956
|
-
const initialState$
|
|
2960
|
+
const initialState$b = documentAttachmentAdapter.getInitialState({});
|
|
2957
2961
|
const documentAttachmentSlice = createSlice({
|
|
2958
2962
|
name: "documentAttachments",
|
|
2959
|
-
initialState: initialState$
|
|
2960
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2963
|
+
initialState: initialState$b,
|
|
2964
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
2961
2965
|
reducers: {
|
|
2962
2966
|
initializeDocumentAttachments: documentAttachmentAdapter.initialize,
|
|
2963
2967
|
addDocumentAttachment: documentAttachmentAdapter.addOne,
|
|
@@ -3016,11 +3020,11 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
|
|
|
3016
3020
|
);
|
|
3017
3021
|
const documentAttachmentReducer = documentAttachmentSlice.reducer;
|
|
3018
3022
|
const teamAdapter = createModelAdapter((team) => team.offline_id);
|
|
3019
|
-
const initialState$
|
|
3023
|
+
const initialState$a = teamAdapter.getInitialState({});
|
|
3020
3024
|
const teamSlice = createSlice({
|
|
3021
3025
|
name: "teams",
|
|
3022
|
-
initialState: initialState$
|
|
3023
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3026
|
+
initialState: initialState$a,
|
|
3027
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
|
|
3024
3028
|
reducers: {
|
|
3025
3029
|
setTeam: teamAdapter.setOne,
|
|
3026
3030
|
initializeTeams: teamAdapter.initialize,
|
|
@@ -3071,11 +3075,11 @@ const teamReducer = teamSlice.reducer;
|
|
|
3071
3075
|
const agentUserConversationAdapter = createModelAdapter(
|
|
3072
3076
|
(conversation) => conversation.offline_id
|
|
3073
3077
|
);
|
|
3074
|
-
const initialState$
|
|
3078
|
+
const initialState$9 = agentUserConversationAdapter.getInitialState({});
|
|
3075
3079
|
const agentsSlice = createSlice({
|
|
3076
3080
|
name: "agents",
|
|
3077
|
-
initialState: initialState$
|
|
3078
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3081
|
+
initialState: initialState$9,
|
|
3082
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
|
|
3079
3083
|
reducers: {
|
|
3080
3084
|
initializeConversations: agentUserConversationAdapter.initialize,
|
|
3081
3085
|
addConversation: agentUserConversationAdapter.addOne,
|
|
@@ -3097,11 +3101,11 @@ const selectConversation = restructureCreateSelectorWithArgs(
|
|
|
3097
3101
|
);
|
|
3098
3102
|
const agentsReducer = agentsSlice.reducer;
|
|
3099
3103
|
const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
|
|
3100
|
-
const initialState$
|
|
3104
|
+
const initialState$8 = issueCommentAdapter.getInitialState({});
|
|
3101
3105
|
const issueCommentSlice = createSlice({
|
|
3102
3106
|
name: "issueComments",
|
|
3103
|
-
initialState: initialState$
|
|
3104
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3107
|
+
initialState: initialState$8,
|
|
3108
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
3105
3109
|
reducers: {
|
|
3106
3110
|
addIssueComment: issueCommentAdapter.addOne,
|
|
3107
3111
|
addIssueComments: issueCommentAdapter.addMany,
|
|
@@ -3130,11 +3134,11 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3130
3134
|
);
|
|
3131
3135
|
const issueCommentReducer = issueCommentSlice.reducer;
|
|
3132
3136
|
const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
|
|
3133
|
-
const initialState$
|
|
3137
|
+
const initialState$7 = issueUpdateAdapter.getInitialState({});
|
|
3134
3138
|
const issueUpdateSlice = createSlice({
|
|
3135
3139
|
name: "issueUpdates",
|
|
3136
|
-
initialState: initialState$
|
|
3137
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3140
|
+
initialState: initialState$7,
|
|
3141
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3138
3142
|
reducers: {
|
|
3139
3143
|
initializeIssueUpdates: issueUpdateAdapter.setMany,
|
|
3140
3144
|
setIssueUpdate: issueUpdateAdapter.setOne,
|
|
@@ -3163,11 +3167,11 @@ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
|
3163
3167
|
);
|
|
3164
3168
|
const issueUpdateReducer = issueUpdateSlice.reducer;
|
|
3165
3169
|
const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
3166
|
-
const initialState$
|
|
3170
|
+
const initialState$6 = issueAttachmentAdapter.getInitialState({});
|
|
3167
3171
|
const issueAttachmentSlice = createSlice({
|
|
3168
3172
|
name: "issueAttachments",
|
|
3169
|
-
initialState: initialState$
|
|
3170
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3173
|
+
initialState: initialState$6,
|
|
3174
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3171
3175
|
reducers: {
|
|
3172
3176
|
initializeIssueAttachments: issueAttachmentAdapter.initialize,
|
|
3173
3177
|
addIssueAttachment: issueAttachmentAdapter.addOne,
|
|
@@ -3225,23 +3229,23 @@ const selectAttachmentsOfIssueByType = restructureCreateSelectorWithArgs(
|
|
|
3225
3229
|
)
|
|
3226
3230
|
);
|
|
3227
3231
|
const issueAttachmentReducer = issueAttachmentSlice.reducer;
|
|
3228
|
-
const initialState$
|
|
3232
|
+
const initialState$5 = {
|
|
3229
3233
|
version: 0
|
|
3230
3234
|
};
|
|
3231
3235
|
const versioningSlice = createSlice({
|
|
3232
3236
|
name: "versioning",
|
|
3233
|
-
initialState: initialState$
|
|
3237
|
+
initialState: initialState$5,
|
|
3234
3238
|
reducers: {}
|
|
3235
3239
|
});
|
|
3236
3240
|
const versioningReducer = versioningSlice.reducer;
|
|
3237
3241
|
const geoImageAdapter = createModelAdapter((model) => model.offline_id);
|
|
3238
|
-
const initialState$
|
|
3242
|
+
const initialState$4 = geoImageAdapter.getInitialState({});
|
|
3239
3243
|
const geoImageSlice = createSlice({
|
|
3240
3244
|
name: "geoImages",
|
|
3241
|
-
initialState: initialState$
|
|
3245
|
+
initialState: initialState$4,
|
|
3242
3246
|
extraReducers: (builder) => {
|
|
3243
3247
|
builder.addCase("RESET", (state) => {
|
|
3244
|
-
Object.assign(state, initialState$
|
|
3248
|
+
Object.assign(state, initialState$4);
|
|
3245
3249
|
});
|
|
3246
3250
|
},
|
|
3247
3251
|
reducers: {
|
|
@@ -3279,11 +3283,11 @@ const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
|
|
|
3279
3283
|
);
|
|
3280
3284
|
const geoImageReducer = geoImageSlice.reducer;
|
|
3281
3285
|
const issueAssociationAdapter = createModelAdapter((assoc) => assoc.offline_id);
|
|
3282
|
-
const initialState = issueAssociationAdapter.getInitialState({});
|
|
3286
|
+
const initialState$3 = issueAssociationAdapter.getInitialState({});
|
|
3283
3287
|
const issueAssociationSlice = createSlice({
|
|
3284
|
-
name: "issueAssociations",
|
|
3285
|
-
initialState,
|
|
3286
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3288
|
+
name: "issueAssociations",
|
|
3289
|
+
initialState: initialState$3,
|
|
3290
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
|
|
3287
3291
|
reducers: {
|
|
3288
3292
|
initializeIssueAssociations: issueAssociationAdapter.initialize,
|
|
3289
3293
|
addIssueAssociation: issueAssociationAdapter.addOne,
|
|
@@ -3341,34 +3345,224 @@ const selectIssueAssociationsOfAsset = restructureCreateSelectorWithArgs(
|
|
|
3341
3345
|
)
|
|
3342
3346
|
);
|
|
3343
3347
|
const issueAssociationReducer = issueAssociationSlice.reducer;
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
constructor(sdk) {
|
|
3361
|
-
__publicField(this, "client");
|
|
3362
|
-
CLASS_NAME_TO_SERVICE[this.constructor.name] = this;
|
|
3363
|
-
this.client = sdk;
|
|
3348
|
+
const assetProcedureAdapter = createModelAdapter((assetProcedure) => assetProcedure.offline_id);
|
|
3349
|
+
const initialState$2 = assetProcedureAdapter.getInitialState({});
|
|
3350
|
+
const assetProcedureSlice = createSlice({
|
|
3351
|
+
name: "assetProcedures",
|
|
3352
|
+
initialState: initialState$2,
|
|
3353
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
3354
|
+
reducers: {
|
|
3355
|
+
initializeAssetProcedures: assetProcedureAdapter.initialize,
|
|
3356
|
+
addAssetProcedure: assetProcedureAdapter.addOne,
|
|
3357
|
+
addAssetProcedures: assetProcedureAdapter.addMany,
|
|
3358
|
+
setAssetProcedure: assetProcedureAdapter.setOne,
|
|
3359
|
+
setAssetProcedures: assetProcedureAdapter.setMany,
|
|
3360
|
+
updateAssetProcedure: assetProcedureAdapter.updateOne,
|
|
3361
|
+
updateAssetProcedures: assetProcedureAdapter.updateMany,
|
|
3362
|
+
deleteAssetProcedure: assetProcedureAdapter.deleteOne,
|
|
3363
|
+
deleteAssetProcedures: assetProcedureAdapter.deleteMany
|
|
3364
3364
|
}
|
|
3365
|
-
|
|
3366
|
-
|
|
3365
|
+
});
|
|
3366
|
+
const {
|
|
3367
|
+
initializeAssetProcedures,
|
|
3368
|
+
addAssetProcedure,
|
|
3369
|
+
addAssetProcedures,
|
|
3370
|
+
updateAssetProcedure,
|
|
3371
|
+
updateAssetProcedures,
|
|
3372
|
+
deleteAssetProcedure,
|
|
3373
|
+
deleteAssetProcedures,
|
|
3374
|
+
setAssetProcedure,
|
|
3375
|
+
setAssetProcedures
|
|
3376
|
+
} = assetProcedureSlice.actions;
|
|
3377
|
+
const selectAssetProceduresMapping = (state) => state.assetProcedureReducer.instances;
|
|
3378
|
+
const selectAssetProcedures = createSelector([selectAssetProceduresMapping], (assetProceduresMapping) => {
|
|
3379
|
+
return Object.values(assetProceduresMapping);
|
|
3380
|
+
});
|
|
3381
|
+
const selectAssetProceduresOfOrganization = restructureCreateSelectorWithArgs(
|
|
3382
|
+
createSelector(
|
|
3383
|
+
[selectAssetProcedures, (_state, organizationId) => organizationId],
|
|
3384
|
+
(assetProcedures, organizationId) => {
|
|
3385
|
+
return fallbackToEmptyArray(
|
|
3386
|
+
assetProcedures.filter((assetProcedure) => assetProcedure.organization === organizationId)
|
|
3387
|
+
);
|
|
3388
|
+
}
|
|
3389
|
+
)
|
|
3390
|
+
);
|
|
3391
|
+
const selectAssetProcedureById = (assetProcedureId) => (state) => {
|
|
3392
|
+
return state.assetProcedureReducer.instances[assetProcedureId];
|
|
3393
|
+
};
|
|
3394
|
+
const selectAssetProceduresByIds = restructureCreateSelectorWithArgs(
|
|
3395
|
+
createSelector(
|
|
3396
|
+
[selectAssetProceduresMapping, (_, assetProcedureIds) => assetProcedureIds],
|
|
3397
|
+
(assetProceduresMapping, assetProcedureIds) => {
|
|
3398
|
+
const assetProcedures = [];
|
|
3399
|
+
for (const assetProcedureId of assetProcedureIds) {
|
|
3400
|
+
const assetProcedure = assetProceduresMapping[assetProcedureId];
|
|
3401
|
+
if (assetProcedure)
|
|
3402
|
+
assetProcedures.push(assetProcedure);
|
|
3403
|
+
}
|
|
3404
|
+
return fallbackToEmptyArray(assetProcedures);
|
|
3405
|
+
}
|
|
3406
|
+
)
|
|
3407
|
+
);
|
|
3408
|
+
const assetProcedureReducer = assetProcedureSlice.reducer;
|
|
3409
|
+
const assetProcedureInstanceAdapter = createModelAdapter(
|
|
3410
|
+
(assetProcedureInstance) => assetProcedureInstance.offline_id
|
|
3411
|
+
);
|
|
3412
|
+
const initialState$1 = assetProcedureInstanceAdapter.getInitialState({});
|
|
3413
|
+
const assetProcedureInstanceSlice = createSlice({
|
|
3414
|
+
name: "assetProcedureInstances",
|
|
3415
|
+
initialState: initialState$1,
|
|
3416
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
|
|
3417
|
+
reducers: {
|
|
3418
|
+
initializeAssetProcedureInstances: assetProcedureInstanceAdapter.initialize,
|
|
3419
|
+
addAssetProcedureInstance: assetProcedureInstanceAdapter.addOne,
|
|
3420
|
+
addAssetProcedureInstances: assetProcedureInstanceAdapter.addMany,
|
|
3421
|
+
setAssetProcedureInstance: assetProcedureInstanceAdapter.setOne,
|
|
3422
|
+
setAssetProcedureInstances: assetProcedureInstanceAdapter.setMany,
|
|
3423
|
+
updateAssetProcedureInstance: assetProcedureInstanceAdapter.updateOne,
|
|
3424
|
+
updateAssetProcedureInstances: assetProcedureInstanceAdapter.updateMany,
|
|
3425
|
+
deleteAssetProcedureInstance: assetProcedureInstanceAdapter.deleteOne,
|
|
3426
|
+
deleteAssetProcedureInstances: assetProcedureInstanceAdapter.deleteMany
|
|
3367
3427
|
}
|
|
3368
|
-
|
|
3369
|
-
|
|
3428
|
+
});
|
|
3429
|
+
const {
|
|
3430
|
+
initializeAssetProcedureInstances,
|
|
3431
|
+
addAssetProcedureInstance,
|
|
3432
|
+
addAssetProcedureInstances,
|
|
3433
|
+
updateAssetProcedureInstance,
|
|
3434
|
+
updateAssetProcedureInstances,
|
|
3435
|
+
deleteAssetProcedureInstance,
|
|
3436
|
+
deleteAssetProcedureInstances,
|
|
3437
|
+
setAssetProcedureInstance,
|
|
3438
|
+
setAssetProcedureInstances
|
|
3439
|
+
} = assetProcedureInstanceSlice.actions;
|
|
3440
|
+
const selectAssetProcedureInstancesMapping = (state) => state.assetProcedureInstanceReducer.instances;
|
|
3441
|
+
const selectAssetProcedureInstances = createSelector(
|
|
3442
|
+
[selectAssetProcedureInstancesMapping],
|
|
3443
|
+
(assetProcedureInstancesMapping) => {
|
|
3444
|
+
return Object.values(assetProcedureInstancesMapping);
|
|
3370
3445
|
}
|
|
3371
|
-
|
|
3446
|
+
);
|
|
3447
|
+
const selectAssetProcedureInstancesOfAssetProcedure = restructureCreateSelectorWithArgs(
|
|
3448
|
+
createSelector(
|
|
3449
|
+
[selectAssetProcedureInstances, (_state, assetProcedureId) => assetProcedureId],
|
|
3450
|
+
(assetProcedureInstances, assetProcedureId) => {
|
|
3451
|
+
return fallbackToEmptyArray(
|
|
3452
|
+
assetProcedureInstances.filter(
|
|
3453
|
+
(assetProcedureInstance) => assetProcedureInstance.asset_procedure === assetProcedureId
|
|
3454
|
+
)
|
|
3455
|
+
);
|
|
3456
|
+
}
|
|
3457
|
+
)
|
|
3458
|
+
);
|
|
3459
|
+
const selectAssetProcedureInstancesOfAssetType = restructureCreateSelectorWithArgs(
|
|
3460
|
+
createSelector(
|
|
3461
|
+
[selectAssetProcedureInstances, (_state, assetTypeId) => assetTypeId],
|
|
3462
|
+
(assetProcedureInstances, assetTypeId) => {
|
|
3463
|
+
return fallbackToEmptyArray(
|
|
3464
|
+
assetProcedureInstances.filter(
|
|
3465
|
+
(assetProcedureInstance) => assetProcedureInstance.asset_type === assetTypeId
|
|
3466
|
+
)
|
|
3467
|
+
);
|
|
3468
|
+
}
|
|
3469
|
+
)
|
|
3470
|
+
);
|
|
3471
|
+
const selectAssetProcedureInstanceById = (assetProcedureInstanceId) => (state) => {
|
|
3472
|
+
return state.assetProcedureInstanceReducer.instances[assetProcedureInstanceId];
|
|
3473
|
+
};
|
|
3474
|
+
const selectAssetProcedureInstancesByIds = restructureCreateSelectorWithArgs(
|
|
3475
|
+
createSelector(
|
|
3476
|
+
[selectAssetProcedureInstancesMapping, (_, assetProcedureInstanceIds) => assetProcedureInstanceIds],
|
|
3477
|
+
(assetProcedureInstancesMapping, assetProcedureInstanceIds) => {
|
|
3478
|
+
const assetProcedureInstances = [];
|
|
3479
|
+
for (const assetProcedureInstanceId of assetProcedureInstanceIds) {
|
|
3480
|
+
const assetProcedureInstance = assetProcedureInstancesMapping[assetProcedureInstanceId];
|
|
3481
|
+
if (assetProcedureInstance)
|
|
3482
|
+
assetProcedureInstances.push(assetProcedureInstance);
|
|
3483
|
+
}
|
|
3484
|
+
return fallbackToEmptyArray(assetProcedureInstances);
|
|
3485
|
+
}
|
|
3486
|
+
)
|
|
3487
|
+
);
|
|
3488
|
+
const assetProcedureInstanceReducer = assetProcedureInstanceSlice.reducer;
|
|
3489
|
+
const assetProcedureCompletionAdapter = createModelAdapter(
|
|
3490
|
+
(assetProcedureCompletion) => assetProcedureCompletion.offline_id
|
|
3491
|
+
);
|
|
3492
|
+
const initialState = assetProcedureCompletionAdapter.getInitialState({});
|
|
3493
|
+
const assetProcedureCompletionSlice = createSlice({
|
|
3494
|
+
name: "assetProcedureCompletions",
|
|
3495
|
+
initialState,
|
|
3496
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState)),
|
|
3497
|
+
reducers: {
|
|
3498
|
+
initializeAssetProcedureCompletions: assetProcedureCompletionAdapter.initialize,
|
|
3499
|
+
addAssetProcedureCompletion: assetProcedureCompletionAdapter.addOne,
|
|
3500
|
+
addAssetProcedureCompletions: assetProcedureCompletionAdapter.addMany,
|
|
3501
|
+
setAssetProcedureCompletion: assetProcedureCompletionAdapter.setOne,
|
|
3502
|
+
setAssetProcedureCompletions: assetProcedureCompletionAdapter.setMany,
|
|
3503
|
+
updateAssetProcedureCompletion: assetProcedureCompletionAdapter.updateOne,
|
|
3504
|
+
updateAssetProcedureCompletions: assetProcedureCompletionAdapter.updateMany,
|
|
3505
|
+
deleteAssetProcedureCompletion: assetProcedureCompletionAdapter.deleteOne,
|
|
3506
|
+
deleteAssetProcedureCompletions: assetProcedureCompletionAdapter.deleteMany
|
|
3507
|
+
}
|
|
3508
|
+
});
|
|
3509
|
+
const {
|
|
3510
|
+
initializeAssetProcedureCompletions,
|
|
3511
|
+
addAssetProcedureCompletion,
|
|
3512
|
+
addAssetProcedureCompletions,
|
|
3513
|
+
updateAssetProcedureCompletion,
|
|
3514
|
+
updateAssetProcedureCompletions,
|
|
3515
|
+
deleteAssetProcedureCompletion,
|
|
3516
|
+
deleteAssetProcedureCompletions,
|
|
3517
|
+
setAssetProcedureCompletion,
|
|
3518
|
+
setAssetProcedureCompletions
|
|
3519
|
+
} = assetProcedureCompletionSlice.actions;
|
|
3520
|
+
const assetProcedureCompletionReducer = assetProcedureCompletionSlice.reducer;
|
|
3521
|
+
const selectAssetProcedureCompletionsMapping = (state) => state.assetProcedureCompletionReducer.instances;
|
|
3522
|
+
const selectAssetProcedureCompletions = createSelector(
|
|
3523
|
+
[selectAssetProcedureCompletionsMapping],
|
|
3524
|
+
(assetProcedureCompletionsMapping) => {
|
|
3525
|
+
return Object.values(assetProcedureCompletionsMapping);
|
|
3526
|
+
}
|
|
3527
|
+
);
|
|
3528
|
+
const selectAssetProcedureCompletionsOfAsset = restructureCreateSelectorWithArgs(
|
|
3529
|
+
createSelector(
|
|
3530
|
+
[selectAssetProcedureCompletions, (_state, id) => id],
|
|
3531
|
+
(assetProcedureCompletions, id) => {
|
|
3532
|
+
return fallbackToEmptyArray(
|
|
3533
|
+
assetProcedureCompletions.filter(
|
|
3534
|
+
(assetProcedureCompletion) => assetProcedureCompletion.asset === id
|
|
3535
|
+
)
|
|
3536
|
+
);
|
|
3537
|
+
}
|
|
3538
|
+
)
|
|
3539
|
+
);
|
|
3540
|
+
const selectAssetProcedureCompletionsOfAssetProcedureInstance = restructureCreateSelectorWithArgs(
|
|
3541
|
+
createSelector([selectAssetProcedureCompletions, (_state, id) => id], (assetProcedureCompletions, id) => {
|
|
3542
|
+
return fallbackToEmptyArray(
|
|
3543
|
+
assetProcedureCompletions.filter(
|
|
3544
|
+
(assetProcedureCompletion) => assetProcedureCompletion.asset_procedure_instance === id
|
|
3545
|
+
)
|
|
3546
|
+
);
|
|
3547
|
+
})
|
|
3548
|
+
);
|
|
3549
|
+
const selectAssetProcedureCompletionById = (assetProcedureCompletionId) => (state) => {
|
|
3550
|
+
return state.assetProcedureCompletionReducer.instances[assetProcedureCompletionId];
|
|
3551
|
+
};
|
|
3552
|
+
const selectAssetProcedureCompletionsByIds = restructureCreateSelectorWithArgs(
|
|
3553
|
+
createSelector(
|
|
3554
|
+
[selectAssetProcedureCompletionsMapping, (_, ids) => ids],
|
|
3555
|
+
(assetProcedureCompletionsMapping, ids) => {
|
|
3556
|
+
const assetProcedureCompletions = [];
|
|
3557
|
+
for (const assetProcedureCompletionId of ids) {
|
|
3558
|
+
const assetProcedureCompletion = assetProcedureCompletionsMapping[assetProcedureCompletionId];
|
|
3559
|
+
if (assetProcedureCompletion)
|
|
3560
|
+
assetProcedureCompletions.push(assetProcedureCompletion);
|
|
3561
|
+
}
|
|
3562
|
+
return fallbackToEmptyArray(assetProcedureCompletions);
|
|
3563
|
+
}
|
|
3564
|
+
)
|
|
3565
|
+
);
|
|
3372
3566
|
const VERSION_REDUCER_KEY = "versioning";
|
|
3373
3567
|
const overmapReducers = {
|
|
3374
3568
|
// TODO: attachmentReducer,
|
|
@@ -3413,11 +3607,62 @@ const overmapReducers = {
|
|
|
3413
3607
|
};
|
|
3414
3608
|
const overmapReducer = combineReducers(overmapReducers);
|
|
3415
3609
|
const resetStore = "RESET";
|
|
3610
|
+
function handleWorkspaceRemoval(draft, action) {
|
|
3611
|
+
const workspaceId = action.payload;
|
|
3612
|
+
const issuesVisibleInWorkspace = Object.values(draft.issueReducer.instances).filter(
|
|
3613
|
+
(issue) => issue.visible_in_workspaces.includes(workspaceId)
|
|
3614
|
+
);
|
|
3615
|
+
const mainWorkspace = selectMainWorkspace(draft);
|
|
3616
|
+
if (!mainWorkspace) {
|
|
3617
|
+
throw new Error("Main workspace not found");
|
|
3618
|
+
}
|
|
3619
|
+
if (action.payload === mainWorkspace.offline_id) {
|
|
3620
|
+
throw new Error("Tried to delete main workspace");
|
|
3621
|
+
}
|
|
3622
|
+
const categoriesInThisWorkspace = new Set(
|
|
3623
|
+
selectCategoriesOfWorkspace(workspaceId)(draft).map((category) => category.offline_id)
|
|
3624
|
+
);
|
|
3625
|
+
for (const issue of issuesVisibleInWorkspace) {
|
|
3626
|
+
if (issue.category && categoriesInThisWorkspace.has(issue.category)) {
|
|
3627
|
+
issue.category = null;
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
const issuesWithThisWorkspaceIndex = issuesVisibleInWorkspace.filter(
|
|
3631
|
+
(issue) => issue.index_workspace === action.payload
|
|
3632
|
+
);
|
|
3633
|
+
for (const issue of issuesWithThisWorkspaceIndex) {
|
|
3634
|
+
issue.index_workspace = mainWorkspace.offline_id;
|
|
3635
|
+
if (!issue.visible_in_workspaces.includes(mainWorkspace.offline_id)) {
|
|
3636
|
+
issue.visible_in_workspaces.push(mainWorkspace.offline_id);
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
for (const issue of issuesVisibleInWorkspace) {
|
|
3640
|
+
const indexOfWorkspace = issue.visible_in_workspaces.indexOf(workspaceId);
|
|
3641
|
+
if (indexOfWorkspace === -1) {
|
|
3642
|
+
throw new Error("Workspace not found in issue's visible_in_workspaces");
|
|
3643
|
+
}
|
|
3644
|
+
issue.visible_in_workspaces.splice(indexOfWorkspace, 1);
|
|
3645
|
+
}
|
|
3646
|
+
for (const issue of issuesVisibleInWorkspace) {
|
|
3647
|
+
if (issue.visible_in_workspaces.length === 0) {
|
|
3648
|
+
throw new Error(`Unexpected error: Issue ${issue.offline_id} has no visible_in_workspaces`);
|
|
3649
|
+
}
|
|
3650
|
+
if (issue.index_workspace === action.payload || !issue.index_workspace) {
|
|
3651
|
+
throw new Error(`Failed to update index_workspace of issue ${issue.offline_id} to main workspace`);
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3416
3655
|
const overmapRootReducer = (state, action) => {
|
|
3417
3656
|
if (action.type === "auth/setLoggedIn" && !action.payload) {
|
|
3418
3657
|
return overmapReducer(void 0, action);
|
|
3419
3658
|
}
|
|
3420
|
-
|
|
3659
|
+
let mutatedState = state;
|
|
3660
|
+
if (state && action.type === "workspace/removeWorkspace") {
|
|
3661
|
+
mutatedState = createNextState(state, (draft) => {
|
|
3662
|
+
handleWorkspaceRemoval(draft, action);
|
|
3663
|
+
});
|
|
3664
|
+
}
|
|
3665
|
+
return overmapReducer(mutatedState, action);
|
|
3421
3666
|
};
|
|
3422
3667
|
let __OUTBOX_COORDINATOR = null;
|
|
3423
3668
|
function getOutboxCoordinator() {
|
|
@@ -4036,17 +4281,10 @@ class BaseApiService extends BaseService {
|
|
|
4036
4281
|
}
|
|
4037
4282
|
}
|
|
4038
4283
|
class CategoryService extends BaseApiService {
|
|
4039
|
-
add(
|
|
4040
|
-
const
|
|
4041
|
-
const
|
|
4042
|
-
|
|
4043
|
-
const offlineCategory = offline({
|
|
4044
|
-
...payload,
|
|
4045
|
-
created_by: createdBy,
|
|
4046
|
-
submitted_at: submittedAt,
|
|
4047
|
-
workspace: workspaceId
|
|
4048
|
-
});
|
|
4049
|
-
this.dispatch(addCategory(offlineCategory));
|
|
4284
|
+
add(category, workspaceId) {
|
|
4285
|
+
const offlineCategory = offline(category);
|
|
4286
|
+
const categoryWithWorkspace = { ...offlineCategory, workspace: workspaceId };
|
|
4287
|
+
this.dispatch(addCategory(categoryWithWorkspace));
|
|
4050
4288
|
const promise = this.enqueueRequest({
|
|
4051
4289
|
description: "Create Category",
|
|
4052
4290
|
method: HttpMethod.POST,
|
|
@@ -4055,10 +4293,10 @@ class CategoryService extends BaseApiService {
|
|
|
4055
4293
|
workspace_id: workspaceId.toString()
|
|
4056
4294
|
},
|
|
4057
4295
|
payload: offlineCategory,
|
|
4058
|
-
blockers: [
|
|
4296
|
+
blockers: [],
|
|
4059
4297
|
blocks: [offlineCategory.offline_id]
|
|
4060
4298
|
});
|
|
4061
|
-
return [
|
|
4299
|
+
return [categoryWithWorkspace, promise];
|
|
4062
4300
|
}
|
|
4063
4301
|
update(category, workspaceId) {
|
|
4064
4302
|
const state = this.client.store.getState();
|
|
@@ -4116,43 +4354,70 @@ function chunkArray(arr, chunkSize) {
|
|
|
4116
4354
|
return chunks;
|
|
4117
4355
|
}
|
|
4118
4356
|
class AssetService extends BaseApiService {
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
if (!
|
|
4357
|
+
add(payload) {
|
|
4358
|
+
const { store } = this.client;
|
|
4359
|
+
if (!payload.canvas_marker && !payload.geo_marker) {
|
|
4122
4360
|
throw new Error("Asset must have either a canvas_marker or geo_marker");
|
|
4123
4361
|
}
|
|
4124
|
-
const
|
|
4362
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
4363
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4364
|
+
const offlineAsset = offline({
|
|
4365
|
+
...payload,
|
|
4366
|
+
created_by: createdBy,
|
|
4367
|
+
submitted_at: submittedAt
|
|
4368
|
+
});
|
|
4125
4369
|
this.dispatch(addAsset(offlineAsset));
|
|
4126
4370
|
const promise = this.enqueueRequest({
|
|
4127
4371
|
description: "Create asset",
|
|
4128
4372
|
method: HttpMethod.POST,
|
|
4129
|
-
url:
|
|
4130
|
-
|
|
4131
|
-
|
|
4373
|
+
url: "/assets/",
|
|
4374
|
+
payload: {
|
|
4375
|
+
offline_id: offlineAsset.offline_id,
|
|
4376
|
+
submitted_at: offlineAsset.submitted_at,
|
|
4377
|
+
geo_marker: offlineAsset.geo_marker,
|
|
4378
|
+
canvas_marker: offlineAsset.canvas_marker,
|
|
4379
|
+
label: offlineAsset.label,
|
|
4380
|
+
description: offlineAsset.description,
|
|
4381
|
+
asset_type: offlineAsset.asset_type
|
|
4132
4382
|
},
|
|
4133
|
-
|
|
4134
|
-
blockers: [],
|
|
4383
|
+
blockers: [offlineAsset.asset_type],
|
|
4135
4384
|
blocks: [offlineAsset.offline_id]
|
|
4136
4385
|
});
|
|
4386
|
+
promise.then((createdAsset) => {
|
|
4387
|
+
this.dispatch(updateAsset(createdAsset));
|
|
4388
|
+
}).catch(() => {
|
|
4389
|
+
this.dispatch(deleteAsset(offlineAsset.offline_id));
|
|
4390
|
+
});
|
|
4137
4391
|
return [offlineAsset, promise];
|
|
4138
4392
|
}
|
|
4139
|
-
update(
|
|
4140
|
-
|
|
4393
|
+
update(payload) {
|
|
4394
|
+
const { store } = this.client;
|
|
4395
|
+
if (!payload.canvas_marker && !payload.geo_marker) {
|
|
4141
4396
|
throw new Error("Asset must have either a canvas_marker or geo_marker");
|
|
4142
4397
|
}
|
|
4143
|
-
|
|
4398
|
+
const asset = selectAssetById(payload.offline_id)(store.getState());
|
|
4399
|
+
if (!asset) {
|
|
4400
|
+
throw new Error(`No asset with id ${payload.offline_id} found in the store`);
|
|
4401
|
+
}
|
|
4402
|
+
const updatedAsset = {
|
|
4403
|
+
...asset,
|
|
4404
|
+
...payload
|
|
4405
|
+
};
|
|
4406
|
+
this.dispatch(updateAsset(updatedAsset));
|
|
4144
4407
|
const promise = this.enqueueRequest({
|
|
4145
4408
|
description: "Edit asset",
|
|
4146
4409
|
method: HttpMethod.PATCH,
|
|
4147
|
-
url: `/assets/${
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4410
|
+
url: `/assets/${payload.offline_id}/`,
|
|
4411
|
+
payload,
|
|
4412
|
+
blockers: [payload.offline_id],
|
|
4413
|
+
blocks: [payload.offline_id]
|
|
4414
|
+
});
|
|
4415
|
+
promise.then((result) => {
|
|
4416
|
+
this.dispatch(updateAsset(result));
|
|
4417
|
+
}).catch(() => {
|
|
4418
|
+
this.dispatch(updateAsset(asset));
|
|
4154
4419
|
});
|
|
4155
|
-
return [
|
|
4420
|
+
return [updatedAsset, promise];
|
|
4156
4421
|
}
|
|
4157
4422
|
async remove(assetId) {
|
|
4158
4423
|
const { store } = this.client;
|
|
@@ -4190,39 +4455,17 @@ class AssetService extends BaseApiService {
|
|
|
4190
4455
|
throw err;
|
|
4191
4456
|
});
|
|
4192
4457
|
}
|
|
4193
|
-
|
|
4194
|
-
const { store } = this.client;
|
|
4195
|
-
const state = store.getState();
|
|
4196
|
-
const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
|
|
4197
|
-
const allAssetsOfAssetTypeIds = allAssetsOfAssetType.map((c) => c.offline_id);
|
|
4198
|
-
const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
|
|
4199
|
-
store.dispatch(deleteAssets(allAssetsOfAssetTypeIds));
|
|
4200
|
-
return this.enqueueRequest({
|
|
4201
|
-
description: "Delete all assets of asset type",
|
|
4202
|
-
method: HttpMethod.DELETE,
|
|
4203
|
-
url: `/assets/types/${assetTypeId}/delete-all-of-type/`,
|
|
4204
|
-
blockers: affectedOfflineIds,
|
|
4205
|
-
blocks: affectedOfflineIds
|
|
4206
|
-
}).catch((err) => {
|
|
4207
|
-
store.dispatch(addAssets(allAssetsOfAssetType));
|
|
4208
|
-
throw err;
|
|
4209
|
-
});
|
|
4210
|
-
}
|
|
4211
|
-
// TODO: payload does not require asset_type
|
|
4212
|
-
bulkAdd(assetsToCreate, workspaceId, assetTypeId, batchSize) {
|
|
4458
|
+
bulkAdd(payloads, assetTypeId, batchSize) {
|
|
4213
4459
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4214
4460
|
const transactionId = v4();
|
|
4215
|
-
const assetBatches = chunkArray(
|
|
4216
|
-
const assetPayloads = assetBatch.map((assetPayload) =>
|
|
4217
|
-
return offline({
|
|
4218
|
-
...assetPayload,
|
|
4219
|
-
submitted_at: submittedAt
|
|
4220
|
-
});
|
|
4221
|
-
});
|
|
4461
|
+
const assetBatches = chunkArray(payloads, batchSize).map((assetBatch) => {
|
|
4462
|
+
const assetPayloads = assetBatch.map((assetPayload) => offline(assetPayload));
|
|
4222
4463
|
return {
|
|
4223
4464
|
batchId: v4(),
|
|
4224
4465
|
payload: {
|
|
4225
4466
|
transaction_id: transactionId,
|
|
4467
|
+
submitted_at: submittedAt,
|
|
4468
|
+
asset_type: assetTypeId,
|
|
4226
4469
|
assets: assetPayloads
|
|
4227
4470
|
}
|
|
4228
4471
|
};
|
|
@@ -4240,10 +4483,7 @@ class AssetService extends BaseApiService {
|
|
|
4240
4483
|
const promise = this.enqueueRequest({
|
|
4241
4484
|
description: "Batch create assets",
|
|
4242
4485
|
method: HttpMethod.POST,
|
|
4243
|
-
url:
|
|
4244
|
-
queryParams: {
|
|
4245
|
-
workspace_id: workspaceId.toString()
|
|
4246
|
-
},
|
|
4486
|
+
url: "/assets/bulk/",
|
|
4247
4487
|
payload,
|
|
4248
4488
|
blockers,
|
|
4249
4489
|
blocks
|
|
@@ -4261,7 +4501,10 @@ class AssetService extends BaseApiService {
|
|
|
4261
4501
|
const result = await this.enqueueRequest({
|
|
4262
4502
|
description: "Get assets",
|
|
4263
4503
|
method: HttpMethod.GET,
|
|
4264
|
-
url:
|
|
4504
|
+
url: "/assets/",
|
|
4505
|
+
queryParams: {
|
|
4506
|
+
project_id: projectId.toString()
|
|
4507
|
+
},
|
|
4265
4508
|
blockers: [],
|
|
4266
4509
|
blocks: []
|
|
4267
4510
|
});
|
|
@@ -4269,154 +4512,217 @@ class AssetService extends BaseApiService {
|
|
|
4269
4512
|
}
|
|
4270
4513
|
}
|
|
4271
4514
|
class AssetStageCompletionService extends BaseApiService {
|
|
4272
|
-
add(
|
|
4273
|
-
var _a2;
|
|
4515
|
+
add(payload) {
|
|
4274
4516
|
const { store } = this.client;
|
|
4275
|
-
const
|
|
4276
|
-
|
|
4277
|
-
throw new Error(`Asset with offline_id ${assetId} not found`);
|
|
4278
|
-
}
|
|
4517
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
4518
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4279
4519
|
const offlineStageCompletion = offline({
|
|
4280
|
-
|
|
4281
|
-
|
|
4520
|
+
...payload,
|
|
4521
|
+
created_by: createdBy,
|
|
4522
|
+
submitted_at: submittedAt
|
|
4282
4523
|
});
|
|
4283
|
-
this.dispatch(
|
|
4524
|
+
this.dispatch(addAssetStageCompletion(offlineStageCompletion));
|
|
4284
4525
|
const promise = this.enqueueRequest({
|
|
4285
|
-
description: "
|
|
4526
|
+
description: "Add asset stage completion",
|
|
4286
4527
|
method: HttpMethod.POST,
|
|
4287
|
-
url:
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4528
|
+
url: "/asset-stage-completions/",
|
|
4529
|
+
payload: {
|
|
4530
|
+
offline_id: offlineStageCompletion.offline_id,
|
|
4531
|
+
submitted_at: submittedAt,
|
|
4532
|
+
asset_procedure_completion: payload.asset_procedure_completion,
|
|
4533
|
+
stage: payload.stage
|
|
4534
|
+
},
|
|
4535
|
+
blockers: [payload.asset_procedure_completion, payload.stage],
|
|
4291
4536
|
blocks: [offlineStageCompletion.offline_id]
|
|
4292
4537
|
});
|
|
4538
|
+
promise.then((result) => {
|
|
4539
|
+
this.dispatch(updateAssetStageCompletion(result));
|
|
4540
|
+
}).catch(() => {
|
|
4541
|
+
this.dispatch(deleteAssetStageCompletion(offlineStageCompletion.offline_id));
|
|
4542
|
+
});
|
|
4293
4543
|
return [offlineStageCompletion, promise];
|
|
4294
4544
|
}
|
|
4295
|
-
|
|
4296
|
-
const
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4545
|
+
delete(id) {
|
|
4546
|
+
const { store } = this.client;
|
|
4547
|
+
const assetStageCompletion = selectAssetStageCompletionById(id)(store.getState());
|
|
4548
|
+
if (!assetStageCompletion) {
|
|
4549
|
+
throw new Error(`Expected asset stage completion with id ${id} to exist`);
|
|
4550
|
+
}
|
|
4551
|
+
this.dispatch(deleteAssetStageCompletion(id));
|
|
4552
|
+
const promise = this.enqueueRequest({
|
|
4553
|
+
description: "Delete asset stage completion",
|
|
4554
|
+
method: HttpMethod.DELETE,
|
|
4555
|
+
url: `/asset-stage-completions/${id}/`,
|
|
4556
|
+
blockers: [id],
|
|
4301
4557
|
blocks: []
|
|
4302
4558
|
});
|
|
4303
|
-
|
|
4559
|
+
promise.catch(() => {
|
|
4560
|
+
this.dispatch(addAssetStageCompletion(assetStageCompletion));
|
|
4561
|
+
});
|
|
4562
|
+
return promise;
|
|
4304
4563
|
}
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
}
|
|
4322
|
-
this.dispatch(addStageCompletions(asMapping));
|
|
4323
|
-
await this.enqueueRequest({
|
|
4324
|
-
description: "Bulk complete stages",
|
|
4564
|
+
bulkAdd(payloads) {
|
|
4565
|
+
const { store } = this.client;
|
|
4566
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4567
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
4568
|
+
const payload = payloads.map((payload2) => offline(payload2));
|
|
4569
|
+
const offlineStageCompletions = payload.map((completion) => {
|
|
4570
|
+
return {
|
|
4571
|
+
...completion,
|
|
4572
|
+
created_by: createdBy,
|
|
4573
|
+
submitted_at: submittedAt
|
|
4574
|
+
};
|
|
4575
|
+
});
|
|
4576
|
+
const offlineIds = offlineStageCompletions.map(({ offline_id }) => offline_id);
|
|
4577
|
+
this.dispatch(addAssetStageCompletions(offlineStageCompletions));
|
|
4578
|
+
const promise = this.enqueueRequest({
|
|
4579
|
+
description: "Bulk create asset stage completions",
|
|
4325
4580
|
method: HttpMethod.POST,
|
|
4326
|
-
url:
|
|
4581
|
+
url: "/asset-stage-completions/bulk/",
|
|
4327
4582
|
payload: {
|
|
4328
|
-
|
|
4583
|
+
submitted_at: submittedAt,
|
|
4584
|
+
completions: payload
|
|
4329
4585
|
},
|
|
4330
|
-
blockers: [
|
|
4331
|
-
blocks:
|
|
4586
|
+
blockers: [...payloads.map((c) => c.asset_procedure_completion), ...payloads.map((c) => c.stage)],
|
|
4587
|
+
blocks: offlineIds
|
|
4332
4588
|
});
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
asset: assetId,
|
|
4338
|
-
stage: stageId
|
|
4339
|
-
};
|
|
4589
|
+
promise.then((result) => {
|
|
4590
|
+
this.dispatch(updateAssetStageCompletions(result));
|
|
4591
|
+
}).catch(() => {
|
|
4592
|
+
this.dispatch(deleteAssetStageCompletions(offlineIds));
|
|
4340
4593
|
});
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4594
|
+
return [offlineStageCompletions, promise];
|
|
4595
|
+
}
|
|
4596
|
+
bulkDelete(ids) {
|
|
4597
|
+
const { store } = this.client;
|
|
4598
|
+
const assetStageCompletions = selectAssetStageCompletionsByIds(ids)(store.getState());
|
|
4599
|
+
this.dispatch(deleteAssetStageCompletions(ids));
|
|
4600
|
+
const promise = this.enqueueRequest({
|
|
4601
|
+
description: "Deleting asset stage completions",
|
|
4345
4602
|
method: HttpMethod.DELETE,
|
|
4346
|
-
url:
|
|
4603
|
+
url: "/asset-stage-completions/bulk/",
|
|
4347
4604
|
payload: {
|
|
4348
|
-
|
|
4605
|
+
completion_ids: ids
|
|
4606
|
+
},
|
|
4607
|
+
blockers: ids,
|
|
4608
|
+
blocks: []
|
|
4609
|
+
});
|
|
4610
|
+
promise.catch(() => {
|
|
4611
|
+
this.dispatch(addAssetStageCompletions(assetStageCompletions));
|
|
4612
|
+
});
|
|
4613
|
+
return promise;
|
|
4614
|
+
}
|
|
4615
|
+
async refreshStore(projectId) {
|
|
4616
|
+
const result = await this.enqueueRequest({
|
|
4617
|
+
description: "Get asset stage completions",
|
|
4618
|
+
method: HttpMethod.GET,
|
|
4619
|
+
url: "/asset-stage-completions/",
|
|
4620
|
+
queryParams: {
|
|
4621
|
+
project_id: projectId.toString()
|
|
4349
4622
|
},
|
|
4350
|
-
blockers: [
|
|
4623
|
+
blockers: [],
|
|
4351
4624
|
blocks: []
|
|
4352
4625
|
});
|
|
4626
|
+
this.dispatch(initializeAssetStageCompletions(result));
|
|
4353
4627
|
}
|
|
4354
4628
|
}
|
|
4355
4629
|
class AssetStageService extends BaseApiService {
|
|
4356
|
-
|
|
4630
|
+
bulkAdd(stagesToSubmit, assetProcedureId) {
|
|
4631
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4632
|
+
const createdBy = this.client.store.getState().userReducer.currentUser.id;
|
|
4357
4633
|
const payload = stagesToSubmit.map((stage) => {
|
|
4358
4634
|
return offline(stage);
|
|
4359
4635
|
});
|
|
4360
|
-
const
|
|
4361
|
-
return { ...stage,
|
|
4636
|
+
const offlineStages = payload.map((stage) => {
|
|
4637
|
+
return { ...stage, asset_procedure: assetProcedureId, created_by: createdBy, submitted_at: submittedAt };
|
|
4362
4638
|
});
|
|
4363
|
-
this.dispatch(
|
|
4364
|
-
|
|
4639
|
+
this.dispatch(addAssetStages(offlineStages));
|
|
4640
|
+
const promise = this.enqueueRequest({
|
|
4365
4641
|
description: "Add asset stages",
|
|
4366
4642
|
method: HttpMethod.POST,
|
|
4367
|
-
url:
|
|
4643
|
+
url: "/asset-stages/bulk/",
|
|
4368
4644
|
payload: {
|
|
4645
|
+
submitted_at: submittedAt,
|
|
4646
|
+
asset_procedure: assetProcedureId,
|
|
4369
4647
|
stages: payload
|
|
4370
4648
|
},
|
|
4371
|
-
|
|
4372
|
-
workspace_id: workspaceId.toString()
|
|
4373
|
-
},
|
|
4374
|
-
blockers: [assetTypeId, workspaceId],
|
|
4649
|
+
blockers: [assetProcedureId],
|
|
4375
4650
|
blocks: payload.map(({ offline_id }) => offline_id)
|
|
4376
4651
|
});
|
|
4652
|
+
promise.then((result) => {
|
|
4653
|
+
this.dispatch(updateAssetStages(result));
|
|
4654
|
+
}).catch(() => {
|
|
4655
|
+
this.dispatch(deleteAssetStages(offlineStages.map(({ offline_id }) => offline_id)));
|
|
4656
|
+
});
|
|
4657
|
+
return [offlineStages, promise];
|
|
4377
4658
|
}
|
|
4378
|
-
async
|
|
4659
|
+
async bulkUpdate(stagesToUpdate, assetProcedureId) {
|
|
4379
4660
|
const store = this.client.store;
|
|
4380
4661
|
const state = store.getState();
|
|
4381
4662
|
const prevStages = selectAssetStagesByIds(stagesToUpdate.map(({ offline_id }) => offline_id))(state);
|
|
4382
|
-
this.dispatch(
|
|
4663
|
+
this.dispatch(updateAssetStages(stagesToUpdate));
|
|
4383
4664
|
return this.enqueueRequest({
|
|
4384
4665
|
description: "Edit asset stages",
|
|
4385
4666
|
method: HttpMethod.PATCH,
|
|
4386
|
-
url: `/
|
|
4667
|
+
url: `/asset-procedures/${assetProcedureId}/bulk-update-stages/`,
|
|
4387
4668
|
payload: {
|
|
4388
4669
|
stages: stagesToUpdate
|
|
4389
4670
|
},
|
|
4390
|
-
blockers: [
|
|
4671
|
+
blockers: [assetProcedureId],
|
|
4391
4672
|
blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
|
|
4392
4673
|
}).catch((e) => {
|
|
4393
|
-
|
|
4674
|
+
this.dispatch(updateAssetStages(prevStages));
|
|
4394
4675
|
throw e;
|
|
4395
4676
|
});
|
|
4396
4677
|
}
|
|
4397
4678
|
async bulkDelete(idsToDelete) {
|
|
4398
|
-
this.
|
|
4399
|
-
|
|
4679
|
+
const { store } = this.client;
|
|
4680
|
+
const assetStages = selectAssetStagesByIds(idsToDelete)(store.getState());
|
|
4681
|
+
this.dispatch(deleteAssetStages(idsToDelete));
|
|
4682
|
+
const promise = this.enqueueRequest({
|
|
4400
4683
|
description: "Delete asset stages",
|
|
4401
4684
|
method: HttpMethod.DELETE,
|
|
4402
|
-
url: "/
|
|
4685
|
+
url: "/asset-stages/bulk/",
|
|
4403
4686
|
payload: {
|
|
4404
4687
|
stage_ids: idsToDelete
|
|
4405
4688
|
},
|
|
4406
4689
|
blockers: idsToDelete,
|
|
4407
4690
|
blocks: []
|
|
4408
4691
|
});
|
|
4692
|
+
promise.catch(() => {
|
|
4693
|
+
this.dispatch(addAssetStages(assetStages));
|
|
4694
|
+
});
|
|
4695
|
+
return promise;
|
|
4409
4696
|
}
|
|
4410
|
-
|
|
4411
|
-
this.
|
|
4412
|
-
|
|
4697
|
+
update(payload) {
|
|
4698
|
+
const { store } = this.client;
|
|
4699
|
+
const assetStage = selectAssetStageById(payload.offline_id)(store.getState());
|
|
4700
|
+
if (!assetStage)
|
|
4701
|
+
throw new Error(`No asset stage with id ${payload.offline_id} found in the store`);
|
|
4702
|
+
const updatedAssetStage = {
|
|
4703
|
+
...assetStage,
|
|
4704
|
+
...payload
|
|
4705
|
+
};
|
|
4706
|
+
this.dispatch(updateAssetStage(updatedAssetStage));
|
|
4707
|
+
const promise = this.enqueueRequest({
|
|
4413
4708
|
description: "Update asset stage",
|
|
4414
4709
|
method: HttpMethod.PATCH,
|
|
4415
|
-
url: `/
|
|
4416
|
-
payload:
|
|
4710
|
+
url: `/asset-stages/${assetStage.offline_id}/`,
|
|
4711
|
+
payload: {
|
|
4712
|
+
name: payload.name,
|
|
4713
|
+
description: payload.description,
|
|
4714
|
+
priority: payload.priority,
|
|
4715
|
+
color: payload.color
|
|
4716
|
+
},
|
|
4417
4717
|
blockers: [assetStage.offline_id],
|
|
4418
4718
|
blocks: [assetStage.offline_id]
|
|
4419
4719
|
});
|
|
4720
|
+
promise.then((result) => {
|
|
4721
|
+
this.dispatch(updateAssetStage(result));
|
|
4722
|
+
}).catch(() => {
|
|
4723
|
+
this.dispatch(setAssetStage(assetStage));
|
|
4724
|
+
});
|
|
4725
|
+
return [updatedAssetStage, promise];
|
|
4420
4726
|
}
|
|
4421
4727
|
async linkForm(stageId, formId) {
|
|
4422
4728
|
const { store } = this.client;
|
|
@@ -4424,18 +4730,18 @@ class AssetStageService extends BaseApiService {
|
|
|
4424
4730
|
if (!stage) {
|
|
4425
4731
|
throw new Error(`No asset stage with id ${stageId} found in the store`);
|
|
4426
4732
|
}
|
|
4427
|
-
this.dispatch(
|
|
4733
|
+
this.dispatch(updateAssetStage({ ...stage, form: formId }));
|
|
4428
4734
|
try {
|
|
4429
4735
|
await this.enqueueRequest({
|
|
4430
4736
|
description: "Link asset stage to form",
|
|
4431
4737
|
method: HttpMethod.POST,
|
|
4432
|
-
url: `/
|
|
4738
|
+
url: `/asset-stages/${stageId}/associate-with-form/`,
|
|
4433
4739
|
payload: { form: formId },
|
|
4434
4740
|
blockers: [stageId, formId],
|
|
4435
4741
|
blocks: [stageId]
|
|
4436
4742
|
});
|
|
4437
4743
|
} catch (e) {
|
|
4438
|
-
this.dispatch(
|
|
4744
|
+
this.dispatch(setAssetStage(stage));
|
|
4439
4745
|
throw e;
|
|
4440
4746
|
}
|
|
4441
4747
|
}
|
|
@@ -4445,29 +4751,32 @@ class AssetStageService extends BaseApiService {
|
|
|
4445
4751
|
if (!stage) {
|
|
4446
4752
|
throw new Error(`No asset stage with id ${stageId} found in the store`);
|
|
4447
4753
|
}
|
|
4448
|
-
this.dispatch(
|
|
4754
|
+
this.dispatch(updateAssetStage({ ...stage, form: void 0 }));
|
|
4449
4755
|
try {
|
|
4450
4756
|
await this.enqueueRequest({
|
|
4451
4757
|
description: "Unlink asset stage from form",
|
|
4452
4758
|
method: HttpMethod.DELETE,
|
|
4453
|
-
url: `/
|
|
4759
|
+
url: `/asset-stages/${stageId}/associate-with-form/`,
|
|
4454
4760
|
blockers: [stageId, formId],
|
|
4455
4761
|
blocks: [stageId]
|
|
4456
4762
|
});
|
|
4457
4763
|
} catch (e) {
|
|
4458
|
-
this.dispatch(
|
|
4764
|
+
this.dispatch(setAssetStage(stage));
|
|
4459
4765
|
throw e;
|
|
4460
4766
|
}
|
|
4461
4767
|
}
|
|
4462
|
-
async refreshStore(
|
|
4768
|
+
async refreshStore(organizationId) {
|
|
4463
4769
|
const result = await this.enqueueRequest({
|
|
4464
4770
|
description: "Get asset stages",
|
|
4465
4771
|
method: HttpMethod.GET,
|
|
4466
|
-
url:
|
|
4772
|
+
url: "/asset-stages/",
|
|
4773
|
+
queryParams: {
|
|
4774
|
+
organization_id: organizationId.toString()
|
|
4775
|
+
},
|
|
4467
4776
|
blockers: [],
|
|
4468
4777
|
blocks: []
|
|
4469
4778
|
});
|
|
4470
|
-
this.dispatch(
|
|
4779
|
+
this.dispatch(initializeAssetStages(result));
|
|
4471
4780
|
}
|
|
4472
4781
|
}
|
|
4473
4782
|
class BaseUploadService extends BaseApiService {
|
|
@@ -4674,29 +4983,64 @@ class AssetAttachmentService extends BaseAttachmentService {
|
|
|
4674
4983
|
}
|
|
4675
4984
|
}
|
|
4676
4985
|
class AssetTypeService extends BaseApiService {
|
|
4677
|
-
add(
|
|
4678
|
-
const
|
|
4986
|
+
add(payload) {
|
|
4987
|
+
const { store } = this.client;
|
|
4988
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
4989
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4990
|
+
const offlineAssetType = offline({
|
|
4991
|
+
...payload,
|
|
4992
|
+
created_by: createdBy,
|
|
4993
|
+
submitted_at: submittedAt
|
|
4994
|
+
});
|
|
4679
4995
|
this.dispatch(addAssetType(offlineAssetType));
|
|
4680
4996
|
const promise = this.enqueueRequest({
|
|
4681
4997
|
description: "Create asset type",
|
|
4682
4998
|
method: HttpMethod.POST,
|
|
4683
|
-
url:
|
|
4999
|
+
url: "/asset-types/",
|
|
5000
|
+
queryParams: {
|
|
5001
|
+
project_id: payload.project.toString()
|
|
5002
|
+
},
|
|
4684
5003
|
payload: { ...offlineAssetType },
|
|
4685
5004
|
blockers: [],
|
|
4686
5005
|
blocks: [offlineAssetType.offline_id]
|
|
4687
5006
|
});
|
|
5007
|
+
promise.then((result) => {
|
|
5008
|
+
this.dispatch(updateAssetType(result));
|
|
5009
|
+
}).catch(() => {
|
|
5010
|
+
this.dispatch(deleteAssetType(offlineAssetType.offline_id));
|
|
5011
|
+
});
|
|
4688
5012
|
return [offlineAssetType, promise];
|
|
4689
5013
|
}
|
|
4690
|
-
update(
|
|
4691
|
-
this.
|
|
4692
|
-
|
|
5014
|
+
update(payload) {
|
|
5015
|
+
const { store } = this.client;
|
|
5016
|
+
const assetType = selectAssetTypeById(payload.offline_id)(store.getState());
|
|
5017
|
+
if (!assetType) {
|
|
5018
|
+
throw new Error(`Expected asset type with offline_id ${payload.offline_id} to exist`);
|
|
5019
|
+
}
|
|
5020
|
+
const updatedAssetType = {
|
|
5021
|
+
...assetType,
|
|
5022
|
+
...payload
|
|
5023
|
+
};
|
|
5024
|
+
this.dispatch(updateAssetType(updatedAssetType));
|
|
5025
|
+
const promise = this.enqueueRequest({
|
|
4693
5026
|
description: "Update asset type",
|
|
4694
5027
|
method: HttpMethod.PATCH,
|
|
4695
|
-
url: `/
|
|
4696
|
-
payload:
|
|
5028
|
+
url: `/asset-types/${payload.offline_id}/`,
|
|
5029
|
+
payload: {
|
|
5030
|
+
icon: payload.icon,
|
|
5031
|
+
color: payload.color,
|
|
5032
|
+
name: payload.name,
|
|
5033
|
+
description: payload.description
|
|
5034
|
+
},
|
|
4697
5035
|
blockers: [assetType.offline_id],
|
|
4698
5036
|
blocks: [assetType.offline_id]
|
|
4699
5037
|
});
|
|
5038
|
+
promise.then((result) => {
|
|
5039
|
+
this.dispatch(updateAssetType(result));
|
|
5040
|
+
}).catch(() => {
|
|
5041
|
+
this.dispatch(updateAssetType(assetType));
|
|
5042
|
+
});
|
|
5043
|
+
return [updatedAssetType, promise];
|
|
4700
5044
|
}
|
|
4701
5045
|
async delete(assetTypeId) {
|
|
4702
5046
|
const { store } = this.client;
|
|
@@ -4705,26 +5049,23 @@ class AssetTypeService extends BaseApiService {
|
|
|
4705
5049
|
if (!assetType) {
|
|
4706
5050
|
throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
|
|
4707
5051
|
}
|
|
4708
|
-
const
|
|
5052
|
+
const assetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
|
|
5053
|
+
const stagesOfAssetType = selectAssetStagesOfAssetProcedure(assetTypeId)(state);
|
|
4709
5054
|
const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
|
|
4710
5055
|
this.dispatch(deleteAssetType(assetTypeId));
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
}
|
|
4715
|
-
if (attachmentsOfAssetType.length > 0) {
|
|
4716
|
-
const attachmentsOfAssetTypeIds = attachmentsOfAssetType.map(({ offline_id }) => offline_id);
|
|
4717
|
-
this.dispatch(deleteAssetTypeAttachments(attachmentsOfAssetTypeIds));
|
|
4718
|
-
}
|
|
5056
|
+
this.dispatch(deleteAssets(assetsOfAssetType.map((asset) => asset.offline_id)));
|
|
5057
|
+
this.dispatch(deleteAssetStages(stagesOfAssetType.map((assetStage) => assetStage.offline_id)));
|
|
5058
|
+
this.dispatch(deleteAssetTypeAttachments(attachmentsOfAssetType.map(({ offline_id }) => offline_id)));
|
|
4719
5059
|
return this.enqueueRequest({
|
|
4720
5060
|
description: "Delete asset type",
|
|
4721
5061
|
method: HttpMethod.DELETE,
|
|
4722
|
-
url: `/
|
|
5062
|
+
url: `/asset-types/${assetTypeId}/`,
|
|
4723
5063
|
blockers: [assetTypeId],
|
|
4724
5064
|
blocks: []
|
|
4725
5065
|
}).catch((e) => {
|
|
4726
5066
|
this.dispatch(addAssetType(assetType));
|
|
4727
|
-
this.dispatch(
|
|
5067
|
+
this.dispatch(addAssets(assetsOfAssetType));
|
|
5068
|
+
this.dispatch(addAssetStages(stagesOfAssetType));
|
|
4728
5069
|
this.dispatch(addAssetTypeAttachments(attachmentsOfAssetType));
|
|
4729
5070
|
throw e;
|
|
4730
5071
|
});
|
|
@@ -4733,7 +5074,10 @@ class AssetTypeService extends BaseApiService {
|
|
|
4733
5074
|
const result = await this.enqueueRequest({
|
|
4734
5075
|
description: "Get asset types",
|
|
4735
5076
|
method: HttpMethod.GET,
|
|
4736
|
-
url:
|
|
5077
|
+
url: "/asset-types/",
|
|
5078
|
+
queryParams: {
|
|
5079
|
+
project_id: projectId.toString()
|
|
5080
|
+
},
|
|
4737
5081
|
blockers: [],
|
|
4738
5082
|
blocks: []
|
|
4739
5083
|
});
|
|
@@ -4928,21 +5272,16 @@ class IssueService extends BaseApiService {
|
|
|
4928
5272
|
...issueType ? { issue_type: issueType } : {}
|
|
4929
5273
|
},
|
|
4930
5274
|
payload: issuePayload,
|
|
4931
|
-
blockers: [
|
|
5275
|
+
blockers: [
|
|
5276
|
+
"add-issue",
|
|
5277
|
+
...issuePayload.index_workspace ? [issuePayload.index_workspace] : [],
|
|
5278
|
+
...issuePayload.visible_in_workspaces
|
|
5279
|
+
],
|
|
4932
5280
|
blocks: [issuePayload.offline_id]
|
|
4933
5281
|
});
|
|
4934
5282
|
void promise.then((result) => {
|
|
4935
5283
|
this.dispatch(updateIssue(result));
|
|
4936
5284
|
}).catch((error) => {
|
|
4937
|
-
var _a2;
|
|
4938
|
-
console.error(error);
|
|
4939
|
-
if (error instanceof APIError) {
|
|
4940
|
-
(_a2 = unsafeShowToast) == null ? void 0 : _a2({
|
|
4941
|
-
title: "Could not create issue",
|
|
4942
|
-
description: error.message,
|
|
4943
|
-
accentColor: "red"
|
|
4944
|
-
});
|
|
4945
|
-
}
|
|
4946
5285
|
this.dispatch(deleteIssue(issuePayload.offline_id));
|
|
4947
5286
|
this.dispatch(addActiveProjectIssuesCount(-1));
|
|
4948
5287
|
throw error;
|
|
@@ -5375,17 +5714,23 @@ class ProjectService extends BaseApiService {
|
|
|
5375
5714
|
* @throws An APIError if the server returns an error, or any other error that may occur.
|
|
5376
5715
|
*/
|
|
5377
5716
|
async add(project) {
|
|
5717
|
+
if (!project.organization_owner && !project.user_owner) {
|
|
5718
|
+
throw new Error("Project type was not chosen when trying to create a project");
|
|
5719
|
+
}
|
|
5378
5720
|
if (!project.bounds && !project.canvas_bounds) {
|
|
5379
5721
|
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5380
5722
|
}
|
|
5723
|
+
const isOrganizationProject = !!project.organization_owner;
|
|
5724
|
+
const url = isOrganizationProject ? `/organizations/${project.organization_owner}/projects/` : "/projects/";
|
|
5725
|
+
const projectType = isOrganizationProject ? { organization_owner: project.organization_owner } : { user_owner: project.user_owner };
|
|
5381
5726
|
return await this.enqueueRequest({
|
|
5382
5727
|
description: "Create project",
|
|
5383
5728
|
method: HttpMethod.POST,
|
|
5384
|
-
url
|
|
5729
|
+
url,
|
|
5385
5730
|
payload: {
|
|
5386
5731
|
name: project.name,
|
|
5387
5732
|
bounds: project.bounds,
|
|
5388
|
-
|
|
5733
|
+
...projectType
|
|
5389
5734
|
},
|
|
5390
5735
|
blockers: [],
|
|
5391
5736
|
blocks: []
|
|
@@ -5703,6 +6048,48 @@ class FormService extends BaseUploadService {
|
|
|
5703
6048
|
});
|
|
5704
6049
|
return [fullRevision, offlineFormRevisionAttachments, promise, attachmentsPromise];
|
|
5705
6050
|
}
|
|
6051
|
+
async favorite(formId, projectId) {
|
|
6052
|
+
const { store } = this.client;
|
|
6053
|
+
const state = store.getState();
|
|
6054
|
+
const form = state.formReducer.instances[formId];
|
|
6055
|
+
if (!form) {
|
|
6056
|
+
throw new Error(`Expected form to exist, got ${form}`);
|
|
6057
|
+
}
|
|
6058
|
+
this.dispatch(updateForm({ ...form, favorite: true }));
|
|
6059
|
+
try {
|
|
6060
|
+
await this.enqueueRequest({
|
|
6061
|
+
description: "Favorite form",
|
|
6062
|
+
method: HttpMethod.POST,
|
|
6063
|
+
url: `/forms/${formId}/favorite/${projectId}/`,
|
|
6064
|
+
blockers: [formId, `favorite-${formId}`],
|
|
6065
|
+
blocks: [`favorite-${formId}`]
|
|
6066
|
+
});
|
|
6067
|
+
} catch (e) {
|
|
6068
|
+
this.dispatch(updateForm(form));
|
|
6069
|
+
throw e;
|
|
6070
|
+
}
|
|
6071
|
+
}
|
|
6072
|
+
async unfavorite(formId, projectId) {
|
|
6073
|
+
const { store } = this.client;
|
|
6074
|
+
const state = store.getState();
|
|
6075
|
+
const form = state.formReducer.instances[formId];
|
|
6076
|
+
if (!form) {
|
|
6077
|
+
throw new Error(`Expected form to exist, got ${form}`);
|
|
6078
|
+
}
|
|
6079
|
+
this.dispatch(updateForm({ ...form, favorite: false }));
|
|
6080
|
+
try {
|
|
6081
|
+
return await this.enqueueRequest({
|
|
6082
|
+
description: "Unfavorite form",
|
|
6083
|
+
method: HttpMethod.DELETE,
|
|
6084
|
+
url: `/forms/${formId}/unfavorite/${projectId}/`,
|
|
6085
|
+
blockers: [formId, `favorite-${formId}`],
|
|
6086
|
+
blocks: [`favorite-${formId}`]
|
|
6087
|
+
});
|
|
6088
|
+
} catch (e) {
|
|
6089
|
+
this.dispatch(updateForm(form));
|
|
6090
|
+
throw e;
|
|
6091
|
+
}
|
|
6092
|
+
}
|
|
5706
6093
|
async delete(formId) {
|
|
5707
6094
|
const { store } = this.client;
|
|
5708
6095
|
const state = store.getState();
|
|
@@ -6163,19 +6550,13 @@ class FormSubmissionService extends BaseUploadService {
|
|
|
6163
6550
|
}
|
|
6164
6551
|
}
|
|
6165
6552
|
class WorkspaceService extends BaseApiService {
|
|
6166
|
-
add(
|
|
6167
|
-
const
|
|
6168
|
-
const createdBy = store.getState().userReducer.currentUser.id;
|
|
6169
|
-
const offlineWorkspace = offline({
|
|
6170
|
-
...payload,
|
|
6171
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6172
|
-
created_by: createdBy
|
|
6173
|
-
});
|
|
6553
|
+
add(workspace) {
|
|
6554
|
+
const offlineWorkspace = offline(workspace);
|
|
6174
6555
|
this.dispatch(addWorkspace(offlineWorkspace));
|
|
6175
6556
|
const promise = this.enqueueRequest({
|
|
6176
6557
|
description: "Create Workspace",
|
|
6177
6558
|
method: HttpMethod.POST,
|
|
6178
|
-
url: `/projects/${
|
|
6559
|
+
url: `/projects/${workspace.project}/workspaces/`,
|
|
6179
6560
|
payload: offlineWorkspace,
|
|
6180
6561
|
blockers: ["add-workspace"],
|
|
6181
6562
|
blocks: [offlineWorkspace.offline_id]
|
|
@@ -6592,7 +6973,9 @@ class LicenseService extends BaseApiService {
|
|
|
6592
6973
|
method: HttpMethod.GET,
|
|
6593
6974
|
url: `/billing/${license.offline_id}/`,
|
|
6594
6975
|
isAuthNeeded: true,
|
|
6595
|
-
blockers: [
|
|
6976
|
+
blockers: [
|
|
6977
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6978
|
+
],
|
|
6596
6979
|
blocks: []
|
|
6597
6980
|
});
|
|
6598
6981
|
this.dispatch(updateLicense(result));
|
|
@@ -6604,7 +6987,9 @@ class LicenseService extends BaseApiService {
|
|
|
6604
6987
|
method: HttpMethod.DELETE,
|
|
6605
6988
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6606
6989
|
isAuthNeeded: true,
|
|
6607
|
-
blockers: [
|
|
6990
|
+
blockers: [
|
|
6991
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
6992
|
+
],
|
|
6608
6993
|
blocks: []
|
|
6609
6994
|
});
|
|
6610
6995
|
this.dispatch(updateLicense(result));
|
|
@@ -6616,7 +7001,9 @@ class LicenseService extends BaseApiService {
|
|
|
6616
7001
|
method: HttpMethod.PATCH,
|
|
6617
7002
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
6618
7003
|
isAuthNeeded: true,
|
|
6619
|
-
blockers: [
|
|
7004
|
+
blockers: [
|
|
7005
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
7006
|
+
],
|
|
6620
7007
|
blocks: []
|
|
6621
7008
|
});
|
|
6622
7009
|
this.dispatch(updateLicense(result));
|
|
@@ -6628,7 +7015,9 @@ class LicenseService extends BaseApiService {
|
|
|
6628
7015
|
method: HttpMethod.DELETE,
|
|
6629
7016
|
url: `/billing/${license.offline_id}/`,
|
|
6630
7017
|
isAuthNeeded: true,
|
|
6631
|
-
blockers: [
|
|
7018
|
+
blockers: [
|
|
7019
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
7020
|
+
],
|
|
6632
7021
|
blocks: []
|
|
6633
7022
|
});
|
|
6634
7023
|
this.dispatch(updateLicense(result));
|
|
@@ -6642,7 +7031,7 @@ class LicenseService extends BaseApiService {
|
|
|
6642
7031
|
isAuthNeeded: true,
|
|
6643
7032
|
payload: { project: project.id },
|
|
6644
7033
|
blockers: [
|
|
6645
|
-
license.organization_owner ? license.organization_owner.toString() : "",
|
|
7034
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : "",
|
|
6646
7035
|
project.id ? project.id.toString() : ""
|
|
6647
7036
|
],
|
|
6648
7037
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
@@ -6656,7 +7045,9 @@ class LicenseService extends BaseApiService {
|
|
|
6656
7045
|
method: HttpMethod.DELETE,
|
|
6657
7046
|
url: `/billing/${license.offline_id}/project/`,
|
|
6658
7047
|
isAuthNeeded: true,
|
|
6659
|
-
blockers: [
|
|
7048
|
+
blockers: [
|
|
7049
|
+
license.organization_owner ? license.organization_owner.toString() : license.user_owner ? license.user_owner.toString() : ""
|
|
7050
|
+
],
|
|
6660
7051
|
blocks: ["add-issue", "add-form-entry", "change-access-level", "add-workspace"]
|
|
6661
7052
|
});
|
|
6662
7053
|
this.dispatch(updateLicense(result));
|
|
@@ -7446,12 +7837,322 @@ class IssueAssociationService extends BaseUploadService {
|
|
|
7446
7837
|
this.dispatch(initializeIssueAssociations(issueAssociations));
|
|
7447
7838
|
}
|
|
7448
7839
|
}
|
|
7840
|
+
class AssetProcedureCompletionService extends BaseApiService {
|
|
7841
|
+
add(payload) {
|
|
7842
|
+
const { store } = this.client;
|
|
7843
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7844
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7845
|
+
const offlineProcedureCompletion = offline({
|
|
7846
|
+
...payload,
|
|
7847
|
+
created_by: createdBy,
|
|
7848
|
+
submitted_at: submittedAt
|
|
7849
|
+
});
|
|
7850
|
+
this.dispatch(addAssetProcedureCompletion(offlineProcedureCompletion));
|
|
7851
|
+
const promise = this.enqueueRequest({
|
|
7852
|
+
description: "Add asset procedure completion",
|
|
7853
|
+
method: HttpMethod.POST,
|
|
7854
|
+
url: "/asset-procedure-completions/",
|
|
7855
|
+
payload: {
|
|
7856
|
+
offline_id: offlineProcedureCompletion.offline_id,
|
|
7857
|
+
submitted_at: submittedAt,
|
|
7858
|
+
asset: payload.asset,
|
|
7859
|
+
asset_procedure_instance: payload.asset_procedure_instance
|
|
7860
|
+
},
|
|
7861
|
+
blockers: [payload.asset, payload.asset_procedure_instance],
|
|
7862
|
+
blocks: [offlineProcedureCompletion.offline_id]
|
|
7863
|
+
});
|
|
7864
|
+
promise.then((result) => {
|
|
7865
|
+
this.dispatch(updateAssetProcedureCompletion(result));
|
|
7866
|
+
}).catch(() => {
|
|
7867
|
+
this.dispatch(deleteAssetProcedureCompletion(offlineProcedureCompletion.offline_id));
|
|
7868
|
+
});
|
|
7869
|
+
return [offlineProcedureCompletion, promise];
|
|
7870
|
+
}
|
|
7871
|
+
bulkAdd(payloads) {
|
|
7872
|
+
const { store } = this.client;
|
|
7873
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7874
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7875
|
+
const completionPayloads = payloads.map((payload) => offline(payload));
|
|
7876
|
+
const offlineProcedureCompletions = completionPayloads.map((completion) => {
|
|
7877
|
+
return {
|
|
7878
|
+
...completion,
|
|
7879
|
+
created_by: createdBy,
|
|
7880
|
+
submitted_at: submittedAt
|
|
7881
|
+
};
|
|
7882
|
+
});
|
|
7883
|
+
const offlineIds = offlineProcedureCompletions.map(({ offline_id }) => offline_id);
|
|
7884
|
+
this.dispatch(addAssetProcedureCompletions(offlineProcedureCompletions));
|
|
7885
|
+
const promise = this.enqueueRequest({
|
|
7886
|
+
description: "Bulk create asset procedure completions",
|
|
7887
|
+
method: HttpMethod.POST,
|
|
7888
|
+
url: "/asset-procedure-completions/bulk/",
|
|
7889
|
+
payload: {
|
|
7890
|
+
submitted_at: submittedAt,
|
|
7891
|
+
asset_procedure_completions: completionPayloads
|
|
7892
|
+
},
|
|
7893
|
+
blockers: [...payloads.map((c) => c.asset), ...payloads.map((c) => c.asset_procedure_instance)],
|
|
7894
|
+
blocks: offlineIds
|
|
7895
|
+
});
|
|
7896
|
+
promise.then((result) => {
|
|
7897
|
+
this.dispatch(updateAssetProcedureCompletions(result));
|
|
7898
|
+
}).catch(() => {
|
|
7899
|
+
this.dispatch(deleteAssetProcedureCompletions(offlineIds));
|
|
7900
|
+
});
|
|
7901
|
+
return [offlineProcedureCompletions, promise];
|
|
7902
|
+
}
|
|
7903
|
+
async delete(id) {
|
|
7904
|
+
const { store } = this.client;
|
|
7905
|
+
const assetProcedureCompletion = selectAssetProcedureCompletionById(id)(store.getState());
|
|
7906
|
+
if (!assetProcedureCompletion) {
|
|
7907
|
+
throw new Error(`Expected asset procedure completion with id ${id} to exist`);
|
|
7908
|
+
}
|
|
7909
|
+
this.dispatch(deleteAssetProcedureCompletion(id));
|
|
7910
|
+
const promise = this.enqueueRequest({
|
|
7911
|
+
description: "Delete asset procedure completion",
|
|
7912
|
+
method: HttpMethod.DELETE,
|
|
7913
|
+
url: `/asset-procedure-completions/${id}/`,
|
|
7914
|
+
blockers: [id],
|
|
7915
|
+
blocks: []
|
|
7916
|
+
});
|
|
7917
|
+
promise.catch(() => {
|
|
7918
|
+
this.dispatch(addAssetProcedureCompletion(assetProcedureCompletion));
|
|
7919
|
+
});
|
|
7920
|
+
return promise;
|
|
7921
|
+
}
|
|
7922
|
+
async bulkDelete(ids) {
|
|
7923
|
+
const { store } = this.client;
|
|
7924
|
+
const assetProcedureCompletions = selectAssetProcedureCompletionsByIds(ids)(store.getState());
|
|
7925
|
+
this.dispatch(deleteAssetProcedureCompletions(ids));
|
|
7926
|
+
const promise = this.enqueueRequest({
|
|
7927
|
+
description: "Deleting asset procedure completions",
|
|
7928
|
+
method: HttpMethod.DELETE,
|
|
7929
|
+
url: "/asset-procedure-completions/bulk/",
|
|
7930
|
+
payload: {
|
|
7931
|
+
completion_ids: ids
|
|
7932
|
+
},
|
|
7933
|
+
blockers: ids,
|
|
7934
|
+
blocks: []
|
|
7935
|
+
});
|
|
7936
|
+
promise.catch(() => {
|
|
7937
|
+
this.dispatch(addAssetProcedureCompletions(assetProcedureCompletions));
|
|
7938
|
+
});
|
|
7939
|
+
return promise;
|
|
7940
|
+
}
|
|
7941
|
+
async refreshStore(projectId) {
|
|
7942
|
+
const result = await this.enqueueRequest({
|
|
7943
|
+
description: "Get asset procedure completions",
|
|
7944
|
+
method: HttpMethod.GET,
|
|
7945
|
+
url: "/asset-procedure-completions/",
|
|
7946
|
+
queryParams: {
|
|
7947
|
+
project_id: projectId.toString()
|
|
7948
|
+
},
|
|
7949
|
+
blockers: [],
|
|
7950
|
+
blocks: []
|
|
7951
|
+
});
|
|
7952
|
+
this.dispatch(initializeAssetProcedureCompletions(result));
|
|
7953
|
+
}
|
|
7954
|
+
}
|
|
7955
|
+
class AssetProcedureInstanceService extends BaseApiService {
|
|
7956
|
+
add(payload) {
|
|
7957
|
+
const { store } = this.client;
|
|
7958
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7959
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7960
|
+
const offlineAssetProcedureInstance = offline({
|
|
7961
|
+
...payload,
|
|
7962
|
+
created_by: createdBy,
|
|
7963
|
+
submitted_at: submittedAt
|
|
7964
|
+
});
|
|
7965
|
+
this.dispatch(addAssetProcedureInstance(offlineAssetProcedureInstance));
|
|
7966
|
+
const promise = this.enqueueRequest({
|
|
7967
|
+
description: "Create asset procedure instance",
|
|
7968
|
+
method: HttpMethod.POST,
|
|
7969
|
+
url: "/asset-procedure-instances/",
|
|
7970
|
+
payload: { ...offlineAssetProcedureInstance },
|
|
7971
|
+
blockers: [payload.asset_procedure, payload.asset_type],
|
|
7972
|
+
blocks: [offlineAssetProcedureInstance.offline_id]
|
|
7973
|
+
});
|
|
7974
|
+
promise.then((result) => {
|
|
7975
|
+
this.dispatch(updateAssetProcedureInstance(result));
|
|
7976
|
+
}).catch(() => {
|
|
7977
|
+
this.dispatch(deleteAssetProcedureInstance(offlineAssetProcedureInstance.offline_id));
|
|
7978
|
+
});
|
|
7979
|
+
return [offlineAssetProcedureInstance, promise];
|
|
7980
|
+
}
|
|
7981
|
+
update(payload) {
|
|
7982
|
+
const { store } = this.client;
|
|
7983
|
+
const assetProcedureInstance = selectAssetProcedureInstanceById(payload.offline_id)(store.getState());
|
|
7984
|
+
if (!assetProcedureInstance) {
|
|
7985
|
+
throw new Error(`Expected asset procedure instance with offline_id ${payload.offline_id} to exist`);
|
|
7986
|
+
}
|
|
7987
|
+
const updatedAssetProcedureInstance = {
|
|
7988
|
+
...assetProcedureInstance,
|
|
7989
|
+
...payload
|
|
7990
|
+
};
|
|
7991
|
+
this.dispatch(updateAssetProcedureInstance(updatedAssetProcedureInstance));
|
|
7992
|
+
const promise = this.enqueueRequest({
|
|
7993
|
+
description: "Update asset procedure instance",
|
|
7994
|
+
method: HttpMethod.PATCH,
|
|
7995
|
+
url: `/asset-procedure-instances/${payload.offline_id}/`,
|
|
7996
|
+
payload: {
|
|
7997
|
+
asset_procedure: payload.asset_procedure,
|
|
7998
|
+
asset_type: payload.asset_type
|
|
7999
|
+
},
|
|
8000
|
+
blockers: [assetProcedureInstance.offline_id],
|
|
8001
|
+
blocks: [assetProcedureInstance.offline_id]
|
|
8002
|
+
});
|
|
8003
|
+
promise.then((result) => {
|
|
8004
|
+
this.dispatch(updateAssetProcedureInstance(result));
|
|
8005
|
+
}).catch(() => {
|
|
8006
|
+
this.dispatch(updateAssetProcedureInstance(assetProcedureInstance));
|
|
8007
|
+
});
|
|
8008
|
+
return [updatedAssetProcedureInstance, promise];
|
|
8009
|
+
}
|
|
8010
|
+
async remove(assetProcedureInstanceId) {
|
|
8011
|
+
const { store } = this.client;
|
|
8012
|
+
const state = store.getState();
|
|
8013
|
+
const assetProcedureInstance = selectAssetProcedureInstanceById(assetProcedureInstanceId)(state);
|
|
8014
|
+
if (!assetProcedureInstance) {
|
|
8015
|
+
throw new Error(`Expected asset procedure instance with offline_id ${assetProcedureInstanceId} to exist`);
|
|
8016
|
+
}
|
|
8017
|
+
this.dispatch(deleteAssetProcedureInstance(assetProcedureInstanceId));
|
|
8018
|
+
return this.enqueueRequest({
|
|
8019
|
+
description: "Delete asset procedure instance",
|
|
8020
|
+
method: HttpMethod.DELETE,
|
|
8021
|
+
url: `/asset-procedure-instances/${assetProcedureInstanceId}/`,
|
|
8022
|
+
blockers: [assetProcedureInstanceId],
|
|
8023
|
+
blocks: []
|
|
8024
|
+
}).catch((e) => {
|
|
8025
|
+
this.dispatch(addAssetProcedureInstance(assetProcedureInstance));
|
|
8026
|
+
throw e;
|
|
8027
|
+
});
|
|
8028
|
+
}
|
|
8029
|
+
async refreshStore(projectId) {
|
|
8030
|
+
const result = await this.enqueueRequest({
|
|
8031
|
+
description: "Get asset procedure instances",
|
|
8032
|
+
method: HttpMethod.GET,
|
|
8033
|
+
url: "/asset-procedure-instances/",
|
|
8034
|
+
queryParams: {
|
|
8035
|
+
project_id: projectId.toString()
|
|
8036
|
+
},
|
|
8037
|
+
blockers: [],
|
|
8038
|
+
blocks: []
|
|
8039
|
+
});
|
|
8040
|
+
this.dispatch(initializeAssetProcedureInstances(result));
|
|
8041
|
+
}
|
|
8042
|
+
}
|
|
8043
|
+
class AssetProcedureService extends BaseApiService {
|
|
8044
|
+
add(payload) {
|
|
8045
|
+
const { store } = this.client;
|
|
8046
|
+
const createdBy = store.getState().userReducer.currentUser.id;
|
|
8047
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
8048
|
+
const offlineAssetProcedure = offline({
|
|
8049
|
+
...payload,
|
|
8050
|
+
created_by: createdBy,
|
|
8051
|
+
submitted_at: submittedAt
|
|
8052
|
+
});
|
|
8053
|
+
this.dispatch(addAssetProcedure(offlineAssetProcedure));
|
|
8054
|
+
const promise = this.enqueueRequest({
|
|
8055
|
+
description: "Create asset procedure",
|
|
8056
|
+
method: HttpMethod.POST,
|
|
8057
|
+
url: "/asset-procedures/",
|
|
8058
|
+
queryParams: {
|
|
8059
|
+
organization_id: payload.organization.toString()
|
|
8060
|
+
},
|
|
8061
|
+
payload: { ...offlineAssetProcedure },
|
|
8062
|
+
blockers: [],
|
|
8063
|
+
blocks: [offlineAssetProcedure.offline_id]
|
|
8064
|
+
});
|
|
8065
|
+
promise.then((result) => {
|
|
8066
|
+
this.dispatch(updateAssetProcedure(result));
|
|
8067
|
+
}).catch(() => {
|
|
8068
|
+
this.dispatch(deleteAssetProcedure(offlineAssetProcedure.offline_id));
|
|
8069
|
+
});
|
|
8070
|
+
return [offlineAssetProcedure, promise];
|
|
8071
|
+
}
|
|
8072
|
+
update(payload) {
|
|
8073
|
+
const { store } = this.client;
|
|
8074
|
+
const assetProcedure = selectAssetProcedureById(payload.offline_id)(store.getState());
|
|
8075
|
+
if (!assetProcedure) {
|
|
8076
|
+
throw new Error(`Expected asset procedure with offline_id ${payload.offline_id} to exist`);
|
|
8077
|
+
}
|
|
8078
|
+
const updatedAssetProcedure = {
|
|
8079
|
+
...assetProcedure,
|
|
8080
|
+
...payload
|
|
8081
|
+
};
|
|
8082
|
+
this.dispatch(updateAssetProcedure(updatedAssetProcedure));
|
|
8083
|
+
const promise = this.enqueueRequest({
|
|
8084
|
+
description: "Update asset procedure",
|
|
8085
|
+
method: HttpMethod.PATCH,
|
|
8086
|
+
url: `/asset-procedures/${payload.offline_id}/`,
|
|
8087
|
+
payload: {
|
|
8088
|
+
icon: payload.icon,
|
|
8089
|
+
color: payload.color,
|
|
8090
|
+
name: payload.name,
|
|
8091
|
+
description: payload.description
|
|
8092
|
+
},
|
|
8093
|
+
blockers: [assetProcedure.offline_id],
|
|
8094
|
+
blocks: [assetProcedure.offline_id]
|
|
8095
|
+
});
|
|
8096
|
+
promise.then((result) => {
|
|
8097
|
+
this.dispatch(updateAssetProcedure(result));
|
|
8098
|
+
}).catch(() => {
|
|
8099
|
+
this.dispatch(updateAssetProcedure(assetProcedure));
|
|
8100
|
+
});
|
|
8101
|
+
return [updatedAssetProcedure, promise];
|
|
8102
|
+
}
|
|
8103
|
+
async remove(assetProcedureId) {
|
|
8104
|
+
const { store } = this.client;
|
|
8105
|
+
const state = store.getState();
|
|
8106
|
+
const assetProcedure = selectAssetProcedureById(assetProcedureId)(state);
|
|
8107
|
+
if (!assetProcedure) {
|
|
8108
|
+
throw new Error(`Expected asset procedure with offline_id ${assetProcedureId} to exist`);
|
|
8109
|
+
}
|
|
8110
|
+
const instancesOfAssetProcedure = selectAssetProcedureInstancesOfAssetProcedure(assetProcedureId)(state);
|
|
8111
|
+
this.dispatch(deleteAssetProcedure(assetProcedureId));
|
|
8112
|
+
this.dispatch(deleteAssetProcedureInstances(instancesOfAssetProcedure.map((instance) => instance.offline_id)));
|
|
8113
|
+
return this.enqueueRequest({
|
|
8114
|
+
description: "Delete asset procedure",
|
|
8115
|
+
method: HttpMethod.DELETE,
|
|
8116
|
+
url: `/asset-procedures/${assetProcedureId}/`,
|
|
8117
|
+
blockers: [assetProcedureId],
|
|
8118
|
+
blocks: []
|
|
8119
|
+
}).catch((e) => {
|
|
8120
|
+
this.dispatch(addAssetProcedure(assetProcedure));
|
|
8121
|
+
this.dispatch(addAssetProcedureInstances(instancesOfAssetProcedure));
|
|
8122
|
+
throw e;
|
|
8123
|
+
});
|
|
8124
|
+
}
|
|
8125
|
+
async refreshStore(organizationId) {
|
|
8126
|
+
const result = await this.enqueueRequest({
|
|
8127
|
+
description: "Get asset procedures",
|
|
8128
|
+
method: HttpMethod.GET,
|
|
8129
|
+
url: "/asset-procedures/",
|
|
8130
|
+
queryParams: {
|
|
8131
|
+
organization_id: organizationId.toString()
|
|
8132
|
+
},
|
|
8133
|
+
blockers: [],
|
|
8134
|
+
blocks: []
|
|
8135
|
+
});
|
|
8136
|
+
this.dispatch(initializeAssetProcedures(result));
|
|
8137
|
+
}
|
|
8138
|
+
}
|
|
8139
|
+
var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
|
|
8140
|
+
VerificationCodeType2[VerificationCodeType2["USER_REGISTRATION"] = 0] = "USER_REGISTRATION";
|
|
8141
|
+
VerificationCodeType2[VerificationCodeType2["APPLICATION_INVITE"] = 2] = "APPLICATION_INVITE";
|
|
8142
|
+
VerificationCodeType2[VerificationCodeType2["PROJECT_INVITE"] = 4] = "PROJECT_INVITE";
|
|
8143
|
+
VerificationCodeType2[VerificationCodeType2["ORGANIZATION_INVITE"] = 6] = "ORGANIZATION_INVITE";
|
|
8144
|
+
VerificationCodeType2[VerificationCodeType2["ADD_EMAIL_DOMAIN"] = 8] = "ADD_EMAIL_DOMAIN";
|
|
8145
|
+
VerificationCodeType2[VerificationCodeType2["RESET_PASSWORD"] = 10] = "RESET_PASSWORD";
|
|
8146
|
+
return VerificationCodeType2;
|
|
8147
|
+
})(VerificationCodeType || {});
|
|
7449
8148
|
export {
|
|
7450
8149
|
APIError,
|
|
7451
8150
|
AgentService,
|
|
7452
8151
|
AssetAttachmentService,
|
|
8152
|
+
AssetProcedureCompletionService,
|
|
8153
|
+
AssetProcedureInstanceService,
|
|
8154
|
+
AssetProcedureService,
|
|
7453
8155
|
AssetService,
|
|
7454
|
-
AssetStageColors,
|
|
7455
8156
|
AssetStageCompletionService,
|
|
7456
8157
|
AssetStageService,
|
|
7457
8158
|
AssetTypeAttachmentService,
|
|
@@ -7513,9 +8214,20 @@ export {
|
|
|
7513
8214
|
addAsset,
|
|
7514
8215
|
addAssetAttachment,
|
|
7515
8216
|
addAssetAttachments,
|
|
8217
|
+
addAssetProcedure,
|
|
8218
|
+
addAssetProcedureCompletion,
|
|
8219
|
+
addAssetProcedureCompletions,
|
|
8220
|
+
addAssetProcedureInstance,
|
|
8221
|
+
addAssetProcedureInstances,
|
|
8222
|
+
addAssetProcedures,
|
|
8223
|
+
addAssetStage,
|
|
8224
|
+
addAssetStageCompletion,
|
|
8225
|
+
addAssetStageCompletions,
|
|
8226
|
+
addAssetStages,
|
|
7516
8227
|
addAssetType,
|
|
7517
8228
|
addAssetTypeAttachment,
|
|
7518
8229
|
addAssetTypeAttachments,
|
|
8230
|
+
addAssetTypes,
|
|
7519
8231
|
addAssets,
|
|
7520
8232
|
addCategory,
|
|
7521
8233
|
addConversation,
|
|
@@ -7523,7 +8235,6 @@ export {
|
|
|
7523
8235
|
addDocumentAttachments,
|
|
7524
8236
|
addDocuments,
|
|
7525
8237
|
addEmailDomain,
|
|
7526
|
-
addFavouriteProjectId,
|
|
7527
8238
|
addForm,
|
|
7528
8239
|
addFormRevision,
|
|
7529
8240
|
addFormRevisionAttachment,
|
|
@@ -7553,9 +8264,6 @@ export {
|
|
|
7553
8264
|
addOrReplaceProjects,
|
|
7554
8265
|
addProjectAttachment,
|
|
7555
8266
|
addProjectAttachments,
|
|
7556
|
-
addStageCompletion,
|
|
7557
|
-
addStageCompletions,
|
|
7558
|
-
addStages,
|
|
7559
8267
|
addTeam,
|
|
7560
8268
|
addToRecentIssues,
|
|
7561
8269
|
addUsers,
|
|
@@ -7565,6 +8273,12 @@ export {
|
|
|
7565
8273
|
areArraysEqual,
|
|
7566
8274
|
assetAttachmentReducer,
|
|
7567
8275
|
assetAttachmentSlice,
|
|
8276
|
+
assetProcedureCompletionReducer,
|
|
8277
|
+
assetProcedureCompletionSlice,
|
|
8278
|
+
assetProcedureInstanceReducer,
|
|
8279
|
+
assetProcedureInstanceSlice,
|
|
8280
|
+
assetProcedureReducer,
|
|
8281
|
+
assetProcedureSlice,
|
|
7568
8282
|
assetReducer,
|
|
7569
8283
|
assetSlice,
|
|
7570
8284
|
assetStageCompletionReducer,
|
|
@@ -7596,9 +8310,20 @@ export {
|
|
|
7596
8310
|
deleteAsset,
|
|
7597
8311
|
deleteAssetAttachment,
|
|
7598
8312
|
deleteAssetAttachments,
|
|
8313
|
+
deleteAssetProcedure,
|
|
8314
|
+
deleteAssetProcedureCompletion,
|
|
8315
|
+
deleteAssetProcedureCompletions,
|
|
8316
|
+
deleteAssetProcedureInstance,
|
|
8317
|
+
deleteAssetProcedureInstances,
|
|
8318
|
+
deleteAssetProcedures,
|
|
8319
|
+
deleteAssetStage,
|
|
8320
|
+
deleteAssetStageCompletion,
|
|
8321
|
+
deleteAssetStageCompletions,
|
|
8322
|
+
deleteAssetStages,
|
|
7599
8323
|
deleteAssetType,
|
|
7600
8324
|
deleteAssetTypeAttachment,
|
|
7601
8325
|
deleteAssetTypeAttachments,
|
|
8326
|
+
deleteAssetTypes,
|
|
7602
8327
|
deleteAssets,
|
|
7603
8328
|
deleteCategory,
|
|
7604
8329
|
deleteDocumentAttachment,
|
|
@@ -7674,10 +8399,14 @@ export {
|
|
|
7674
8399
|
getLocalRelativeDateString,
|
|
7675
8400
|
getOutboxCoordinator,
|
|
7676
8401
|
getRenamedFile,
|
|
7677
|
-
getStageColor,
|
|
7678
8402
|
hashFile,
|
|
7679
8403
|
initSDK,
|
|
7680
8404
|
initializeAssetAttachments,
|
|
8405
|
+
initializeAssetProcedureCompletions,
|
|
8406
|
+
initializeAssetProcedureInstances,
|
|
8407
|
+
initializeAssetProcedures,
|
|
8408
|
+
initializeAssetStageCompletions,
|
|
8409
|
+
initializeAssetStages,
|
|
7681
8410
|
initializeAssetTypeAttachments,
|
|
7682
8411
|
initializeAssetTypes,
|
|
7683
8412
|
initializeAssets,
|
|
@@ -7700,7 +8429,6 @@ export {
|
|
|
7700
8429
|
initializeOrganizationAccesses,
|
|
7701
8430
|
initializeProjectAccesses,
|
|
7702
8431
|
initializeProjectAttachments,
|
|
7703
|
-
initializeStages,
|
|
7704
8432
|
initializeTeams,
|
|
7705
8433
|
initializeWorkspaces,
|
|
7706
8434
|
isToday,
|
|
@@ -7753,13 +8481,10 @@ export {
|
|
|
7753
8481
|
rehydratedReducer,
|
|
7754
8482
|
rehydratedSlice,
|
|
7755
8483
|
removeDocuments,
|
|
7756
|
-
removeFavouriteProjectId,
|
|
7757
8484
|
removeIssueType,
|
|
7758
8485
|
removeProjectFile,
|
|
7759
8486
|
removeProjectFilesOfProject,
|
|
7760
8487
|
removeRecentIssue,
|
|
7761
|
-
removeStageCompletions,
|
|
7762
|
-
removeStages,
|
|
7763
8488
|
removeUser,
|
|
7764
8489
|
resetProjectFileObjectUrls,
|
|
7765
8490
|
resetRecentIssues,
|
|
@@ -7781,14 +8506,35 @@ export {
|
|
|
7781
8506
|
selectAssetAttachmentMapping,
|
|
7782
8507
|
selectAssetAttachments,
|
|
7783
8508
|
selectAssetById,
|
|
8509
|
+
selectAssetProcedureById,
|
|
8510
|
+
selectAssetProcedureCompletionById,
|
|
8511
|
+
selectAssetProcedureCompletions,
|
|
8512
|
+
selectAssetProcedureCompletionsByIds,
|
|
8513
|
+
selectAssetProcedureCompletionsMapping,
|
|
8514
|
+
selectAssetProcedureCompletionsOfAsset,
|
|
8515
|
+
selectAssetProcedureCompletionsOfAssetProcedureInstance,
|
|
8516
|
+
selectAssetProcedureInstanceById,
|
|
8517
|
+
selectAssetProcedureInstances,
|
|
8518
|
+
selectAssetProcedureInstancesByIds,
|
|
8519
|
+
selectAssetProcedureInstancesMapping,
|
|
8520
|
+
selectAssetProcedureInstancesOfAssetProcedure,
|
|
8521
|
+
selectAssetProcedureInstancesOfAssetType,
|
|
8522
|
+
selectAssetProcedures,
|
|
8523
|
+
selectAssetProceduresByIds,
|
|
8524
|
+
selectAssetProceduresMapping,
|
|
8525
|
+
selectAssetProceduresOfOrganization,
|
|
7784
8526
|
selectAssetStageById,
|
|
8527
|
+
selectAssetStageCompletionById,
|
|
8528
|
+
selectAssetStageCompletionMapping,
|
|
8529
|
+
selectAssetStageCompletionsByIds,
|
|
7785
8530
|
selectAssetStages,
|
|
7786
8531
|
selectAssetStagesByIds,
|
|
8532
|
+
selectAssetStagesMappingOfAssetProcedure,
|
|
8533
|
+
selectAssetStagesOfAssetProcedure,
|
|
7787
8534
|
selectAssetTypeAttachmentById,
|
|
7788
8535
|
selectAssetTypeAttachmentMapping,
|
|
7789
8536
|
selectAssetTypeAttachments,
|
|
7790
8537
|
selectAssetTypeById,
|
|
7791
|
-
selectAssetTypeStagesMapping,
|
|
7792
8538
|
selectAssetTypes,
|
|
7793
8539
|
selectAssetTypesByIds,
|
|
7794
8540
|
selectAssetTypesMapping,
|
|
@@ -7816,8 +8562,8 @@ export {
|
|
|
7816
8562
|
selectCategoryById,
|
|
7817
8563
|
selectCategoryMapping,
|
|
7818
8564
|
selectCommentsOfIssue,
|
|
7819
|
-
|
|
7820
|
-
|
|
8565
|
+
selectCompletedStageIdsOfAssetProcedureCompletion,
|
|
8566
|
+
selectCompletedStagesByAssetProcedureCompletion,
|
|
7821
8567
|
selectConversation,
|
|
7822
8568
|
selectConversationMapping,
|
|
7823
8569
|
selectConversations,
|
|
@@ -7832,7 +8578,6 @@ export {
|
|
|
7832
8578
|
selectEmailDomains,
|
|
7833
8579
|
selectEmailDomainsAsMapping,
|
|
7834
8580
|
selectEmailDomainsOfOrganization,
|
|
7835
|
-
selectFavouriteProjects,
|
|
7836
8581
|
selectFilteredForms,
|
|
7837
8582
|
selectFormById,
|
|
7838
8583
|
selectFormMapping,
|
|
@@ -7931,8 +8676,6 @@ export {
|
|
|
7931
8676
|
selectSortedProjectUsers,
|
|
7932
8677
|
selectStageFormIdsFromStageIds,
|
|
7933
8678
|
selectStageMapping,
|
|
7934
|
-
selectStagesFromAssetTypeIds,
|
|
7935
|
-
selectStagesOfAssetType,
|
|
7936
8679
|
selectTeamById,
|
|
7937
8680
|
selectTeams,
|
|
7938
8681
|
selectTeamsByIds,
|
|
@@ -7951,8 +8694,18 @@ export {
|
|
|
7951
8694
|
setAsset,
|
|
7952
8695
|
setAssetAttachment,
|
|
7953
8696
|
setAssetAttachments,
|
|
8697
|
+
setAssetProcedure,
|
|
8698
|
+
setAssetProcedureCompletion,
|
|
8699
|
+
setAssetProcedureCompletions,
|
|
8700
|
+
setAssetProcedureInstance,
|
|
8701
|
+
setAssetProcedureInstances,
|
|
8702
|
+
setAssetProcedures,
|
|
8703
|
+
setAssetStage,
|
|
8704
|
+
setAssetStages,
|
|
8705
|
+
setAssetType,
|
|
7954
8706
|
setAssetTypeAttachment,
|
|
7955
8707
|
setAssetTypeAttachments,
|
|
8708
|
+
setAssetTypes,
|
|
7956
8709
|
setAssets,
|
|
7957
8710
|
setConversation,
|
|
7958
8711
|
setCurrentUser,
|
|
@@ -7985,11 +8738,8 @@ export {
|
|
|
7985
8738
|
setProjectAttachments,
|
|
7986
8739
|
setProjects,
|
|
7987
8740
|
setRehydrated,
|
|
7988
|
-
setStage,
|
|
7989
|
-
setStageCompletions,
|
|
7990
8741
|
setTeam,
|
|
7991
8742
|
setTokens,
|
|
7992
|
-
setTourStep,
|
|
7993
8743
|
setUploadUrl,
|
|
7994
8744
|
setUsers,
|
|
7995
8745
|
setWorkspaces,
|
|
@@ -8005,8 +8755,20 @@ export {
|
|
|
8005
8755
|
updateAsset,
|
|
8006
8756
|
updateAssetAttachment,
|
|
8007
8757
|
updateAssetAttachments,
|
|
8758
|
+
updateAssetProcedure,
|
|
8759
|
+
updateAssetProcedureCompletion,
|
|
8760
|
+
updateAssetProcedureCompletions,
|
|
8761
|
+
updateAssetProcedureInstance,
|
|
8762
|
+
updateAssetProcedureInstances,
|
|
8763
|
+
updateAssetProcedures,
|
|
8764
|
+
updateAssetStage,
|
|
8765
|
+
updateAssetStageCompletion,
|
|
8766
|
+
updateAssetStageCompletions,
|
|
8767
|
+
updateAssetStages,
|
|
8768
|
+
updateAssetType,
|
|
8008
8769
|
updateAssetTypeAttachment,
|
|
8009
8770
|
updateAssetTypeAttachments,
|
|
8771
|
+
updateAssetTypes,
|
|
8010
8772
|
updateAssets,
|
|
8011
8773
|
updateCategory,
|
|
8012
8774
|
updateConversation,
|
|
@@ -8034,8 +8796,6 @@ export {
|
|
|
8034
8796
|
updateProjectAccess,
|
|
8035
8797
|
updateProjectAttachment,
|
|
8036
8798
|
updateProjectAttachments,
|
|
8037
|
-
updateStage,
|
|
8038
|
-
updateStages,
|
|
8039
8799
|
updateTeam,
|
|
8040
8800
|
updateWorkspace,
|
|
8041
8801
|
useMemoCompare,
|