@overmap-ai/core 1.0.53-component-asset-renames.2 → 1.0.53-fix-outbox.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/README.md +4 -4
- package/dist/constants/ui.d.ts +1 -1
- package/dist/enums/ui.d.ts +1 -1
- package/dist/overmap-core.js +967 -913
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +968 -914
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/sdk.d.ts +20 -8
- package/dist/sdk/services/BaseApiService.d.ts +0 -12
- package/dist/sdk/services/ComponentAttachmentService.d.ts +10 -0
- package/dist/sdk/services/ComponentService.d.ts +11 -0
- package/dist/sdk/services/ComponentStageCompletionService.d.ts +17 -0
- package/dist/sdk/services/ComponentStageService.d.ts +11 -0
- package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +10 -0
- package/dist/sdk/services/ComponentTypeService.d.ts +9 -0
- package/dist/sdk/services/UserFormService.d.ts +2 -2
- package/dist/sdk/services/UserFormSubmissionService.d.ts +1 -1
- package/dist/sdk/services/index.d.ts +6 -6
- package/dist/store/slices/ComponentStageCompletionSlice.d.ts +27 -0
- package/dist/store/slices/categorySlice.d.ts +4 -4
- package/dist/store/slices/componentSlice.d.ts +73 -0
- package/dist/store/slices/componentStageSlice.d.ts +42 -0
- package/dist/store/slices/componentTypeSlice.d.ts +75 -0
- package/dist/store/slices/documentSlice.d.ts +7 -6
- package/dist/store/slices/formRevisionSlice.d.ts +5 -5
- package/dist/store/slices/formSlice.d.ts +7 -7
- package/dist/store/slices/formSubmissionSlice.d.ts +2 -2
- package/dist/store/slices/index.d.ts +4 -4
- package/dist/store/slices/issueSlice.d.ts +4 -4
- package/dist/store/slices/projectFileSlice.d.ts +4 -4
- package/dist/store/slices/workspaceSlice.d.ts +4 -4
- package/dist/store/store.d.ts +13 -13
- package/dist/typings/models/attachments.d.ts +6 -6
- package/dist/typings/models/components.d.ts +7 -11
- package/dist/typings/models/forms.d.ts +3 -3
- package/dist/utils/colors.d.ts +1 -1
- package/package.json +153 -153
- package/dist/sdk/services/AssetAttachmentService.d.ts +0 -10
- package/dist/sdk/services/AssetService.d.ts +0 -11
- package/dist/sdk/services/AssetStageCompletionService.d.ts +0 -16
- package/dist/sdk/services/AssetStageService.d.ts +0 -11
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +0 -10
- package/dist/sdk/services/AssetTypeService.d.ts +0 -9
- package/dist/store/slices/assetSlice.d.ts +0 -63
- package/dist/store/slices/assetStageCompletionSlice.d.ts +0 -15
- package/dist/store/slices/assetStageSlice.d.ts +0 -32
- package/dist/store/slices/assetTypeSlice.d.ts +0 -74
|
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
(function(global2, factory) {
|
|
8
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("
|
|
9
|
-
})(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux,
|
|
8
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("file-saver"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("uuid"), require("color"), require("jwt-decode"), require("@redux-offline/redux-offline/lib/constants"), require("idb"), require("formik"), require("react-dom"), require("lodash.get"), require("linkify-react"), require("@hello-pangea/dnd"), require("qr-scanner"), require("xlsx"), require("react-pdf"), require("react-pdf/dist/Page/AnnotationLayer.css"), require("react-pdf/dist/Page/TextLayer.css"), require("react-sketch-canvas"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react", "react/jsx-runtime", "@overmap-ai/blocks", "dependency-graph", "file-saver", "@redux-offline/redux-offline", "@redux-offline/redux-offline/lib/defaults", "localforage", "redux-persist-migrate", "@reduxjs/toolkit", "superagent", "react-redux", "uuid", "color", "jwt-decode", "@redux-offline/redux-offline/lib/constants", "idb", "formik", "react-dom", "lodash.get", "linkify-react", "@hello-pangea/dnd", "qr-scanner", "xlsx", "react-pdf", "react-pdf/dist/Page/AnnotationLayer.css", "react-pdf/dist/Page/TextLayer.css", "react-sketch-canvas", "lodash.set", "lodash.clonedeep"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["overmap-core"] = {}, global2.React, global2.jsxRuntime, global2.blocks, global2.dependencyGraph, global2.saveAs, global2.reduxOffline, global2.offlineConfig, global2.localforage, global2.createMigration, global2.toolkit, global2.request, global2.reactRedux, global2.uuid, global2.ColorCls, global2.jwtDecode, global2.constants, global2.idb, global2.formik, global2.ReactDOM, global2.get, global2.Linkify, global2.dnd, global2.QrScannerAPI, global2.xlsx, global2.reactPdf, null, null, global2.reactSketchCanvas, global2.set, global2.cloneDeep));
|
|
9
|
+
})(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, saveAs, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux, uuid, ColorCls, jwtDecode, constants, idb, formik, ReactDOM, get, Linkify, dnd, QrScannerAPI, xlsx, reactPdf, AnnotationLayer_css, TextLayer_css, reactSketchCanvas, set, cloneDeep) {
|
|
10
10
|
var _a;
|
|
11
11
|
"use strict";
|
|
12
12
|
function _interopNamespaceDefault(e) {
|
|
@@ -268,46 +268,112 @@ var __publicField = (obj, key, value) => {
|
|
|
268
268
|
this.options = options;
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
class
|
|
272
|
-
constructor() {
|
|
273
|
-
__publicField(this,
|
|
274
|
-
|
|
275
|
-
__publicField(this, "_resolve");
|
|
276
|
-
__publicField(this, "_reject");
|
|
277
|
-
__publicField(this, "_state", "pending");
|
|
278
|
-
this._resolve = null;
|
|
279
|
-
this._reject = null;
|
|
280
|
-
this._promise = new Promise((resolve, reject) => {
|
|
281
|
-
this._resolve = resolve;
|
|
282
|
-
this._reject = reject;
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
get state() {
|
|
286
|
-
return this._state;
|
|
271
|
+
class BaseApiService {
|
|
272
|
+
constructor(sdk) {
|
|
273
|
+
__publicField(this, "client");
|
|
274
|
+
this.client = sdk;
|
|
287
275
|
}
|
|
288
|
-
|
|
289
|
-
|
|
276
|
+
}
|
|
277
|
+
function hex(buffer) {
|
|
278
|
+
const hashArray = new Uint8Array(buffer);
|
|
279
|
+
return hashArray.reduce((data, byte) => data + byte.toString(16).padStart(2, "0"), "");
|
|
280
|
+
}
|
|
281
|
+
const getFileS3Key = async (file, hash) => {
|
|
282
|
+
if (!hash) {
|
|
283
|
+
hash = await hashFile(file);
|
|
290
284
|
}
|
|
291
|
-
|
|
292
|
-
|
|
285
|
+
let fileType = file.type;
|
|
286
|
+
if (fileType.includes("/")) {
|
|
287
|
+
fileType = fileType.split("/")[1];
|
|
293
288
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
throw new Error("No resolve callback");
|
|
297
|
-
this._resolve(value);
|
|
298
|
-
this._state = "fulfilled";
|
|
289
|
+
if (!fileType) {
|
|
290
|
+
throw new Error(`Could not extract file type from ${file.type}`);
|
|
299
291
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
292
|
+
return `${hash}.${fileType}`;
|
|
293
|
+
};
|
|
294
|
+
function hashFile(file) {
|
|
295
|
+
return new Promise((resolve, reject) => {
|
|
296
|
+
const reader = new FileReader();
|
|
297
|
+
reader.onload = () => {
|
|
298
|
+
const fileResult = reader.result;
|
|
299
|
+
if (!fileResult) {
|
|
300
|
+
reject();
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
void crypto.subtle.digest("SHA-1", fileResult).then((hash) => {
|
|
304
|
+
const sha1result = hex(hash);
|
|
305
|
+
resolve(sha1result);
|
|
306
|
+
});
|
|
307
|
+
};
|
|
308
|
+
reader.readAsArrayBuffer(file);
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function getFileIdentifier(file) {
|
|
312
|
+
if (!file.name || !file.type || !file.size) {
|
|
313
|
+
const message = "File has no name, type, and/or size";
|
|
314
|
+
console.error(`${message}`, file);
|
|
315
|
+
throw new Error(`${message}.`);
|
|
305
316
|
}
|
|
306
|
-
|
|
307
|
-
|
|
317
|
+
return `${file.name}&${file.type}${file.size}`;
|
|
318
|
+
}
|
|
319
|
+
function getRenamedFile(file, newName) {
|
|
320
|
+
return new File([file], newName, { type: file.type });
|
|
321
|
+
}
|
|
322
|
+
function downloadInMemoryFile(filename, text) {
|
|
323
|
+
const element = document.createElement("a");
|
|
324
|
+
element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text));
|
|
325
|
+
element.setAttribute("download", filename);
|
|
326
|
+
element.style.display = "none";
|
|
327
|
+
document.body.appendChild(element);
|
|
328
|
+
element.click();
|
|
329
|
+
document.body.removeChild(element);
|
|
330
|
+
}
|
|
331
|
+
const constructUploadedFilePayloads = async (files) => {
|
|
332
|
+
const filePayloads = {};
|
|
333
|
+
for (const file of files) {
|
|
334
|
+
const sha1 = await hashFile(file);
|
|
335
|
+
filePayloads[sha1] = {
|
|
336
|
+
sha1,
|
|
337
|
+
extension: file.name.split(".").pop() || "",
|
|
338
|
+
file_type: file.type,
|
|
339
|
+
size: file.size
|
|
340
|
+
};
|
|
308
341
|
}
|
|
342
|
+
return Object.values(filePayloads);
|
|
343
|
+
};
|
|
344
|
+
const fileToBlob = async (dataUrl) => {
|
|
345
|
+
return (await fetch(dataUrl)).blob();
|
|
346
|
+
};
|
|
347
|
+
const blobToBase64 = (blob) => {
|
|
348
|
+
return new Promise((resolve, _) => {
|
|
349
|
+
const reader = new FileReader();
|
|
350
|
+
reader.onloadend = () => {
|
|
351
|
+
var _a2;
|
|
352
|
+
resolve(((_a2 = reader.result) == null ? void 0 : _a2.toString()) || "");
|
|
353
|
+
};
|
|
354
|
+
reader.readAsDataURL(blob);
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
const useFileSrc = (props) => {
|
|
358
|
+
const { file, fileSha1, placeholder } = props;
|
|
359
|
+
const [src, setSrc] = React.useState(placeholder);
|
|
360
|
+
const { sdk } = useSDK();
|
|
361
|
+
React.useEffect(() => {
|
|
362
|
+
if (!fileSha1 || !file)
|
|
363
|
+
return;
|
|
364
|
+
sdk.files.fetchFileFromUrl(file, fileSha1).then((file2) => {
|
|
365
|
+
setSrc(URL.createObjectURL(file2));
|
|
366
|
+
}).catch((reason) => {
|
|
367
|
+
console.error(`Failed to fetch file ${file} (${fileSha1}):
|
|
368
|
+
`, reason);
|
|
369
|
+
});
|
|
370
|
+
}, [file, fileSha1, sdk.files]);
|
|
371
|
+
return src;
|
|
372
|
+
};
|
|
373
|
+
function downloadFile(file) {
|
|
374
|
+
const blob = new Blob([file]);
|
|
375
|
+
saveAs.saveAs(blob, file.name);
|
|
309
376
|
}
|
|
310
|
-
_a = Symbol.toStringTag;
|
|
311
377
|
const global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
312
378
|
function defaultSetTimout() {
|
|
313
379
|
throw new Error("setTimeout has not been defined");
|
|
@@ -787,106 +853,6 @@ var __publicField = (obj, key, value) => {
|
|
|
787
853
|
}
|
|
788
854
|
return classes.join(" ");
|
|
789
855
|
}
|
|
790
|
-
function hex(buffer) {
|
|
791
|
-
const hashArray = new Uint8Array(buffer);
|
|
792
|
-
return hashArray.reduce((data, byte) => data + byte.toString(16).padStart(2, "0"), "");
|
|
793
|
-
}
|
|
794
|
-
const getFileS3Key = async (file, hash) => {
|
|
795
|
-
if (!hash) {
|
|
796
|
-
hash = await hashFile(file);
|
|
797
|
-
}
|
|
798
|
-
let fileType = file.type;
|
|
799
|
-
if (fileType.includes("/")) {
|
|
800
|
-
fileType = fileType.split("/")[1];
|
|
801
|
-
}
|
|
802
|
-
if (!fileType) {
|
|
803
|
-
throw new Error(`Could not extract file type from ${file.type}`);
|
|
804
|
-
}
|
|
805
|
-
return `${hash}.${fileType}`;
|
|
806
|
-
};
|
|
807
|
-
function hashFile(file) {
|
|
808
|
-
return new Promise((resolve, reject) => {
|
|
809
|
-
const reader = new FileReader();
|
|
810
|
-
reader.onload = () => {
|
|
811
|
-
const fileResult = reader.result;
|
|
812
|
-
if (!fileResult) {
|
|
813
|
-
reject();
|
|
814
|
-
return;
|
|
815
|
-
}
|
|
816
|
-
void crypto.subtle.digest("SHA-1", fileResult).then((hash) => {
|
|
817
|
-
const sha1result = hex(hash);
|
|
818
|
-
resolve(sha1result);
|
|
819
|
-
});
|
|
820
|
-
};
|
|
821
|
-
reader.readAsArrayBuffer(file);
|
|
822
|
-
});
|
|
823
|
-
}
|
|
824
|
-
function getFileIdentifier(file) {
|
|
825
|
-
if (!file.name || !file.type || !file.size) {
|
|
826
|
-
const message = "File has no name, type, and/or size";
|
|
827
|
-
console.error(`${message}`, file);
|
|
828
|
-
throw new Error(`${message}.`);
|
|
829
|
-
}
|
|
830
|
-
return `${file.name}&${file.type}${file.size}`;
|
|
831
|
-
}
|
|
832
|
-
function getRenamedFile(file, newName) {
|
|
833
|
-
return new File([file], newName, { type: file.type });
|
|
834
|
-
}
|
|
835
|
-
function downloadInMemoryFile(filename, text) {
|
|
836
|
-
const element = document.createElement("a");
|
|
837
|
-
element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text));
|
|
838
|
-
element.setAttribute("download", filename);
|
|
839
|
-
element.style.display = "none";
|
|
840
|
-
document.body.appendChild(element);
|
|
841
|
-
element.click();
|
|
842
|
-
document.body.removeChild(element);
|
|
843
|
-
}
|
|
844
|
-
const constructUploadedFilePayloads = async (files) => {
|
|
845
|
-
const filePayloads = {};
|
|
846
|
-
for (const file of files) {
|
|
847
|
-
const sha1 = await hashFile(file);
|
|
848
|
-
filePayloads[sha1] = {
|
|
849
|
-
sha1,
|
|
850
|
-
extension: file.name.split(".").pop() || "",
|
|
851
|
-
file_type: file.type,
|
|
852
|
-
size: file.size
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
return Object.values(filePayloads);
|
|
856
|
-
};
|
|
857
|
-
const fileToBlob = async (dataUrl) => {
|
|
858
|
-
return (await fetch(dataUrl)).blob();
|
|
859
|
-
};
|
|
860
|
-
const blobToBase64 = (blob) => {
|
|
861
|
-
return new Promise((resolve, _) => {
|
|
862
|
-
const reader = new FileReader();
|
|
863
|
-
reader.onloadend = () => {
|
|
864
|
-
var _a2;
|
|
865
|
-
resolve(((_a2 = reader.result) == null ? void 0 : _a2.toString()) || "");
|
|
866
|
-
};
|
|
867
|
-
reader.readAsDataURL(blob);
|
|
868
|
-
});
|
|
869
|
-
};
|
|
870
|
-
const useFileSrc = (props) => {
|
|
871
|
-
const { file, fileSha1, placeholder } = props;
|
|
872
|
-
const [src, setSrc] = React.useState(placeholder);
|
|
873
|
-
const { sdk } = useSDK();
|
|
874
|
-
React.useEffect(() => {
|
|
875
|
-
if (!fileSha1 || !file)
|
|
876
|
-
return;
|
|
877
|
-
sdk.files.fetchFileFromUrl(file, fileSha1).then((file2) => {
|
|
878
|
-
setSrc(URL.createObjectURL(file2));
|
|
879
|
-
}).catch((reason) => {
|
|
880
|
-
console.error(`Failed to fetch file ${file} (${fileSha1}):
|
|
881
|
-
`, reason);
|
|
882
|
-
});
|
|
883
|
-
}, [file, fileSha1, sdk.files]);
|
|
884
|
-
return src;
|
|
885
|
-
};
|
|
886
|
-
function downloadFile(file) {
|
|
887
|
-
const blob = new Blob([file]);
|
|
888
|
-
saveAs.saveAs(blob, file.name);
|
|
889
|
-
}
|
|
890
856
|
const logCache = {};
|
|
891
857
|
function logOnlyOnce(logId, objId, level, ...args) {
|
|
892
858
|
const thisLogIdCache = logCache[logId];
|
|
@@ -1374,7 +1340,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1374
1340
|
[mint.mint9]: "mint",
|
|
1375
1341
|
[sky.sky9]: "sky"
|
|
1376
1342
|
};
|
|
1377
|
-
const
|
|
1343
|
+
const ComponentStageColors = {
|
|
1378
1344
|
indigo: indigo.indigo9,
|
|
1379
1345
|
red: red.red9,
|
|
1380
1346
|
violet: violet.violet9,
|
|
@@ -1396,7 +1362,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1396
1362
|
return { backgroundColor, textColor };
|
|
1397
1363
|
};
|
|
1398
1364
|
function getStageColor(index2) {
|
|
1399
|
-
return Object.values(
|
|
1365
|
+
return Object.values(ComponentStageColors)[index2 % Object.keys(ComponentStageColors).length];
|
|
1400
1366
|
}
|
|
1401
1367
|
const getLocalDateString = memoize((date) => {
|
|
1402
1368
|
if (!date)
|
|
@@ -1616,115 +1582,122 @@ var __publicField = (obj, key, value) => {
|
|
|
1616
1582
|
}
|
|
1617
1583
|
}
|
|
1618
1584
|
const initialState$q = {
|
|
1619
|
-
|
|
1620
|
-
|
|
1585
|
+
componentTypes: {},
|
|
1586
|
+
hiddenComponentTypeIds: {},
|
|
1621
1587
|
attachments: {}
|
|
1622
1588
|
};
|
|
1623
|
-
const
|
|
1624
|
-
name: "
|
|
1589
|
+
const componentTypeSlice = toolkit.createSlice({
|
|
1590
|
+
name: "componentTypes",
|
|
1625
1591
|
initialState: initialState$q,
|
|
1626
1592
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1627
1593
|
reducers: {
|
|
1628
|
-
|
|
1629
|
-
state.
|
|
1594
|
+
addComponentType: (state, action) => {
|
|
1595
|
+
state.componentTypes[action.payload.offline_id] = action.payload;
|
|
1630
1596
|
},
|
|
1631
|
-
|
|
1632
|
-
state.
|
|
1597
|
+
setComponentTypes: (state, action) => {
|
|
1598
|
+
state.componentTypes = toOfflineIdRecord(action.payload);
|
|
1633
1599
|
},
|
|
1634
|
-
|
|
1635
|
-
state.
|
|
1600
|
+
toggleComponentTypeVisibility: (state, action) => {
|
|
1601
|
+
state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
|
|
1636
1602
|
},
|
|
1637
|
-
|
|
1638
|
-
delete state.
|
|
1603
|
+
deleteComponentType: (state, action) => {
|
|
1604
|
+
delete state.componentTypes[action.payload];
|
|
1639
1605
|
},
|
|
1640
1606
|
// Attachments
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1607
|
+
setComponentTypeAttachment: setAttachment,
|
|
1608
|
+
setComponentTypeAttachments: setAttachments,
|
|
1609
|
+
addComponentTypeAttachment: addAttachment,
|
|
1610
|
+
addComponentTypeAttachments: addAttachments,
|
|
1611
|
+
updateComponentTypeAttachment: updateAttachment,
|
|
1612
|
+
updateComponentTypeAttachments: updateAttachments,
|
|
1613
|
+
removeComponentTypeAttachment: removeAttachment,
|
|
1614
|
+
removeComponentTypeAttachments: removeAttachments
|
|
1649
1615
|
}
|
|
1650
1616
|
});
|
|
1651
1617
|
const {
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1618
|
+
addComponentType,
|
|
1619
|
+
setComponentTypes,
|
|
1620
|
+
toggleComponentTypeVisibility,
|
|
1621
|
+
deleteComponentType,
|
|
1656
1622
|
// Attachmet
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
} =
|
|
1666
|
-
const
|
|
1667
|
-
const
|
|
1668
|
-
[
|
|
1623
|
+
setComponentTypeAttachment,
|
|
1624
|
+
setComponentTypeAttachments,
|
|
1625
|
+
addComponentTypeAttachment,
|
|
1626
|
+
addComponentTypeAttachments,
|
|
1627
|
+
updateComponentTypeAttachment,
|
|
1628
|
+
updateComponentTypeAttachments,
|
|
1629
|
+
removeComponentTypeAttachment,
|
|
1630
|
+
removeComponentTypeAttachments
|
|
1631
|
+
} = componentTypeSlice.actions;
|
|
1632
|
+
const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
|
|
1633
|
+
const selectComponentTypes = toolkit.createSelector(
|
|
1634
|
+
[selectComponentTypesMapping],
|
|
1669
1635
|
(mapping) => Object.values(mapping)
|
|
1670
1636
|
);
|
|
1671
|
-
const
|
|
1672
|
-
toolkit.createSelector(
|
|
1673
|
-
[selectAssetTypesMapping, (_state, assetTypeId) => assetTypeId],
|
|
1674
|
-
(mapping, assetTypeId) => mapping[assetTypeId]
|
|
1675
|
-
)
|
|
1637
|
+
const selectComponentType = restructureCreateSelectorWithArgs(
|
|
1638
|
+
toolkit.createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
|
|
1676
1639
|
);
|
|
1677
|
-
const
|
|
1640
|
+
const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
|
|
1678
1641
|
toolkit.createSelector(
|
|
1679
|
-
[
|
|
1642
|
+
[
|
|
1643
|
+
selectComponentTypesMapping,
|
|
1644
|
+
(_state, args) => args
|
|
1645
|
+
],
|
|
1680
1646
|
(mapping, args) => {
|
|
1681
1647
|
var _a2;
|
|
1682
1648
|
const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
|
|
1683
1649
|
return Object.values(mapping).filter(
|
|
1684
|
-
(
|
|
1650
|
+
(componentType) => {
|
|
1685
1651
|
var _a3;
|
|
1686
|
-
return (((_a3 =
|
|
1652
|
+
return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
|
|
1687
1653
|
}
|
|
1688
1654
|
).length;
|
|
1689
1655
|
}
|
|
1690
1656
|
)
|
|
1691
1657
|
);
|
|
1692
|
-
const
|
|
1693
|
-
toolkit.createSelector(
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
return (
|
|
1698
|
-
|
|
1699
|
-
|
|
1658
|
+
const selectComponentTypesByName = restructureCreateSelectorWithArgs(
|
|
1659
|
+
toolkit.createSelector(
|
|
1660
|
+
[selectComponentTypesMapping, (_state, name) => name],
|
|
1661
|
+
(mapping, name) => {
|
|
1662
|
+
name = (name == null ? void 0 : name.toLowerCase()) ?? null;
|
|
1663
|
+
return Object.values(mapping).filter(
|
|
1664
|
+
(componentType) => {
|
|
1665
|
+
var _a2;
|
|
1666
|
+
return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
1667
|
+
}
|
|
1668
|
+
);
|
|
1669
|
+
}
|
|
1670
|
+
)
|
|
1700
1671
|
);
|
|
1701
|
-
const
|
|
1702
|
-
const
|
|
1703
|
-
const
|
|
1704
|
-
[
|
|
1672
|
+
const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
|
|
1673
|
+
const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
|
|
1674
|
+
const selectAllComponentTypeAttachments = toolkit.createSelector(
|
|
1675
|
+
[selectComponentTypeAttachmentMapping],
|
|
1705
1676
|
(mapping) => Object.values(mapping)
|
|
1706
1677
|
);
|
|
1707
|
-
const
|
|
1708
|
-
return state.
|
|
1678
|
+
const selectComponentTypeAttachment = (attachmentId) => (state) => {
|
|
1679
|
+
return state.componentTypeReducer.attachments[attachmentId];
|
|
1709
1680
|
};
|
|
1710
|
-
const
|
|
1681
|
+
const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
|
|
1711
1682
|
toolkit.createSelector(
|
|
1712
|
-
[
|
|
1713
|
-
(attachments,
|
|
1714
|
-
return attachments.filter(({
|
|
1683
|
+
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
1684
|
+
(attachments, componentTypeId) => {
|
|
1685
|
+
return attachments.filter(({ component_type }) => componentTypeId === component_type);
|
|
1715
1686
|
}
|
|
1716
1687
|
)
|
|
1717
1688
|
);
|
|
1718
|
-
const
|
|
1689
|
+
const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
|
|
1719
1690
|
toolkit.createSelector(
|
|
1720
|
-
[
|
|
1721
|
-
(attachments,
|
|
1722
|
-
const
|
|
1723
|
-
|
|
1691
|
+
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
1692
|
+
(attachments, componentTypeId) => {
|
|
1693
|
+
const attachmentsOfComponent = attachments.filter(
|
|
1694
|
+
({ component_type }) => component_type === componentTypeId
|
|
1695
|
+
);
|
|
1696
|
+
const fileAttachments = attachmentsOfComponent.filter(
|
|
1724
1697
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1725
1698
|
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1726
1699
|
);
|
|
1727
|
-
const imageAttachments =
|
|
1700
|
+
const imageAttachments = attachmentsOfComponent.filter(
|
|
1728
1701
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1729
1702
|
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1730
1703
|
);
|
|
@@ -1732,157 +1705,173 @@ var __publicField = (obj, key, value) => {
|
|
|
1732
1705
|
}
|
|
1733
1706
|
)
|
|
1734
1707
|
);
|
|
1735
|
-
const
|
|
1708
|
+
const componentTypeReducer = componentTypeSlice.reducer;
|
|
1736
1709
|
const initialState$p = {
|
|
1737
|
-
|
|
1710
|
+
components: {},
|
|
1738
1711
|
attachments: {}
|
|
1739
1712
|
};
|
|
1740
|
-
const
|
|
1741
|
-
name: "
|
|
1713
|
+
const componentSlice = toolkit.createSlice({
|
|
1714
|
+
name: "components",
|
|
1742
1715
|
initialState: initialState$p,
|
|
1743
1716
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1744
1717
|
reducers: {
|
|
1745
|
-
|
|
1746
|
-
state.
|
|
1747
|
-
|
|
1718
|
+
addComponent: (state, action) => {
|
|
1719
|
+
state.components[action.payload.offline_id] = action.payload;
|
|
1720
|
+
prevComponents = null;
|
|
1748
1721
|
},
|
|
1749
|
-
|
|
1750
|
-
Object.assign(state.
|
|
1751
|
-
|
|
1722
|
+
addComponentsInBatches: (state, action) => {
|
|
1723
|
+
Object.assign(state.components, toOfflineIdRecord(action.payload));
|
|
1724
|
+
prevComponents = null;
|
|
1752
1725
|
},
|
|
1753
|
-
|
|
1754
|
-
state.
|
|
1755
|
-
|
|
1726
|
+
setComponents: (state, action) => {
|
|
1727
|
+
state.components = toOfflineIdRecord(action.payload);
|
|
1728
|
+
prevComponents = null;
|
|
1756
1729
|
},
|
|
1757
|
-
|
|
1758
|
-
if (action.payload.offline_id in state.
|
|
1759
|
-
state.
|
|
1730
|
+
updateComponent: (state, action) => {
|
|
1731
|
+
if (action.payload.offline_id in state.components) {
|
|
1732
|
+
state.components[action.payload.offline_id] = action.payload;
|
|
1760
1733
|
} else {
|
|
1761
|
-
throw new Error(`Tried to update
|
|
1734
|
+
throw new Error(`Tried to update component with ID that doesn't exist: ${action.payload.offline_id}`);
|
|
1762
1735
|
}
|
|
1763
|
-
|
|
1736
|
+
prevComponents = null;
|
|
1764
1737
|
},
|
|
1765
|
-
|
|
1766
|
-
if (action.payload in state.
|
|
1767
|
-
delete state.
|
|
1738
|
+
removeComponent: (state, action) => {
|
|
1739
|
+
if (action.payload in state.components) {
|
|
1740
|
+
delete state.components[action.payload];
|
|
1768
1741
|
} else {
|
|
1769
|
-
throw new Error(`Failed to remove
|
|
1742
|
+
throw new Error(`Failed to remove component because ID doesn't exist: ${action.payload}`);
|
|
1770
1743
|
}
|
|
1771
|
-
|
|
1744
|
+
prevComponents = null;
|
|
1772
1745
|
},
|
|
1773
|
-
|
|
1746
|
+
removeAllComponentsOfType: (state, action) => {
|
|
1774
1747
|
var _a2;
|
|
1775
|
-
for (const componentId in state.
|
|
1776
|
-
if (((_a2 = state.
|
|
1777
|
-
delete state.
|
|
1748
|
+
for (const componentId in state.components) {
|
|
1749
|
+
if (((_a2 = state.components[componentId]) == null ? void 0 : _a2.component_type) === action.payload) {
|
|
1750
|
+
delete state.components[componentId];
|
|
1778
1751
|
}
|
|
1779
1752
|
}
|
|
1780
|
-
|
|
1753
|
+
prevComponents = null;
|
|
1781
1754
|
},
|
|
1782
1755
|
// Attachments
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1756
|
+
setComponentAttachment: setAttachment,
|
|
1757
|
+
setComponentAttachments: setAttachments,
|
|
1758
|
+
addComponentAttachment: addAttachment,
|
|
1759
|
+
addComponentAttachments: addAttachments,
|
|
1760
|
+
updateComponentAttachment: updateAttachment,
|
|
1761
|
+
updateComponentAttachments: updateAttachments,
|
|
1762
|
+
removeComponentAttachment: removeAttachment,
|
|
1763
|
+
removeComponentAttachments: removeAttachments
|
|
1791
1764
|
}
|
|
1792
1765
|
});
|
|
1793
1766
|
const {
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1767
|
+
addComponent,
|
|
1768
|
+
updateComponent,
|
|
1769
|
+
removeComponent,
|
|
1770
|
+
addComponentsInBatches,
|
|
1771
|
+
setComponents,
|
|
1772
|
+
removeAllComponentsOfType,
|
|
1800
1773
|
// Attachments
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
} =
|
|
1810
|
-
let
|
|
1811
|
-
const
|
|
1812
|
-
if (!
|
|
1813
|
-
|
|
1814
|
-
}
|
|
1815
|
-
return
|
|
1774
|
+
setComponentAttachment,
|
|
1775
|
+
setComponentAttachments,
|
|
1776
|
+
addComponentAttachment,
|
|
1777
|
+
addComponentAttachments,
|
|
1778
|
+
updateComponentAttachment,
|
|
1779
|
+
updateComponentAttachments,
|
|
1780
|
+
removeComponentAttachment,
|
|
1781
|
+
removeComponentAttachments
|
|
1782
|
+
} = componentSlice.actions;
|
|
1783
|
+
let prevComponents = null;
|
|
1784
|
+
const selectComponents = (state) => {
|
|
1785
|
+
if (!prevComponents) {
|
|
1786
|
+
prevComponents = Object.values(state.componentReducer.components);
|
|
1787
|
+
}
|
|
1788
|
+
return prevComponents;
|
|
1816
1789
|
};
|
|
1817
|
-
const
|
|
1818
|
-
const
|
|
1819
|
-
toolkit.createSelector(
|
|
1820
|
-
|
|
1821
|
-
|
|
1790
|
+
const selectComponentsMapping = (state) => state.componentReducer.components;
|
|
1791
|
+
const selectComponentsFromComponentType = restructureCreateSelectorWithArgs(
|
|
1792
|
+
toolkit.createSelector(
|
|
1793
|
+
[selectComponents, (_state, componentTypeId) => componentTypeId],
|
|
1794
|
+
(components, componentTypeId) => {
|
|
1795
|
+
if (!componentTypeId)
|
|
1796
|
+
return [];
|
|
1797
|
+
return components.filter((component) => component.component_type === componentTypeId);
|
|
1798
|
+
}
|
|
1799
|
+
)
|
|
1822
1800
|
);
|
|
1823
|
-
const
|
|
1824
|
-
return state.
|
|
1801
|
+
const selectComponent = (componentId) => (state) => {
|
|
1802
|
+
return state.componentReducer.components[componentId];
|
|
1825
1803
|
};
|
|
1826
|
-
const
|
|
1827
|
-
[
|
|
1828
|
-
|
|
1804
|
+
const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
|
|
1805
|
+
return state.componentTypeReducer.componentTypes[componentTypeId];
|
|
1806
|
+
};
|
|
1807
|
+
const selectComponentTypeFromComponents = toolkit.createSelector(
|
|
1808
|
+
[selectComponents, selectComponentTypesMapping],
|
|
1809
|
+
(components, componentTypeMapping) => {
|
|
1829
1810
|
const ret = {};
|
|
1830
|
-
for (const
|
|
1831
|
-
const
|
|
1832
|
-
if (!
|
|
1811
|
+
for (const component of components) {
|
|
1812
|
+
const componentType = componentTypeMapping[component.component_type];
|
|
1813
|
+
if (!componentType) {
|
|
1833
1814
|
console.error(
|
|
1834
|
-
`
|
|
1835
|
-
Expected all referenced
|
|
1815
|
+
`Component type with ID ${component.component_type} not found.
|
|
1816
|
+
Expected all referenced component types to be populated.
|
|
1836
1817
|
Returning empty object to avoid fatal errors.`
|
|
1837
1818
|
);
|
|
1838
1819
|
return {};
|
|
1839
1820
|
}
|
|
1840
|
-
ret[
|
|
1821
|
+
ret[component.offline_id] = componentType;
|
|
1841
1822
|
}
|
|
1842
1823
|
return ret;
|
|
1843
1824
|
}
|
|
1844
1825
|
);
|
|
1845
|
-
const
|
|
1826
|
+
const selectComponentsByType = restructureCreateSelectorWithArgs(
|
|
1827
|
+
toolkit.createSelector(
|
|
1828
|
+
[selectComponents, (_state, componentTypeId) => componentTypeId],
|
|
1829
|
+
(components, componentTypeId) => {
|
|
1830
|
+
return components.filter((component) => component.component_type === componentTypeId);
|
|
1831
|
+
}
|
|
1832
|
+
)
|
|
1833
|
+
);
|
|
1834
|
+
const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
|
|
1846
1835
|
var _a2;
|
|
1847
|
-
if (!
|
|
1836
|
+
if (!componentTypeId)
|
|
1848
1837
|
return 0;
|
|
1849
|
-
return (_a2 =
|
|
1838
|
+
return (_a2 = selectComponentsByType(componentTypeId)(state)) == null ? void 0 : _a2.length;
|
|
1850
1839
|
};
|
|
1851
|
-
const
|
|
1852
|
-
return
|
|
1853
|
-
const
|
|
1854
|
-
if (
|
|
1855
|
-
acc.push(
|
|
1840
|
+
const selectComponentTypesFromIds = (componentTypeIds) => (state) => {
|
|
1841
|
+
return componentTypeIds.reduce((acc, componentTypeId) => {
|
|
1842
|
+
const componentType = state.componentTypeReducer.componentTypes[componentTypeId];
|
|
1843
|
+
if (componentType) {
|
|
1844
|
+
acc.push(componentType);
|
|
1856
1845
|
}
|
|
1857
1846
|
return acc;
|
|
1858
1847
|
}, []);
|
|
1859
1848
|
};
|
|
1860
|
-
const
|
|
1861
|
-
const
|
|
1862
|
-
[
|
|
1849
|
+
const selectComponentAttachmentMapping = (state) => state.componentReducer.attachments;
|
|
1850
|
+
const selectAllComponentAttachments = toolkit.createSelector(
|
|
1851
|
+
[selectComponentAttachmentMapping],
|
|
1863
1852
|
(mapping) => Object.values(mapping)
|
|
1864
1853
|
);
|
|
1865
|
-
const
|
|
1866
|
-
return state.
|
|
1854
|
+
const selectComponentAttachment = (attachmentId) => (state) => {
|
|
1855
|
+
return state.componentReducer.attachments[attachmentId];
|
|
1867
1856
|
};
|
|
1868
|
-
const
|
|
1857
|
+
const selectAttachmentsOfComponent = restructureCreateSelectorWithArgs(
|
|
1869
1858
|
toolkit.createSelector(
|
|
1870
|
-
[
|
|
1871
|
-
(attachments,
|
|
1872
|
-
return attachments.filter(({
|
|
1859
|
+
[selectAllComponentAttachments, (_state, componentId) => componentId],
|
|
1860
|
+
(attachments, componentId) => {
|
|
1861
|
+
return attachments.filter(({ component }) => componentId === component);
|
|
1873
1862
|
}
|
|
1874
1863
|
)
|
|
1875
1864
|
);
|
|
1876
|
-
const
|
|
1865
|
+
const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
|
|
1877
1866
|
toolkit.createSelector(
|
|
1878
|
-
[
|
|
1879
|
-
(attachments,
|
|
1880
|
-
const
|
|
1881
|
-
const fileAttachments =
|
|
1867
|
+
[selectAllComponentAttachments, (_state, componentId) => componentId],
|
|
1868
|
+
(attachments, componentId) => {
|
|
1869
|
+
const attachmentsOfComponent = attachments.filter(({ component }) => componentId === component);
|
|
1870
|
+
const fileAttachments = attachmentsOfComponent.filter(
|
|
1882
1871
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1883
1872
|
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1884
1873
|
);
|
|
1885
|
-
const imageAttachments =
|
|
1874
|
+
const imageAttachments = attachmentsOfComponent.filter(
|
|
1886
1875
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1887
1876
|
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1888
1877
|
);
|
|
@@ -1890,67 +1879,69 @@ var __publicField = (obj, key, value) => {
|
|
|
1890
1879
|
}
|
|
1891
1880
|
)
|
|
1892
1881
|
);
|
|
1893
|
-
const
|
|
1882
|
+
const componentReducer = componentSlice.reducer;
|
|
1894
1883
|
const initialState$o = {
|
|
1895
|
-
|
|
1884
|
+
completionsByComponentId: {}
|
|
1896
1885
|
};
|
|
1897
|
-
const
|
|
1898
|
-
name: "
|
|
1886
|
+
const componentStageCompletionSlice = toolkit.createSlice({
|
|
1887
|
+
name: "componentStageCompletions",
|
|
1899
1888
|
initialState: initialState$o,
|
|
1900
1889
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1901
1890
|
reducers: {
|
|
1902
1891
|
addStageCompletion: (state, action) => {
|
|
1903
|
-
let stageToCompletionDateMapping = state.
|
|
1892
|
+
let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
|
|
1904
1893
|
if (!stageToCompletionDateMapping) {
|
|
1905
1894
|
stageToCompletionDateMapping = {};
|
|
1906
|
-
state.
|
|
1895
|
+
state.completionsByComponentId[action.payload.component] = stageToCompletionDateMapping;
|
|
1907
1896
|
}
|
|
1908
1897
|
stageToCompletionDateMapping[action.payload.stage] = (/* @__PURE__ */ new Date()).toISOString();
|
|
1909
1898
|
},
|
|
1910
1899
|
addStageCompletions: (state, action) => {
|
|
1911
|
-
for (const [
|
|
1900
|
+
for (const [componentId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
|
|
1912
1901
|
if (Object.keys(stageIdToCompletionDateMapping).length === 0)
|
|
1913
|
-
throw new Error(
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1902
|
+
throw new Error(
|
|
1903
|
+
`Encountered empty stageIdToCompletionDateMapping argument for component ${componentId}`
|
|
1904
|
+
);
|
|
1905
|
+
let thisComponentCompletions = state.completionsByComponentId[componentId];
|
|
1906
|
+
if (thisComponentCompletions === void 0) {
|
|
1907
|
+
thisComponentCompletions = {};
|
|
1917
1908
|
}
|
|
1918
1909
|
for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
|
|
1919
|
-
|
|
1910
|
+
thisComponentCompletions[stageId] = completionDate;
|
|
1920
1911
|
}
|
|
1921
|
-
state.
|
|
1912
|
+
state.completionsByComponentId[componentId] = thisComponentCompletions;
|
|
1922
1913
|
}
|
|
1923
1914
|
},
|
|
1924
1915
|
removeStageCompletions: (state, action) => {
|
|
1925
1916
|
for (const completion of action.payload) {
|
|
1926
|
-
const
|
|
1927
|
-
if (!
|
|
1917
|
+
const thisComponentCompletions = state.completionsByComponentId[completion.component];
|
|
1918
|
+
if (!thisComponentCompletions || !(completion.stage in thisComponentCompletions)) {
|
|
1928
1919
|
console.warn(
|
|
1929
1920
|
"Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
|
|
1930
1921
|
);
|
|
1931
1922
|
continue;
|
|
1932
1923
|
}
|
|
1933
|
-
delete
|
|
1924
|
+
delete thisComponentCompletions[completion.stage];
|
|
1934
1925
|
}
|
|
1935
1926
|
},
|
|
1936
1927
|
setStageCompletions: (state, action) => {
|
|
1937
|
-
state.
|
|
1928
|
+
state.completionsByComponentId = action.payload;
|
|
1938
1929
|
}
|
|
1939
1930
|
}
|
|
1940
1931
|
});
|
|
1941
|
-
const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } =
|
|
1932
|
+
const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = componentStageCompletionSlice.actions;
|
|
1942
1933
|
const selectCompletedStages = (state) => {
|
|
1943
|
-
return state.
|
|
1934
|
+
return state.componentStageCompletionReducer.completionsByComponentId;
|
|
1944
1935
|
};
|
|
1945
|
-
const
|
|
1946
|
-
return Object.keys(state.
|
|
1936
|
+
const selectCompletedStageIdsForComponent = (component) => (state) => {
|
|
1937
|
+
return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
|
|
1947
1938
|
};
|
|
1948
|
-
const
|
|
1939
|
+
const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
|
|
1949
1940
|
const initialState$n = {
|
|
1950
1941
|
stages: {}
|
|
1951
1942
|
};
|
|
1952
|
-
const
|
|
1953
|
-
name: "
|
|
1943
|
+
const componentStageSlice = toolkit.createSlice({
|
|
1944
|
+
name: "componentStages",
|
|
1954
1945
|
initialState: initialState$n,
|
|
1955
1946
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1956
1947
|
reducers: {
|
|
@@ -1985,48 +1976,60 @@ var __publicField = (obj, key, value) => {
|
|
|
1985
1976
|
}
|
|
1986
1977
|
}
|
|
1987
1978
|
});
|
|
1988
|
-
const selectStageMapping = (state) => state.
|
|
1979
|
+
const selectStageMapping = (state) => state.componentStageReducer.stages;
|
|
1989
1980
|
const selectStage = restructureCreateSelectorWithArgs(
|
|
1990
1981
|
toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
|
|
1991
1982
|
return stageMapping[stageId];
|
|
1992
1983
|
})
|
|
1993
1984
|
);
|
|
1994
|
-
const selectStages = toolkit.createSelector(
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
1985
|
+
const selectStages = toolkit.createSelector(
|
|
1986
|
+
[selectStageMapping],
|
|
1987
|
+
(stageMapping) => {
|
|
1988
|
+
return Object.values(stageMapping);
|
|
1989
|
+
}
|
|
1990
|
+
);
|
|
1991
|
+
const selectStagesFromComponentTypeIds = restructureCreateSelectorWithArgs(
|
|
1992
|
+
toolkit.createSelector(
|
|
1993
|
+
[selectStages, (_state, componentTypeIds) => componentTypeIds],
|
|
1994
|
+
(stages, componentTypeIds) => {
|
|
1995
|
+
const componentTypeIdsSet = new Set(componentTypeIds);
|
|
1996
|
+
const ret = {};
|
|
1997
|
+
for (const stage of stages) {
|
|
1998
|
+
if (componentTypeIdsSet.has(stage.component_type)) {
|
|
1999
|
+
if (!ret[stage.component_type]) {
|
|
2000
|
+
ret[stage.component_type] = [];
|
|
2001
|
+
}
|
|
2002
|
+
ret[stage.component_type].push(stage);
|
|
2005
2003
|
}
|
|
2006
|
-
ret[stage.asset_type].push(stage);
|
|
2007
2004
|
}
|
|
2005
|
+
for (const key in ret) {
|
|
2006
|
+
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
2007
|
+
}
|
|
2008
|
+
return ret;
|
|
2008
2009
|
}
|
|
2009
|
-
|
|
2010
|
-
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
2011
|
-
}
|
|
2012
|
-
return ret;
|
|
2013
|
-
})
|
|
2010
|
+
)
|
|
2014
2011
|
);
|
|
2015
|
-
const
|
|
2016
|
-
toolkit.createSelector(
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2012
|
+
const selectComponentTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
2013
|
+
toolkit.createSelector(
|
|
2014
|
+
[selectStageMapping, (_state, componentTypeId) => componentTypeId],
|
|
2015
|
+
(stagesMapping, componentTypeId) => {
|
|
2016
|
+
const componentTypeStagesMapping = {};
|
|
2017
|
+
for (const [stageId, stage] of Object.entries(stagesMapping)) {
|
|
2018
|
+
if (stage.component_type === componentTypeId) {
|
|
2019
|
+
componentTypeStagesMapping[stageId] = stage;
|
|
2020
|
+
}
|
|
2021
2021
|
}
|
|
2022
|
+
return componentTypeStagesMapping;
|
|
2022
2023
|
}
|
|
2023
|
-
|
|
2024
|
-
})
|
|
2024
|
+
)
|
|
2025
2025
|
);
|
|
2026
|
-
const
|
|
2027
|
-
toolkit.createSelector(
|
|
2028
|
-
|
|
2029
|
-
|
|
2026
|
+
const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
|
|
2027
|
+
toolkit.createSelector(
|
|
2028
|
+
[selectStages, (_state, componentTypeId) => componentTypeId],
|
|
2029
|
+
(stages, componentTypeId) => {
|
|
2030
|
+
return stages.filter((stage) => stage.component_type === componentTypeId).sort((a, b) => a.priority - b.priority);
|
|
2031
|
+
}
|
|
2032
|
+
)
|
|
2030
2033
|
);
|
|
2031
2034
|
const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
|
|
2032
2035
|
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
@@ -2048,8 +2051,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2048
2051
|
return ret;
|
|
2049
2052
|
})
|
|
2050
2053
|
);
|
|
2051
|
-
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } =
|
|
2052
|
-
const
|
|
2054
|
+
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
|
|
2055
|
+
const componentStageReducer = componentStageSlice.reducer;
|
|
2053
2056
|
const initialState$m = {
|
|
2054
2057
|
workspaces: {},
|
|
2055
2058
|
activeWorkspaceId: null
|
|
@@ -2708,8 +2711,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2708
2711
|
})(OrganizationAccessLevel || {});
|
|
2709
2712
|
var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
|
|
2710
2713
|
AttachmentModel2["Issue"] = "issue";
|
|
2711
|
-
AttachmentModel2["
|
|
2712
|
-
AttachmentModel2["
|
|
2714
|
+
AttachmentModel2["Component"] = "component";
|
|
2715
|
+
AttachmentModel2["ComponentType"] = "component_type";
|
|
2713
2716
|
AttachmentModel2["Project"] = "project";
|
|
2714
2717
|
AttachmentModel2["Document"] = "document";
|
|
2715
2718
|
return AttachmentModel2;
|
|
@@ -3522,7 +3525,6 @@ var __publicField = (obj, key, value) => {
|
|
|
3522
3525
|
placementMode: false,
|
|
3523
3526
|
enableClustering: false,
|
|
3524
3527
|
svgLayout: false,
|
|
3525
|
-
// TODO: this is no longer used
|
|
3526
3528
|
expandedSections: {
|
|
3527
3529
|
Issues: true,
|
|
3528
3530
|
"Map Layers": false,
|
|
@@ -3733,27 +3735,27 @@ var __publicField = (obj, key, value) => {
|
|
|
3733
3735
|
});
|
|
3734
3736
|
})
|
|
3735
3737
|
);
|
|
3736
|
-
const
|
|
3738
|
+
const selectLatestFormRevisionsOfComponentTypes = restructureCreateSelectorWithArgs(
|
|
3737
3739
|
toolkit.createSelector(
|
|
3738
3740
|
[
|
|
3739
3741
|
(state) => state.formReducer.forms,
|
|
3740
3742
|
selectFormRevisionMapping,
|
|
3741
|
-
(_state,
|
|
3743
|
+
(_state, componentTypeIds) => componentTypeIds
|
|
3742
3744
|
],
|
|
3743
|
-
(userForms, revisions,
|
|
3744
|
-
const
|
|
3745
|
-
const
|
|
3745
|
+
(userForms, revisions, componentTypeIds) => {
|
|
3746
|
+
const componentTypeIdsSet = new Set(componentTypeIds);
|
|
3747
|
+
const formsOfComponentTypes = {};
|
|
3746
3748
|
const ret = {};
|
|
3747
3749
|
for (const form of Object.values(userForms)) {
|
|
3748
|
-
if (form.
|
|
3749
|
-
|
|
3750
|
+
if (form.component_type && componentTypeIdsSet.has(form.component_type)) {
|
|
3751
|
+
formsOfComponentTypes[form.offline_id] = form;
|
|
3750
3752
|
}
|
|
3751
3753
|
}
|
|
3752
3754
|
for (const revision of Object.values(revisions)) {
|
|
3753
|
-
const form =
|
|
3754
|
-
if (!form || !form.
|
|
3755
|
+
const form = formsOfComponentTypes[revision.form];
|
|
3756
|
+
if (!form || !form.component_type || ret[form.component_type] && formRevisionSortFn(ret[form.component_type], revision) > 0)
|
|
3755
3757
|
continue;
|
|
3756
|
-
ret[form.
|
|
3758
|
+
ret[form.component_type] = revision;
|
|
3757
3759
|
}
|
|
3758
3760
|
return ret;
|
|
3759
3761
|
}
|
|
@@ -3870,11 +3872,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3870
3872
|
const selectFormMapping = (state) => {
|
|
3871
3873
|
return state.formReducer.forms;
|
|
3872
3874
|
};
|
|
3873
|
-
const
|
|
3875
|
+
const selectFormOfComponentType = restructureCreateSelectorWithArgs(
|
|
3874
3876
|
toolkit.createSelector(
|
|
3875
|
-
[selectFormMapping, (_state,
|
|
3876
|
-
(userForms,
|
|
3877
|
-
return Object.values(userForms).find((userForm) => userForm.
|
|
3877
|
+
[selectFormMapping, (_state, componentTypeId) => componentTypeId],
|
|
3878
|
+
(userForms, componentTypeId) => {
|
|
3879
|
+
return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
|
|
3878
3880
|
}
|
|
3879
3881
|
)
|
|
3880
3882
|
);
|
|
@@ -3890,7 +3892,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3890
3892
|
return Object.keys(userForms).length;
|
|
3891
3893
|
});
|
|
3892
3894
|
const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (userForms) => {
|
|
3893
|
-
return Object.values(userForms).filter((form) => !form.
|
|
3895
|
+
return Object.values(userForms).filter((form) => !form.component_type).length;
|
|
3894
3896
|
});
|
|
3895
3897
|
const formReducer = formSlice.reducer;
|
|
3896
3898
|
const initialState$5 = {
|
|
@@ -4098,31 +4100,31 @@ var __publicField = (obj, key, value) => {
|
|
|
4098
4100
|
}
|
|
4099
4101
|
)
|
|
4100
4102
|
);
|
|
4101
|
-
const
|
|
4103
|
+
const selectFormSubmissionsOfComponent = restructureCreateSelectorWithArgs(
|
|
4102
4104
|
toolkit.createSelector(
|
|
4103
|
-
[selectFormSubmissions, (_state,
|
|
4104
|
-
(submissions,
|
|
4105
|
+
[selectFormSubmissions, (_state, componentId) => componentId],
|
|
4106
|
+
(submissions, componentId) => {
|
|
4105
4107
|
return submissions.filter((submission) => {
|
|
4106
|
-
return submission.
|
|
4108
|
+
return submission.component === componentId;
|
|
4107
4109
|
});
|
|
4108
4110
|
}
|
|
4109
4111
|
)
|
|
4110
4112
|
);
|
|
4111
|
-
const
|
|
4112
|
-
[selectFormSubmissionsMapping,
|
|
4113
|
-
(submissions,
|
|
4113
|
+
const selectFormSubmissionsByComponents = toolkit.createSelector(
|
|
4114
|
+
[selectFormSubmissionsMapping, selectComponentsMapping],
|
|
4115
|
+
(submissions, components) => {
|
|
4114
4116
|
var _a2;
|
|
4115
|
-
const
|
|
4116
|
-
for (const
|
|
4117
|
-
|
|
4117
|
+
const componentSubmissionMapping = {};
|
|
4118
|
+
for (const componentId in components) {
|
|
4119
|
+
componentSubmissionMapping[componentId] = [];
|
|
4118
4120
|
}
|
|
4119
4121
|
for (const submissionId in submissions) {
|
|
4120
4122
|
const submission = submissions[submissionId];
|
|
4121
|
-
if (submission.
|
|
4122
|
-
(_a2 =
|
|
4123
|
+
if (submission.component) {
|
|
4124
|
+
(_a2 = componentSubmissionMapping[submission.component]) == null ? void 0 : _a2.push(submission);
|
|
4123
4125
|
}
|
|
4124
4126
|
}
|
|
4125
|
-
return
|
|
4127
|
+
return componentSubmissionMapping;
|
|
4126
4128
|
}
|
|
4127
4129
|
);
|
|
4128
4130
|
const selectFormSubmissionAttachmentsMapping = (state) => {
|
|
@@ -4521,7 +4523,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4521
4523
|
reducers: {}
|
|
4522
4524
|
});
|
|
4523
4525
|
const versioningReducer = versioningSlice.reducer;
|
|
4524
|
-
const
|
|
4526
|
+
const fullComponentMarkerSize = 45;
|
|
4525
4527
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
4526
4528
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
4527
4529
|
const OUTBOX_RETRY_DELAY = 5e3;
|
|
@@ -4539,10 +4541,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4539
4541
|
fileReducer,
|
|
4540
4542
|
authReducer,
|
|
4541
4543
|
categoryReducer,
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4544
|
+
componentReducer,
|
|
4545
|
+
componentStageCompletionReducer,
|
|
4546
|
+
componentStageReducer,
|
|
4547
|
+
componentTypeReducer,
|
|
4546
4548
|
issueReducer,
|
|
4547
4549
|
issueTypeReducer,
|
|
4548
4550
|
mapReducer,
|
|
@@ -4984,7 +4986,11 @@ var __publicField = (obj, key, value) => {
|
|
|
4984
4986
|
return false;
|
|
4985
4987
|
}
|
|
4986
4988
|
function peek(_array, _item, _context) {
|
|
4987
|
-
|
|
4989
|
+
const ret = _getOutboxCoordinator().peek();
|
|
4990
|
+
if (!ret) {
|
|
4991
|
+
throw new Error(`Peek returned ${ret}`);
|
|
4992
|
+
}
|
|
4993
|
+
return ret;
|
|
4988
4994
|
}
|
|
4989
4995
|
function retry(_action, _retries) {
|
|
4990
4996
|
getClientStore().dispatch(_setLatestRetryTime((/* @__PURE__ */ new Date()).getTime()));
|
|
@@ -4992,94 +4998,6 @@ var __publicField = (obj, key, value) => {
|
|
|
4992
4998
|
}
|
|
4993
4999
|
const useAppDispatch = () => reactRedux.useDispatch();
|
|
4994
5000
|
const useAppSelector = reactRedux.useSelector;
|
|
4995
|
-
class BaseApiService {
|
|
4996
|
-
constructor(sdk) {
|
|
4997
|
-
__publicField(this, "client");
|
|
4998
|
-
this.client = sdk;
|
|
4999
|
-
}
|
|
5000
|
-
/**
|
|
5001
|
-
* Enqueues an API request to the offline outbox.
|
|
5002
|
-
* @param requestDetails An SDKRequest object containing the details of the request.
|
|
5003
|
-
* @protected
|
|
5004
|
-
*/
|
|
5005
|
-
async enqueueRequest(requestDetails) {
|
|
5006
|
-
return this._enqueueRequest(requestDetails).then((result) => {
|
|
5007
|
-
if (result instanceof APIError) {
|
|
5008
|
-
throw result;
|
|
5009
|
-
}
|
|
5010
|
-
return result;
|
|
5011
|
-
});
|
|
5012
|
-
}
|
|
5013
|
-
/**
|
|
5014
|
-
* Enqueues an API request to the Redux Offline outbox
|
|
5015
|
-
* @protected
|
|
5016
|
-
*/
|
|
5017
|
-
_enqueueRequest(requestDetails) {
|
|
5018
|
-
const promise = new DeferredPromise();
|
|
5019
|
-
const requestDetailsWithBaseUrl = { ...requestDetails, BASE_URL: this.client.API_URL };
|
|
5020
|
-
const { store } = this.client;
|
|
5021
|
-
if (requestDetails.immediate) {
|
|
5022
|
-
const requestWithUuid = {
|
|
5023
|
-
...requestDetailsWithBaseUrl,
|
|
5024
|
-
uuid: requestDetails.uuid ?? uuid.v4()
|
|
5025
|
-
};
|
|
5026
|
-
const fullOfflineAction = {
|
|
5027
|
-
payload: requestWithUuid,
|
|
5028
|
-
type: "",
|
|
5029
|
-
meta: {
|
|
5030
|
-
offline: {
|
|
5031
|
-
effect: {
|
|
5032
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5033
|
-
request: requestWithUuid,
|
|
5034
|
-
BASE_URL: this.client.API_URL
|
|
5035
|
-
}
|
|
5036
|
-
}
|
|
5037
|
-
}
|
|
5038
|
-
};
|
|
5039
|
-
performRequest(fullOfflineAction, this.client).then((result) => {
|
|
5040
|
-
promise.resolve(result.body);
|
|
5041
|
-
}).catch((error2) => {
|
|
5042
|
-
discard(error2, fullOfflineAction);
|
|
5043
|
-
promise.reject(error2);
|
|
5044
|
-
});
|
|
5045
|
-
} else {
|
|
5046
|
-
const innerPromise = store.dispatch(
|
|
5047
|
-
enqueueRequest(requestDetailsWithBaseUrl)
|
|
5048
|
-
);
|
|
5049
|
-
const successOrUndefinedHandler = (response) => {
|
|
5050
|
-
if (response) {
|
|
5051
|
-
promise.resolve(response.body);
|
|
5052
|
-
} else {
|
|
5053
|
-
const error2 = new APIError({
|
|
5054
|
-
message: "Could not get a response from the server.",
|
|
5055
|
-
response,
|
|
5056
|
-
discard: true
|
|
5057
|
-
});
|
|
5058
|
-
promise.reject(error2);
|
|
5059
|
-
}
|
|
5060
|
-
};
|
|
5061
|
-
const errorHandler = (error2) => {
|
|
5062
|
-
if (error2 instanceof APIError) {
|
|
5063
|
-
error2.options.discard = true;
|
|
5064
|
-
} else {
|
|
5065
|
-
console.error(
|
|
5066
|
-
"Received an unexpected error while processing a request:",
|
|
5067
|
-
error2,
|
|
5068
|
-
"\nConverting error to APIError and discarding."
|
|
5069
|
-
);
|
|
5070
|
-
error2 = new APIError({
|
|
5071
|
-
message: "An error occurred while processing the request.",
|
|
5072
|
-
innerError: error2,
|
|
5073
|
-
discard: true
|
|
5074
|
-
});
|
|
5075
|
-
}
|
|
5076
|
-
promise.reject(error2);
|
|
5077
|
-
};
|
|
5078
|
-
innerPromise.then(successOrUndefinedHandler, errorHandler);
|
|
5079
|
-
}
|
|
5080
|
-
return promise;
|
|
5081
|
-
}
|
|
5082
|
-
}
|
|
5083
5001
|
const EXPIRING_SOON_THRESHOLD = 1800;
|
|
5084
5002
|
function parseTokens(response) {
|
|
5085
5003
|
if (!response.access)
|
|
@@ -5106,7 +5024,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5106
5024
|
*/
|
|
5107
5025
|
__publicField(this, "_getTokenPair", (credentials, logoutOnFailure = true) => {
|
|
5108
5026
|
const uuid$1 = uuid.v4();
|
|
5109
|
-
const responsePromise = this.enqueueRequest({
|
|
5027
|
+
const responsePromise = this.client.enqueueRequest({
|
|
5110
5028
|
uuid: uuid$1,
|
|
5111
5029
|
description: "Get token pair",
|
|
5112
5030
|
method: HttpMethod.POST,
|
|
@@ -5131,7 +5049,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5131
5049
|
* @returns {Promise<TokenPair>} The new access and refresh tokens
|
|
5132
5050
|
*/
|
|
5133
5051
|
__publicField(this, "_getRenewedTokens", async (refreshToken) => {
|
|
5134
|
-
const promise = this.enqueueRequest({
|
|
5052
|
+
const promise = this.client.enqueueRequest({
|
|
5135
5053
|
description: "Get renewed tokens",
|
|
5136
5054
|
method: HttpMethod.POST,
|
|
5137
5055
|
url: "/api/token/refresh/",
|
|
@@ -5244,7 +5162,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5244
5162
|
* Register a new user
|
|
5245
5163
|
*/
|
|
5246
5164
|
register(payload) {
|
|
5247
|
-
return this.enqueueRequest({
|
|
5165
|
+
return this.client.enqueueRequest({
|
|
5248
5166
|
description: "Register",
|
|
5249
5167
|
method: HttpMethod.POST,
|
|
5250
5168
|
url: "/authentication/users/register/",
|
|
@@ -5255,7 +5173,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5255
5173
|
});
|
|
5256
5174
|
}
|
|
5257
5175
|
async resetPassword(email) {
|
|
5258
|
-
return this.enqueueRequest({
|
|
5176
|
+
return this.client.enqueueRequest({
|
|
5259
5177
|
description: "Reset password",
|
|
5260
5178
|
method: HttpMethod.PATCH,
|
|
5261
5179
|
url: "/authentication/users/reset-password/",
|
|
@@ -5292,7 +5210,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5292
5210
|
const { store } = this.client;
|
|
5293
5211
|
const [fileProps] = await this.client.files.uploadFileToS3(hash);
|
|
5294
5212
|
store.dispatch(setProfilePicture({ file: `/files/${fileProps.file}`, file_sha1: hash }));
|
|
5295
|
-
return this.enqueueRequest({
|
|
5213
|
+
return this.client.enqueueRequest({
|
|
5296
5214
|
description: "Replace profile picture",
|
|
5297
5215
|
method: HttpMethod.PATCH,
|
|
5298
5216
|
url: "/authentication/users/profile-details/",
|
|
@@ -5303,7 +5221,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5303
5221
|
}
|
|
5304
5222
|
async addFavouriteProjectId(projectId) {
|
|
5305
5223
|
this.client.store.dispatch(addFavouriteProjectId(projectId));
|
|
5306
|
-
return this.enqueueRequest({
|
|
5224
|
+
return this.client.enqueueRequest({
|
|
5307
5225
|
description: "Add favourite project",
|
|
5308
5226
|
method: HttpMethod.POST,
|
|
5309
5227
|
url: `/authentication/users/favourite-project/${projectId}/`,
|
|
@@ -5313,7 +5231,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5313
5231
|
}
|
|
5314
5232
|
async removeFavouriteProjectId(projectId) {
|
|
5315
5233
|
this.client.store.dispatch(removeFavouriteProjectId(projectId));
|
|
5316
|
-
return this.enqueueRequest({
|
|
5234
|
+
return this.client.enqueueRequest({
|
|
5317
5235
|
description: "Add favourite project",
|
|
5318
5236
|
method: HttpMethod.POST,
|
|
5319
5237
|
url: `/authentication/users/unfavourite-project/${projectId}/`,
|
|
@@ -5326,7 +5244,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5326
5244
|
const currentStep = this.client.store.getState().userReducer.currentUser.profile.tour_step;
|
|
5327
5245
|
if (currentStep === stepIndex)
|
|
5328
5246
|
return Promise.resolve(void 0);
|
|
5329
|
-
return this.enqueueRequest({
|
|
5247
|
+
return this.client.enqueueRequest({
|
|
5330
5248
|
description: "Set tour step",
|
|
5331
5249
|
method: HttpMethod.PATCH,
|
|
5332
5250
|
url: "/authentication/users/profile-details/",
|
|
@@ -5338,7 +5256,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5338
5256
|
});
|
|
5339
5257
|
}
|
|
5340
5258
|
async joinApplication(projectInviteId, verification_code, username, password) {
|
|
5341
|
-
return this.enqueueRequest({
|
|
5259
|
+
return this.client.enqueueRequest({
|
|
5342
5260
|
description: "Join application",
|
|
5343
5261
|
method: HttpMethod.PATCH,
|
|
5344
5262
|
url: `/authentication/join-app/${projectInviteId}/${verification_code}/`,
|
|
@@ -5357,7 +5275,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5357
5275
|
const offlineCategory = offline(category);
|
|
5358
5276
|
const categoryWithWorkspace = { ...offlineCategory, workspace: workspaceId };
|
|
5359
5277
|
this.client.store.dispatch(addCategory(categoryWithWorkspace));
|
|
5360
|
-
const promise = this.enqueueRequest({
|
|
5278
|
+
const promise = this.client.enqueueRequest({
|
|
5361
5279
|
description: "Create Category",
|
|
5362
5280
|
method: HttpMethod.POST,
|
|
5363
5281
|
url: "/categories/",
|
|
@@ -5371,7 +5289,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5371
5289
|
return [categoryWithWorkspace, promise];
|
|
5372
5290
|
}
|
|
5373
5291
|
fetchAll(projectId) {
|
|
5374
|
-
const promise = this.enqueueRequest({
|
|
5292
|
+
const promise = this.client.enqueueRequest({
|
|
5375
5293
|
description: "Get categories",
|
|
5376
5294
|
method: HttpMethod.GET,
|
|
5377
5295
|
url: `/projects/${projectId}/categories/`,
|
|
@@ -5388,7 +5306,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5388
5306
|
}
|
|
5389
5307
|
this.client.store.dispatch(patchCategory(category));
|
|
5390
5308
|
const optimisticCategory = { ...existingCategory, ...category };
|
|
5391
|
-
const promise = this.enqueueRequest({
|
|
5309
|
+
const promise = this.client.enqueueRequest({
|
|
5392
5310
|
description: "Edit Category",
|
|
5393
5311
|
method: HttpMethod.PATCH,
|
|
5394
5312
|
url: `/categories/${category.offline_id}/`,
|
|
@@ -5403,7 +5321,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5403
5321
|
}
|
|
5404
5322
|
remove(category, workspaceId) {
|
|
5405
5323
|
this.client.store.dispatch(removeCategory(category.offline_id));
|
|
5406
|
-
return this.enqueueRequest({
|
|
5324
|
+
return this.client.enqueueRequest({
|
|
5407
5325
|
description: "Delete Category",
|
|
5408
5326
|
method: HttpMethod.DELETE,
|
|
5409
5327
|
url: `/categories/${category.offline_id}/`,
|
|
@@ -5444,108 +5362,110 @@ var __publicField = (obj, key, value) => {
|
|
|
5444
5362
|
store.dispatch(setCategories(result));
|
|
5445
5363
|
}
|
|
5446
5364
|
}
|
|
5447
|
-
class
|
|
5365
|
+
class ComponentService extends BaseApiService {
|
|
5448
5366
|
// Basic CRUD functions
|
|
5449
|
-
add(
|
|
5450
|
-
const
|
|
5451
|
-
this.client.store.dispatch(
|
|
5452
|
-
const promise = this.enqueueRequest({
|
|
5453
|
-
description: "Create
|
|
5367
|
+
add(component, workspaceId) {
|
|
5368
|
+
const offlineComponent = offline(component);
|
|
5369
|
+
this.client.store.dispatch(addComponent(offlineComponent));
|
|
5370
|
+
const promise = this.client.enqueueRequest({
|
|
5371
|
+
description: "Create Component",
|
|
5454
5372
|
method: HttpMethod.POST,
|
|
5455
|
-
url: `/
|
|
5373
|
+
url: `/components/types/${offlineComponent.component_type}/add-components/`,
|
|
5456
5374
|
queryParams: {
|
|
5457
5375
|
workspace_id: workspaceId.toString()
|
|
5458
5376
|
},
|
|
5459
|
-
payload: {
|
|
5377
|
+
payload: { components: [offlineComponent] },
|
|
5460
5378
|
blockers: [],
|
|
5461
|
-
blocks: [
|
|
5379
|
+
blocks: [offlineComponent.offline_id]
|
|
5462
5380
|
});
|
|
5463
|
-
return [
|
|
5381
|
+
return [offlineComponent, promise];
|
|
5464
5382
|
}
|
|
5465
|
-
update(
|
|
5466
|
-
this.client.store.dispatch(
|
|
5467
|
-
const promise = this.enqueueRequest({
|
|
5468
|
-
description: "Edit
|
|
5383
|
+
update(component, workspaceId) {
|
|
5384
|
+
this.client.store.dispatch(updateComponent(component));
|
|
5385
|
+
const promise = this.client.enqueueRequest({
|
|
5386
|
+
description: "Edit component",
|
|
5469
5387
|
method: HttpMethod.PATCH,
|
|
5470
|
-
url: `/
|
|
5388
|
+
url: `/components/${component.offline_id}/`,
|
|
5471
5389
|
queryParams: {
|
|
5472
5390
|
workspace_id: workspaceId.toString()
|
|
5473
5391
|
},
|
|
5474
|
-
payload:
|
|
5475
|
-
blockers: [
|
|
5476
|
-
blocks: [
|
|
5392
|
+
payload: component,
|
|
5393
|
+
blockers: [component.offline_id],
|
|
5394
|
+
blocks: [component.offline_id]
|
|
5477
5395
|
});
|
|
5478
|
-
return [
|
|
5396
|
+
return [component, promise];
|
|
5479
5397
|
}
|
|
5480
|
-
async remove(
|
|
5398
|
+
async remove(id) {
|
|
5481
5399
|
const { store } = this.client;
|
|
5482
|
-
const
|
|
5483
|
-
if (!
|
|
5484
|
-
throw new Error(`No
|
|
5485
|
-
const
|
|
5486
|
-
store.dispatch(
|
|
5487
|
-
if (
|
|
5488
|
-
const
|
|
5489
|
-
store.dispatch(
|
|
5490
|
-
}
|
|
5491
|
-
return this.enqueueRequest({
|
|
5492
|
-
description: "Delete
|
|
5400
|
+
const backupComponent = selectComponent(id)(store.getState());
|
|
5401
|
+
if (!backupComponent)
|
|
5402
|
+
throw new Error(`No component with id ${id} found in the store`);
|
|
5403
|
+
const attachmentsOfComponent = selectAttachmentsOfComponent(id)(store.getState());
|
|
5404
|
+
store.dispatch(removeComponent(id));
|
|
5405
|
+
if (attachmentsOfComponent.length > 0) {
|
|
5406
|
+
const attachmentsOfComponentIds = attachmentsOfComponent.map(({ offline_id }) => offline_id);
|
|
5407
|
+
store.dispatch(removeComponentAttachments(attachmentsOfComponentIds));
|
|
5408
|
+
}
|
|
5409
|
+
return this.client.enqueueRequest({
|
|
5410
|
+
description: "Delete issue",
|
|
5493
5411
|
method: HttpMethod.DELETE,
|
|
5494
|
-
url: `/
|
|
5495
|
-
blockers: [
|
|
5412
|
+
url: `/components/${id}/`,
|
|
5413
|
+
blockers: [id],
|
|
5496
5414
|
blocks: []
|
|
5497
5415
|
}).catch((err) => {
|
|
5498
|
-
store.dispatch(
|
|
5499
|
-
store.dispatch(
|
|
5416
|
+
store.dispatch(addComponent(backupComponent));
|
|
5417
|
+
store.dispatch(addComponentAttachments(attachmentsOfComponent));
|
|
5500
5418
|
throw err;
|
|
5501
5419
|
});
|
|
5502
5420
|
}
|
|
5503
|
-
async
|
|
5421
|
+
async deleteAllByComponentType(componentTypeId) {
|
|
5422
|
+
const clientStore2 = this.client.store;
|
|
5423
|
+
const allComponentsOfType = selectComponentsFromComponentType(componentTypeId)(clientStore2.getState());
|
|
5424
|
+
const affectedComponentIds = (allComponentsOfType || []).map((c) => c.offline_id);
|
|
5425
|
+
const affectedOfflineIds = [componentTypeId, ...affectedComponentIds];
|
|
5504
5426
|
const { store } = this.client;
|
|
5505
5427
|
const state = store.getState();
|
|
5506
|
-
const
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
return this.enqueueRequest({
|
|
5511
|
-
description: "Delete all assets of asset type",
|
|
5428
|
+
const componentsOfThisType = selectComponentsByType(componentTypeId)(state);
|
|
5429
|
+
store.dispatch(removeAllComponentsOfType(componentTypeId));
|
|
5430
|
+
return this.client.enqueueRequest({
|
|
5431
|
+
description: "Batch delete components by component type",
|
|
5512
5432
|
method: HttpMethod.DELETE,
|
|
5513
|
-
url: `/
|
|
5433
|
+
url: `/components/types/${componentTypeId}/delete-all-of-type/`,
|
|
5514
5434
|
blockers: affectedOfflineIds,
|
|
5515
5435
|
blocks: affectedOfflineIds
|
|
5516
5436
|
}).catch((err) => {
|
|
5517
|
-
if (
|
|
5518
|
-
store.dispatch(
|
|
5437
|
+
if (componentsOfThisType) {
|
|
5438
|
+
store.dispatch(addComponentsInBatches(componentsOfThisType));
|
|
5519
5439
|
}
|
|
5520
5440
|
throw err;
|
|
5521
5441
|
});
|
|
5522
5442
|
}
|
|
5523
|
-
async addBatch(
|
|
5524
|
-
const
|
|
5525
|
-
return { ...offline(
|
|
5443
|
+
async addBatch(componentsToCreate, workspaceId, componentTypeId) {
|
|
5444
|
+
const fullComponents = componentsToCreate.map((component) => {
|
|
5445
|
+
return { ...offline(component), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
5526
5446
|
});
|
|
5527
5447
|
const { store } = this.client;
|
|
5528
|
-
store.dispatch(
|
|
5529
|
-
const promise = this.enqueueRequest({
|
|
5530
|
-
description: "Batch create
|
|
5448
|
+
store.dispatch(addComponentsInBatches(fullComponents));
|
|
5449
|
+
const promise = this.client.enqueueRequest({
|
|
5450
|
+
description: "Batch create components",
|
|
5531
5451
|
method: HttpMethod.POST,
|
|
5532
|
-
url: `/
|
|
5452
|
+
url: `/components/types/${componentTypeId}/add-components/`,
|
|
5533
5453
|
queryParams: {
|
|
5534
5454
|
workspace_id: workspaceId.toString()
|
|
5535
5455
|
},
|
|
5536
5456
|
payload: {
|
|
5537
|
-
|
|
5457
|
+
components: fullComponents
|
|
5538
5458
|
},
|
|
5539
|
-
blockers: [
|
|
5540
|
-
blocks:
|
|
5459
|
+
blockers: [componentTypeId],
|
|
5460
|
+
blocks: fullComponents.map((c) => c.offline_id)
|
|
5541
5461
|
});
|
|
5542
5462
|
void promise.then((result) => {
|
|
5543
|
-
for (const
|
|
5544
|
-
store.dispatch(
|
|
5463
|
+
for (const component of Object.values(result)) {
|
|
5464
|
+
store.dispatch(updateComponent(component));
|
|
5545
5465
|
}
|
|
5546
5466
|
}).catch((e) => {
|
|
5547
|
-
for (const
|
|
5548
|
-
store.dispatch(
|
|
5467
|
+
for (const component of fullComponents) {
|
|
5468
|
+
store.dispatch(removeComponent(component.offline_id));
|
|
5549
5469
|
}
|
|
5550
5470
|
throw e;
|
|
5551
5471
|
});
|
|
@@ -5553,125 +5473,129 @@ var __publicField = (obj, key, value) => {
|
|
|
5553
5473
|
}
|
|
5554
5474
|
async refreshStore() {
|
|
5555
5475
|
const { store } = this.client;
|
|
5556
|
-
const result = await this.enqueueRequest({
|
|
5557
|
-
description: "Get
|
|
5476
|
+
const result = await this.client.enqueueRequest({
|
|
5477
|
+
description: "Get components",
|
|
5558
5478
|
method: HttpMethod.GET,
|
|
5559
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5479
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/components/`,
|
|
5560
5480
|
blockers: [],
|
|
5561
5481
|
blocks: []
|
|
5562
5482
|
});
|
|
5563
|
-
store.dispatch(
|
|
5483
|
+
store.dispatch(setComponents(result));
|
|
5564
5484
|
}
|
|
5565
5485
|
}
|
|
5566
|
-
class
|
|
5567
|
-
add(
|
|
5486
|
+
class ComponentStageCompletionService extends BaseApiService {
|
|
5487
|
+
add(componentId, stageId) {
|
|
5568
5488
|
var _a2;
|
|
5569
5489
|
const { store } = this.client;
|
|
5570
|
-
const
|
|
5571
|
-
if (!
|
|
5572
|
-
throw new Error(`
|
|
5490
|
+
const componentType = (_a2 = store.getState().componentReducer.components[componentId]) == null ? void 0 : _a2.component_type;
|
|
5491
|
+
if (!componentType) {
|
|
5492
|
+
throw new Error(`Component ${componentId} not found`);
|
|
5573
5493
|
}
|
|
5574
|
-
const
|
|
5575
|
-
|
|
5494
|
+
const offlineCompletion = offline({
|
|
5495
|
+
component: componentId,
|
|
5576
5496
|
stage: stageId
|
|
5577
5497
|
});
|
|
5578
|
-
store.dispatch(addStageCompletion(
|
|
5579
|
-
const promise = this.enqueueRequest({
|
|
5580
|
-
description: "
|
|
5498
|
+
store.dispatch(addStageCompletion(offlineCompletion));
|
|
5499
|
+
const promise = this.client.enqueueRequest({
|
|
5500
|
+
description: "Mark stage as completed",
|
|
5581
5501
|
method: HttpMethod.POST,
|
|
5582
|
-
url: `/
|
|
5502
|
+
url: `/components/types/${componentType}/complete-stages/`,
|
|
5583
5503
|
// TODO: Add submitted_at to model
|
|
5584
|
-
payload: { completions: [{ ...
|
|
5585
|
-
blockers: [
|
|
5586
|
-
blocks: [
|
|
5504
|
+
payload: { completions: [{ ...offlineCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
|
|
5505
|
+
blockers: [componentId, stageId],
|
|
5506
|
+
blocks: [offlineCompletion.offline_id]
|
|
5587
5507
|
});
|
|
5588
|
-
return [
|
|
5508
|
+
return [offlineCompletion, promise];
|
|
5589
5509
|
}
|
|
5590
5510
|
async refreshStore() {
|
|
5591
5511
|
const { store } = this.client;
|
|
5592
|
-
const result = await this.enqueueRequest({
|
|
5593
|
-
description: "Get
|
|
5512
|
+
const result = await this.client.enqueueRequest({
|
|
5513
|
+
description: "Get completed stages",
|
|
5594
5514
|
method: HttpMethod.GET,
|
|
5595
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5515
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stage-completions/`,
|
|
5596
5516
|
blockers: [],
|
|
5597
5517
|
blocks: []
|
|
5598
5518
|
});
|
|
5599
5519
|
store.dispatch(addStageCompletions(result));
|
|
5600
5520
|
}
|
|
5601
5521
|
/**
|
|
5602
|
-
* Creates a collection of
|
|
5603
|
-
*
|
|
5604
|
-
* @param
|
|
5605
|
-
* stages for one
|
|
5522
|
+
* Creates a collection of ComponentStageCompletions, marking the referenced stages as completed for the referenced
|
|
5523
|
+
* components. It's REQUIRED that all components referenced all have the SAME component type.
|
|
5524
|
+
* @param componentTypeId The ID of the component type for which we are completing stages (we can only complete
|
|
5525
|
+
* stages for one component type at a time)
|
|
5606
5526
|
* @param stageCompletions
|
|
5607
5527
|
*/
|
|
5608
|
-
async bulkAdd(
|
|
5609
|
-
const
|
|
5528
|
+
async bulkAdd(componentTypeId, stageCompletions) {
|
|
5529
|
+
const offlineStagesCompletions = stageCompletions.map((completion) => {
|
|
5610
5530
|
return offline(completion);
|
|
5611
5531
|
});
|
|
5612
5532
|
const asMapping = {};
|
|
5613
5533
|
for (const completion of stageCompletions) {
|
|
5614
|
-
const stageToCompletionDateMapping = asMapping[completion.
|
|
5534
|
+
const stageToCompletionDateMapping = asMapping[completion.component] || {};
|
|
5615
5535
|
stageToCompletionDateMapping[completion.stage] = (/* @__PURE__ */ new Date()).toISOString();
|
|
5616
|
-
asMapping[completion.
|
|
5536
|
+
asMapping[completion.component] = stageToCompletionDateMapping;
|
|
5617
5537
|
}
|
|
5618
5538
|
this.client.store.dispatch(addStageCompletions(asMapping));
|
|
5619
|
-
await this.enqueueRequest({
|
|
5620
|
-
description: "
|
|
5539
|
+
await this.client.enqueueRequest({
|
|
5540
|
+
description: "Mark multiple stage as completed",
|
|
5621
5541
|
method: HttpMethod.POST,
|
|
5622
|
-
url: `/
|
|
5542
|
+
url: `/components/types/${componentTypeId}/complete-stages/`,
|
|
5623
5543
|
payload: {
|
|
5624
|
-
completions:
|
|
5544
|
+
completions: offlineStagesCompletions
|
|
5625
5545
|
},
|
|
5626
|
-
blockers: [
|
|
5627
|
-
|
|
5546
|
+
blockers: [
|
|
5547
|
+
componentTypeId,
|
|
5548
|
+
...stageCompletions.map((c) => c.component),
|
|
5549
|
+
...stageCompletions.map((c) => c.stage)
|
|
5550
|
+
],
|
|
5551
|
+
blocks: offlineStagesCompletions.map((c) => c.offline_id)
|
|
5628
5552
|
});
|
|
5629
5553
|
}
|
|
5630
|
-
bulkDelete(stageId,
|
|
5631
|
-
const
|
|
5554
|
+
bulkDelete(stageId, componentIds) {
|
|
5555
|
+
const completionsToRemove = componentIds.map((componentId) => {
|
|
5632
5556
|
return {
|
|
5633
|
-
|
|
5557
|
+
component: componentId,
|
|
5634
5558
|
stage: stageId
|
|
5635
5559
|
};
|
|
5636
5560
|
});
|
|
5637
|
-
this.client.store.dispatch(removeStageCompletions(
|
|
5638
|
-
return this.enqueueRequest({
|
|
5639
|
-
description: `Undo stage for ${
|
|
5561
|
+
this.client.store.dispatch(removeStageCompletions(completionsToRemove));
|
|
5562
|
+
return this.client.enqueueRequest({
|
|
5563
|
+
description: `Undo stage for ${componentIds.length} component(s)`,
|
|
5640
5564
|
// TODO: Rename to setCompletedStages
|
|
5641
5565
|
method: HttpMethod.DELETE,
|
|
5642
|
-
url: `/
|
|
5566
|
+
url: `/components/stages/${stageId}/undo-stages/`,
|
|
5643
5567
|
payload: {
|
|
5644
|
-
|
|
5568
|
+
components: componentIds
|
|
5645
5569
|
},
|
|
5646
|
-
blockers: [stageId, ...
|
|
5570
|
+
blockers: [stageId, ...componentIds],
|
|
5647
5571
|
blocks: []
|
|
5648
5572
|
});
|
|
5649
5573
|
}
|
|
5650
5574
|
}
|
|
5651
|
-
class
|
|
5652
|
-
async bulkCreateStages(stagesToSubmit,
|
|
5575
|
+
class ComponentStageService extends BaseApiService {
|
|
5576
|
+
async bulkCreateStages(stagesToSubmit, componentTypeId, workspaceId) {
|
|
5653
5577
|
const payload = stagesToSubmit.map((stage) => {
|
|
5654
5578
|
return offline(stage);
|
|
5655
5579
|
});
|
|
5656
5580
|
const fullStages = payload.map((stage) => {
|
|
5657
|
-
return { ...stage,
|
|
5581
|
+
return { ...stage, component_type: componentTypeId };
|
|
5658
5582
|
});
|
|
5659
5583
|
this.client.store.dispatch(addStages(fullStages));
|
|
5660
|
-
return this.enqueueRequest({
|
|
5661
|
-
description: "Add
|
|
5584
|
+
return this.client.enqueueRequest({
|
|
5585
|
+
description: "Add component stages",
|
|
5662
5586
|
method: HttpMethod.POST,
|
|
5663
|
-
url: `/
|
|
5587
|
+
url: `/components/types/${componentTypeId}/add-stages/`,
|
|
5664
5588
|
payload: {
|
|
5665
5589
|
stages: payload
|
|
5666
5590
|
},
|
|
5667
5591
|
queryParams: {
|
|
5668
5592
|
workspace_id: workspaceId.toString()
|
|
5669
5593
|
},
|
|
5670
|
-
blockers: [
|
|
5594
|
+
blockers: [componentTypeId, workspaceId],
|
|
5671
5595
|
blocks: payload.map(({ offline_id }) => offline_id)
|
|
5672
5596
|
});
|
|
5673
5597
|
}
|
|
5674
|
-
async bulkUpdateStages(stagesToUpdate,
|
|
5598
|
+
async bulkUpdateStages(stagesToUpdate, componentTypeId) {
|
|
5675
5599
|
const store = this.client.store;
|
|
5676
5600
|
const state = store.getState();
|
|
5677
5601
|
const prevStages = selectStagesFromStageIds(
|
|
@@ -5681,14 +5605,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5681
5605
|
throw new Error("Could not find the desired stages to update within the store");
|
|
5682
5606
|
}
|
|
5683
5607
|
store.dispatch(updateStages(stagesToUpdate));
|
|
5684
|
-
return this.enqueueRequest({
|
|
5685
|
-
description: "Edit
|
|
5608
|
+
return this.client.enqueueRequest({
|
|
5609
|
+
description: "Edit component stages",
|
|
5686
5610
|
method: HttpMethod.PATCH,
|
|
5687
|
-
url: `/
|
|
5611
|
+
url: `/components/types/${componentTypeId}/bulk-update-stages/`,
|
|
5688
5612
|
payload: {
|
|
5689
5613
|
stages: stagesToUpdate
|
|
5690
5614
|
},
|
|
5691
|
-
blockers: [
|
|
5615
|
+
blockers: [componentTypeId],
|
|
5692
5616
|
blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
|
|
5693
5617
|
}).catch((e) => {
|
|
5694
5618
|
store.dispatch(updateStages(prevStages));
|
|
@@ -5697,10 +5621,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5697
5621
|
}
|
|
5698
5622
|
async bulkDelete(idsToDelete) {
|
|
5699
5623
|
this.client.store.dispatch(removeStages(idsToDelete));
|
|
5700
|
-
return this.enqueueRequest({
|
|
5701
|
-
description: "Delete
|
|
5624
|
+
return this.client.enqueueRequest({
|
|
5625
|
+
description: "Delete component stages",
|
|
5702
5626
|
method: HttpMethod.DELETE,
|
|
5703
|
-
url: "/
|
|
5627
|
+
url: "/components/stages/bulk-delete/",
|
|
5704
5628
|
payload: {
|
|
5705
5629
|
stage_ids: idsToDelete
|
|
5706
5630
|
},
|
|
@@ -5708,25 +5632,25 @@ var __publicField = (obj, key, value) => {
|
|
|
5708
5632
|
blocks: []
|
|
5709
5633
|
});
|
|
5710
5634
|
}
|
|
5711
|
-
async update(
|
|
5712
|
-
this.client.store.dispatch(addStages([
|
|
5713
|
-
return this.enqueueRequest({
|
|
5714
|
-
description: "Update
|
|
5635
|
+
async update(componentStage) {
|
|
5636
|
+
this.client.store.dispatch(addStages([componentStage]));
|
|
5637
|
+
return this.client.enqueueRequest({
|
|
5638
|
+
description: "Update component stage",
|
|
5715
5639
|
method: HttpMethod.PATCH,
|
|
5716
|
-
url: `/
|
|
5717
|
-
payload:
|
|
5718
|
-
blockers: [
|
|
5719
|
-
blocks: [
|
|
5640
|
+
url: `/components/stages/${componentStage.offline_id}/`,
|
|
5641
|
+
payload: componentStage,
|
|
5642
|
+
blockers: [componentStage.offline_id],
|
|
5643
|
+
blocks: [componentStage.offline_id]
|
|
5720
5644
|
});
|
|
5721
5645
|
}
|
|
5722
5646
|
async linkForm(stageId, formId2) {
|
|
5723
5647
|
const { store } = this.client;
|
|
5724
5648
|
store.dispatch(linkStageToForm({ stageId, formId: formId2 }));
|
|
5725
5649
|
try {
|
|
5726
|
-
await this.enqueueRequest({
|
|
5727
|
-
description: "Link
|
|
5650
|
+
await this.client.enqueueRequest({
|
|
5651
|
+
description: "Link component stage to form",
|
|
5728
5652
|
method: HttpMethod.POST,
|
|
5729
|
-
url: `/
|
|
5653
|
+
url: `/components/stages/${stageId}/associate-with-form/`,
|
|
5730
5654
|
payload: { user_form: formId2 },
|
|
5731
5655
|
blockers: [stageId, formId2],
|
|
5732
5656
|
blocks: [stageId]
|
|
@@ -5740,10 +5664,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5740
5664
|
const { store } = this.client;
|
|
5741
5665
|
store.dispatch(unlinkStageToForm({ stageId }));
|
|
5742
5666
|
try {
|
|
5743
|
-
await this.enqueueRequest({
|
|
5744
|
-
description: "Unlink
|
|
5667
|
+
await this.client.enqueueRequest({
|
|
5668
|
+
description: "Unlink component stage from form",
|
|
5745
5669
|
method: HttpMethod.DELETE,
|
|
5746
|
-
url: `/
|
|
5670
|
+
url: `/components/stages/${stageId}/associate-with-form/`,
|
|
5747
5671
|
blockers: [stageId, formId2],
|
|
5748
5672
|
blocks: [stageId]
|
|
5749
5673
|
});
|
|
@@ -5754,10 +5678,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5754
5678
|
}
|
|
5755
5679
|
async refreshStore() {
|
|
5756
5680
|
const { store } = this.client;
|
|
5757
|
-
const result = await this.enqueueRequest({
|
|
5758
|
-
description: "Get
|
|
5681
|
+
const result = await this.client.enqueueRequest({
|
|
5682
|
+
description: "Get component stages",
|
|
5759
5683
|
method: HttpMethod.GET,
|
|
5760
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5684
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stages/`,
|
|
5761
5685
|
blockers: [],
|
|
5762
5686
|
blocks: []
|
|
5763
5687
|
});
|
|
@@ -5771,20 +5695,20 @@ var __publicField = (obj, key, value) => {
|
|
|
5771
5695
|
deleteUrlPrefix: "/issues",
|
|
5772
5696
|
fetchUrlPostfix: "/issue-attachments"
|
|
5773
5697
|
},
|
|
5774
|
-
[AttachmentModel.
|
|
5775
|
-
name: "
|
|
5776
|
-
attachUrlPrefix: "/
|
|
5777
|
-
deleteUrlPrefix: "/
|
|
5778
|
-
fetchUrlPostfix: "/
|
|
5698
|
+
[AttachmentModel.Component]: {
|
|
5699
|
+
name: "component",
|
|
5700
|
+
attachUrlPrefix: "/components",
|
|
5701
|
+
deleteUrlPrefix: "/components",
|
|
5702
|
+
fetchUrlPostfix: "/component-attachments"
|
|
5779
5703
|
},
|
|
5780
|
-
[AttachmentModel.
|
|
5781
|
-
name: "
|
|
5782
|
-
attachUrlPrefix: "/
|
|
5783
|
-
deleteUrlPrefix: "/
|
|
5784
|
-
fetchUrlPostfix: "/
|
|
5704
|
+
[AttachmentModel.ComponentType]: {
|
|
5705
|
+
name: "component type",
|
|
5706
|
+
attachUrlPrefix: "/components/types",
|
|
5707
|
+
deleteUrlPrefix: "/components/types",
|
|
5708
|
+
fetchUrlPostfix: "/component-type-attachments"
|
|
5785
5709
|
},
|
|
5786
5710
|
[AttachmentModel.Project]: {
|
|
5787
|
-
name: "project",
|
|
5711
|
+
name: "component project",
|
|
5788
5712
|
attachUrlPrefix: "/projects",
|
|
5789
5713
|
deleteUrlPrefix: "/projects",
|
|
5790
5714
|
fetchUrlPostfix: "/attachments"
|
|
@@ -5800,8 +5724,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5800
5724
|
getNumberOfAttachmentsWithSha1(sha1) {
|
|
5801
5725
|
const {
|
|
5802
5726
|
issueReducer: issueReducer2,
|
|
5803
|
-
|
|
5804
|
-
|
|
5727
|
+
componentReducer: componentReducer2,
|
|
5728
|
+
componentTypeReducer: componentTypeReducer2,
|
|
5805
5729
|
documentsReducer: documentsReducer2,
|
|
5806
5730
|
projectReducer: projectReducer2,
|
|
5807
5731
|
formSubmissionReducer: formSubmissionReducer2,
|
|
@@ -5809,8 +5733,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5809
5733
|
} = this.client.store.getState();
|
|
5810
5734
|
const objectsWithSha1 = [].concat(
|
|
5811
5735
|
Object.values(issueReducer2.attachments),
|
|
5812
|
-
Object.values(
|
|
5813
|
-
Object.values(
|
|
5736
|
+
Object.values(componentReducer2.attachments),
|
|
5737
|
+
Object.values(componentTypeReducer2.attachments),
|
|
5814
5738
|
Object.values(documentsReducer2.attachments),
|
|
5815
5739
|
Object.values(projectReducer2.attachments),
|
|
5816
5740
|
Object.values(formRevisionReducer2.attachments),
|
|
@@ -5820,7 +5744,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5820
5744
|
}
|
|
5821
5745
|
processPresignedUrls(presignedUrls) {
|
|
5822
5746
|
for (const [sha1, presignedUrl] of Object.entries(presignedUrls)) {
|
|
5823
|
-
void this.enqueueRequest({
|
|
5747
|
+
void this.client.enqueueRequest({
|
|
5824
5748
|
url: presignedUrl.url,
|
|
5825
5749
|
description: "Upload file to S3",
|
|
5826
5750
|
method: HttpMethod.POST,
|
|
@@ -5840,7 +5764,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5840
5764
|
const { store } = this.client;
|
|
5841
5765
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
5842
5766
|
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
5843
|
-
const result = await this.enqueueRequest({
|
|
5767
|
+
const result = await this.client.enqueueRequest({
|
|
5844
5768
|
description: `Get ${meta.name} attachments`,
|
|
5845
5769
|
method: HttpMethod.GET,
|
|
5846
5770
|
url: `/projects/${activeProjectId}${meta.fetchUrlPostfix}/`,
|
|
@@ -5885,7 +5809,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5885
5809
|
}
|
|
5886
5810
|
store.dispatch(actions.addAttachments(offlineAttachments));
|
|
5887
5811
|
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
5888
|
-
const promise = this.enqueueRequest({
|
|
5812
|
+
const promise = this.client.enqueueRequest({
|
|
5889
5813
|
description: `Attach files to ${meta.name}`,
|
|
5890
5814
|
method: HttpMethod.POST,
|
|
5891
5815
|
url: `${meta.attachUrlPrefix}/${modelId}/attach/`,
|
|
@@ -5915,7 +5839,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5915
5839
|
}
|
|
5916
5840
|
store.dispatch(actions.removeAttachment(attachment.offline_id));
|
|
5917
5841
|
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
5918
|
-
const promise = this.enqueueRequest({
|
|
5842
|
+
const promise = this.client.enqueueRequest({
|
|
5919
5843
|
description: "Delete attachment",
|
|
5920
5844
|
method: HttpMethod.DELETE,
|
|
5921
5845
|
url: `${meta.deleteUrlPrefix}/attachments/${attachmendId}/`,
|
|
@@ -5932,10 +5856,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5932
5856
|
return promise;
|
|
5933
5857
|
}
|
|
5934
5858
|
}
|
|
5935
|
-
class
|
|
5859
|
+
class ComponentAttachmentService extends BaseAttachmentService {
|
|
5936
5860
|
constructor() {
|
|
5937
5861
|
super(...arguments);
|
|
5938
|
-
__publicField(this, "attachmentModel", AttachmentModel.
|
|
5862
|
+
__publicField(this, "attachmentModel", AttachmentModel.Component);
|
|
5939
5863
|
}
|
|
5940
5864
|
buildOfflineAttachment(data) {
|
|
5941
5865
|
return offline({
|
|
@@ -5946,108 +5870,115 @@ var __publicField = (obj, key, value) => {
|
|
|
5946
5870
|
file_type: data.file.type,
|
|
5947
5871
|
submitted_at: data.submittedAt,
|
|
5948
5872
|
description: data.description,
|
|
5949
|
-
|
|
5873
|
+
component: data.modelId
|
|
5950
5874
|
});
|
|
5951
5875
|
}
|
|
5952
|
-
async
|
|
5953
|
-
return this.attachFiles(
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5876
|
+
async attachFilesToComponent(files, componentId) {
|
|
5877
|
+
return this.attachFiles(
|
|
5878
|
+
files,
|
|
5879
|
+
componentId,
|
|
5880
|
+
this.buildOfflineAttachment.bind(this),
|
|
5881
|
+
{
|
|
5882
|
+
addAttachments: addComponentAttachments,
|
|
5883
|
+
updateAttachments: updateComponentAttachments,
|
|
5884
|
+
removeAttachments: removeComponentAttachments
|
|
5885
|
+
}
|
|
5886
|
+
);
|
|
5958
5887
|
}
|
|
5959
|
-
|
|
5888
|
+
deleteComponentAttachment(attachmentId) {
|
|
5960
5889
|
return this.deleteAttachment(
|
|
5961
5890
|
attachmentId,
|
|
5962
5891
|
{
|
|
5963
|
-
setAttachment:
|
|
5964
|
-
removeAttachment:
|
|
5892
|
+
setAttachment: setComponentAttachment,
|
|
5893
|
+
removeAttachment: removeComponentAttachment
|
|
5965
5894
|
},
|
|
5966
5895
|
{
|
|
5967
|
-
selectAttachment:
|
|
5896
|
+
selectAttachment: selectComponentAttachment
|
|
5968
5897
|
}
|
|
5969
5898
|
);
|
|
5970
5899
|
}
|
|
5971
5900
|
async refreshStore() {
|
|
5972
5901
|
return this.getAttachments({
|
|
5973
|
-
setAttachments:
|
|
5902
|
+
setAttachments: setComponentAttachments
|
|
5974
5903
|
});
|
|
5975
5904
|
}
|
|
5976
5905
|
}
|
|
5977
|
-
class
|
|
5978
|
-
add(
|
|
5979
|
-
const
|
|
5906
|
+
class ComponentTypeService extends BaseApiService {
|
|
5907
|
+
add(componentType) {
|
|
5908
|
+
const offlineComponentType = offline(componentType);
|
|
5980
5909
|
const { store } = this.client;
|
|
5981
5910
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
5982
|
-
store.dispatch(
|
|
5983
|
-
const promise = this.enqueueRequest({
|
|
5984
|
-
description: "Create
|
|
5911
|
+
store.dispatch(addComponentType(offlineComponentType));
|
|
5912
|
+
const promise = this.client.enqueueRequest({
|
|
5913
|
+
description: "Create ComponentType",
|
|
5985
5914
|
method: HttpMethod.POST,
|
|
5986
|
-
url: `/projects/${activeProjectId}/
|
|
5987
|
-
payload: { ...
|
|
5915
|
+
url: `/projects/${activeProjectId}/component-types/`,
|
|
5916
|
+
payload: { ...offlineComponentType },
|
|
5988
5917
|
blockers: [],
|
|
5989
|
-
blocks: [
|
|
5918
|
+
blocks: [offlineComponentType.offline_id]
|
|
5990
5919
|
});
|
|
5991
|
-
return [
|
|
5920
|
+
return [offlineComponentType, promise];
|
|
5992
5921
|
}
|
|
5993
|
-
update(
|
|
5994
|
-
this.client.store.dispatch(
|
|
5995
|
-
return this.enqueueRequest({
|
|
5996
|
-
description: "Update
|
|
5922
|
+
update(componentType) {
|
|
5923
|
+
this.client.store.dispatch(addComponentType(componentType));
|
|
5924
|
+
return this.client.enqueueRequest({
|
|
5925
|
+
description: "Update ComponentType",
|
|
5997
5926
|
method: HttpMethod.PATCH,
|
|
5998
|
-
url: `/
|
|
5999
|
-
payload:
|
|
6000
|
-
blockers: [
|
|
6001
|
-
blocks: [
|
|
5927
|
+
url: `/components/types/${componentType.offline_id}/`,
|
|
5928
|
+
payload: componentType,
|
|
5929
|
+
blockers: [componentType.offline_id],
|
|
5930
|
+
blocks: [componentType.offline_id]
|
|
6002
5931
|
});
|
|
6003
5932
|
}
|
|
6004
|
-
async delete(
|
|
5933
|
+
async delete(componentTypeId) {
|
|
6005
5934
|
const { store } = this.client;
|
|
6006
5935
|
const state = store.getState();
|
|
6007
|
-
const
|
|
6008
|
-
if (!
|
|
6009
|
-
throw new Error(
|
|
6010
|
-
}
|
|
6011
|
-
const
|
|
6012
|
-
const
|
|
6013
|
-
store.dispatch(
|
|
6014
|
-
if (
|
|
6015
|
-
const
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
5936
|
+
const componentType = selectComponentType(componentTypeId)(state);
|
|
5937
|
+
if (!componentType) {
|
|
5938
|
+
throw new Error("Expected componentType to exist");
|
|
5939
|
+
}
|
|
5940
|
+
const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
|
|
5941
|
+
const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
|
|
5942
|
+
store.dispatch(deleteComponentType(componentTypeId));
|
|
5943
|
+
if (stagesOfComponentType.length > 0) {
|
|
5944
|
+
const stagesOfComponentTypeIds = stagesOfComponentType.map(
|
|
5945
|
+
(componentTypeStage) => componentTypeStage.offline_id
|
|
5946
|
+
);
|
|
5947
|
+
store.dispatch(removeStages(stagesOfComponentTypeIds));
|
|
5948
|
+
}
|
|
5949
|
+
if (attachmentsOfComponentType.length > 0) {
|
|
5950
|
+
const attachmentsOfComponentTypeIds = attachmentsOfComponentType.map(({ offline_id }) => offline_id);
|
|
5951
|
+
store.dispatch(removeComponentTypeAttachments(attachmentsOfComponentTypeIds));
|
|
5952
|
+
}
|
|
5953
|
+
return this.client.enqueueRequest({
|
|
5954
|
+
description: "Delete ComponentType",
|
|
6024
5955
|
method: HttpMethod.DELETE,
|
|
6025
|
-
url: `/
|
|
6026
|
-
blockers: [
|
|
5956
|
+
url: `/components/types/${componentTypeId}/`,
|
|
5957
|
+
blockers: [componentTypeId],
|
|
6027
5958
|
blocks: []
|
|
6028
5959
|
}).catch((e) => {
|
|
6029
|
-
store.dispatch(
|
|
6030
|
-
store.dispatch(addStages(
|
|
6031
|
-
store.dispatch(
|
|
5960
|
+
store.dispatch(addComponentType(componentType));
|
|
5961
|
+
store.dispatch(addStages(stagesOfComponentType));
|
|
5962
|
+
store.dispatch(addComponentTypeAttachments(attachmentsOfComponentType));
|
|
6032
5963
|
throw e;
|
|
6033
5964
|
});
|
|
6034
5965
|
}
|
|
6035
5966
|
async refreshStore() {
|
|
6036
5967
|
const { store } = this.client;
|
|
6037
|
-
const result = await this.enqueueRequest({
|
|
6038
|
-
description: "Get
|
|
5968
|
+
const result = await this.client.enqueueRequest({
|
|
5969
|
+
description: "Get component types",
|
|
6039
5970
|
method: HttpMethod.GET,
|
|
6040
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5971
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/component-types/`,
|
|
6041
5972
|
blockers: [],
|
|
6042
5973
|
blocks: []
|
|
6043
5974
|
});
|
|
6044
|
-
store.dispatch(
|
|
5975
|
+
store.dispatch(setComponentTypes(result));
|
|
6045
5976
|
}
|
|
6046
5977
|
}
|
|
6047
|
-
class
|
|
5978
|
+
class ComponentTypeAttachmentService extends BaseAttachmentService {
|
|
6048
5979
|
constructor() {
|
|
6049
5980
|
super(...arguments);
|
|
6050
|
-
__publicField(this, "attachmentModel", AttachmentModel.
|
|
5981
|
+
__publicField(this, "attachmentModel", AttachmentModel.ComponentType);
|
|
6051
5982
|
}
|
|
6052
5983
|
buildOfflineAttachment(data) {
|
|
6053
5984
|
return offline({
|
|
@@ -6058,36 +5989,36 @@ var __publicField = (obj, key, value) => {
|
|
|
6058
5989
|
file_type: data.file.type,
|
|
6059
5990
|
submitted_at: data.submittedAt,
|
|
6060
5991
|
description: data.description,
|
|
6061
|
-
|
|
5992
|
+
component_type: data.modelId
|
|
6062
5993
|
});
|
|
6063
5994
|
}
|
|
6064
|
-
async
|
|
5995
|
+
async attachFilesToComponentType(files, componentTypeId) {
|
|
6065
5996
|
return this.attachFiles(
|
|
6066
5997
|
files,
|
|
6067
|
-
|
|
5998
|
+
componentTypeId,
|
|
6068
5999
|
this.buildOfflineAttachment.bind(this),
|
|
6069
6000
|
{
|
|
6070
|
-
addAttachments:
|
|
6071
|
-
updateAttachments:
|
|
6072
|
-
removeAttachments:
|
|
6001
|
+
addAttachments: addComponentTypeAttachments,
|
|
6002
|
+
updateAttachments: updateComponentTypeAttachments,
|
|
6003
|
+
removeAttachments: removeComponentTypeAttachments
|
|
6073
6004
|
}
|
|
6074
6005
|
);
|
|
6075
6006
|
}
|
|
6076
|
-
|
|
6007
|
+
deleteComponentTypeAttachment(attachmentId) {
|
|
6077
6008
|
return this.deleteAttachment(
|
|
6078
6009
|
attachmentId,
|
|
6079
6010
|
{
|
|
6080
|
-
setAttachment:
|
|
6081
|
-
removeAttachment:
|
|
6011
|
+
setAttachment: setComponentTypeAttachment,
|
|
6012
|
+
removeAttachment: removeComponentTypeAttachment
|
|
6082
6013
|
},
|
|
6083
6014
|
{
|
|
6084
|
-
selectAttachment:
|
|
6015
|
+
selectAttachment: selectComponentTypeAttachment
|
|
6085
6016
|
}
|
|
6086
6017
|
);
|
|
6087
6018
|
}
|
|
6088
6019
|
async refreshStore() {
|
|
6089
6020
|
return this.getAttachments({
|
|
6090
|
-
setAttachments:
|
|
6021
|
+
setAttachments: setComponentTypeAttachments
|
|
6091
6022
|
});
|
|
6092
6023
|
}
|
|
6093
6024
|
}
|
|
@@ -6101,7 +6032,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6101
6032
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
6102
6033
|
});
|
|
6103
6034
|
store.dispatch(addIssueComment(offlineComment));
|
|
6104
|
-
const promise = this.enqueueRequest({
|
|
6035
|
+
const promise = this.client.enqueueRequest({
|
|
6105
6036
|
description: `${truncate(comment.content, 80)}`,
|
|
6106
6037
|
method: HttpMethod.POST,
|
|
6107
6038
|
url: `/issues/${comment.issue}/comment/`,
|
|
@@ -6121,7 +6052,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6121
6052
|
throw new Error(`Comment with offline_id ${comment.offline_id} not found in store`);
|
|
6122
6053
|
}
|
|
6123
6054
|
store.dispatch(setIssueComment(comment));
|
|
6124
|
-
const promise = this.enqueueRequest({
|
|
6055
|
+
const promise = this.client.enqueueRequest({
|
|
6125
6056
|
description: `Edit comment: ${truncate(comment.content, 80)}`,
|
|
6126
6057
|
method: HttpMethod.PATCH,
|
|
6127
6058
|
url: `/issues/comments/${comment.offline_id}/`,
|
|
@@ -6140,7 +6071,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6140
6071
|
throw new Error(`Comment with offline_id ${offline_id} not found in store`);
|
|
6141
6072
|
}
|
|
6142
6073
|
this.client.store.dispatch(removeIssueComment(offline_id));
|
|
6143
|
-
const promise = this.enqueueRequest({
|
|
6074
|
+
const promise = this.client.enqueueRequest({
|
|
6144
6075
|
description: "Delete comment",
|
|
6145
6076
|
method: HttpMethod.DELETE,
|
|
6146
6077
|
url: `/issues/comments/${offline_id}/`,
|
|
@@ -6154,7 +6085,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6154
6085
|
}
|
|
6155
6086
|
async refreshStore() {
|
|
6156
6087
|
const { store } = this.client;
|
|
6157
|
-
const result = await this.enqueueRequest({
|
|
6088
|
+
const result = await this.client.enqueueRequest({
|
|
6158
6089
|
description: "Get comments",
|
|
6159
6090
|
method: HttpMethod.GET,
|
|
6160
6091
|
// TODO: Choose between /issues/comments/in-project/${projectId}/ and /projects/${projectId}/issue-comments/
|
|
@@ -6168,7 +6099,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6168
6099
|
class IssueUpdateService extends BaseApiService {
|
|
6169
6100
|
async refreshStore() {
|
|
6170
6101
|
const { store } = this.client;
|
|
6171
|
-
const result = await this.enqueueRequest({
|
|
6102
|
+
const result = await this.client.enqueueRequest({
|
|
6172
6103
|
description: "Get issue updates",
|
|
6173
6104
|
method: HttpMethod.GET,
|
|
6174
6105
|
url: `/projects/${store.getState().projectReducer.activeProjectId}/issues/updates/`,
|
|
@@ -6254,7 +6185,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6254
6185
|
store.dispatch(addIssue(issuePayload));
|
|
6255
6186
|
store.dispatch(addToRecentIssues(issuePayload.offline_id));
|
|
6256
6187
|
store.dispatch(addActiveProjectIssuesCount(1));
|
|
6257
|
-
const promise = this.enqueueRequest({
|
|
6188
|
+
const promise = this.client.enqueueRequest({
|
|
6258
6189
|
description: "Create issue",
|
|
6259
6190
|
method: HttpMethod.POST,
|
|
6260
6191
|
url: "/issues/",
|
|
@@ -6289,7 +6220,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6289
6220
|
return [issuePayload, promise];
|
|
6290
6221
|
}
|
|
6291
6222
|
fetchAll(projectId) {
|
|
6292
|
-
const promise = this.enqueueRequest({
|
|
6223
|
+
const promise = this.client.enqueueRequest({
|
|
6293
6224
|
description: "Get issues",
|
|
6294
6225
|
method: HttpMethod.GET,
|
|
6295
6226
|
url: `/projects/${projectId}/issues/`,
|
|
@@ -6386,7 +6317,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6386
6317
|
changes
|
|
6387
6318
|
});
|
|
6388
6319
|
this.client.store.dispatch(addIssueUpdate(offlineIssueUpdate));
|
|
6389
|
-
const promise = this.enqueueRequest({
|
|
6320
|
+
const promise = this.client.enqueueRequest({
|
|
6390
6321
|
description: "Edit issue",
|
|
6391
6322
|
method: HttpMethod.PATCH,
|
|
6392
6323
|
url: `/issues/${issue.offline_id}/`,
|
|
@@ -6419,7 +6350,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6419
6350
|
if (updatesOfIssue.length > 0)
|
|
6420
6351
|
dispatch(removeIssueUpdates(updatesOfIssue.map(({ offline_id }) => offline_id)));
|
|
6421
6352
|
try {
|
|
6422
|
-
return await this.enqueueRequest({
|
|
6353
|
+
return await this.client.enqueueRequest({
|
|
6423
6354
|
description: "Delete issue",
|
|
6424
6355
|
method: HttpMethod.DELETE,
|
|
6425
6356
|
url: `/issues/${id}/`,
|
|
@@ -6461,7 +6392,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6461
6392
|
organization: activeOrganizationId
|
|
6462
6393
|
});
|
|
6463
6394
|
store.dispatch(addIssueType(offlineIssueType));
|
|
6464
|
-
const promise = this.enqueueRequest({
|
|
6395
|
+
const promise = this.client.enqueueRequest({
|
|
6465
6396
|
method: HttpMethod.POST,
|
|
6466
6397
|
url: `/organizations/${activeOrganizationId}/issue-types/`,
|
|
6467
6398
|
// Sending only whats needed here
|
|
@@ -6494,7 +6425,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6494
6425
|
...issueTypeFields
|
|
6495
6426
|
};
|
|
6496
6427
|
store.dispatch(updateIssueType(offlineUpdatedIssueType));
|
|
6497
|
-
const promise = this.enqueueRequest({
|
|
6428
|
+
const promise = this.client.enqueueRequest({
|
|
6498
6429
|
method: HttpMethod.PATCH,
|
|
6499
6430
|
url: `/issues/types/${issueTypeFields.offline_id}/`,
|
|
6500
6431
|
payload: issueTypeFields,
|
|
@@ -6518,7 +6449,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6518
6449
|
const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(state) ?? [];
|
|
6519
6450
|
store.dispatch(removeIssueType(issueTypeId));
|
|
6520
6451
|
store.dispatch(removeIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
6521
|
-
const promise = this.enqueueRequest({
|
|
6452
|
+
const promise = this.client.enqueueRequest({
|
|
6522
6453
|
method: HttpMethod.DELETE,
|
|
6523
6454
|
url: `/issues/types/${issueTypeId}/`,
|
|
6524
6455
|
blockers: [issueTypeId],
|
|
@@ -6536,7 +6467,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6536
6467
|
if (!activeOrganizationId) {
|
|
6537
6468
|
throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
|
|
6538
6469
|
}
|
|
6539
|
-
const result = await this.enqueueRequest({
|
|
6470
|
+
const result = await this.client.enqueueRequest({
|
|
6540
6471
|
method: HttpMethod.GET,
|
|
6541
6472
|
url: `/organizations/${activeOrganizationId}/issue-types/`,
|
|
6542
6473
|
blockers: [],
|
|
@@ -6550,7 +6481,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6550
6481
|
if (replaceExisting) {
|
|
6551
6482
|
this.client.store.dispatch(setIsFetchingInitialData(true));
|
|
6552
6483
|
}
|
|
6553
|
-
const result = await this.enqueueRequest({
|
|
6484
|
+
const result = await this.client.enqueueRequest({
|
|
6554
6485
|
uuid: uuid2,
|
|
6555
6486
|
description: "Get initial data",
|
|
6556
6487
|
method: HttpMethod.GET,
|
|
@@ -6564,7 +6495,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6564
6495
|
}
|
|
6565
6496
|
async fetchProjectUsers() {
|
|
6566
6497
|
const projectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
6567
|
-
return this.enqueueRequest({
|
|
6498
|
+
return this.client.enqueueRequest({
|
|
6568
6499
|
description: "Fetch users",
|
|
6569
6500
|
method: HttpMethod.GET,
|
|
6570
6501
|
url: `/projects/${projectId}/users/`,
|
|
@@ -6576,7 +6507,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6576
6507
|
});
|
|
6577
6508
|
}
|
|
6578
6509
|
async fetchOrganizationUsers(orgId) {
|
|
6579
|
-
return this.enqueueRequest({
|
|
6510
|
+
return this.client.enqueueRequest({
|
|
6580
6511
|
description: "Fetch organization users",
|
|
6581
6512
|
method: HttpMethod.GET,
|
|
6582
6513
|
url: `/organizations/${orgId}/users/`,
|
|
@@ -6585,8 +6516,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6585
6516
|
});
|
|
6586
6517
|
}
|
|
6587
6518
|
// TODO:
|
|
6588
|
-
// Don't accept updateStore in
|
|
6589
|
-
// overwrite, use
|
|
6519
|
+
// Don't accept updateStore in ComponentService.list. Just return the offline objects and promise. Here, if
|
|
6520
|
+
// overwrite, use setComponents. Otherwise, use bulkAddComponents.
|
|
6590
6521
|
// TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
|
|
6591
6522
|
// literally immediately.
|
|
6592
6523
|
async _processInitialData(data, overwrite) {
|
|
@@ -6691,10 +6622,10 @@ var __publicField = (obj, key, value) => {
|
|
|
6691
6622
|
} finally {
|
|
6692
6623
|
store.dispatch(setIsFetchingInitialData(false));
|
|
6693
6624
|
}
|
|
6694
|
-
void this.client.
|
|
6695
|
-
void this.client.
|
|
6696
|
-
void this.client.
|
|
6697
|
-
void this.client.
|
|
6625
|
+
void this.client.componentTypes.refreshStore();
|
|
6626
|
+
void this.client.componentStages.refreshStore();
|
|
6627
|
+
void this.client.components.refreshStore();
|
|
6628
|
+
void this.client.componentStageCompletions.refreshStore();
|
|
6698
6629
|
void this.client.categories.refreshStore();
|
|
6699
6630
|
void this.client.issueTypes.refreshStore();
|
|
6700
6631
|
void this.client.issues.refreshStore();
|
|
@@ -6709,15 +6640,15 @@ var __publicField = (obj, key, value) => {
|
|
|
6709
6640
|
void this.client.issueUpdates.refreshStore();
|
|
6710
6641
|
void this.client.projectAccesses.refreshStore();
|
|
6711
6642
|
void this.client.projectAttachments.refreshStore();
|
|
6712
|
-
void this.client.
|
|
6713
|
-
void this.client.
|
|
6643
|
+
void this.client.componentTypeAttachments.refreshStore();
|
|
6644
|
+
void this.client.componentAttachments.refreshStore();
|
|
6714
6645
|
}
|
|
6715
6646
|
void this.client.teams.refreshStore();
|
|
6716
6647
|
}
|
|
6717
6648
|
}
|
|
6718
6649
|
class ProjectAccessService extends BaseApiService {
|
|
6719
6650
|
async fetchAll(projectId) {
|
|
6720
|
-
return this.enqueueRequest({
|
|
6651
|
+
return this.client.enqueueRequest({
|
|
6721
6652
|
description: "Get project accesses",
|
|
6722
6653
|
method: HttpMethod.GET,
|
|
6723
6654
|
url: `/projects/${projectId}/access/`,
|
|
@@ -6727,7 +6658,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6727
6658
|
}
|
|
6728
6659
|
async update(projectAccess) {
|
|
6729
6660
|
this.client.store.dispatch(updateProjectAccess(projectAccess));
|
|
6730
|
-
return this.enqueueRequest({
|
|
6661
|
+
return this.client.enqueueRequest({
|
|
6731
6662
|
description: "Edit project access",
|
|
6732
6663
|
method: HttpMethod.PATCH,
|
|
6733
6664
|
url: `/access/${projectAccess.offline_id}/`,
|
|
@@ -6740,7 +6671,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6740
6671
|
async remove(projectAccess) {
|
|
6741
6672
|
const { store } = this.client;
|
|
6742
6673
|
store.dispatch(removeProjectAccess(projectAccess));
|
|
6743
|
-
return this.enqueueRequest({
|
|
6674
|
+
return this.client.enqueueRequest({
|
|
6744
6675
|
description: "Delete project access",
|
|
6745
6676
|
method: HttpMethod.DELETE,
|
|
6746
6677
|
url: `/access/${projectAccess.offline_id}/`,
|
|
@@ -6763,7 +6694,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6763
6694
|
class ProjectFileService extends BaseApiService {
|
|
6764
6695
|
async refreshStore() {
|
|
6765
6696
|
const { store } = this.client;
|
|
6766
|
-
const result = await this.enqueueRequest({
|
|
6697
|
+
const result = await this.client.enqueueRequest({
|
|
6767
6698
|
description: "Get project files",
|
|
6768
6699
|
method: HttpMethod.GET,
|
|
6769
6700
|
url: `/projects/${store.getState().projectReducer.activeProjectId}/files/`,
|
|
@@ -6780,7 +6711,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6780
6711
|
}
|
|
6781
6712
|
const editableData = { ...file };
|
|
6782
6713
|
delete editableData.file;
|
|
6783
|
-
const promise = this.enqueueRequest({
|
|
6714
|
+
const promise = this.client.enqueueRequest({
|
|
6784
6715
|
method: HttpMethod.PATCH,
|
|
6785
6716
|
url: `/projects/files/${file.offline_id}/`,
|
|
6786
6717
|
payload: editableData,
|
|
@@ -6838,7 +6769,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6838
6769
|
});
|
|
6839
6770
|
}
|
|
6840
6771
|
const promise = Promise.resolve(requestDetails).then((requestDetails2) => {
|
|
6841
|
-
return this.enqueueRequest(requestDetails2);
|
|
6772
|
+
return this.client.enqueueRequest(requestDetails2);
|
|
6842
6773
|
});
|
|
6843
6774
|
void promise.then((result) => {
|
|
6844
6775
|
store.dispatch(addOrReplaceProjectFile(result));
|
|
@@ -6850,7 +6781,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6850
6781
|
}
|
|
6851
6782
|
delete(projectFileId) {
|
|
6852
6783
|
this.client.store.dispatch(removeProjectFile(projectFileId));
|
|
6853
|
-
return this.enqueueRequest({
|
|
6784
|
+
return this.client.enqueueRequest({
|
|
6854
6785
|
method: HttpMethod.DELETE,
|
|
6855
6786
|
url: `/projects/files/${projectFileId}`,
|
|
6856
6787
|
blockers: [projectFileId],
|
|
@@ -6921,7 +6852,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6921
6852
|
}
|
|
6922
6853
|
const url = isOrganizationProject ? `/organizations/${project.owner_organization}/projects/` : "/projects/";
|
|
6923
6854
|
const projectType = isOrganizationProject ? { organization_owner: project.owner_organization } : { user_owner: project.owner_user };
|
|
6924
|
-
const result = await this.enqueueRequest({
|
|
6855
|
+
const result = await this.client.enqueueRequest({
|
|
6925
6856
|
description: "Create project",
|
|
6926
6857
|
method: HttpMethod.POST,
|
|
6927
6858
|
url,
|
|
@@ -6945,7 +6876,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6945
6876
|
throw new Error("Project bounds were not set before trying to create a project");
|
|
6946
6877
|
}
|
|
6947
6878
|
store.dispatch(updateOrCreateProject(project));
|
|
6948
|
-
return await this.enqueueRequest({
|
|
6879
|
+
return await this.client.enqueueRequest({
|
|
6949
6880
|
description: "Update project",
|
|
6950
6881
|
method: HttpMethod.PATCH,
|
|
6951
6882
|
url: `/projects/${project.id}/`,
|
|
@@ -6985,7 +6916,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6985
6916
|
store.dispatch(updateLicense({ ...license, project: null }));
|
|
6986
6917
|
}
|
|
6987
6918
|
try {
|
|
6988
|
-
await this.enqueueRequest({
|
|
6919
|
+
await this.client.enqueueRequest({
|
|
6989
6920
|
description: "Delete project",
|
|
6990
6921
|
method: HttpMethod.DELETE,
|
|
6991
6922
|
url: `/projects/${projectId}/`,
|
|
@@ -7008,7 +6939,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7008
6939
|
}
|
|
7009
6940
|
invite(projectId, email) {
|
|
7010
6941
|
const offline_id = uuid.v4();
|
|
7011
|
-
return this.enqueueRequest({
|
|
6942
|
+
return this.client.enqueueRequest({
|
|
7012
6943
|
description: "Invite user to project",
|
|
7013
6944
|
method: HttpMethod.POST,
|
|
7014
6945
|
url: `/projects/${projectId}/invite/${email}/`,
|
|
@@ -7020,7 +6951,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7020
6951
|
});
|
|
7021
6952
|
}
|
|
7022
6953
|
joinProject(projectId, userId, inviteCode) {
|
|
7023
|
-
return this.enqueueRequest({
|
|
6954
|
+
return this.client.enqueueRequest({
|
|
7024
6955
|
description: "Join project",
|
|
7025
6956
|
method: HttpMethod.GET,
|
|
7026
6957
|
url: `/projects/${projectId}/join-project/${userId}/${inviteCode}/`,
|
|
@@ -7030,7 +6961,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7030
6961
|
});
|
|
7031
6962
|
}
|
|
7032
6963
|
async acceptInvite(projectId) {
|
|
7033
|
-
return this.enqueueRequest({
|
|
6964
|
+
return this.client.enqueueRequest({
|
|
7034
6965
|
description: "Accept project invite",
|
|
7035
6966
|
method: HttpMethod.PATCH,
|
|
7036
6967
|
url: `/projects/${projectId}/accept-invite/`,
|
|
@@ -7089,7 +7020,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7089
7020
|
revision: offlineRevisionId,
|
|
7090
7021
|
field_identifier: key
|
|
7091
7022
|
});
|
|
7092
|
-
const attach = await this.enqueueRequest({
|
|
7023
|
+
const attach = await this.client.enqueueRequest({
|
|
7093
7024
|
description: "Attach image to form revision field",
|
|
7094
7025
|
method: HttpMethod.POST,
|
|
7095
7026
|
url: `/forms/revisions/${offlineRevisionId}/attachments/`,
|
|
@@ -7106,7 +7037,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7106
7037
|
});
|
|
7107
7038
|
});
|
|
7108
7039
|
}
|
|
7109
|
-
async add(state, initialRevision, url, ownerUser, ownerOrganization,
|
|
7040
|
+
async add(state, initialRevision, url, ownerUser, ownerOrganization, componentTypeId, issueTypeId) {
|
|
7110
7041
|
if (!!ownerUser === !!ownerOrganization) {
|
|
7111
7042
|
throw new Error("Exactly one of ownerUser and ownerOrganization must be defined.");
|
|
7112
7043
|
}
|
|
@@ -7125,7 +7056,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7125
7056
|
favorite: true,
|
|
7126
7057
|
submitted_at: submittedAt,
|
|
7127
7058
|
created_by: currentUser.id,
|
|
7128
|
-
...
|
|
7059
|
+
...componentTypeId && { component_type: componentTypeId },
|
|
7129
7060
|
...issueTypeId && { issue_type: issueTypeId },
|
|
7130
7061
|
...ownerAttrs
|
|
7131
7062
|
};
|
|
@@ -7140,7 +7071,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7140
7071
|
const { store } = this.client;
|
|
7141
7072
|
store.dispatch(addForm(retForm));
|
|
7142
7073
|
store.dispatch(addFormRevision(retRevision));
|
|
7143
|
-
const formPromise = this.enqueueRequest({
|
|
7074
|
+
const formPromise = this.client.enqueueRequest({
|
|
7144
7075
|
description: "Create form",
|
|
7145
7076
|
method: HttpMethod.POST,
|
|
7146
7077
|
url,
|
|
@@ -7149,11 +7080,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7149
7080
|
} : void 0,
|
|
7150
7081
|
payload: {
|
|
7151
7082
|
...offlineFormPayload,
|
|
7152
|
-
...
|
|
7083
|
+
...componentTypeId && { component_type: componentTypeId },
|
|
7153
7084
|
...issueTypeId && { issue_type: issueTypeId },
|
|
7154
7085
|
initial_revision: payloadWithoutImage
|
|
7155
7086
|
},
|
|
7156
|
-
blockers:
|
|
7087
|
+
blockers: componentTypeId ? [componentTypeId] : issueTypeId ? [issueTypeId] : [],
|
|
7157
7088
|
blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
|
|
7158
7089
|
});
|
|
7159
7090
|
const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
|
|
@@ -7177,7 +7108,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7177
7108
|
`/forms/in-organization/${activeOrganizationId}/`,
|
|
7178
7109
|
void 0,
|
|
7179
7110
|
activeOrganizationId,
|
|
7180
|
-
attachedTo && "
|
|
7111
|
+
attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
|
|
7181
7112
|
attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
|
|
7182
7113
|
);
|
|
7183
7114
|
}
|
|
@@ -7190,7 +7121,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7190
7121
|
"/forms/my-forms/",
|
|
7191
7122
|
currentUser.id,
|
|
7192
7123
|
void 0,
|
|
7193
|
-
attachedTo && "
|
|
7124
|
+
attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
|
|
7194
7125
|
attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
|
|
7195
7126
|
);
|
|
7196
7127
|
}
|
|
@@ -7212,7 +7143,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7212
7143
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7213
7144
|
};
|
|
7214
7145
|
store.dispatch(addFormRevision(fullRevision));
|
|
7215
|
-
const promise = this.enqueueRequest({
|
|
7146
|
+
const promise = this.client.enqueueRequest({
|
|
7216
7147
|
description: "Create form revision",
|
|
7217
7148
|
method: HttpMethod.PATCH,
|
|
7218
7149
|
url: `/forms/${formId2}/`,
|
|
@@ -7237,7 +7168,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7237
7168
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
7238
7169
|
store.dispatch(favoriteForm({ formId: formId2 }));
|
|
7239
7170
|
try {
|
|
7240
|
-
await this.enqueueRequest({
|
|
7171
|
+
await this.client.enqueueRequest({
|
|
7241
7172
|
description: "Favorite form",
|
|
7242
7173
|
method: HttpMethod.POST,
|
|
7243
7174
|
url: `/forms/${formId2}/favorite/${activeProjectId}/`,
|
|
@@ -7254,7 +7185,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7254
7185
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
7255
7186
|
store.dispatch(unfavoriteForm({ formId: formId2 }));
|
|
7256
7187
|
try {
|
|
7257
|
-
return await this.enqueueRequest({
|
|
7188
|
+
return await this.client.enqueueRequest({
|
|
7258
7189
|
description: "Unfavorite form",
|
|
7259
7190
|
method: HttpMethod.DELETE,
|
|
7260
7191
|
url: `/forms/${formId2}/unfavorite/${activeProjectId}/`,
|
|
@@ -7283,7 +7214,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7283
7214
|
}
|
|
7284
7215
|
store.dispatch(deleteForm(formId2));
|
|
7285
7216
|
try {
|
|
7286
|
-
return await this.enqueueRequest({
|
|
7217
|
+
return await this.client.enqueueRequest({
|
|
7287
7218
|
description: "Delete form",
|
|
7288
7219
|
method: HttpMethod.DELETE,
|
|
7289
7220
|
url: `/forms/${formId2}/`,
|
|
@@ -7303,7 +7234,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7303
7234
|
}
|
|
7304
7235
|
async refreshStore() {
|
|
7305
7236
|
const { store } = this.client;
|
|
7306
|
-
const result = await this.enqueueRequest({
|
|
7237
|
+
const result = await this.client.enqueueRequest({
|
|
7307
7238
|
description: "Fetch user forms",
|
|
7308
7239
|
method: HttpMethod.GET,
|
|
7309
7240
|
url: `/forms/in-project/${store.getState().projectReducer.activeProjectId}/forms/`,
|
|
@@ -7352,14 +7283,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7352
7283
|
submission: submission.offline_id,
|
|
7353
7284
|
field_identifier: key
|
|
7354
7285
|
});
|
|
7355
|
-
const attach = await this.enqueueRequest({
|
|
7286
|
+
const attach = await this.client.enqueueRequest({
|
|
7356
7287
|
description: "Attach file to form submission",
|
|
7357
7288
|
method: HttpMethod.POST,
|
|
7358
7289
|
url: `/forms/submission/${submission.offline_id}/attachments/`,
|
|
7359
7290
|
payload: submissionAttachmentPayload,
|
|
7360
7291
|
blockers: [
|
|
7361
|
-
submission.
|
|
7362
|
-
submission.
|
|
7292
|
+
submission.component,
|
|
7293
|
+
submission.component_stage,
|
|
7363
7294
|
submission.issue,
|
|
7364
7295
|
submission.form_revision
|
|
7365
7296
|
].filter((x) => x !== void 0),
|
|
@@ -7390,12 +7321,12 @@ var __publicField = (obj, key, value) => {
|
|
|
7390
7321
|
created_by: state.userReducer.currentUser.id,
|
|
7391
7322
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7392
7323
|
};
|
|
7393
|
-
const promise = this.enqueueRequest({
|
|
7324
|
+
const promise = this.client.enqueueRequest({
|
|
7394
7325
|
description: "Respond to form",
|
|
7395
7326
|
method: HttpMethod.POST,
|
|
7396
7327
|
url: `/forms/revisions/${payload.form_revision}/respond/`,
|
|
7397
7328
|
payload: { ...offlineSubmission, project: activeProjectId },
|
|
7398
|
-
blockers: [payload.issue, payload.
|
|
7329
|
+
blockers: [payload.issue, payload.component, payload.component_stage, "add-form-entry"].filter(
|
|
7399
7330
|
(x) => x !== void 0
|
|
7400
7331
|
),
|
|
7401
7332
|
blocks: [payload.offline_id]
|
|
@@ -7413,10 +7344,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7413
7344
|
const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
|
|
7414
7345
|
return [offlineSubmission, settledPromise];
|
|
7415
7346
|
}
|
|
7416
|
-
// Note currently the bulkAdd method is specific to form submissions for
|
|
7347
|
+
// Note currently the bulkAdd method is specific to form submissions for components
|
|
7417
7348
|
// TODO: adapt the support bulk adding to any model type
|
|
7418
7349
|
async bulkAdd(args) {
|
|
7419
|
-
const { formRevision, values: argsValues,
|
|
7350
|
+
const { formRevision, values: argsValues, componentOfflineIds } = args;
|
|
7420
7351
|
const { store } = this.client;
|
|
7421
7352
|
const offlineSubmissions = [];
|
|
7422
7353
|
const offlineAttachments = [];
|
|
@@ -7426,16 +7357,16 @@ var __publicField = (obj, key, value) => {
|
|
|
7426
7357
|
const { values, files } = separateFilesFromValues(argsValues);
|
|
7427
7358
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7428
7359
|
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7429
|
-
for (const
|
|
7360
|
+
for (const component_id of componentOfflineIds) {
|
|
7430
7361
|
const submission = offline({
|
|
7431
7362
|
form_revision: formRevision,
|
|
7432
7363
|
values,
|
|
7433
7364
|
created_by: createdBy,
|
|
7434
7365
|
submitted_at: submittedAt,
|
|
7435
|
-
|
|
7366
|
+
component: component_id
|
|
7436
7367
|
});
|
|
7437
7368
|
submissionOfflineIds.push(submission.offline_id);
|
|
7438
|
-
submissionsPayload.push({ offline_id: submission.offline_id,
|
|
7369
|
+
submissionsPayload.push({ offline_id: submission.offline_id, component_id });
|
|
7439
7370
|
offlineSubmissions.push(submission);
|
|
7440
7371
|
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
7441
7372
|
for (const file of fileArray) {
|
|
@@ -7471,7 +7402,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7471
7402
|
}
|
|
7472
7403
|
store.dispatch(addFormSubmissions(offlineSubmissions));
|
|
7473
7404
|
store.dispatch(addFormSubmissionAttachments(offlineAttachments));
|
|
7474
|
-
const promise = this.enqueueRequest({
|
|
7405
|
+
const promise = this.client.enqueueRequest({
|
|
7475
7406
|
description: "Bulk add form submissions",
|
|
7476
7407
|
method: HttpMethod.POST,
|
|
7477
7408
|
url: `/forms/revisions/${formRevision}/bulk-respond/`,
|
|
@@ -7482,7 +7413,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7482
7413
|
attachments: attachmentsPayload,
|
|
7483
7414
|
files: Object.values(filesRecord)
|
|
7484
7415
|
},
|
|
7485
|
-
blockers:
|
|
7416
|
+
blockers: componentOfflineIds,
|
|
7486
7417
|
blocks: submissionOfflineIds
|
|
7487
7418
|
});
|
|
7488
7419
|
promise.then(({ submissions, attachments, presigned_urls }) => {
|
|
@@ -7492,7 +7423,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7492
7423
|
const file = filesRecord[sha1];
|
|
7493
7424
|
if (!file)
|
|
7494
7425
|
continue;
|
|
7495
|
-
void this.enqueueRequest({
|
|
7426
|
+
void this.client.enqueueRequest({
|
|
7496
7427
|
url: presigned_url.url,
|
|
7497
7428
|
description: "Upload file",
|
|
7498
7429
|
method: HttpMethod.POST,
|
|
@@ -7520,12 +7451,12 @@ var __publicField = (obj, key, value) => {
|
|
|
7520
7451
|
};
|
|
7521
7452
|
const submissionToBeUpdated = store.getState().formSubmissionReducer.formSubmissions[submission.offline_id];
|
|
7522
7453
|
store.dispatch(updateFormSubmission(offlineSubmission));
|
|
7523
|
-
const promise = this.enqueueRequest({
|
|
7454
|
+
const promise = this.client.enqueueRequest({
|
|
7524
7455
|
description: "Patch form submission",
|
|
7525
7456
|
method: HttpMethod.PATCH,
|
|
7526
7457
|
url: `/forms/submissions/${submission.offline_id}/`,
|
|
7527
7458
|
payload: offlineSubmission,
|
|
7528
|
-
blockers: [offlineSubmission.issue, offlineSubmission.
|
|
7459
|
+
blockers: [offlineSubmission.issue, offlineSubmission.component, offlineSubmission.component_stage].filter(
|
|
7529
7460
|
(x) => x !== void 0
|
|
7530
7461
|
),
|
|
7531
7462
|
blocks: [offlineSubmission.offline_id]
|
|
@@ -7546,7 +7477,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7546
7477
|
store.dispatch(addActiveProjectFormSubmissionsCount(-1));
|
|
7547
7478
|
store.dispatch(deleteFormSubmissionAttachments(submissionAttachments.map((x) => x.offline_id)));
|
|
7548
7479
|
try {
|
|
7549
|
-
return await this.enqueueRequest({
|
|
7480
|
+
return await this.client.enqueueRequest({
|
|
7550
7481
|
description: "Delete user form submissions",
|
|
7551
7482
|
method: HttpMethod.DELETE,
|
|
7552
7483
|
url: `/forms/submissions/${submissionId}/`,
|
|
@@ -7563,7 +7494,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7563
7494
|
async refreshStore() {
|
|
7564
7495
|
const { store } = this.client;
|
|
7565
7496
|
const projectId = store.getState().projectReducer.activeProjectId;
|
|
7566
|
-
const submissions = await this.enqueueRequest({
|
|
7497
|
+
const submissions = await this.client.enqueueRequest({
|
|
7567
7498
|
description: "Fetch form submissions",
|
|
7568
7499
|
method: HttpMethod.GET,
|
|
7569
7500
|
url: `/forms/in-project/${projectId}/submissions/`,
|
|
@@ -7571,7 +7502,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7571
7502
|
blocks: []
|
|
7572
7503
|
});
|
|
7573
7504
|
store.dispatch(setFormSubmissions(submissions));
|
|
7574
|
-
const attachments = await this.enqueueRequest({
|
|
7505
|
+
const attachments = await this.client.enqueueRequest({
|
|
7575
7506
|
description: "Fetch form attachments",
|
|
7576
7507
|
method: HttpMethod.GET,
|
|
7577
7508
|
url: `/forms/in-project/${projectId}/attachments/`,
|
|
@@ -7586,7 +7517,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7586
7517
|
const { store } = this.client;
|
|
7587
7518
|
const offlineWorkspace = offline(workspace);
|
|
7588
7519
|
store.dispatch(addWorkspace(offlineWorkspace));
|
|
7589
|
-
const promise = this.enqueueRequest({
|
|
7520
|
+
const promise = this.client.enqueueRequest({
|
|
7590
7521
|
description: "Create Workspace",
|
|
7591
7522
|
method: HttpMethod.POST,
|
|
7592
7523
|
url: `/projects/${store.getState().projectReducer.activeProjectId}/workspaces/`,
|
|
@@ -7604,7 +7535,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7604
7535
|
update(workspace) {
|
|
7605
7536
|
const { store } = this.client;
|
|
7606
7537
|
store.dispatch(addOrReplaceWorkspaces({ [workspace.offline_id]: workspace }));
|
|
7607
|
-
const promise = this.enqueueRequest({
|
|
7538
|
+
const promise = this.client.enqueueRequest({
|
|
7608
7539
|
description: "Update Workspace",
|
|
7609
7540
|
method: HttpMethod.PATCH,
|
|
7610
7541
|
url: `/workspaces/${workspace.offline_id}/`,
|
|
@@ -7616,7 +7547,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7616
7547
|
}
|
|
7617
7548
|
delete(workspaceId) {
|
|
7618
7549
|
const { store } = this.client;
|
|
7619
|
-
const promise = this.enqueueRequest({
|
|
7550
|
+
const promise = this.client.enqueueRequest({
|
|
7620
7551
|
description: "Delete Workspace",
|
|
7621
7552
|
method: HttpMethod.DELETE,
|
|
7622
7553
|
url: `/workspaces/${workspaceId}/`,
|
|
@@ -7638,7 +7569,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7638
7569
|
}
|
|
7639
7570
|
class OrganizationAccessService extends BaseApiService {
|
|
7640
7571
|
async update(organizationAccess) {
|
|
7641
|
-
const promise = this.enqueueRequest({
|
|
7572
|
+
const promise = this.client.enqueueRequest({
|
|
7642
7573
|
description: "Edit organization access",
|
|
7643
7574
|
method: HttpMethod.PATCH,
|
|
7644
7575
|
url: `/organizations/${organizationAccess.organization}/access/${organizationAccess.offline_id}/`,
|
|
@@ -7654,7 +7585,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7654
7585
|
async remove(organizationAccess) {
|
|
7655
7586
|
this.client.store.dispatch(removeOrganizationAccess(organizationAccess));
|
|
7656
7587
|
this.client.store.dispatch(removeUser(organizationAccess.user));
|
|
7657
|
-
return this.enqueueRequest({
|
|
7588
|
+
return this.client.enqueueRequest({
|
|
7658
7589
|
description: "Remove organization access",
|
|
7659
7590
|
method: HttpMethod.DELETE,
|
|
7660
7591
|
url: `/organizations/${organizationAccess.organization}/access/${organizationAccess.offline_id}/`,
|
|
@@ -7669,7 +7600,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7669
7600
|
if (!organizationId) {
|
|
7670
7601
|
return;
|
|
7671
7602
|
}
|
|
7672
|
-
const result = await this.enqueueRequest({
|
|
7603
|
+
const result = await this.client.enqueueRequest({
|
|
7673
7604
|
description: "Get organization accesses",
|
|
7674
7605
|
method: HttpMethod.GET,
|
|
7675
7606
|
url: `/organizations/${organizationId}/access/`,
|
|
@@ -7701,7 +7632,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7701
7632
|
if (!file)
|
|
7702
7633
|
throw new Error(`File with sha1 ${sha1} not found in cache`);
|
|
7703
7634
|
const key = await getFileS3Key(file, sha1);
|
|
7704
|
-
const s3UploadUrl = await this.enqueueRequest({
|
|
7635
|
+
const s3UploadUrl = await this.client.enqueueRequest({
|
|
7705
7636
|
description: "Get S3 URL",
|
|
7706
7637
|
method: HttpMethod.GET,
|
|
7707
7638
|
url: "/authentication/files/presigned-upload-url/",
|
|
@@ -7785,7 +7716,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7785
7716
|
throw new Error(fileUploadUrlResponse.warning);
|
|
7786
7717
|
}
|
|
7787
7718
|
const url = fileUploadUrlResponse.url;
|
|
7788
|
-
const promise = this.enqueueRequest({
|
|
7719
|
+
const promise = this.client.enqueueRequest({
|
|
7789
7720
|
url,
|
|
7790
7721
|
description: "Upload file",
|
|
7791
7722
|
method: HttpMethod.POST,
|
|
@@ -7827,7 +7758,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7827
7758
|
let isFirstRequest = true;
|
|
7828
7759
|
if (!promise) {
|
|
7829
7760
|
promise = new Promise((resolve) => {
|
|
7830
|
-
void this.enqueueRequest({
|
|
7761
|
+
void this.client.enqueueRequest({
|
|
7831
7762
|
description: "Download file",
|
|
7832
7763
|
method: HttpMethod.GET,
|
|
7833
7764
|
url,
|
|
@@ -7895,7 +7826,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7895
7826
|
blockers: [],
|
|
7896
7827
|
blocks: []
|
|
7897
7828
|
};
|
|
7898
|
-
return this.enqueueRequest(requestDetails);
|
|
7829
|
+
return this.client.enqueueRequest(requestDetails);
|
|
7899
7830
|
}
|
|
7900
7831
|
validateVerificationCode(verificationCode, payload = void 0) {
|
|
7901
7832
|
const requestDetails = {
|
|
@@ -7907,12 +7838,12 @@ var __publicField = (obj, key, value) => {
|
|
|
7907
7838
|
blockers: [],
|
|
7908
7839
|
blocks: []
|
|
7909
7840
|
};
|
|
7910
|
-
return this.enqueueRequest(requestDetails);
|
|
7841
|
+
return this.client.enqueueRequest(requestDetails);
|
|
7911
7842
|
}
|
|
7912
7843
|
}
|
|
7913
7844
|
class EmailDomainsService extends BaseApiService {
|
|
7914
7845
|
async fetchAll(orgId) {
|
|
7915
|
-
return this.enqueueRequest({
|
|
7846
|
+
return this.client.enqueueRequest({
|
|
7916
7847
|
description: "Fetch email domains for organization",
|
|
7917
7848
|
method: HttpMethod.GET,
|
|
7918
7849
|
url: `/organizations/${orgId}/email-domains/`,
|
|
@@ -7921,7 +7852,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7921
7852
|
});
|
|
7922
7853
|
}
|
|
7923
7854
|
async add(orgId, email) {
|
|
7924
|
-
return this.enqueueRequest({
|
|
7855
|
+
return this.client.enqueueRequest({
|
|
7925
7856
|
description: "Add email domain to organization",
|
|
7926
7857
|
method: HttpMethod.POST,
|
|
7927
7858
|
url: `/organizations/${orgId}/email-domains/`,
|
|
@@ -7932,7 +7863,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7932
7863
|
}
|
|
7933
7864
|
async remove(emailDomain) {
|
|
7934
7865
|
this.client.store.dispatch(removeEmailDomain(emailDomain));
|
|
7935
|
-
return this.enqueueRequest({
|
|
7866
|
+
return this.client.enqueueRequest({
|
|
7936
7867
|
description: "Remove email domain from organization",
|
|
7937
7868
|
method: HttpMethod.DELETE,
|
|
7938
7869
|
url: `/organizations/${emailDomain.organization}/email-domains/${emailDomain.offline_id}/`,
|
|
@@ -7958,7 +7889,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7958
7889
|
if (showLoading) {
|
|
7959
7890
|
this.client.store.dispatch(setIsFetchingInitialData(true));
|
|
7960
7891
|
}
|
|
7961
|
-
return this.enqueueRequest({
|
|
7892
|
+
return this.client.enqueueRequest({
|
|
7962
7893
|
description: "Get initial organization data",
|
|
7963
7894
|
method: HttpMethod.GET,
|
|
7964
7895
|
url: `/organizations/${organizationId}/initial-data/`,
|
|
@@ -7986,7 +7917,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7986
7917
|
}
|
|
7987
7918
|
}
|
|
7988
7919
|
async create(name) {
|
|
7989
|
-
const result = await this.enqueueRequest({
|
|
7920
|
+
const result = await this.client.enqueueRequest({
|
|
7990
7921
|
description: "Create organization",
|
|
7991
7922
|
method: HttpMethod.POST,
|
|
7992
7923
|
url: "/organizations/",
|
|
@@ -7998,7 +7929,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7998
7929
|
return result;
|
|
7999
7930
|
}
|
|
8000
7931
|
async update(organization) {
|
|
8001
|
-
const promise = this.enqueueRequest({
|
|
7932
|
+
const promise = this.client.enqueueRequest({
|
|
8002
7933
|
description: "Edit organization",
|
|
8003
7934
|
method: HttpMethod.PATCH,
|
|
8004
7935
|
url: `/organizations/${organization.id}/`,
|
|
@@ -8012,7 +7943,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8012
7943
|
});
|
|
8013
7944
|
}
|
|
8014
7945
|
async invite(organizationId, email) {
|
|
8015
|
-
return this.enqueueRequest({
|
|
7946
|
+
return this.client.enqueueRequest({
|
|
8016
7947
|
description: "Invite user to organization",
|
|
8017
7948
|
method: HttpMethod.POST,
|
|
8018
7949
|
url: `/organizations/${organizationId}/invite/${email}/`,
|
|
@@ -8026,7 +7957,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8026
7957
|
if (showLoading) {
|
|
8027
7958
|
this.client.store.dispatch(setIsFetchingInitialData(true));
|
|
8028
7959
|
}
|
|
8029
|
-
const result = await this.enqueueRequest({
|
|
7960
|
+
const result = await this.client.enqueueRequest({
|
|
8030
7961
|
description: "Get licenses",
|
|
8031
7962
|
method: HttpMethod.GET,
|
|
8032
7963
|
url: `/organizations/${organizationId}/licenses/`,
|
|
@@ -8041,7 +7972,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8041
7972
|
return result;
|
|
8042
7973
|
}
|
|
8043
7974
|
async getLicense(license) {
|
|
8044
|
-
const result = await this.enqueueRequest({
|
|
7975
|
+
const result = await this.client.enqueueRequest({
|
|
8045
7976
|
description: "Get license",
|
|
8046
7977
|
method: HttpMethod.GET,
|
|
8047
7978
|
url: `/billing/${license.offline_id}/`,
|
|
@@ -8055,7 +7986,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8055
7986
|
return result;
|
|
8056
7987
|
}
|
|
8057
7988
|
async pauseLicense(license) {
|
|
8058
|
-
const result = await this.enqueueRequest({
|
|
7989
|
+
const result = await this.client.enqueueRequest({
|
|
8059
7990
|
description: "Pause license",
|
|
8060
7991
|
method: HttpMethod.DELETE,
|
|
8061
7992
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
@@ -8069,7 +8000,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8069
8000
|
return result;
|
|
8070
8001
|
}
|
|
8071
8002
|
async resumeLicense(license) {
|
|
8072
|
-
const result = await this.enqueueRequest({
|
|
8003
|
+
const result = await this.client.enqueueRequest({
|
|
8073
8004
|
description: "Resume license",
|
|
8074
8005
|
method: HttpMethod.PATCH,
|
|
8075
8006
|
url: `/billing/${license.offline_id}/suspend/`,
|
|
@@ -8083,7 +8014,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8083
8014
|
return result;
|
|
8084
8015
|
}
|
|
8085
8016
|
async cancelLicense(license) {
|
|
8086
|
-
const result = await this.enqueueRequest({
|
|
8017
|
+
const result = await this.client.enqueueRequest({
|
|
8087
8018
|
description: "Cancel license",
|
|
8088
8019
|
method: HttpMethod.DELETE,
|
|
8089
8020
|
url: `/billing/${license.offline_id}/`,
|
|
@@ -8097,7 +8028,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8097
8028
|
return result;
|
|
8098
8029
|
}
|
|
8099
8030
|
async attachLicenseToProject(license, project) {
|
|
8100
|
-
const result = await this.enqueueRequest({
|
|
8031
|
+
const result = await this.client.enqueueRequest({
|
|
8101
8032
|
description: "Attach license",
|
|
8102
8033
|
method: HttpMethod.PATCH,
|
|
8103
8034
|
url: `/billing/${license.offline_id}/project/`,
|
|
@@ -8113,7 +8044,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8113
8044
|
return result;
|
|
8114
8045
|
}
|
|
8115
8046
|
async detachLicenseFromProject(license) {
|
|
8116
|
-
const result = await this.enqueueRequest({
|
|
8047
|
+
const result = await this.client.enqueueRequest({
|
|
8117
8048
|
description: "Detach license",
|
|
8118
8049
|
method: HttpMethod.DELETE,
|
|
8119
8050
|
url: `/billing/${license.offline_id}/project/`,
|
|
@@ -8127,7 +8058,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8127
8058
|
return result;
|
|
8128
8059
|
}
|
|
8129
8060
|
async getLatestTransaction(license) {
|
|
8130
|
-
return await this.enqueueRequest({
|
|
8061
|
+
return await this.client.enqueueRequest({
|
|
8131
8062
|
description: "Get latest transaction",
|
|
8132
8063
|
method: HttpMethod.GET,
|
|
8133
8064
|
url: `/billing/${license.offline_id}/transaction/`,
|
|
@@ -8155,7 +8086,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8155
8086
|
children_documents: []
|
|
8156
8087
|
};
|
|
8157
8088
|
store.dispatch(addDocuments([submittedDocument]));
|
|
8158
|
-
const promise = this.enqueueRequest({
|
|
8089
|
+
const promise = this.client.enqueueRequest({
|
|
8159
8090
|
description: "Create Document",
|
|
8160
8091
|
method: HttpMethod.POST,
|
|
8161
8092
|
url: `/projects/${activeProjectId}/documents/`,
|
|
@@ -8181,7 +8112,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8181
8112
|
);
|
|
8182
8113
|
}
|
|
8183
8114
|
store.dispatch(updateDocuments([document2]));
|
|
8184
|
-
const promise = this.enqueueRequest({
|
|
8115
|
+
const promise = this.client.enqueueRequest({
|
|
8185
8116
|
description: "Update Document",
|
|
8186
8117
|
method: HttpMethod.PATCH,
|
|
8187
8118
|
url: `/documents/${document2.offline_id}/`,
|
|
@@ -8222,7 +8153,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8222
8153
|
}
|
|
8223
8154
|
}
|
|
8224
8155
|
store.dispatch(moveDocument({ documentId, targetDocumentId, position }));
|
|
8225
|
-
const promise = this.enqueueRequest({
|
|
8156
|
+
const promise = this.client.enqueueRequest({
|
|
8226
8157
|
description: "Move Document",
|
|
8227
8158
|
method: HttpMethod.PATCH,
|
|
8228
8159
|
url: `/documents/${documentId}/move/`,
|
|
@@ -8251,7 +8182,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8251
8182
|
}
|
|
8252
8183
|
const parentDocument = documentToBeDeleted.parent_document ? documentsMapping[documentToBeDeleted.parent_document] : void 0;
|
|
8253
8184
|
store.dispatch(removeDocuments([documentId]));
|
|
8254
|
-
const promise = this.enqueueRequest({
|
|
8185
|
+
const promise = this.client.enqueueRequest({
|
|
8255
8186
|
description: "Delete Document",
|
|
8256
8187
|
method: HttpMethod.DELETE,
|
|
8257
8188
|
url: `/documents/${documentId}/`,
|
|
@@ -8272,7 +8203,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8272
8203
|
const { store } = this.client;
|
|
8273
8204
|
const state = store.getState();
|
|
8274
8205
|
const activeProjectId = state.projectReducer.activeProjectId;
|
|
8275
|
-
const projectDocumentsPromise = this.enqueueRequest({
|
|
8206
|
+
const projectDocumentsPromise = this.client.enqueueRequest({
|
|
8276
8207
|
description: "Get project documents",
|
|
8277
8208
|
method: HttpMethod.GET,
|
|
8278
8209
|
url: `/projects/${activeProjectId}/documents/`,
|
|
@@ -8280,7 +8211,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8280
8211
|
blocks: []
|
|
8281
8212
|
});
|
|
8282
8213
|
const activeOrganizationId = state.organizationReducer.activeOrganizationId;
|
|
8283
|
-
const organizationDocumentsPromise = this.enqueueRequest({
|
|
8214
|
+
const organizationDocumentsPromise = this.client.enqueueRequest({
|
|
8284
8215
|
description: "Get organization documents",
|
|
8285
8216
|
method: HttpMethod.GET,
|
|
8286
8217
|
url: `/organizations/${activeOrganizationId}/documents/`,
|
|
@@ -8336,7 +8267,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8336
8267
|
class AgentService extends BaseApiService {
|
|
8337
8268
|
async startConversation(prompt) {
|
|
8338
8269
|
const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
8339
|
-
return this.enqueueRequest({
|
|
8270
|
+
return this.client.enqueueRequest({
|
|
8340
8271
|
description: "Start agent conversation",
|
|
8341
8272
|
method: HttpMethod.POST,
|
|
8342
8273
|
url: "/agents/prompt/",
|
|
@@ -8362,7 +8293,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8362
8293
|
async continueConversation(prompt, conversationId) {
|
|
8363
8294
|
const { store } = this.client;
|
|
8364
8295
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
8365
|
-
return this.enqueueRequest({
|
|
8296
|
+
return this.client.enqueueRequest({
|
|
8366
8297
|
description: "Prompt agent",
|
|
8367
8298
|
method: HttpMethod.POST,
|
|
8368
8299
|
url: "/agents/prompt/",
|
|
@@ -8390,7 +8321,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8390
8321
|
});
|
|
8391
8322
|
}
|
|
8392
8323
|
async fetchDetails(conversationId) {
|
|
8393
|
-
return this.enqueueRequest({
|
|
8324
|
+
return this.client.enqueueRequest({
|
|
8394
8325
|
description: "Get agent conversation",
|
|
8395
8326
|
method: HttpMethod.GET,
|
|
8396
8327
|
url: `/agents/conversations/${conversationId}/`,
|
|
@@ -8401,7 +8332,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8401
8332
|
});
|
|
8402
8333
|
}
|
|
8403
8334
|
async rate(responseId, rating) {
|
|
8404
|
-
return this.enqueueRequest({
|
|
8335
|
+
return this.client.enqueueRequest({
|
|
8405
8336
|
description: "Rate agent response",
|
|
8406
8337
|
method: HttpMethod.PUT,
|
|
8407
8338
|
url: `/agents/responses/${responseId}/rate/`,
|
|
@@ -8413,7 +8344,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8413
8344
|
async refreshStore() {
|
|
8414
8345
|
const { store } = this.client;
|
|
8415
8346
|
const activeProject = store.getState().projectReducer.activeProjectId;
|
|
8416
|
-
const result = await this.enqueueRequest({
|
|
8347
|
+
const result = await this.client.enqueueRequest({
|
|
8417
8348
|
description: "Get agent conversation history",
|
|
8418
8349
|
method: HttpMethod.GET,
|
|
8419
8350
|
url: `/projects/${activeProject}/agent-conversations/`,
|
|
@@ -8439,7 +8370,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8439
8370
|
// created_by: state.userReducer.currentUser.id,
|
|
8440
8371
|
});
|
|
8441
8372
|
store.dispatch(addTeam(offlineTeam));
|
|
8442
|
-
const promise = this.enqueueRequest({
|
|
8373
|
+
const promise = this.client.enqueueRequest({
|
|
8443
8374
|
description: "Create team",
|
|
8444
8375
|
method: HttpMethod.POST,
|
|
8445
8376
|
url: `/organizations/${activeOrganizationId}/teams/`,
|
|
@@ -8464,7 +8395,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8464
8395
|
...team
|
|
8465
8396
|
};
|
|
8466
8397
|
store.dispatch(updateTeam(offlineUpdatedTeam));
|
|
8467
|
-
const promise = this.enqueueRequest({
|
|
8398
|
+
const promise = this.client.enqueueRequest({
|
|
8468
8399
|
description: "Update team",
|
|
8469
8400
|
method: HttpMethod.PATCH,
|
|
8470
8401
|
url: `/organizations/teams/${team.offline_id}/`,
|
|
@@ -8488,7 +8419,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8488
8419
|
}
|
|
8489
8420
|
store.dispatch(deleteTeam(teamId));
|
|
8490
8421
|
try {
|
|
8491
|
-
return await this.enqueueRequest({
|
|
8422
|
+
return await this.client.enqueueRequest({
|
|
8492
8423
|
description: "Delete team",
|
|
8493
8424
|
method: HttpMethod.DELETE,
|
|
8494
8425
|
url: `/organizations/teams/${teamId}/`,
|
|
@@ -8510,7 +8441,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8510
8441
|
throw new Error("Duplicate members found in the list");
|
|
8511
8442
|
}
|
|
8512
8443
|
store.dispatch(updateTeam({ ...team, members }));
|
|
8513
|
-
const promise = this.enqueueRequest({
|
|
8444
|
+
const promise = this.client.enqueueRequest({
|
|
8514
8445
|
description: "Set team members",
|
|
8515
8446
|
method: HttpMethod.PUT,
|
|
8516
8447
|
url: `/organizations/teams/${teamId}/set-members/`,
|
|
@@ -8549,7 +8480,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8549
8480
|
if (!activeOrganizationId) {
|
|
8550
8481
|
throw new Error(`Expected active organization to be set, got ${activeOrganizationId}`);
|
|
8551
8482
|
}
|
|
8552
|
-
const result = await this.enqueueRequest({
|
|
8483
|
+
const result = await this.client.enqueueRequest({
|
|
8553
8484
|
description: "Fetch teams",
|
|
8554
8485
|
method: HttpMethod.GET,
|
|
8555
8486
|
url: `/organizations/${activeOrganizationId}/teams/`,
|
|
@@ -8559,6 +8490,46 @@ var __publicField = (obj, key, value) => {
|
|
|
8559
8490
|
store.dispatch(setTeams(result));
|
|
8560
8491
|
}
|
|
8561
8492
|
}
|
|
8493
|
+
class DeferredPromise {
|
|
8494
|
+
constructor() {
|
|
8495
|
+
__publicField(this, _a, "Promise");
|
|
8496
|
+
__publicField(this, "_promise");
|
|
8497
|
+
__publicField(this, "_resolve");
|
|
8498
|
+
__publicField(this, "_reject");
|
|
8499
|
+
__publicField(this, "_state", "pending");
|
|
8500
|
+
this._resolve = null;
|
|
8501
|
+
this._reject = null;
|
|
8502
|
+
this._promise = new Promise((resolve, reject) => {
|
|
8503
|
+
this._resolve = resolve;
|
|
8504
|
+
this._reject = reject;
|
|
8505
|
+
});
|
|
8506
|
+
}
|
|
8507
|
+
get state() {
|
|
8508
|
+
return this._state;
|
|
8509
|
+
}
|
|
8510
|
+
then(onFulfilled, onRejected) {
|
|
8511
|
+
return this._promise.then(onFulfilled, onRejected);
|
|
8512
|
+
}
|
|
8513
|
+
catch(onRejected) {
|
|
8514
|
+
return this._promise.catch(onRejected);
|
|
8515
|
+
}
|
|
8516
|
+
resolve(value) {
|
|
8517
|
+
if (!this._resolve)
|
|
8518
|
+
throw new Error("No resolve callback");
|
|
8519
|
+
this._resolve(value);
|
|
8520
|
+
this._state = "fulfilled";
|
|
8521
|
+
}
|
|
8522
|
+
reject(reason) {
|
|
8523
|
+
if (!this._reject)
|
|
8524
|
+
throw reason;
|
|
8525
|
+
this._reject(reason);
|
|
8526
|
+
this._state = "rejected";
|
|
8527
|
+
}
|
|
8528
|
+
finally(_onFinally) {
|
|
8529
|
+
throw new Error("`finally` not implemented");
|
|
8530
|
+
}
|
|
8531
|
+
}
|
|
8532
|
+
_a = Symbol.toStringTag;
|
|
8562
8533
|
class OvermapSDK {
|
|
8563
8534
|
constructor(apiUrl, store) {
|
|
8564
8535
|
__publicField(this, "API_URL");
|
|
@@ -8577,12 +8548,12 @@ var __publicField = (obj, key, value) => {
|
|
|
8577
8548
|
__publicField(this, "issueAttachments", new IssueAttachmentService(this));
|
|
8578
8549
|
__publicField(this, "workspaces", new WorkspaceService(this));
|
|
8579
8550
|
__publicField(this, "main", new MainService(this));
|
|
8580
|
-
__publicField(this, "
|
|
8581
|
-
__publicField(this, "
|
|
8582
|
-
__publicField(this, "
|
|
8583
|
-
__publicField(this, "
|
|
8584
|
-
__publicField(this, "
|
|
8585
|
-
__publicField(this, "
|
|
8551
|
+
__publicField(this, "components", new ComponentService(this));
|
|
8552
|
+
__publicField(this, "componentAttachments", new ComponentAttachmentService(this));
|
|
8553
|
+
__publicField(this, "componentTypes", new ComponentTypeService(this));
|
|
8554
|
+
__publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
|
|
8555
|
+
__publicField(this, "componentStages", new ComponentStageService(this));
|
|
8556
|
+
__publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
|
|
8586
8557
|
__publicField(this, "userForms", new UserFormService(this));
|
|
8587
8558
|
__publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
|
|
8588
8559
|
__publicField(this, "projects", new ProjectService(this));
|
|
@@ -8597,6 +8568,87 @@ var __publicField = (obj, key, value) => {
|
|
|
8597
8568
|
this.API_URL = apiUrl;
|
|
8598
8569
|
this.store = store;
|
|
8599
8570
|
}
|
|
8571
|
+
/**
|
|
8572
|
+
* Enqueues an API request to the offline outbox.
|
|
8573
|
+
* @param requestDetails An SDKRequest object containing the details of the request.
|
|
8574
|
+
* @protected
|
|
8575
|
+
*/
|
|
8576
|
+
async enqueueRequest(requestDetails) {
|
|
8577
|
+
return this._enqueueRequest(requestDetails).then((result) => {
|
|
8578
|
+
if (result instanceof APIError) {
|
|
8579
|
+
throw result;
|
|
8580
|
+
}
|
|
8581
|
+
return result;
|
|
8582
|
+
});
|
|
8583
|
+
}
|
|
8584
|
+
/**
|
|
8585
|
+
* Enqueues an API request to the Redux Offline outbox
|
|
8586
|
+
* @protected
|
|
8587
|
+
*/
|
|
8588
|
+
_enqueueRequest(requestDetails) {
|
|
8589
|
+
const promise = new DeferredPromise();
|
|
8590
|
+
const requestDetailsWithBaseUrl = { ...requestDetails, BASE_URL: this.API_URL };
|
|
8591
|
+
if (requestDetails.immediate) {
|
|
8592
|
+
const requestWithUuid = {
|
|
8593
|
+
...requestDetailsWithBaseUrl,
|
|
8594
|
+
uuid: requestDetails.uuid ?? uuid.v4()
|
|
8595
|
+
};
|
|
8596
|
+
const fullOfflineAction = {
|
|
8597
|
+
payload: requestWithUuid,
|
|
8598
|
+
type: "",
|
|
8599
|
+
meta: {
|
|
8600
|
+
offline: {
|
|
8601
|
+
effect: {
|
|
8602
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
8603
|
+
request: requestWithUuid,
|
|
8604
|
+
BASE_URL: this.API_URL
|
|
8605
|
+
}
|
|
8606
|
+
}
|
|
8607
|
+
}
|
|
8608
|
+
};
|
|
8609
|
+
performRequest(fullOfflineAction, this).then((result) => {
|
|
8610
|
+
promise.resolve(result.body);
|
|
8611
|
+
}).catch((error2) => {
|
|
8612
|
+
discard(error2, fullOfflineAction);
|
|
8613
|
+
promise.reject(error2);
|
|
8614
|
+
});
|
|
8615
|
+
} else {
|
|
8616
|
+
const innerPromise = this.store.dispatch(
|
|
8617
|
+
enqueueRequest(requestDetailsWithBaseUrl)
|
|
8618
|
+
);
|
|
8619
|
+
const successOrUndefinedHandler = (response) => {
|
|
8620
|
+
if (response) {
|
|
8621
|
+
promise.resolve(response.body);
|
|
8622
|
+
} else {
|
|
8623
|
+
const error2 = new APIError({
|
|
8624
|
+
message: "Could not get a response from the server.",
|
|
8625
|
+
response,
|
|
8626
|
+
discard: true
|
|
8627
|
+
});
|
|
8628
|
+
promise.reject(error2);
|
|
8629
|
+
}
|
|
8630
|
+
};
|
|
8631
|
+
const errorHandler = (error2) => {
|
|
8632
|
+
if (error2 instanceof APIError) {
|
|
8633
|
+
error2.options.discard = true;
|
|
8634
|
+
} else {
|
|
8635
|
+
console.error(
|
|
8636
|
+
"Received an unexpected error while processing a request:",
|
|
8637
|
+
error2,
|
|
8638
|
+
"\nConverting error to APIError and discarding."
|
|
8639
|
+
);
|
|
8640
|
+
error2 = new APIError({
|
|
8641
|
+
message: "An error occurred while processing the request.",
|
|
8642
|
+
innerError: error2,
|
|
8643
|
+
discard: true
|
|
8644
|
+
});
|
|
8645
|
+
}
|
|
8646
|
+
promise.reject(error2);
|
|
8647
|
+
};
|
|
8648
|
+
innerPromise.then(successOrUndefinedHandler, errorHandler);
|
|
8649
|
+
}
|
|
8650
|
+
return promise;
|
|
8651
|
+
}
|
|
8600
8652
|
}
|
|
8601
8653
|
const makeClient = (apiUrl, store) => new OvermapSDK(apiUrl, store);
|
|
8602
8654
|
const SDKContext = React.createContext({});
|
|
@@ -15213,9 +15265,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15213
15265
|
}, [filter, maxResults, ownerFilter]);
|
|
15214
15266
|
const userForms = useAppSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
|
|
15215
15267
|
const userFormMapping = useAppSelector(selectFormMapping);
|
|
15216
|
-
const attachableUserForms = userForms.filter((form) => !form.
|
|
15268
|
+
const attachableUserForms = userForms.filter((form) => !form.component_type && !form.issue_type);
|
|
15217
15269
|
const attachableUserFormMapping = Object.values(userFormMapping).filter(
|
|
15218
|
-
(form) => !form.
|
|
15270
|
+
(form) => !form.component_type
|
|
15219
15271
|
);
|
|
15220
15272
|
const handleToggleFavorite = React.useCallback(
|
|
15221
15273
|
(form) => {
|
|
@@ -16619,13 +16671,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16619
16671
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16620
16672
|
exports2.APIError = APIError;
|
|
16621
16673
|
exports2.AgentService = AgentService;
|
|
16622
|
-
exports2.AssetAttachmentService = AssetAttachmentService;
|
|
16623
|
-
exports2.AssetService = AssetService;
|
|
16624
|
-
exports2.AssetStageColors = AssetStageColors;
|
|
16625
|
-
exports2.AssetStageCompletionService = AssetStageCompletionService;
|
|
16626
|
-
exports2.AssetStageService = AssetStageService;
|
|
16627
|
-
exports2.AssetTypeAttachmentService = AssetTypeAttachmentService;
|
|
16628
|
-
exports2.AssetTypeService = AssetTypeService;
|
|
16629
16674
|
exports2.AttachmentModel = AttachmentModel;
|
|
16630
16675
|
exports2.AuthService = AuthService;
|
|
16631
16676
|
exports2.BaseApiService = BaseApiService;
|
|
@@ -16637,6 +16682,13 @@ var __publicField = (obj, key, value) => {
|
|
|
16637
16682
|
exports2.ColorPicker = ColorPicker;
|
|
16638
16683
|
exports2.Colors = Colors;
|
|
16639
16684
|
exports2.ColorsToString = ColorsToString;
|
|
16685
|
+
exports2.ComponentAttachmentService = ComponentAttachmentService;
|
|
16686
|
+
exports2.ComponentService = ComponentService;
|
|
16687
|
+
exports2.ComponentStageColors = ComponentStageColors;
|
|
16688
|
+
exports2.ComponentStageCompletionService = ComponentStageCompletionService;
|
|
16689
|
+
exports2.ComponentStageService = ComponentStageService;
|
|
16690
|
+
exports2.ComponentTypeAttachmentService = ComponentTypeAttachmentService;
|
|
16691
|
+
exports2.ComponentTypeService = ComponentTypeService;
|
|
16640
16692
|
exports2.DEFAULT_ISSUE_PRIORITY = DEFAULT_ISSUE_PRIORITY;
|
|
16641
16693
|
exports2.DEFAULT_ISSUE_STATUS = DEFAULT_ISSUE_STATUS;
|
|
16642
16694
|
exports2.DateField = DateField;
|
|
@@ -16728,14 +16780,14 @@ var __publicField = (obj, key, value) => {
|
|
|
16728
16780
|
exports2.acceptProjectInvite = acceptProjectInvite;
|
|
16729
16781
|
exports2.addActiveProjectFormSubmissionsCount = addActiveProjectFormSubmissionsCount;
|
|
16730
16782
|
exports2.addActiveProjectIssuesCount = addActiveProjectIssuesCount;
|
|
16731
|
-
exports2.addAsset = addAsset;
|
|
16732
|
-
exports2.addAssetAttachment = addAssetAttachment;
|
|
16733
|
-
exports2.addAssetAttachments = addAssetAttachments;
|
|
16734
|
-
exports2.addAssetType = addAssetType;
|
|
16735
|
-
exports2.addAssetTypeAttachment = addAssetTypeAttachment;
|
|
16736
|
-
exports2.addAssetTypeAttachments = addAssetTypeAttachments;
|
|
16737
|
-
exports2.addAssetsInBatches = addAssetsInBatches;
|
|
16738
16783
|
exports2.addCategory = addCategory;
|
|
16784
|
+
exports2.addComponent = addComponent;
|
|
16785
|
+
exports2.addComponentAttachment = addComponentAttachment;
|
|
16786
|
+
exports2.addComponentAttachments = addComponentAttachments;
|
|
16787
|
+
exports2.addComponentType = addComponentType;
|
|
16788
|
+
exports2.addComponentTypeAttachment = addComponentTypeAttachment;
|
|
16789
|
+
exports2.addComponentTypeAttachments = addComponentTypeAttachments;
|
|
16790
|
+
exports2.addComponentsInBatches = addComponentsInBatches;
|
|
16739
16791
|
exports2.addConversation = addConversation;
|
|
16740
16792
|
exports2.addDocumentAttachment = addDocumentAttachment;
|
|
16741
16793
|
exports2.addDocumentAttachments = addDocumentAttachments;
|
|
@@ -16780,14 +16832,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16780
16832
|
exports2.agentsReducer = agentsReducer;
|
|
16781
16833
|
exports2.agentsSlice = agentsSlice;
|
|
16782
16834
|
exports2.areArraysEqual = areArraysEqual;
|
|
16783
|
-
exports2.assetReducer = assetReducer;
|
|
16784
|
-
exports2.assetSlice = assetSlice;
|
|
16785
|
-
exports2.assetStageCompletionReducer = assetStageCompletionReducer;
|
|
16786
|
-
exports2.assetStageCompletionSlice = assetStageCompletionSlice;
|
|
16787
|
-
exports2.assetStageReducer = assetStageReducer;
|
|
16788
|
-
exports2.assetStageSlice = assetStageSlice;
|
|
16789
|
-
exports2.assetTypeReducer = assetTypeReducer;
|
|
16790
|
-
exports2.assetTypeSlice = assetTypeSlice;
|
|
16791
16835
|
exports2.authReducer = authReducer;
|
|
16792
16836
|
exports2.authSlice = authSlice;
|
|
16793
16837
|
exports2.blobToBase64 = blobToBase64;
|
|
@@ -16797,6 +16841,14 @@ var __publicField = (obj, key, value) => {
|
|
|
16797
16841
|
exports2.classNames = classNames$1;
|
|
16798
16842
|
exports2.cleanRecentIssues = cleanRecentIssues;
|
|
16799
16843
|
exports2.clearTokens = clearTokens;
|
|
16844
|
+
exports2.componentReducer = componentReducer;
|
|
16845
|
+
exports2.componentSlice = componentSlice;
|
|
16846
|
+
exports2.componentStageCompletionReducer = componentStageCompletionReducer;
|
|
16847
|
+
exports2.componentStageCompletionSlice = componentStageCompletionSlice;
|
|
16848
|
+
exports2.componentStageReducer = componentStageReducer;
|
|
16849
|
+
exports2.componentStageSlice = componentStageSlice;
|
|
16850
|
+
exports2.componentTypeReducer = componentTypeReducer;
|
|
16851
|
+
exports2.componentTypeSlice = componentTypeSlice;
|
|
16800
16852
|
exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
|
|
16801
16853
|
exports2.coordinatesAreEqual = coordinatesAreEqual;
|
|
16802
16854
|
exports2.coordinatesToLiteral = coordinatesToLiteral;
|
|
@@ -16807,7 +16859,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16807
16859
|
exports2.createPointMarker = createPointMarker;
|
|
16808
16860
|
exports2.defaultBadgeColor = defaultBadgeColor;
|
|
16809
16861
|
exports2.defaultStore = defaultStore;
|
|
16810
|
-
exports2.
|
|
16862
|
+
exports2.deleteComponentType = deleteComponentType;
|
|
16811
16863
|
exports2.deleteForm = deleteForm;
|
|
16812
16864
|
exports2.deleteFormRevision = deleteFormRevision;
|
|
16813
16865
|
exports2.deleteFormRevisionAttachment = deleteFormRevisionAttachment;
|
|
@@ -16856,7 +16908,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16856
16908
|
exports2.formSubmissionReducer = formSubmissionReducer;
|
|
16857
16909
|
exports2.formSubmissionSlice = formSubmissionSlice;
|
|
16858
16910
|
exports2.forms = index;
|
|
16859
|
-
exports2.
|
|
16911
|
+
exports2.fullComponentMarkerSize = fullComponentMarkerSize;
|
|
16860
16912
|
exports2.generateBadgeColors = generateBadgeColors;
|
|
16861
16913
|
exports2.genericMemo = genericMemo;
|
|
16862
16914
|
exports2.getFileIdentifier = getFileIdentifier;
|
|
@@ -16916,15 +16968,15 @@ var __publicField = (obj, key, value) => {
|
|
|
16916
16968
|
exports2.projectSlice = projectSlice;
|
|
16917
16969
|
exports2.rehydratedReducer = rehydratedReducer;
|
|
16918
16970
|
exports2.rehydratedSlice = rehydratedSlice;
|
|
16919
|
-
exports2.
|
|
16920
|
-
exports2.removeAsset = removeAsset;
|
|
16921
|
-
exports2.removeAssetAttachment = removeAssetAttachment;
|
|
16922
|
-
exports2.removeAssetAttachments = removeAssetAttachments;
|
|
16923
|
-
exports2.removeAssetTypeAttachment = removeAssetTypeAttachment;
|
|
16924
|
-
exports2.removeAssetTypeAttachments = removeAssetTypeAttachments;
|
|
16971
|
+
exports2.removeAllComponentsOfType = removeAllComponentsOfType;
|
|
16925
16972
|
exports2.removeAttachmentsOfIssue = removeAttachmentsOfIssue;
|
|
16926
16973
|
exports2.removeCategory = removeCategory;
|
|
16927
16974
|
exports2.removeColor = removeColor;
|
|
16975
|
+
exports2.removeComponent = removeComponent;
|
|
16976
|
+
exports2.removeComponentAttachment = removeComponentAttachment;
|
|
16977
|
+
exports2.removeComponentAttachments = removeComponentAttachments;
|
|
16978
|
+
exports2.removeComponentTypeAttachment = removeComponentTypeAttachment;
|
|
16979
|
+
exports2.removeComponentTypeAttachments = removeComponentTypeAttachments;
|
|
16928
16980
|
exports2.removeDocumentAttachment = removeDocumentAttachment;
|
|
16929
16981
|
exports2.removeDocumentAttachments = removeDocumentAttachments;
|
|
16930
16982
|
exports2.removeDocuments = removeDocuments;
|
|
@@ -16975,31 +17027,16 @@ var __publicField = (obj, key, value) => {
|
|
|
16975
17027
|
exports2.selectActiveWorkspace = selectActiveWorkspace;
|
|
16976
17028
|
exports2.selectActiveWorkspaceId = selectActiveWorkspaceId;
|
|
16977
17029
|
exports2.selectAllAttachments = selectAllAttachments;
|
|
17030
|
+
exports2.selectAllComponentAttachments = selectAllComponentAttachments;
|
|
17031
|
+
exports2.selectAllComponentTypeAttachments = selectAllComponentTypeAttachments;
|
|
16978
17032
|
exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
|
|
16979
17033
|
exports2.selectAllProjectAttachments = selectAllProjectAttachments;
|
|
16980
17034
|
exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
|
|
16981
17035
|
exports2.selectAppearance = selectAppearance;
|
|
16982
|
-
exports2.
|
|
16983
|
-
exports2.
|
|
16984
|
-
exports2.
|
|
16985
|
-
exports2.
|
|
16986
|
-
exports2.selectAssetToAssetTypeMapping = selectAssetToAssetTypeMapping;
|
|
16987
|
-
exports2.selectAssetType = selectAssetType;
|
|
16988
|
-
exports2.selectAssetTypeAttachment = selectAssetTypeAttachment;
|
|
16989
|
-
exports2.selectAssetTypeAttachmentMapping = selectAssetTypeAttachmentMapping;
|
|
16990
|
-
exports2.selectAssetTypeAttachments = selectAssetTypeAttachments;
|
|
16991
|
-
exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
|
|
16992
|
-
exports2.selectAssetTypes = selectAssetTypes;
|
|
16993
|
-
exports2.selectAssetTypesByName = selectAssetTypesByName;
|
|
16994
|
-
exports2.selectAssetTypesFromIds = selectAssetTypesFromIds;
|
|
16995
|
-
exports2.selectAssetTypesMapping = selectAssetTypesMapping;
|
|
16996
|
-
exports2.selectAssets = selectAssets;
|
|
16997
|
-
exports2.selectAssetsMapping = selectAssetsMapping;
|
|
16998
|
-
exports2.selectAssetsOfAssetType = selectAssetsOfAssetType;
|
|
16999
|
-
exports2.selectAttachmentsOfAsset = selectAttachmentsOfAsset;
|
|
17000
|
-
exports2.selectAttachmentsOfAssetType = selectAttachmentsOfAssetType;
|
|
17001
|
-
exports2.selectAttachmentsOfAssetTypeByType = selectAttachmentsOfAssetTypeByType;
|
|
17002
|
-
exports2.selectAttachmentsOfAssetsByType = selectAttachmentsOfAssetsByType;
|
|
17036
|
+
exports2.selectAttachmentsOfComponent = selectAttachmentsOfComponent;
|
|
17037
|
+
exports2.selectAttachmentsOfComponentByType = selectAttachmentsOfComponentByType;
|
|
17038
|
+
exports2.selectAttachmentsOfComponentType = selectAttachmentsOfComponentType;
|
|
17039
|
+
exports2.selectAttachmentsOfComponentTypeByType = selectAttachmentsOfComponentTypeByType;
|
|
17003
17040
|
exports2.selectAttachmentsOfDocument = selectAttachmentsOfDocument;
|
|
17004
17041
|
exports2.selectAttachmentsOfDocumentByType = selectAttachmentsOfDocumentByType;
|
|
17005
17042
|
exports2.selectAttachmentsOfFormRevision = selectAttachmentsOfFormRevision;
|
|
@@ -17016,8 +17053,25 @@ var __publicField = (obj, key, value) => {
|
|
|
17016
17053
|
exports2.selectCenterMapToProject = selectCenterMapToProject;
|
|
17017
17054
|
exports2.selectCommentMapping = selectCommentMapping;
|
|
17018
17055
|
exports2.selectCommentsOfIssue = selectCommentsOfIssue;
|
|
17019
|
-
exports2.
|
|
17056
|
+
exports2.selectCompletedStageIdsForComponent = selectCompletedStageIdsForComponent;
|
|
17020
17057
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
17058
|
+
exports2.selectComponent = selectComponent;
|
|
17059
|
+
exports2.selectComponentAttachment = selectComponentAttachment;
|
|
17060
|
+
exports2.selectComponentAttachmentMapping = selectComponentAttachmentMapping;
|
|
17061
|
+
exports2.selectComponentType = selectComponentType;
|
|
17062
|
+
exports2.selectComponentTypeAttachment = selectComponentTypeAttachment;
|
|
17063
|
+
exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
|
|
17064
|
+
exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
|
|
17065
|
+
exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
|
|
17066
|
+
exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
|
|
17067
|
+
exports2.selectComponentTypes = selectComponentTypes;
|
|
17068
|
+
exports2.selectComponentTypesByName = selectComponentTypesByName;
|
|
17069
|
+
exports2.selectComponentTypesFromIds = selectComponentTypesFromIds;
|
|
17070
|
+
exports2.selectComponentTypesMapping = selectComponentTypesMapping;
|
|
17071
|
+
exports2.selectComponents = selectComponents;
|
|
17072
|
+
exports2.selectComponentsByType = selectComponentsByType;
|
|
17073
|
+
exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
|
|
17074
|
+
exports2.selectComponentsMapping = selectComponentsMapping;
|
|
17021
17075
|
exports2.selectConversation = selectConversation;
|
|
17022
17076
|
exports2.selectConversationMapping = selectConversationMapping;
|
|
17023
17077
|
exports2.selectConversations = selectConversations;
|
|
@@ -17042,7 +17096,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17042
17096
|
exports2.selectFilteredForms = selectFilteredForms;
|
|
17043
17097
|
exports2.selectForm = selectForm;
|
|
17044
17098
|
exports2.selectFormMapping = selectFormMapping;
|
|
17045
|
-
exports2.
|
|
17099
|
+
exports2.selectFormOfComponentType = selectFormOfComponentType;
|
|
17046
17100
|
exports2.selectFormOfIssueType = selectFormOfIssueType;
|
|
17047
17101
|
exports2.selectFormRevision = selectFormRevision;
|
|
17048
17102
|
exports2.selectFormRevisionMapping = selectFormRevisionMapping;
|
|
@@ -17051,16 +17105,16 @@ var __publicField = (obj, key, value) => {
|
|
|
17051
17105
|
exports2.selectFormSubmission = selectFormSubmission;
|
|
17052
17106
|
exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
|
|
17053
17107
|
exports2.selectFormSubmissions = selectFormSubmissions;
|
|
17054
|
-
exports2.
|
|
17108
|
+
exports2.selectFormSubmissionsByComponents = selectFormSubmissionsByComponents;
|
|
17055
17109
|
exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
|
|
17056
17110
|
exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
|
|
17057
|
-
exports2.
|
|
17111
|
+
exports2.selectFormSubmissionsOfComponent = selectFormSubmissionsOfComponent;
|
|
17058
17112
|
exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
|
|
17059
17113
|
exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
|
|
17060
17114
|
exports2.selectFormsCount = selectFormsCount;
|
|
17061
17115
|
exports2.selectGeneralFormCount = selectGeneralFormCount;
|
|
17062
|
-
exports2.selectHiddenAssetTypeIds = selectHiddenAssetTypeIds;
|
|
17063
17116
|
exports2.selectHiddenCategoryCount = selectHiddenCategoryCount;
|
|
17117
|
+
exports2.selectHiddenComponentTypeIds = selectHiddenComponentTypeIds;
|
|
17064
17118
|
exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
|
|
17065
17119
|
exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
|
|
17066
17120
|
exports2.selectIsLoading = selectIsLoading;
|
|
@@ -17082,7 +17136,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17082
17136
|
exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
|
|
17083
17137
|
exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
|
|
17084
17138
|
exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
|
|
17085
|
-
exports2.
|
|
17139
|
+
exports2.selectLatestFormRevisionsOfComponentTypes = selectLatestFormRevisionsOfComponentTypes;
|
|
17086
17140
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
17087
17141
|
exports2.selectLicense = selectLicense;
|
|
17088
17142
|
exports2.selectLicenseForProject = selectLicenseForProject;
|
|
@@ -17090,8 +17144,8 @@ var __publicField = (obj, key, value) => {
|
|
|
17090
17144
|
exports2.selectLicensesForProjectsMapping = selectLicensesForProjectsMapping;
|
|
17091
17145
|
exports2.selectMainWorkspace = selectMainWorkspace;
|
|
17092
17146
|
exports2.selectMapStyle = selectMapStyle;
|
|
17093
|
-
exports2.
|
|
17094
|
-
exports2.
|
|
17147
|
+
exports2.selectNumberOfComponentTypesMatchingCaseInsensitiveName = selectNumberOfComponentTypesMatchingCaseInsensitiveName;
|
|
17148
|
+
exports2.selectNumberOfComponentsOfComponentType = selectNumberOfComponentsOfComponentType;
|
|
17095
17149
|
exports2.selectOrganization = selectOrganization;
|
|
17096
17150
|
exports2.selectOrganizationAccess = selectOrganizationAccess;
|
|
17097
17151
|
exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
|
|
@@ -17132,9 +17186,9 @@ var __publicField = (obj, key, value) => {
|
|
|
17132
17186
|
exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
|
|
17133
17187
|
exports2.selectStageMapping = selectStageMapping;
|
|
17134
17188
|
exports2.selectStages = selectStages;
|
|
17135
|
-
exports2.
|
|
17189
|
+
exports2.selectStagesFromComponentType = selectStagesFromComponentType;
|
|
17190
|
+
exports2.selectStagesFromComponentTypeIds = selectStagesFromComponentTypeIds;
|
|
17136
17191
|
exports2.selectStagesFromStageIds = selectStagesFromStageIds;
|
|
17137
|
-
exports2.selectStagesOfAssetType = selectStagesOfAssetType;
|
|
17138
17192
|
exports2.selectTeam = selectTeam;
|
|
17139
17193
|
exports2.selectTeams = selectTeams;
|
|
17140
17194
|
exports2.selectTeamsMapping = selectTeamsMapping;
|
|
@@ -17156,14 +17210,14 @@ var __publicField = (obj, key, value) => {
|
|
|
17156
17210
|
exports2.setActiveProjectId = setActiveProjectId;
|
|
17157
17211
|
exports2.setActiveWorkspaceId = setActiveWorkspaceId;
|
|
17158
17212
|
exports2.setAppearance = setAppearance;
|
|
17159
|
-
exports2.setAssetAttachment = setAssetAttachment;
|
|
17160
|
-
exports2.setAssetAttachments = setAssetAttachments;
|
|
17161
|
-
exports2.setAssetTypeAttachment = setAssetTypeAttachment;
|
|
17162
|
-
exports2.setAssetTypeAttachments = setAssetTypeAttachments;
|
|
17163
|
-
exports2.setAssetTypes = setAssetTypes;
|
|
17164
|
-
exports2.setAssets = setAssets;
|
|
17165
17213
|
exports2.setCategories = setCategories;
|
|
17166
17214
|
exports2.setCenterMapToProject = setCenterMapToProject;
|
|
17215
|
+
exports2.setComponentAttachment = setComponentAttachment;
|
|
17216
|
+
exports2.setComponentAttachments = setComponentAttachments;
|
|
17217
|
+
exports2.setComponentTypeAttachment = setComponentTypeAttachment;
|
|
17218
|
+
exports2.setComponentTypeAttachments = setComponentTypeAttachments;
|
|
17219
|
+
exports2.setComponentTypes = setComponentTypes;
|
|
17220
|
+
exports2.setComponents = setComponents;
|
|
17167
17221
|
exports2.setConversation = setConversation;
|
|
17168
17222
|
exports2.setConversations = setConversations;
|
|
17169
17223
|
exports2.setCreateProjectType = setCreateProjectType;
|
|
@@ -17226,18 +17280,18 @@ var __publicField = (obj, key, value) => {
|
|
|
17226
17280
|
exports2.teamSlice = teamSlice;
|
|
17227
17281
|
exports2.toFileNameSafeString = toFileNameSafeString;
|
|
17228
17282
|
exports2.toOfflineIdRecord = toOfflineIdRecord;
|
|
17229
|
-
exports2.
|
|
17283
|
+
exports2.toggleComponentTypeVisibility = toggleComponentTypeVisibility;
|
|
17230
17284
|
exports2.truncate = truncate;
|
|
17231
17285
|
exports2.unfavoriteForm = unfavoriteForm;
|
|
17232
17286
|
exports2.unhideAllCategories = unhideAllCategories;
|
|
17233
17287
|
exports2.unhideCategory = unhideCategory;
|
|
17234
17288
|
exports2.unlinkStageToForm = unlinkStageToForm;
|
|
17235
17289
|
exports2.updateActiveOrganization = updateActiveOrganization;
|
|
17236
|
-
exports2.
|
|
17237
|
-
exports2.
|
|
17238
|
-
exports2.
|
|
17239
|
-
exports2.
|
|
17240
|
-
exports2.
|
|
17290
|
+
exports2.updateComponent = updateComponent;
|
|
17291
|
+
exports2.updateComponentAttachment = updateComponentAttachment;
|
|
17292
|
+
exports2.updateComponentAttachments = updateComponentAttachments;
|
|
17293
|
+
exports2.updateComponentTypeAttachment = updateComponentTypeAttachment;
|
|
17294
|
+
exports2.updateComponentTypeAttachments = updateComponentTypeAttachments;
|
|
17241
17295
|
exports2.updateConversation = updateConversation;
|
|
17242
17296
|
exports2.updateDocumentAttachment = updateDocumentAttachment;
|
|
17243
17297
|
exports2.updateDocumentAttachments = updateDocumentAttachments;
|