@overmap-ai/core 1.0.56 → 1.0.57-export-overmap-reducer.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/LICENSE +1 -0
- package/README.md +4 -4
- package/dist/constants/ui.d.ts +1 -1
- package/dist/contexts/overmap.d.ts +2 -2
- package/dist/contexts/sdk/globals.d.ts +3 -3
- package/dist/contexts/sdk/sdk.d.ts +2 -2
- package/dist/enums/ui.d.ts +1 -1
- package/dist/forms/builder/constants.d.ts +1 -1
- package/dist/forms/builder/hooks.d.ts +1 -1
- package/dist/overmap-core.js +610 -942
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +611 -943
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/sdk.d.ts +11 -11
- package/dist/sdk/services/AgentService.d.ts +2 -21
- package/dist/sdk/services/AssetAttachmentService.d.ts +10 -0
- package/dist/sdk/services/AssetService.d.ts +11 -0
- package/dist/sdk/services/AssetStageCompletionService.d.ts +16 -0
- package/dist/sdk/services/AssetStageService.d.ts +11 -0
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +10 -0
- package/dist/sdk/services/AssetTypeService.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/index.d.ts +0 -1
- package/dist/store/slices/agentsSlice.d.ts +3 -3
- package/dist/store/slices/assetSlice.d.ts +63 -0
- package/dist/store/slices/assetStageCompletionSlice.d.ts +15 -0
- package/dist/store/slices/assetStageSlice.d.ts +32 -0
- package/dist/store/slices/assetTypeSlice.d.ts +74 -0
- package/dist/store/slices/authSlice.d.ts +3 -3
- package/dist/store/slices/categorySlice.d.ts +9 -9
- package/dist/store/slices/documentSlice.d.ts +12 -13
- package/dist/store/slices/formRevisionSlice.d.ts +7 -7
- 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 +18 -18
- package/dist/store/slices/mapSlice.d.ts +4 -4
- package/dist/store/slices/organizationAccessSlice.d.ts +3 -3
- package/dist/store/slices/outboxSlice.d.ts +3 -3
- package/dist/store/slices/projectAccessSlice.d.ts +2 -2
- package/dist/store/slices/projectFileSlice.d.ts +7 -7
- package/dist/store/slices/projectSlice.d.ts +8 -8
- package/dist/store/slices/rehydratedSlice.d.ts +2 -2
- package/dist/store/slices/settingsSlice.d.ts +9 -9
- package/dist/store/slices/userSlice.d.ts +4 -4
- package/dist/store/slices/workspaceSlice.d.ts +6 -6
- package/dist/store/store.d.ts +12 -45
- package/dist/typings/models/access.d.ts +1 -0
- package/dist/typings/models/attachments.d.ts +6 -6
- package/dist/typings/models/components.d.ts +11 -7
- package/dist/typings/models/forms.d.ts +3 -3
- package/dist/typings/models/store.d.ts +2 -3
- package/dist/typings/store.d.ts +4 -4
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/utils.d.ts +3 -3
- package/package.json +153 -153
- package/dist/sdk/services/ComponentAttachmentService.d.ts +0 -10
- package/dist/sdk/services/ComponentService.d.ts +0 -11
- package/dist/sdk/services/ComponentStageCompletionService.d.ts +0 -17
- package/dist/sdk/services/ComponentStageService.d.ts +0 -11
- package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +0 -10
- package/dist/sdk/services/ComponentTypeService.d.ts +0 -9
- package/dist/store/hooks.d.ts +0 -4
- package/dist/store/slices/ComponentStageCompletionSlice.d.ts +0 -27
- package/dist/store/slices/componentSlice.d.ts +0 -73
- package/dist/store/slices/componentStageSlice.d.ts +0 -42
- package/dist/store/slices/componentTypeSlice.d.ts +0 -75
|
@@ -4,9 +4,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
(function(
|
|
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("
|
|
9
|
-
})(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, saveAs, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request,
|
|
7
|
+
(function(global, factory) {
|
|
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("uuid"), require("color"), require("react-redux"), 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", "uuid", "color", "react-redux", "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) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["overmap-core"] = {}, global.React, global.jsxRuntime, global.blocks, global.dependencyGraph, global.saveAs, global.reduxOffline, global.offlineConfig, global.localforage, global.createMigration, global.toolkit, global.request, global.uuid, global.ColorCls, global.reactRedux, global.jwtDecode, global.constants, global.idb, global.formik, global.ReactDOM, global.get, global.Linkify, global.dnd, global.QrScannerAPI, global.xlsx, global.reactPdf, null, null, global.reactSketchCanvas, global.set, global.cloneDeep));
|
|
9
|
+
})(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, saveAs, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, uuid, ColorCls, reactRedux, 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) {
|
|
@@ -374,257 +374,6 @@ var __publicField = (obj, key, value) => {
|
|
|
374
374
|
const blob = new Blob([file]);
|
|
375
375
|
saveAs.saveAs(blob, file.name);
|
|
376
376
|
}
|
|
377
|
-
const global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
378
|
-
function defaultSetTimout() {
|
|
379
|
-
throw new Error("setTimeout has not been defined");
|
|
380
|
-
}
|
|
381
|
-
function defaultClearTimeout() {
|
|
382
|
-
throw new Error("clearTimeout has not been defined");
|
|
383
|
-
}
|
|
384
|
-
var cachedSetTimeout = defaultSetTimout;
|
|
385
|
-
var cachedClearTimeout = defaultClearTimeout;
|
|
386
|
-
if (typeof global$1.setTimeout === "function") {
|
|
387
|
-
cachedSetTimeout = setTimeout;
|
|
388
|
-
}
|
|
389
|
-
if (typeof global$1.clearTimeout === "function") {
|
|
390
|
-
cachedClearTimeout = clearTimeout;
|
|
391
|
-
}
|
|
392
|
-
function runTimeout(fun) {
|
|
393
|
-
if (cachedSetTimeout === setTimeout) {
|
|
394
|
-
return setTimeout(fun, 0);
|
|
395
|
-
}
|
|
396
|
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
397
|
-
cachedSetTimeout = setTimeout;
|
|
398
|
-
return setTimeout(fun, 0);
|
|
399
|
-
}
|
|
400
|
-
try {
|
|
401
|
-
return cachedSetTimeout(fun, 0);
|
|
402
|
-
} catch (e) {
|
|
403
|
-
try {
|
|
404
|
-
return cachedSetTimeout.call(null, fun, 0);
|
|
405
|
-
} catch (e2) {
|
|
406
|
-
return cachedSetTimeout.call(this, fun, 0);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
function runClearTimeout(marker) {
|
|
411
|
-
if (cachedClearTimeout === clearTimeout) {
|
|
412
|
-
return clearTimeout(marker);
|
|
413
|
-
}
|
|
414
|
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
415
|
-
cachedClearTimeout = clearTimeout;
|
|
416
|
-
return clearTimeout(marker);
|
|
417
|
-
}
|
|
418
|
-
try {
|
|
419
|
-
return cachedClearTimeout(marker);
|
|
420
|
-
} catch (e) {
|
|
421
|
-
try {
|
|
422
|
-
return cachedClearTimeout.call(null, marker);
|
|
423
|
-
} catch (e2) {
|
|
424
|
-
return cachedClearTimeout.call(this, marker);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
var queue = [];
|
|
429
|
-
var draining = false;
|
|
430
|
-
var currentQueue;
|
|
431
|
-
var queueIndex = -1;
|
|
432
|
-
function cleanUpNextTick() {
|
|
433
|
-
if (!draining || !currentQueue) {
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
draining = false;
|
|
437
|
-
if (currentQueue.length) {
|
|
438
|
-
queue = currentQueue.concat(queue);
|
|
439
|
-
} else {
|
|
440
|
-
queueIndex = -1;
|
|
441
|
-
}
|
|
442
|
-
if (queue.length) {
|
|
443
|
-
drainQueue();
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
function drainQueue() {
|
|
447
|
-
if (draining) {
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
var timeout = runTimeout(cleanUpNextTick);
|
|
451
|
-
draining = true;
|
|
452
|
-
var len = queue.length;
|
|
453
|
-
while (len) {
|
|
454
|
-
currentQueue = queue;
|
|
455
|
-
queue = [];
|
|
456
|
-
while (++queueIndex < len) {
|
|
457
|
-
if (currentQueue) {
|
|
458
|
-
currentQueue[queueIndex].run();
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
queueIndex = -1;
|
|
462
|
-
len = queue.length;
|
|
463
|
-
}
|
|
464
|
-
currentQueue = null;
|
|
465
|
-
draining = false;
|
|
466
|
-
runClearTimeout(timeout);
|
|
467
|
-
}
|
|
468
|
-
function nextTick(fun) {
|
|
469
|
-
var args = new Array(arguments.length - 1);
|
|
470
|
-
if (arguments.length > 1) {
|
|
471
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
472
|
-
args[i - 1] = arguments[i];
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
queue.push(new Item(fun, args));
|
|
476
|
-
if (queue.length === 1 && !draining) {
|
|
477
|
-
runTimeout(drainQueue);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
function Item(fun, array) {
|
|
481
|
-
this.fun = fun;
|
|
482
|
-
this.array = array;
|
|
483
|
-
}
|
|
484
|
-
Item.prototype.run = function() {
|
|
485
|
-
this.fun.apply(null, this.array);
|
|
486
|
-
};
|
|
487
|
-
var title$1 = "browser";
|
|
488
|
-
var platform = "browser";
|
|
489
|
-
var browser = true;
|
|
490
|
-
var env = {};
|
|
491
|
-
var argv = [];
|
|
492
|
-
var version = "";
|
|
493
|
-
var versions = {};
|
|
494
|
-
var release = {};
|
|
495
|
-
var config = {};
|
|
496
|
-
function noop() {
|
|
497
|
-
}
|
|
498
|
-
var on = noop;
|
|
499
|
-
var addListener = noop;
|
|
500
|
-
var once = noop;
|
|
501
|
-
var off = noop;
|
|
502
|
-
var removeListener = noop;
|
|
503
|
-
var removeAllListeners = noop;
|
|
504
|
-
var emit = noop;
|
|
505
|
-
function binding(name) {
|
|
506
|
-
throw new Error("process.binding is not supported");
|
|
507
|
-
}
|
|
508
|
-
function cwd() {
|
|
509
|
-
return "/";
|
|
510
|
-
}
|
|
511
|
-
function chdir(dir) {
|
|
512
|
-
throw new Error("process.chdir is not supported");
|
|
513
|
-
}
|
|
514
|
-
function umask() {
|
|
515
|
-
return 0;
|
|
516
|
-
}
|
|
517
|
-
var performance = global$1.performance || {};
|
|
518
|
-
var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() {
|
|
519
|
-
return (/* @__PURE__ */ new Date()).getTime();
|
|
520
|
-
};
|
|
521
|
-
function hrtime(previousTimestamp) {
|
|
522
|
-
var clocktime = performanceNow.call(performance) * 1e-3;
|
|
523
|
-
var seconds = Math.floor(clocktime);
|
|
524
|
-
var nanoseconds = Math.floor(clocktime % 1 * 1e9);
|
|
525
|
-
if (previousTimestamp) {
|
|
526
|
-
seconds = seconds - previousTimestamp[0];
|
|
527
|
-
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
528
|
-
if (nanoseconds < 0) {
|
|
529
|
-
seconds--;
|
|
530
|
-
nanoseconds += 1e9;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
return [seconds, nanoseconds];
|
|
534
|
-
}
|
|
535
|
-
var startTime = /* @__PURE__ */ new Date();
|
|
536
|
-
function uptime() {
|
|
537
|
-
var currentTime = /* @__PURE__ */ new Date();
|
|
538
|
-
var dif = currentTime - startTime;
|
|
539
|
-
return dif / 1e3;
|
|
540
|
-
}
|
|
541
|
-
var browser$1 = {
|
|
542
|
-
nextTick,
|
|
543
|
-
title: title$1,
|
|
544
|
-
browser,
|
|
545
|
-
env,
|
|
546
|
-
argv,
|
|
547
|
-
version,
|
|
548
|
-
versions,
|
|
549
|
-
on,
|
|
550
|
-
addListener,
|
|
551
|
-
once,
|
|
552
|
-
off,
|
|
553
|
-
removeListener,
|
|
554
|
-
removeAllListeners,
|
|
555
|
-
emit,
|
|
556
|
-
binding,
|
|
557
|
-
cwd,
|
|
558
|
-
chdir,
|
|
559
|
-
umask,
|
|
560
|
-
hrtime,
|
|
561
|
-
platform,
|
|
562
|
-
release,
|
|
563
|
-
config,
|
|
564
|
-
uptime
|
|
565
|
-
};
|
|
566
|
-
function _typeof(o) {
|
|
567
|
-
"@babel/helpers - typeof";
|
|
568
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
569
|
-
return typeof o2;
|
|
570
|
-
} : function(o2) {
|
|
571
|
-
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
572
|
-
}, _typeof(o);
|
|
573
|
-
}
|
|
574
|
-
function _toPrimitive$1(input, hint) {
|
|
575
|
-
if (_typeof(input) !== "object" || input === null)
|
|
576
|
-
return input;
|
|
577
|
-
var prim = input[Symbol.toPrimitive];
|
|
578
|
-
if (prim !== void 0) {
|
|
579
|
-
var res = prim.call(input, hint || "default");
|
|
580
|
-
if (_typeof(res) !== "object")
|
|
581
|
-
return res;
|
|
582
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
583
|
-
}
|
|
584
|
-
return (hint === "string" ? String : Number)(input);
|
|
585
|
-
}
|
|
586
|
-
function _toPropertyKey$1(arg) {
|
|
587
|
-
var key = _toPrimitive$1(arg, "string");
|
|
588
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
589
|
-
}
|
|
590
|
-
function _defineProperty$1(obj, key, value) {
|
|
591
|
-
key = _toPropertyKey$1(key);
|
|
592
|
-
if (key in obj) {
|
|
593
|
-
Object.defineProperty(obj, key, {
|
|
594
|
-
value,
|
|
595
|
-
enumerable: true,
|
|
596
|
-
configurable: true,
|
|
597
|
-
writable: true
|
|
598
|
-
});
|
|
599
|
-
} else {
|
|
600
|
-
obj[key] = value;
|
|
601
|
-
}
|
|
602
|
-
return obj;
|
|
603
|
-
}
|
|
604
|
-
function ownKeys$1(e, r) {
|
|
605
|
-
var t = Object.keys(e);
|
|
606
|
-
if (Object.getOwnPropertySymbols) {
|
|
607
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
608
|
-
r && (o = o.filter(function(r2) {
|
|
609
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
610
|
-
})), t.push.apply(t, o);
|
|
611
|
-
}
|
|
612
|
-
return t;
|
|
613
|
-
}
|
|
614
|
-
function _objectSpread2(e) {
|
|
615
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
616
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
617
|
-
r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) {
|
|
618
|
-
_defineProperty$1(e, r2, t[r2]);
|
|
619
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) {
|
|
620
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
return e;
|
|
624
|
-
}
|
|
625
|
-
function formatProdErrorMessage(code) {
|
|
626
|
-
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or use the non-minified dev environment for full errors. ";
|
|
627
|
-
}
|
|
628
377
|
var randomString = function randomString2() {
|
|
629
378
|
return Math.random().toString(36).substring(7).split("").join(".");
|
|
630
379
|
};
|
|
@@ -653,32 +402,6 @@ var __publicField = (obj, key, value) => {
|
|
|
653
402
|
};
|
|
654
403
|
});
|
|
655
404
|
}
|
|
656
|
-
function applyMiddleware() {
|
|
657
|
-
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
658
|
-
middlewares[_key] = arguments[_key];
|
|
659
|
-
}
|
|
660
|
-
return function(createStore) {
|
|
661
|
-
return function() {
|
|
662
|
-
var store = createStore.apply(void 0, arguments);
|
|
663
|
-
var _dispatch = function dispatch() {
|
|
664
|
-
throw new Error(browser$1.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
|
|
665
|
-
};
|
|
666
|
-
var middlewareAPI = {
|
|
667
|
-
getState: store.getState,
|
|
668
|
-
dispatch: function dispatch() {
|
|
669
|
-
return _dispatch.apply(void 0, arguments);
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
var chain = middlewares.map(function(middleware) {
|
|
673
|
-
return middleware(middlewareAPI);
|
|
674
|
-
});
|
|
675
|
-
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
|
676
|
-
return _objectSpread2(_objectSpread2({}, store), {}, {
|
|
677
|
-
dispatch: _dispatch
|
|
678
|
-
});
|
|
679
|
-
};
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
405
|
var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
683
406
|
HttpMethod2["GET"] = "GET";
|
|
684
407
|
HttpMethod2["POST"] = "POST";
|
|
@@ -1340,7 +1063,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1340
1063
|
[mint.mint9]: "mint",
|
|
1341
1064
|
[sky.sky9]: "sky"
|
|
1342
1065
|
};
|
|
1343
|
-
const
|
|
1066
|
+
const AssetStageColors = {
|
|
1344
1067
|
indigo: indigo.indigo9,
|
|
1345
1068
|
red: red.red9,
|
|
1346
1069
|
violet: violet.violet9,
|
|
@@ -1362,7 +1085,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1362
1085
|
return { backgroundColor, textColor };
|
|
1363
1086
|
};
|
|
1364
1087
|
function getStageColor(index2) {
|
|
1365
|
-
return Object.values(
|
|
1088
|
+
return Object.values(AssetStageColors)[index2 % Object.keys(AssetStageColors).length];
|
|
1366
1089
|
}
|
|
1367
1090
|
const getLocalDateString = memoize((date) => {
|
|
1368
1091
|
if (!date)
|
|
@@ -1582,122 +1305,115 @@ var __publicField = (obj, key, value) => {
|
|
|
1582
1305
|
}
|
|
1583
1306
|
}
|
|
1584
1307
|
const initialState$q = {
|
|
1585
|
-
|
|
1586
|
-
|
|
1308
|
+
assetTypes: {},
|
|
1309
|
+
hiddenAssetTypeIds: {},
|
|
1587
1310
|
attachments: {}
|
|
1588
1311
|
};
|
|
1589
|
-
const
|
|
1590
|
-
name: "
|
|
1312
|
+
const assetTypeSlice = toolkit.createSlice({
|
|
1313
|
+
name: "assetTypes",
|
|
1591
1314
|
initialState: initialState$q,
|
|
1592
1315
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1593
1316
|
reducers: {
|
|
1594
|
-
|
|
1595
|
-
state.
|
|
1317
|
+
addAssetType: (state, action) => {
|
|
1318
|
+
state.assetTypes[action.payload.offline_id] = action.payload;
|
|
1596
1319
|
},
|
|
1597
|
-
|
|
1598
|
-
state.
|
|
1320
|
+
setAssetTypes: (state, action) => {
|
|
1321
|
+
state.assetTypes = toOfflineIdRecord(action.payload);
|
|
1599
1322
|
},
|
|
1600
|
-
|
|
1601
|
-
state.
|
|
1323
|
+
toggleAssetTypeVisibility: (state, action) => {
|
|
1324
|
+
state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
|
|
1602
1325
|
},
|
|
1603
|
-
|
|
1604
|
-
delete state.
|
|
1326
|
+
deleteAssetType: (state, action) => {
|
|
1327
|
+
delete state.assetTypes[action.payload];
|
|
1605
1328
|
},
|
|
1606
1329
|
// Attachments
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1330
|
+
setAssetTypeAttachment: setAttachment,
|
|
1331
|
+
setAssetTypeAttachments: setAttachments,
|
|
1332
|
+
addAssetTypeAttachment: addAttachment,
|
|
1333
|
+
addAssetTypeAttachments: addAttachments,
|
|
1334
|
+
updateAssetTypeAttachment: updateAttachment,
|
|
1335
|
+
updateAssetTypeAttachments: updateAttachments,
|
|
1336
|
+
removeAssetTypeAttachment: removeAttachment,
|
|
1337
|
+
removeAssetTypeAttachments: removeAttachments
|
|
1615
1338
|
}
|
|
1616
1339
|
});
|
|
1617
1340
|
const {
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1341
|
+
addAssetType,
|
|
1342
|
+
setAssetTypes,
|
|
1343
|
+
toggleAssetTypeVisibility,
|
|
1344
|
+
deleteAssetType,
|
|
1622
1345
|
// Attachmet
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
} =
|
|
1632
|
-
const
|
|
1633
|
-
const
|
|
1634
|
-
[
|
|
1346
|
+
setAssetTypeAttachment,
|
|
1347
|
+
setAssetTypeAttachments,
|
|
1348
|
+
addAssetTypeAttachment,
|
|
1349
|
+
addAssetTypeAttachments,
|
|
1350
|
+
updateAssetTypeAttachment,
|
|
1351
|
+
updateAssetTypeAttachments,
|
|
1352
|
+
removeAssetTypeAttachment,
|
|
1353
|
+
removeAssetTypeAttachments
|
|
1354
|
+
} = assetTypeSlice.actions;
|
|
1355
|
+
const selectAssetTypesMapping = (state) => state.assetTypeReducer.assetTypes;
|
|
1356
|
+
const selectAssetTypes = toolkit.createSelector(
|
|
1357
|
+
[selectAssetTypesMapping],
|
|
1635
1358
|
(mapping) => Object.values(mapping)
|
|
1636
1359
|
);
|
|
1637
|
-
const
|
|
1638
|
-
toolkit.createSelector(
|
|
1360
|
+
const selectAssetType = restructureCreateSelectorWithArgs(
|
|
1361
|
+
toolkit.createSelector(
|
|
1362
|
+
[selectAssetTypesMapping, (_state, assetTypeId) => assetTypeId],
|
|
1363
|
+
(mapping, assetTypeId) => mapping[assetTypeId]
|
|
1364
|
+
)
|
|
1639
1365
|
);
|
|
1640
|
-
const
|
|
1366
|
+
const selectNumberOfAssetTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
|
|
1641
1367
|
toolkit.createSelector(
|
|
1642
|
-
[
|
|
1643
|
-
selectComponentTypesMapping,
|
|
1644
|
-
(_state, args) => args
|
|
1645
|
-
],
|
|
1368
|
+
[selectAssetTypesMapping, (_state, args) => args],
|
|
1646
1369
|
(mapping, args) => {
|
|
1647
1370
|
var _a2;
|
|
1648
1371
|
const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
|
|
1649
1372
|
return Object.values(mapping).filter(
|
|
1650
|
-
(
|
|
1373
|
+
(assetType) => {
|
|
1651
1374
|
var _a3;
|
|
1652
|
-
return (((_a3 =
|
|
1375
|
+
return (((_a3 = assetType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && assetType.offline_id !== args.assetTypeId;
|
|
1653
1376
|
}
|
|
1654
1377
|
).length;
|
|
1655
1378
|
}
|
|
1656
1379
|
)
|
|
1657
1380
|
);
|
|
1658
|
-
const
|
|
1659
|
-
toolkit.createSelector(
|
|
1660
|
-
|
|
1661
|
-
(mapping
|
|
1662
|
-
|
|
1663
|
-
return
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
1667
|
-
}
|
|
1668
|
-
);
|
|
1669
|
-
}
|
|
1670
|
-
)
|
|
1381
|
+
const selectAssetTypesByName = restructureCreateSelectorWithArgs(
|
|
1382
|
+
toolkit.createSelector([selectAssetTypesMapping, (_state, name) => name], (mapping, name) => {
|
|
1383
|
+
name = (name == null ? void 0 : name.toLowerCase()) ?? null;
|
|
1384
|
+
return Object.values(mapping).filter((assetType) => {
|
|
1385
|
+
var _a2;
|
|
1386
|
+
return (((_a2 = assetType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
1387
|
+
});
|
|
1388
|
+
})
|
|
1671
1389
|
);
|
|
1672
|
-
const
|
|
1673
|
-
const
|
|
1674
|
-
const
|
|
1675
|
-
[
|
|
1390
|
+
const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
|
|
1391
|
+
const selectAssetTypeAttachmentMapping = (state) => state.assetTypeReducer.attachments;
|
|
1392
|
+
const selectAssetTypeAttachments = toolkit.createSelector(
|
|
1393
|
+
[selectAssetTypeAttachmentMapping],
|
|
1676
1394
|
(mapping) => Object.values(mapping)
|
|
1677
1395
|
);
|
|
1678
|
-
const
|
|
1679
|
-
return state.
|
|
1396
|
+
const selectAssetTypeAttachment = (attachmentId) => (state) => {
|
|
1397
|
+
return state.assetTypeReducer.attachments[attachmentId];
|
|
1680
1398
|
};
|
|
1681
|
-
const
|
|
1399
|
+
const selectAttachmentsOfAssetType = restructureCreateSelectorWithArgs(
|
|
1682
1400
|
toolkit.createSelector(
|
|
1683
|
-
[
|
|
1684
|
-
(attachments,
|
|
1685
|
-
return attachments.filter(({
|
|
1401
|
+
[selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
|
|
1402
|
+
(attachments, assetTypeId) => {
|
|
1403
|
+
return attachments.filter(({ asset_type }) => assetTypeId === asset_type);
|
|
1686
1404
|
}
|
|
1687
1405
|
)
|
|
1688
1406
|
);
|
|
1689
|
-
const
|
|
1407
|
+
const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
1690
1408
|
toolkit.createSelector(
|
|
1691
|
-
[
|
|
1692
|
-
(attachments,
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1695
|
-
);
|
|
1696
|
-
const fileAttachments = attachmentsOfComponent.filter(
|
|
1409
|
+
[selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
|
|
1410
|
+
(attachments, assetTypeId) => {
|
|
1411
|
+
const attachmentsOfAssetType = attachments.filter(({ asset_type }) => asset_type === assetTypeId);
|
|
1412
|
+
const fileAttachments = attachmentsOfAssetType.filter(
|
|
1697
1413
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1698
1414
|
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1699
1415
|
);
|
|
1700
|
-
const imageAttachments =
|
|
1416
|
+
const imageAttachments = attachmentsOfAssetType.filter(
|
|
1701
1417
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1702
1418
|
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1703
1419
|
);
|
|
@@ -1705,173 +1421,157 @@ var __publicField = (obj, key, value) => {
|
|
|
1705
1421
|
}
|
|
1706
1422
|
)
|
|
1707
1423
|
);
|
|
1708
|
-
const
|
|
1424
|
+
const assetTypeReducer = assetTypeSlice.reducer;
|
|
1709
1425
|
const initialState$p = {
|
|
1710
|
-
|
|
1426
|
+
assets: {},
|
|
1711
1427
|
attachments: {}
|
|
1712
1428
|
};
|
|
1713
|
-
const
|
|
1714
|
-
name: "
|
|
1429
|
+
const assetSlice = toolkit.createSlice({
|
|
1430
|
+
name: "assets",
|
|
1715
1431
|
initialState: initialState$p,
|
|
1716
1432
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1717
1433
|
reducers: {
|
|
1718
|
-
|
|
1719
|
-
state.
|
|
1720
|
-
|
|
1434
|
+
addAsset: (state, action) => {
|
|
1435
|
+
state.assets[action.payload.offline_id] = action.payload;
|
|
1436
|
+
prevAssets = null;
|
|
1721
1437
|
},
|
|
1722
|
-
|
|
1723
|
-
Object.assign(state.
|
|
1724
|
-
|
|
1438
|
+
addAssetsInBatches: (state, action) => {
|
|
1439
|
+
Object.assign(state.assets, toOfflineIdRecord(action.payload));
|
|
1440
|
+
prevAssets = null;
|
|
1725
1441
|
},
|
|
1726
|
-
|
|
1727
|
-
state.
|
|
1728
|
-
|
|
1442
|
+
setAssets: (state, action) => {
|
|
1443
|
+
state.assets = toOfflineIdRecord(action.payload);
|
|
1444
|
+
prevAssets = null;
|
|
1729
1445
|
},
|
|
1730
|
-
|
|
1731
|
-
if (action.payload.offline_id in state.
|
|
1732
|
-
state.
|
|
1446
|
+
updateAsset: (state, action) => {
|
|
1447
|
+
if (action.payload.offline_id in state.assets) {
|
|
1448
|
+
state.assets[action.payload.offline_id] = action.payload;
|
|
1733
1449
|
} else {
|
|
1734
|
-
throw new Error(`Tried to update
|
|
1450
|
+
throw new Error(`Tried to update asset with ID that doesn't exist: ${action.payload.offline_id}`);
|
|
1735
1451
|
}
|
|
1736
|
-
|
|
1452
|
+
prevAssets = null;
|
|
1737
1453
|
},
|
|
1738
|
-
|
|
1739
|
-
if (action.payload in state.
|
|
1740
|
-
delete state.
|
|
1454
|
+
removeAsset: (state, action) => {
|
|
1455
|
+
if (action.payload in state.assets) {
|
|
1456
|
+
delete state.assets[action.payload];
|
|
1741
1457
|
} else {
|
|
1742
|
-
throw new Error(`Failed to remove
|
|
1458
|
+
throw new Error(`Failed to remove asset because ID doesn't exist: ${action.payload}`);
|
|
1743
1459
|
}
|
|
1744
|
-
|
|
1460
|
+
prevAssets = null;
|
|
1745
1461
|
},
|
|
1746
|
-
|
|
1462
|
+
removeAllAssetsOfType: (state, action) => {
|
|
1747
1463
|
var _a2;
|
|
1748
|
-
for (const componentId in state.
|
|
1749
|
-
if (((_a2 = state.
|
|
1750
|
-
delete state.
|
|
1464
|
+
for (const componentId in state.assets) {
|
|
1465
|
+
if (((_a2 = state.assets[componentId]) == null ? void 0 : _a2.asset_type) === action.payload) {
|
|
1466
|
+
delete state.assets[componentId];
|
|
1751
1467
|
}
|
|
1752
1468
|
}
|
|
1753
|
-
|
|
1469
|
+
prevAssets = null;
|
|
1754
1470
|
},
|
|
1755
1471
|
// Attachments
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1472
|
+
setAssetAttachment: setAttachment,
|
|
1473
|
+
setAssetAttachments: setAttachments,
|
|
1474
|
+
addAssetAttachment: addAttachment,
|
|
1475
|
+
addAssetAttachments: addAttachments,
|
|
1476
|
+
updateAssetAttachment: updateAttachment,
|
|
1477
|
+
updateAssetAttachments: updateAttachments,
|
|
1478
|
+
removeAssetAttachment: removeAttachment,
|
|
1479
|
+
removeAssetAttachments: removeAttachments
|
|
1764
1480
|
}
|
|
1765
1481
|
});
|
|
1766
1482
|
const {
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1483
|
+
addAsset,
|
|
1484
|
+
updateAsset,
|
|
1485
|
+
removeAsset,
|
|
1486
|
+
addAssetsInBatches,
|
|
1487
|
+
setAssets,
|
|
1488
|
+
removeAllAssetsOfType,
|
|
1773
1489
|
// Attachments
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
} =
|
|
1783
|
-
let
|
|
1784
|
-
const
|
|
1785
|
-
if (!
|
|
1786
|
-
|
|
1787
|
-
}
|
|
1788
|
-
return
|
|
1490
|
+
setAssetAttachment,
|
|
1491
|
+
setAssetAttachments,
|
|
1492
|
+
addAssetAttachment,
|
|
1493
|
+
addAssetAttachments,
|
|
1494
|
+
updateAssetAttachment,
|
|
1495
|
+
updateAssetAttachments,
|
|
1496
|
+
removeAssetAttachment,
|
|
1497
|
+
removeAssetAttachments
|
|
1498
|
+
} = assetSlice.actions;
|
|
1499
|
+
let prevAssets = null;
|
|
1500
|
+
const selectAssets = (state) => {
|
|
1501
|
+
if (!prevAssets) {
|
|
1502
|
+
prevAssets = Object.values(state.assetReducer.assets);
|
|
1503
|
+
}
|
|
1504
|
+
return prevAssets;
|
|
1789
1505
|
};
|
|
1790
|
-
const
|
|
1791
|
-
const
|
|
1792
|
-
toolkit.createSelector(
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
if (!componentTypeId)
|
|
1796
|
-
return [];
|
|
1797
|
-
return components.filter((component) => component.component_type === componentTypeId);
|
|
1798
|
-
}
|
|
1799
|
-
)
|
|
1506
|
+
const selectAssetsMapping = (state) => state.assetReducer.assets;
|
|
1507
|
+
const selectAssetsOfAssetType = restructureCreateSelectorWithArgs(
|
|
1508
|
+
toolkit.createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (components, assetTypeId) => {
|
|
1509
|
+
return components.filter((asset) => asset.asset_type === assetTypeId);
|
|
1510
|
+
})
|
|
1800
1511
|
);
|
|
1801
|
-
const
|
|
1802
|
-
return state.
|
|
1803
|
-
};
|
|
1804
|
-
const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
|
|
1805
|
-
return state.componentTypeReducer.componentTypes[componentTypeId];
|
|
1512
|
+
const selectAsset = (assetId) => (state) => {
|
|
1513
|
+
return state.assetReducer.assets[assetId];
|
|
1806
1514
|
};
|
|
1807
|
-
const
|
|
1808
|
-
[
|
|
1809
|
-
(
|
|
1515
|
+
const selectAssetToAssetTypeMapping = toolkit.createSelector(
|
|
1516
|
+
[selectAssets, selectAssetTypesMapping],
|
|
1517
|
+
(assets, assetTypeMapping) => {
|
|
1810
1518
|
const ret = {};
|
|
1811
|
-
for (const
|
|
1812
|
-
const
|
|
1813
|
-
if (!
|
|
1519
|
+
for (const asset of assets) {
|
|
1520
|
+
const assetType = assetTypeMapping[asset.asset_type];
|
|
1521
|
+
if (!assetType) {
|
|
1814
1522
|
console.error(
|
|
1815
|
-
`
|
|
1816
|
-
Expected all referenced
|
|
1523
|
+
`Asset type with ID ${asset.asset_type} not found.
|
|
1524
|
+
Expected all referenced asset types to be populated.
|
|
1817
1525
|
Returning empty object to avoid fatal errors.`
|
|
1818
1526
|
);
|
|
1819
1527
|
return {};
|
|
1820
1528
|
}
|
|
1821
|
-
ret[
|
|
1529
|
+
ret[asset.offline_id] = assetType;
|
|
1822
1530
|
}
|
|
1823
1531
|
return ret;
|
|
1824
1532
|
}
|
|
1825
1533
|
);
|
|
1826
|
-
const
|
|
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) => {
|
|
1534
|
+
const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
1835
1535
|
var _a2;
|
|
1836
|
-
if (!
|
|
1536
|
+
if (!assetTypeId)
|
|
1837
1537
|
return 0;
|
|
1838
|
-
return (_a2 =
|
|
1538
|
+
return (_a2 = selectAssetsOfAssetType(assetTypeId)(state)) == null ? void 0 : _a2.length;
|
|
1839
1539
|
};
|
|
1840
|
-
const
|
|
1841
|
-
return
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1844
|
-
acc.push(
|
|
1540
|
+
const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
|
|
1541
|
+
return assetTypeIds.reduce((acc, assetTypeId) => {
|
|
1542
|
+
const assetType = state.assetTypeReducer.assetTypes[assetTypeId];
|
|
1543
|
+
if (assetType) {
|
|
1544
|
+
acc.push(assetType);
|
|
1845
1545
|
}
|
|
1846
1546
|
return acc;
|
|
1847
1547
|
}, []);
|
|
1848
1548
|
};
|
|
1849
|
-
const
|
|
1850
|
-
const
|
|
1851
|
-
[
|
|
1549
|
+
const selectAssetAttachmentMapping = (state) => state.assetReducer.attachments;
|
|
1550
|
+
const selectAssetAttachments = toolkit.createSelector(
|
|
1551
|
+
[selectAssetAttachmentMapping],
|
|
1852
1552
|
(mapping) => Object.values(mapping)
|
|
1853
1553
|
);
|
|
1854
|
-
const
|
|
1855
|
-
return state.
|
|
1554
|
+
const selectAssetAttachment = (attachmentId) => (state) => {
|
|
1555
|
+
return state.assetReducer.attachments[attachmentId];
|
|
1856
1556
|
};
|
|
1857
|
-
const
|
|
1557
|
+
const selectAttachmentsOfAsset = restructureCreateSelectorWithArgs(
|
|
1858
1558
|
toolkit.createSelector(
|
|
1859
|
-
[
|
|
1860
|
-
(attachments,
|
|
1861
|
-
return attachments.filter(({
|
|
1559
|
+
[selectAssetAttachments, (_state, assetId) => assetId],
|
|
1560
|
+
(attachments, assetId) => {
|
|
1561
|
+
return attachments.filter(({ asset }) => assetId === asset);
|
|
1862
1562
|
}
|
|
1863
1563
|
)
|
|
1864
1564
|
);
|
|
1865
|
-
const
|
|
1565
|
+
const selectAttachmentsOfAssetByType = restructureCreateSelectorWithArgs(
|
|
1866
1566
|
toolkit.createSelector(
|
|
1867
|
-
[
|
|
1868
|
-
(attachments,
|
|
1869
|
-
const
|
|
1870
|
-
const fileAttachments =
|
|
1567
|
+
[selectAssetAttachments, (_state, assetId) => assetId],
|
|
1568
|
+
(attachments, assetId) => {
|
|
1569
|
+
const attachmentsOfAsset = attachments.filter(({ asset }) => assetId === asset);
|
|
1570
|
+
const fileAttachments = attachmentsOfAsset.filter(
|
|
1871
1571
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1872
1572
|
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1873
1573
|
);
|
|
1874
|
-
const imageAttachments =
|
|
1574
|
+
const imageAttachments = attachmentsOfAsset.filter(
|
|
1875
1575
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1876
1576
|
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1877
1577
|
);
|
|
@@ -1879,69 +1579,67 @@ var __publicField = (obj, key, value) => {
|
|
|
1879
1579
|
}
|
|
1880
1580
|
)
|
|
1881
1581
|
);
|
|
1882
|
-
const
|
|
1582
|
+
const assetReducer = assetSlice.reducer;
|
|
1883
1583
|
const initialState$o = {
|
|
1884
|
-
|
|
1584
|
+
completionsByAssetId: {}
|
|
1885
1585
|
};
|
|
1886
|
-
const
|
|
1887
|
-
name: "
|
|
1586
|
+
const assetStageCompletionSlice = toolkit.createSlice({
|
|
1587
|
+
name: "assetStageCompletions",
|
|
1888
1588
|
initialState: initialState$o,
|
|
1889
1589
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1890
1590
|
reducers: {
|
|
1891
1591
|
addStageCompletion: (state, action) => {
|
|
1892
|
-
let stageToCompletionDateMapping = state.
|
|
1592
|
+
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
1893
1593
|
if (!stageToCompletionDateMapping) {
|
|
1894
1594
|
stageToCompletionDateMapping = {};
|
|
1895
|
-
state.
|
|
1595
|
+
state.completionsByAssetId[action.payload.asset] = stageToCompletionDateMapping;
|
|
1896
1596
|
}
|
|
1897
1597
|
stageToCompletionDateMapping[action.payload.stage] = (/* @__PURE__ */ new Date()).toISOString();
|
|
1898
1598
|
},
|
|
1899
1599
|
addStageCompletions: (state, action) => {
|
|
1900
|
-
for (const [
|
|
1600
|
+
for (const [assetId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
|
|
1901
1601
|
if (Object.keys(stageIdToCompletionDateMapping).length === 0)
|
|
1902
|
-
throw new Error(
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
if (thisComponentCompletions === void 0) {
|
|
1907
|
-
thisComponentCompletions = {};
|
|
1602
|
+
throw new Error(`Encountered empty stageIdToCompletionDateMapping argument for asset ${assetId}`);
|
|
1603
|
+
let thisAssetCompletions = state.completionsByAssetId[assetId];
|
|
1604
|
+
if (thisAssetCompletions === void 0) {
|
|
1605
|
+
thisAssetCompletions = {};
|
|
1908
1606
|
}
|
|
1909
1607
|
for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
|
|
1910
|
-
|
|
1608
|
+
thisAssetCompletions[stageId] = completionDate;
|
|
1911
1609
|
}
|
|
1912
|
-
state.
|
|
1610
|
+
state.completionsByAssetId[assetId] = thisAssetCompletions;
|
|
1913
1611
|
}
|
|
1914
1612
|
},
|
|
1915
1613
|
removeStageCompletions: (state, action) => {
|
|
1916
1614
|
for (const completion of action.payload) {
|
|
1917
|
-
const
|
|
1918
|
-
if (!
|
|
1615
|
+
const thisAssetCompletions = state.completionsByAssetId[completion.asset];
|
|
1616
|
+
if (!thisAssetCompletions || !(completion.stage in thisAssetCompletions)) {
|
|
1919
1617
|
console.warn(
|
|
1920
1618
|
"Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
|
|
1921
1619
|
);
|
|
1922
1620
|
continue;
|
|
1923
1621
|
}
|
|
1924
|
-
delete
|
|
1622
|
+
delete thisAssetCompletions[completion.stage];
|
|
1925
1623
|
}
|
|
1926
1624
|
},
|
|
1927
1625
|
setStageCompletions: (state, action) => {
|
|
1928
|
-
state.
|
|
1626
|
+
state.completionsByAssetId = action.payload;
|
|
1929
1627
|
}
|
|
1930
1628
|
}
|
|
1931
1629
|
});
|
|
1932
|
-
const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } =
|
|
1630
|
+
const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = assetStageCompletionSlice.actions;
|
|
1933
1631
|
const selectCompletedStages = (state) => {
|
|
1934
|
-
return state.
|
|
1632
|
+
return state.assetStageCompletionReducer.completionsByAssetId;
|
|
1935
1633
|
};
|
|
1936
|
-
const
|
|
1937
|
-
return Object.keys(state.
|
|
1634
|
+
const selectCompletedStageIdsForAsset = (asset) => (state) => {
|
|
1635
|
+
return Object.keys(state.assetStageCompletionReducer.completionsByAssetId[asset.offline_id] ?? {});
|
|
1938
1636
|
};
|
|
1939
|
-
const
|
|
1637
|
+
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1940
1638
|
const initialState$n = {
|
|
1941
1639
|
stages: {}
|
|
1942
1640
|
};
|
|
1943
|
-
const
|
|
1944
|
-
name: "
|
|
1641
|
+
const assetStageSlice = toolkit.createSlice({
|
|
1642
|
+
name: "assetStages",
|
|
1945
1643
|
initialState: initialState$n,
|
|
1946
1644
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1947
1645
|
reducers: {
|
|
@@ -1976,7 +1674,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1976
1674
|
}
|
|
1977
1675
|
}
|
|
1978
1676
|
});
|
|
1979
|
-
const selectStageMapping = (state) => state.
|
|
1677
|
+
const selectStageMapping = (state) => state.assetStageReducer.stages;
|
|
1980
1678
|
const selectStage = restructureCreateSelectorWithArgs(
|
|
1981
1679
|
toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
|
|
1982
1680
|
return stageMapping[stageId];
|
|
@@ -1988,48 +1686,39 @@ var __publicField = (obj, key, value) => {
|
|
|
1988
1686
|
return Object.values(stageMapping);
|
|
1989
1687
|
}
|
|
1990
1688
|
);
|
|
1991
|
-
const
|
|
1992
|
-
toolkit.createSelector(
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
if (!ret[stage.component_type]) {
|
|
2000
|
-
ret[stage.component_type] = [];
|
|
2001
|
-
}
|
|
2002
|
-
ret[stage.component_type].push(stage);
|
|
1689
|
+
const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
|
|
1690
|
+
toolkit.createSelector([selectStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
|
|
1691
|
+
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
1692
|
+
const ret = {};
|
|
1693
|
+
for (const stage of stages) {
|
|
1694
|
+
if (assetTypeIdsSet.has(stage.asset_type)) {
|
|
1695
|
+
if (!ret[stage.asset_type]) {
|
|
1696
|
+
ret[stage.asset_type] = [];
|
|
2003
1697
|
}
|
|
1698
|
+
ret[stage.asset_type].push(stage);
|
|
2004
1699
|
}
|
|
2005
|
-
for (const key in ret) {
|
|
2006
|
-
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
2007
|
-
}
|
|
2008
|
-
return ret;
|
|
2009
1700
|
}
|
|
2010
|
-
|
|
1701
|
+
for (const key in ret) {
|
|
1702
|
+
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
1703
|
+
}
|
|
1704
|
+
return ret;
|
|
1705
|
+
})
|
|
2011
1706
|
);
|
|
2012
|
-
const
|
|
2013
|
-
toolkit.createSelector(
|
|
2014
|
-
|
|
2015
|
-
(
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
if (stage.component_type === componentTypeId) {
|
|
2019
|
-
componentTypeStagesMapping[stageId] = stage;
|
|
2020
|
-
}
|
|
1707
|
+
const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
1708
|
+
toolkit.createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
|
|
1709
|
+
const assetTypeStagesMapping = {};
|
|
1710
|
+
for (const [stageId, stage] of Object.entries(stagesMapping)) {
|
|
1711
|
+
if (stage.asset_type === assetTypeId) {
|
|
1712
|
+
assetTypeStagesMapping[stageId] = stage;
|
|
2021
1713
|
}
|
|
2022
|
-
return componentTypeStagesMapping;
|
|
2023
1714
|
}
|
|
2024
|
-
|
|
1715
|
+
return assetTypeStagesMapping;
|
|
1716
|
+
})
|
|
2025
1717
|
);
|
|
2026
|
-
const
|
|
2027
|
-
toolkit.createSelector(
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
return stages.filter((stage) => stage.component_type === componentTypeId).sort((a, b) => a.priority - b.priority);
|
|
2031
|
-
}
|
|
2032
|
-
)
|
|
1718
|
+
const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
|
|
1719
|
+
toolkit.createSelector([selectStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
|
|
1720
|
+
return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
|
|
1721
|
+
})
|
|
2033
1722
|
);
|
|
2034
1723
|
const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
|
|
2035
1724
|
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
@@ -2051,8 +1740,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2051
1740
|
return ret;
|
|
2052
1741
|
})
|
|
2053
1742
|
);
|
|
2054
|
-
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } =
|
|
2055
|
-
const
|
|
1743
|
+
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = assetStageSlice.actions;
|
|
1744
|
+
const assetStageReducer = assetStageSlice.reducer;
|
|
2056
1745
|
const initialState$m = {
|
|
2057
1746
|
workspaces: {},
|
|
2058
1747
|
activeWorkspaceId: null
|
|
@@ -2420,9 +2109,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2420
2109
|
);
|
|
2421
2110
|
const selectIssueUpdateMapping = (state) => state.issueReducer.updates;
|
|
2422
2111
|
const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
2423
|
-
toolkit.createSelector(
|
|
2424
|
-
|
|
2425
|
-
|
|
2112
|
+
toolkit.createSelector(
|
|
2113
|
+
[selectIssueUpdateMapping, (_state, issueId) => issueId],
|
|
2114
|
+
(updates, issueId) => {
|
|
2115
|
+
return Object.values(updates).filter((update) => update.issue === issueId);
|
|
2116
|
+
}
|
|
2117
|
+
)
|
|
2426
2118
|
);
|
|
2427
2119
|
const selectAttachmentsOfIssue = restructureCreateSelectorWithArgs(
|
|
2428
2120
|
toolkit.createSelector(
|
|
@@ -2711,8 +2403,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2711
2403
|
})(OrganizationAccessLevel || {});
|
|
2712
2404
|
var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
|
|
2713
2405
|
AttachmentModel2["Issue"] = "issue";
|
|
2714
|
-
AttachmentModel2["
|
|
2715
|
-
AttachmentModel2["
|
|
2406
|
+
AttachmentModel2["Asset"] = "asset";
|
|
2407
|
+
AttachmentModel2["AssetType"] = "asset_type";
|
|
2716
2408
|
AttachmentModel2["Project"] = "project";
|
|
2717
2409
|
AttachmentModel2["Document"] = "document";
|
|
2718
2410
|
return AttachmentModel2;
|
|
@@ -3525,6 +3217,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3525
3217
|
placementMode: false,
|
|
3526
3218
|
enableClustering: false,
|
|
3527
3219
|
svgLayout: false,
|
|
3220
|
+
// TODO: this is no longer used
|
|
3528
3221
|
expandedSections: {
|
|
3529
3222
|
Issues: true,
|
|
3530
3223
|
"Map Layers": false,
|
|
@@ -3729,33 +3422,36 @@ var __publicField = (obj, key, value) => {
|
|
|
3729
3422
|
})
|
|
3730
3423
|
);
|
|
3731
3424
|
const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
3732
|
-
toolkit.createSelector(
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3425
|
+
toolkit.createSelector(
|
|
3426
|
+
[selectFormRevisions, (_state, formId2) => formId2],
|
|
3427
|
+
(revisions, formId2) => {
|
|
3428
|
+
return revisions.filter((revision) => {
|
|
3429
|
+
return revision.form === formId2;
|
|
3430
|
+
});
|
|
3431
|
+
}
|
|
3432
|
+
)
|
|
3737
3433
|
);
|
|
3738
|
-
const
|
|
3434
|
+
const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
|
|
3739
3435
|
toolkit.createSelector(
|
|
3740
3436
|
[
|
|
3741
3437
|
(state) => state.formReducer.forms,
|
|
3742
3438
|
selectFormRevisionMapping,
|
|
3743
|
-
(_state,
|
|
3439
|
+
(_state, assetTypeIds) => assetTypeIds
|
|
3744
3440
|
],
|
|
3745
|
-
(userForms, revisions,
|
|
3746
|
-
const
|
|
3747
|
-
const
|
|
3441
|
+
(userForms, revisions, assetTypeIds) => {
|
|
3442
|
+
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
3443
|
+
const formsOfAssetTypes = {};
|
|
3748
3444
|
const ret = {};
|
|
3749
3445
|
for (const form of Object.values(userForms)) {
|
|
3750
|
-
if (form.
|
|
3751
|
-
|
|
3446
|
+
if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
|
|
3447
|
+
formsOfAssetTypes[form.offline_id] = form;
|
|
3752
3448
|
}
|
|
3753
3449
|
}
|
|
3754
3450
|
for (const revision of Object.values(revisions)) {
|
|
3755
|
-
const form =
|
|
3756
|
-
if (!form || !form.
|
|
3451
|
+
const form = formsOfAssetTypes[revision.form];
|
|
3452
|
+
if (!form || !form.asset_type || ret[form.asset_type] && formRevisionSortFn(ret[form.asset_type], revision) > 0)
|
|
3757
3453
|
continue;
|
|
3758
|
-
ret[form.
|
|
3454
|
+
ret[form.asset_type] = revision;
|
|
3759
3455
|
}
|
|
3760
3456
|
return ret;
|
|
3761
3457
|
}
|
|
@@ -3872,11 +3568,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3872
3568
|
const selectFormMapping = (state) => {
|
|
3873
3569
|
return state.formReducer.forms;
|
|
3874
3570
|
};
|
|
3875
|
-
const
|
|
3571
|
+
const selectFormOfAssetType = restructureCreateSelectorWithArgs(
|
|
3876
3572
|
toolkit.createSelector(
|
|
3877
|
-
[selectFormMapping, (_state,
|
|
3878
|
-
(userForms,
|
|
3879
|
-
return Object.values(userForms).find((userForm) => userForm.
|
|
3573
|
+
[selectFormMapping, (_state, assetTypeId) => assetTypeId],
|
|
3574
|
+
(userForms, assetTypeId) => {
|
|
3575
|
+
return Object.values(userForms).find((userForm) => userForm.asset_type === assetTypeId);
|
|
3880
3576
|
}
|
|
3881
3577
|
)
|
|
3882
3578
|
);
|
|
@@ -3892,7 +3588,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3892
3588
|
return Object.keys(userForms).length;
|
|
3893
3589
|
});
|
|
3894
3590
|
const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (userForms) => {
|
|
3895
|
-
return Object.values(userForms).filter((form) => !form.
|
|
3591
|
+
return Object.values(userForms).filter((form) => !form.asset_type).length;
|
|
3896
3592
|
});
|
|
3897
3593
|
const formReducer = formSlice.reducer;
|
|
3898
3594
|
const initialState$5 = {
|
|
@@ -4100,31 +3796,31 @@ var __publicField = (obj, key, value) => {
|
|
|
4100
3796
|
}
|
|
4101
3797
|
)
|
|
4102
3798
|
);
|
|
4103
|
-
const
|
|
3799
|
+
const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
4104
3800
|
toolkit.createSelector(
|
|
4105
|
-
[selectFormSubmissions, (_state,
|
|
4106
|
-
(submissions,
|
|
3801
|
+
[selectFormSubmissions, (_state, assetId) => assetId],
|
|
3802
|
+
(submissions, assetId) => {
|
|
4107
3803
|
return submissions.filter((submission) => {
|
|
4108
|
-
return submission.
|
|
3804
|
+
return submission.asset === assetId;
|
|
4109
3805
|
});
|
|
4110
3806
|
}
|
|
4111
3807
|
)
|
|
4112
3808
|
);
|
|
4113
|
-
const
|
|
4114
|
-
[selectFormSubmissionsMapping,
|
|
4115
|
-
(submissions,
|
|
3809
|
+
const selectFormSubmissionsByAssets = toolkit.createSelector(
|
|
3810
|
+
[selectFormSubmissionsMapping, selectAssetsMapping],
|
|
3811
|
+
(submissions, assets) => {
|
|
4116
3812
|
var _a2;
|
|
4117
|
-
const
|
|
4118
|
-
for (const
|
|
4119
|
-
|
|
3813
|
+
const assetSubmissionMapping = {};
|
|
3814
|
+
for (const assetId in assets) {
|
|
3815
|
+
assetSubmissionMapping[assetId] = [];
|
|
4120
3816
|
}
|
|
4121
3817
|
for (const submissionId in submissions) {
|
|
4122
3818
|
const submission = submissions[submissionId];
|
|
4123
|
-
if (submission.
|
|
4124
|
-
(_a2 =
|
|
3819
|
+
if (submission.asset) {
|
|
3820
|
+
(_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
|
|
4125
3821
|
}
|
|
4126
3822
|
}
|
|
4127
|
-
return
|
|
3823
|
+
return assetSubmissionMapping;
|
|
4128
3824
|
}
|
|
4129
3825
|
);
|
|
4130
3826
|
const selectFormSubmissionAttachmentsMapping = (state) => {
|
|
@@ -4523,7 +4219,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4523
4219
|
reducers: {}
|
|
4524
4220
|
});
|
|
4525
4221
|
const versioningReducer = versioningSlice.reducer;
|
|
4526
|
-
const
|
|
4222
|
+
const fullAssetMarkerSize = 45;
|
|
4527
4223
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
4528
4224
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
4529
4225
|
const OUTBOX_RETRY_DELAY = 5e3;
|
|
@@ -4541,10 +4237,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4541
4237
|
fileReducer,
|
|
4542
4238
|
authReducer,
|
|
4543
4239
|
categoryReducer,
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4240
|
+
assetReducer,
|
|
4241
|
+
assetStageCompletionReducer,
|
|
4242
|
+
assetStageReducer,
|
|
4243
|
+
assetTypeReducer,
|
|
4548
4244
|
issueReducer,
|
|
4549
4245
|
issueTypeReducer,
|
|
4550
4246
|
mapReducer,
|
|
@@ -4618,7 +4314,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4618
4314
|
form.index_workspace = mainWorkspace.offline_id;
|
|
4619
4315
|
}
|
|
4620
4316
|
}
|
|
4621
|
-
const
|
|
4317
|
+
const overmapRootReducer = (state, action) => {
|
|
4622
4318
|
if (action.type === "auth/setLoggedIn" && !action.payload) {
|
|
4623
4319
|
return overmapReducer(void 0, action);
|
|
4624
4320
|
}
|
|
@@ -4706,17 +4402,6 @@ var __publicField = (obj, key, value) => {
|
|
|
4706
4402
|
};
|
|
4707
4403
|
const migration = createMigration(manifest, VERSION_REDUCER_KEY);
|
|
4708
4404
|
const overmapEnhancer = compose(reduxOffline.offline(customConfig), migration);
|
|
4709
|
-
const defaultStore = toolkit.configureStore({
|
|
4710
|
-
reducer: rootReducer,
|
|
4711
|
-
enhancers: [compose(applyMiddleware(), overmapEnhancer)],
|
|
4712
|
-
middleware: (getDefaultMiddleware) => {
|
|
4713
|
-
return getDefaultMiddleware({
|
|
4714
|
-
// TODO: Enable periodically to find problems
|
|
4715
|
-
serializableCheck: false,
|
|
4716
|
-
immutableCheck: false
|
|
4717
|
-
});
|
|
4718
|
-
}
|
|
4719
|
-
});
|
|
4720
4405
|
function extractResponseFromError(error2) {
|
|
4721
4406
|
function isResponse(response) {
|
|
4722
4407
|
const knownKeys = ["ok", "redirect", "clientError", "serverError", "error"];
|
|
@@ -5020,8 +4705,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5020
4705
|
getClientStore().dispatch(_setLatestRetryTime((/* @__PURE__ */ new Date()).getTime()));
|
|
5021
4706
|
return OUTBOX_RETRY_DELAY;
|
|
5022
4707
|
}
|
|
5023
|
-
const useAppDispatch = () => reactRedux.useDispatch();
|
|
5024
|
-
const useAppSelector = reactRedux.useSelector;
|
|
5025
4708
|
const EXPIRING_SOON_THRESHOLD = 1800;
|
|
5026
4709
|
function parseTokens(response) {
|
|
5027
4710
|
if (!response.access)
|
|
@@ -5386,110 +5069,108 @@ var __publicField = (obj, key, value) => {
|
|
|
5386
5069
|
store.dispatch(setCategories(result));
|
|
5387
5070
|
}
|
|
5388
5071
|
}
|
|
5389
|
-
class
|
|
5072
|
+
class AssetService extends BaseApiService {
|
|
5390
5073
|
// Basic CRUD functions
|
|
5391
|
-
add(
|
|
5392
|
-
const
|
|
5393
|
-
this.client.store.dispatch(
|
|
5074
|
+
add(asset, workspaceId) {
|
|
5075
|
+
const offlineAsset = offline(asset);
|
|
5076
|
+
this.client.store.dispatch(addAsset(offlineAsset));
|
|
5394
5077
|
const promise = this.client.enqueueRequest({
|
|
5395
|
-
description: "Create
|
|
5078
|
+
description: "Create asset",
|
|
5396
5079
|
method: HttpMethod.POST,
|
|
5397
|
-
url: `/
|
|
5080
|
+
url: `/assets/types/${offlineAsset.asset_type}/add-assets/`,
|
|
5398
5081
|
queryParams: {
|
|
5399
5082
|
workspace_id: workspaceId.toString()
|
|
5400
5083
|
},
|
|
5401
|
-
payload: {
|
|
5084
|
+
payload: { assets: [offlineAsset] },
|
|
5402
5085
|
blockers: [],
|
|
5403
|
-
blocks: [
|
|
5086
|
+
blocks: [offlineAsset.offline_id]
|
|
5404
5087
|
});
|
|
5405
|
-
return [
|
|
5088
|
+
return [offlineAsset, promise];
|
|
5406
5089
|
}
|
|
5407
|
-
update(
|
|
5408
|
-
this.client.store.dispatch(
|
|
5090
|
+
update(asset, workspaceId) {
|
|
5091
|
+
this.client.store.dispatch(updateAsset(asset));
|
|
5409
5092
|
const promise = this.client.enqueueRequest({
|
|
5410
|
-
description: "Edit
|
|
5093
|
+
description: "Edit asset",
|
|
5411
5094
|
method: HttpMethod.PATCH,
|
|
5412
|
-
url: `/
|
|
5095
|
+
url: `/assets/${asset.offline_id}/`,
|
|
5413
5096
|
queryParams: {
|
|
5414
5097
|
workspace_id: workspaceId.toString()
|
|
5415
5098
|
},
|
|
5416
|
-
payload:
|
|
5417
|
-
blockers: [
|
|
5418
|
-
blocks: [
|
|
5099
|
+
payload: asset,
|
|
5100
|
+
blockers: [asset.offline_id],
|
|
5101
|
+
blocks: [asset.offline_id]
|
|
5419
5102
|
});
|
|
5420
|
-
return [
|
|
5103
|
+
return [asset, promise];
|
|
5421
5104
|
}
|
|
5422
|
-
async remove(
|
|
5105
|
+
async remove(assetId) {
|
|
5423
5106
|
const { store } = this.client;
|
|
5424
|
-
const
|
|
5425
|
-
if (!
|
|
5426
|
-
throw new Error(`No
|
|
5427
|
-
const
|
|
5428
|
-
store.dispatch(
|
|
5429
|
-
if (
|
|
5430
|
-
const
|
|
5431
|
-
store.dispatch(
|
|
5107
|
+
const assetToBeDeleted = selectAsset(assetId)(store.getState());
|
|
5108
|
+
if (!assetToBeDeleted)
|
|
5109
|
+
throw new Error(`No asset with id ${assetId} found in the store`);
|
|
5110
|
+
const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(store.getState());
|
|
5111
|
+
store.dispatch(removeAsset(assetId));
|
|
5112
|
+
if (attachmentsOfAssets.length > 0) {
|
|
5113
|
+
const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
|
|
5114
|
+
store.dispatch(removeAssetAttachments(attachmentsOfAssetIds));
|
|
5432
5115
|
}
|
|
5433
5116
|
return this.client.enqueueRequest({
|
|
5434
|
-
description: "Delete
|
|
5117
|
+
description: "Delete asset",
|
|
5435
5118
|
method: HttpMethod.DELETE,
|
|
5436
|
-
url: `/
|
|
5437
|
-
blockers: [
|
|
5119
|
+
url: `/assets/${assetId}/`,
|
|
5120
|
+
blockers: [assetId],
|
|
5438
5121
|
blocks: []
|
|
5439
5122
|
}).catch((err) => {
|
|
5440
|
-
store.dispatch(
|
|
5441
|
-
store.dispatch(
|
|
5123
|
+
store.dispatch(addAsset(assetToBeDeleted));
|
|
5124
|
+
store.dispatch(addAssetAttachments(attachmentsOfAssets));
|
|
5442
5125
|
throw err;
|
|
5443
5126
|
});
|
|
5444
5127
|
}
|
|
5445
|
-
async
|
|
5446
|
-
const clientStore2 = this.client.store;
|
|
5447
|
-
const allComponentsOfType = selectComponentsFromComponentType(componentTypeId)(clientStore2.getState());
|
|
5448
|
-
const affectedComponentIds = (allComponentsOfType || []).map((c) => c.offline_id);
|
|
5449
|
-
const affectedOfflineIds = [componentTypeId, ...affectedComponentIds];
|
|
5128
|
+
async deleteAllAssetsOfAssetType(assetTypeId) {
|
|
5450
5129
|
const { store } = this.client;
|
|
5451
5130
|
const state = store.getState();
|
|
5452
|
-
const
|
|
5453
|
-
|
|
5131
|
+
const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
|
|
5132
|
+
const allAssetsOfAssetTypeIds = (allAssetsOfAssetType || []).map((c) => c.offline_id);
|
|
5133
|
+
const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
|
|
5134
|
+
store.dispatch(removeAllAssetsOfType(assetTypeId));
|
|
5454
5135
|
return this.client.enqueueRequest({
|
|
5455
|
-
description: "
|
|
5136
|
+
description: "Delete all assets of asset type",
|
|
5456
5137
|
method: HttpMethod.DELETE,
|
|
5457
|
-
url: `/
|
|
5138
|
+
url: `/assets/types/${assetTypeId}/delete-all-of-type/`,
|
|
5458
5139
|
blockers: affectedOfflineIds,
|
|
5459
5140
|
blocks: affectedOfflineIds
|
|
5460
5141
|
}).catch((err) => {
|
|
5461
|
-
if (
|
|
5462
|
-
store.dispatch(
|
|
5142
|
+
if (allAssetsOfAssetType) {
|
|
5143
|
+
store.dispatch(addAssetsInBatches(allAssetsOfAssetType));
|
|
5463
5144
|
}
|
|
5464
5145
|
throw err;
|
|
5465
5146
|
});
|
|
5466
5147
|
}
|
|
5467
|
-
async addBatch(
|
|
5468
|
-
const
|
|
5469
|
-
return { ...offline(
|
|
5148
|
+
async addBatch(assetsToCreate, workspaceId, assetTypeId) {
|
|
5149
|
+
const fullAssets = assetsToCreate.map((asset) => {
|
|
5150
|
+
return { ...offline(asset), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
5470
5151
|
});
|
|
5471
5152
|
const { store } = this.client;
|
|
5472
|
-
store.dispatch(
|
|
5153
|
+
store.dispatch(addAssetsInBatches(fullAssets));
|
|
5473
5154
|
const promise = this.client.enqueueRequest({
|
|
5474
|
-
description: "Batch create
|
|
5155
|
+
description: "Batch create assets",
|
|
5475
5156
|
method: HttpMethod.POST,
|
|
5476
|
-
url: `/
|
|
5157
|
+
url: `/assets/types/${assetTypeId}/add-assets/`,
|
|
5477
5158
|
queryParams: {
|
|
5478
5159
|
workspace_id: workspaceId.toString()
|
|
5479
5160
|
},
|
|
5480
5161
|
payload: {
|
|
5481
|
-
|
|
5162
|
+
assets: fullAssets
|
|
5482
5163
|
},
|
|
5483
|
-
blockers: [
|
|
5484
|
-
blocks:
|
|
5164
|
+
blockers: [assetTypeId],
|
|
5165
|
+
blocks: fullAssets.map((c) => c.offline_id)
|
|
5485
5166
|
});
|
|
5486
5167
|
void promise.then((result) => {
|
|
5487
|
-
for (const
|
|
5488
|
-
store.dispatch(
|
|
5168
|
+
for (const assets of Object.values(result)) {
|
|
5169
|
+
store.dispatch(updateAsset(assets));
|
|
5489
5170
|
}
|
|
5490
5171
|
}).catch((e) => {
|
|
5491
|
-
for (const
|
|
5492
|
-
store.dispatch(
|
|
5172
|
+
for (const asset of fullAssets) {
|
|
5173
|
+
store.dispatch(removeAsset(asset.offline_id));
|
|
5493
5174
|
}
|
|
5494
5175
|
throw e;
|
|
5495
5176
|
});
|
|
@@ -5498,128 +5179,124 @@ var __publicField = (obj, key, value) => {
|
|
|
5498
5179
|
async refreshStore() {
|
|
5499
5180
|
const { store } = this.client;
|
|
5500
5181
|
const result = await this.client.enqueueRequest({
|
|
5501
|
-
description: "Get
|
|
5182
|
+
description: "Get assets",
|
|
5502
5183
|
method: HttpMethod.GET,
|
|
5503
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5184
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/assets/`,
|
|
5504
5185
|
blockers: [],
|
|
5505
5186
|
blocks: []
|
|
5506
5187
|
});
|
|
5507
|
-
store.dispatch(
|
|
5188
|
+
store.dispatch(setAssets(result));
|
|
5508
5189
|
}
|
|
5509
5190
|
}
|
|
5510
|
-
class
|
|
5511
|
-
add(
|
|
5191
|
+
class AssetStageCompletionService extends BaseApiService {
|
|
5192
|
+
add(assetId, stageId) {
|
|
5512
5193
|
var _a2;
|
|
5513
5194
|
const { store } = this.client;
|
|
5514
|
-
const
|
|
5515
|
-
if (!
|
|
5516
|
-
throw new Error(`
|
|
5195
|
+
const assetTypeId = (_a2 = store.getState().assetReducer.assets[assetId]) == null ? void 0 : _a2.asset_type;
|
|
5196
|
+
if (!assetTypeId) {
|
|
5197
|
+
throw new Error(`Asset with offline_id ${assetId} not found`);
|
|
5517
5198
|
}
|
|
5518
|
-
const
|
|
5519
|
-
|
|
5199
|
+
const offlineStageCompletion = offline({
|
|
5200
|
+
asset: assetId,
|
|
5520
5201
|
stage: stageId
|
|
5521
5202
|
});
|
|
5522
|
-
store.dispatch(addStageCompletion(
|
|
5203
|
+
store.dispatch(addStageCompletion(offlineStageCompletion));
|
|
5523
5204
|
const promise = this.client.enqueueRequest({
|
|
5524
|
-
description: "
|
|
5205
|
+
description: "Complete stage",
|
|
5525
5206
|
method: HttpMethod.POST,
|
|
5526
|
-
url: `/
|
|
5207
|
+
url: `/assets/types/${assetTypeId}/complete-stages/`,
|
|
5527
5208
|
// TODO: Add submitted_at to model
|
|
5528
|
-
payload: { completions: [{ ...
|
|
5529
|
-
blockers: [
|
|
5530
|
-
blocks: [
|
|
5209
|
+
payload: { completions: [{ ...offlineStageCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
|
|
5210
|
+
blockers: [assetId, stageId],
|
|
5211
|
+
blocks: [offlineStageCompletion.offline_id]
|
|
5531
5212
|
});
|
|
5532
|
-
return [
|
|
5213
|
+
return [offlineStageCompletion, promise];
|
|
5533
5214
|
}
|
|
5534
5215
|
async refreshStore() {
|
|
5535
5216
|
const { store } = this.client;
|
|
5536
5217
|
const result = await this.client.enqueueRequest({
|
|
5537
|
-
description: "Get
|
|
5218
|
+
description: "Get stage completions",
|
|
5538
5219
|
method: HttpMethod.GET,
|
|
5539
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5220
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stage-completions/`,
|
|
5540
5221
|
blockers: [],
|
|
5541
5222
|
blocks: []
|
|
5542
5223
|
});
|
|
5543
5224
|
store.dispatch(addStageCompletions(result));
|
|
5544
5225
|
}
|
|
5545
5226
|
/**
|
|
5546
|
-
* Creates a collection of
|
|
5547
|
-
*
|
|
5548
|
-
* @param
|
|
5549
|
-
* stages for one
|
|
5227
|
+
* Creates a collection of AssetStageCompletions, marking the referenced stages as completed for the referenced
|
|
5228
|
+
* assets. It's REQUIRED that all assets referenced all have the SAME asset type.
|
|
5229
|
+
* @param assetTypeId The ID of the asset type for which we are completing stages (we can only complete
|
|
5230
|
+
* stages for one asset type at a time)
|
|
5550
5231
|
* @param stageCompletions
|
|
5551
5232
|
*/
|
|
5552
|
-
async bulkAdd(
|
|
5553
|
-
const
|
|
5233
|
+
async bulkAdd(assetTypeId, stageCompletions) {
|
|
5234
|
+
const offlineStageCompletions = stageCompletions.map((completion) => {
|
|
5554
5235
|
return offline(completion);
|
|
5555
5236
|
});
|
|
5556
5237
|
const asMapping = {};
|
|
5557
5238
|
for (const completion of stageCompletions) {
|
|
5558
|
-
const stageToCompletionDateMapping = asMapping[completion.
|
|
5239
|
+
const stageToCompletionDateMapping = asMapping[completion.asset] || {};
|
|
5559
5240
|
stageToCompletionDateMapping[completion.stage] = (/* @__PURE__ */ new Date()).toISOString();
|
|
5560
|
-
asMapping[completion.
|
|
5241
|
+
asMapping[completion.asset] = stageToCompletionDateMapping;
|
|
5561
5242
|
}
|
|
5562
5243
|
this.client.store.dispatch(addStageCompletions(asMapping));
|
|
5563
5244
|
await this.client.enqueueRequest({
|
|
5564
|
-
description: "
|
|
5245
|
+
description: "Bulk complete stages",
|
|
5565
5246
|
method: HttpMethod.POST,
|
|
5566
|
-
url: `/
|
|
5247
|
+
url: `/assets/types/${assetTypeId}/complete-stages/`,
|
|
5567
5248
|
payload: {
|
|
5568
|
-
completions:
|
|
5249
|
+
completions: offlineStageCompletions
|
|
5569
5250
|
},
|
|
5570
|
-
blockers: [
|
|
5571
|
-
|
|
5572
|
-
...stageCompletions.map((c) => c.component),
|
|
5573
|
-
...stageCompletions.map((c) => c.stage)
|
|
5574
|
-
],
|
|
5575
|
-
blocks: offlineStagesCompletions.map((c) => c.offline_id)
|
|
5251
|
+
blockers: [assetTypeId, ...stageCompletions.map((c) => c.asset), ...stageCompletions.map((c) => c.stage)],
|
|
5252
|
+
blocks: offlineStageCompletions.map((c) => c.offline_id)
|
|
5576
5253
|
});
|
|
5577
5254
|
}
|
|
5578
|
-
bulkDelete(stageId,
|
|
5579
|
-
const
|
|
5255
|
+
bulkDelete(stageId, assetIds) {
|
|
5256
|
+
const stageCompletionsToRemove = assetIds.map((assetId) => {
|
|
5580
5257
|
return {
|
|
5581
|
-
|
|
5258
|
+
asset: assetId,
|
|
5582
5259
|
stage: stageId
|
|
5583
5260
|
};
|
|
5584
5261
|
});
|
|
5585
|
-
this.client.store.dispatch(removeStageCompletions(
|
|
5262
|
+
this.client.store.dispatch(removeStageCompletions(stageCompletionsToRemove));
|
|
5586
5263
|
return this.client.enqueueRequest({
|
|
5587
|
-
description: `Undo stage for ${
|
|
5264
|
+
description: `Undo stage for ${assetIds.length} assets(s)`,
|
|
5588
5265
|
// TODO: Rename to setCompletedStages
|
|
5589
5266
|
method: HttpMethod.DELETE,
|
|
5590
|
-
url: `/
|
|
5267
|
+
url: `/assets/stages/${stageId}/undo-stages/`,
|
|
5591
5268
|
payload: {
|
|
5592
|
-
|
|
5269
|
+
assets: assetIds
|
|
5593
5270
|
},
|
|
5594
|
-
blockers: [stageId, ...
|
|
5271
|
+
blockers: [stageId, ...assetIds],
|
|
5595
5272
|
blocks: []
|
|
5596
5273
|
});
|
|
5597
5274
|
}
|
|
5598
5275
|
}
|
|
5599
|
-
class
|
|
5600
|
-
async bulkCreateStages(stagesToSubmit,
|
|
5276
|
+
class AssetStageService extends BaseApiService {
|
|
5277
|
+
async bulkCreateStages(stagesToSubmit, assetTypeId, workspaceId) {
|
|
5601
5278
|
const payload = stagesToSubmit.map((stage) => {
|
|
5602
5279
|
return offline(stage);
|
|
5603
5280
|
});
|
|
5604
5281
|
const fullStages = payload.map((stage) => {
|
|
5605
|
-
return { ...stage,
|
|
5282
|
+
return { ...stage, asset_type: assetTypeId };
|
|
5606
5283
|
});
|
|
5607
5284
|
this.client.store.dispatch(addStages(fullStages));
|
|
5608
5285
|
return this.client.enqueueRequest({
|
|
5609
|
-
description: "Add
|
|
5286
|
+
description: "Add asset stages",
|
|
5610
5287
|
method: HttpMethod.POST,
|
|
5611
|
-
url: `/
|
|
5288
|
+
url: `/assets/types/${assetTypeId}/add-stages/`,
|
|
5612
5289
|
payload: {
|
|
5613
5290
|
stages: payload
|
|
5614
5291
|
},
|
|
5615
5292
|
queryParams: {
|
|
5616
5293
|
workspace_id: workspaceId.toString()
|
|
5617
5294
|
},
|
|
5618
|
-
blockers: [
|
|
5295
|
+
blockers: [assetTypeId, workspaceId],
|
|
5619
5296
|
blocks: payload.map(({ offline_id }) => offline_id)
|
|
5620
5297
|
});
|
|
5621
5298
|
}
|
|
5622
|
-
async bulkUpdateStages(stagesToUpdate,
|
|
5299
|
+
async bulkUpdateStages(stagesToUpdate, assetTypeId) {
|
|
5623
5300
|
const store = this.client.store;
|
|
5624
5301
|
const state = store.getState();
|
|
5625
5302
|
const prevStages = selectStagesFromStageIds(
|
|
@@ -5630,13 +5307,13 @@ var __publicField = (obj, key, value) => {
|
|
|
5630
5307
|
}
|
|
5631
5308
|
store.dispatch(updateStages(stagesToUpdate));
|
|
5632
5309
|
return this.client.enqueueRequest({
|
|
5633
|
-
description: "Edit
|
|
5310
|
+
description: "Edit asset stages",
|
|
5634
5311
|
method: HttpMethod.PATCH,
|
|
5635
|
-
url: `/
|
|
5312
|
+
url: `/assets/types/${assetTypeId}/bulk-update-stages/`,
|
|
5636
5313
|
payload: {
|
|
5637
5314
|
stages: stagesToUpdate
|
|
5638
5315
|
},
|
|
5639
|
-
blockers: [
|
|
5316
|
+
blockers: [assetTypeId],
|
|
5640
5317
|
blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
|
|
5641
5318
|
}).catch((e) => {
|
|
5642
5319
|
store.dispatch(updateStages(prevStages));
|
|
@@ -5646,9 +5323,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5646
5323
|
async bulkDelete(idsToDelete) {
|
|
5647
5324
|
this.client.store.dispatch(removeStages(idsToDelete));
|
|
5648
5325
|
return this.client.enqueueRequest({
|
|
5649
|
-
description: "Delete
|
|
5326
|
+
description: "Delete asset stages",
|
|
5650
5327
|
method: HttpMethod.DELETE,
|
|
5651
|
-
url: "/
|
|
5328
|
+
url: "/assets/stages/bulk-delete/",
|
|
5652
5329
|
payload: {
|
|
5653
5330
|
stage_ids: idsToDelete
|
|
5654
5331
|
},
|
|
@@ -5656,15 +5333,15 @@ var __publicField = (obj, key, value) => {
|
|
|
5656
5333
|
blocks: []
|
|
5657
5334
|
});
|
|
5658
5335
|
}
|
|
5659
|
-
async update(
|
|
5660
|
-
this.client.store.dispatch(addStages([
|
|
5336
|
+
async update(assetStage) {
|
|
5337
|
+
this.client.store.dispatch(addStages([assetStage]));
|
|
5661
5338
|
return this.client.enqueueRequest({
|
|
5662
|
-
description: "Update
|
|
5339
|
+
description: "Update asset stage",
|
|
5663
5340
|
method: HttpMethod.PATCH,
|
|
5664
|
-
url: `/
|
|
5665
|
-
payload:
|
|
5666
|
-
blockers: [
|
|
5667
|
-
blocks: [
|
|
5341
|
+
url: `/assets/stages/${assetStage.offline_id}/`,
|
|
5342
|
+
payload: assetStage,
|
|
5343
|
+
blockers: [assetStage.offline_id],
|
|
5344
|
+
blocks: [assetStage.offline_id]
|
|
5668
5345
|
});
|
|
5669
5346
|
}
|
|
5670
5347
|
async linkForm(stageId, formId2) {
|
|
@@ -5672,9 +5349,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5672
5349
|
store.dispatch(linkStageToForm({ stageId, formId: formId2 }));
|
|
5673
5350
|
try {
|
|
5674
5351
|
await this.client.enqueueRequest({
|
|
5675
|
-
description: "Link
|
|
5352
|
+
description: "Link asset stage to form",
|
|
5676
5353
|
method: HttpMethod.POST,
|
|
5677
|
-
url: `/
|
|
5354
|
+
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
5678
5355
|
payload: { user_form: formId2 },
|
|
5679
5356
|
blockers: [stageId, formId2],
|
|
5680
5357
|
blocks: [stageId]
|
|
@@ -5689,9 +5366,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5689
5366
|
store.dispatch(unlinkStageToForm({ stageId }));
|
|
5690
5367
|
try {
|
|
5691
5368
|
await this.client.enqueueRequest({
|
|
5692
|
-
description: "Unlink
|
|
5369
|
+
description: "Unlink asset stage from form",
|
|
5693
5370
|
method: HttpMethod.DELETE,
|
|
5694
|
-
url: `/
|
|
5371
|
+
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
5695
5372
|
blockers: [stageId, formId2],
|
|
5696
5373
|
blocks: [stageId]
|
|
5697
5374
|
});
|
|
@@ -5703,9 +5380,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5703
5380
|
async refreshStore() {
|
|
5704
5381
|
const { store } = this.client;
|
|
5705
5382
|
const result = await this.client.enqueueRequest({
|
|
5706
|
-
description: "Get
|
|
5383
|
+
description: "Get asset stages",
|
|
5707
5384
|
method: HttpMethod.GET,
|
|
5708
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5385
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stages/`,
|
|
5709
5386
|
blockers: [],
|
|
5710
5387
|
blocks: []
|
|
5711
5388
|
});
|
|
@@ -5719,20 +5396,20 @@ var __publicField = (obj, key, value) => {
|
|
|
5719
5396
|
deleteUrlPrefix: "/issues",
|
|
5720
5397
|
fetchUrlPostfix: "/issue-attachments"
|
|
5721
5398
|
},
|
|
5722
|
-
[AttachmentModel.
|
|
5723
|
-
name: "
|
|
5724
|
-
attachUrlPrefix: "/
|
|
5725
|
-
deleteUrlPrefix: "/
|
|
5726
|
-
fetchUrlPostfix: "/
|
|
5399
|
+
[AttachmentModel.Asset]: {
|
|
5400
|
+
name: "asset",
|
|
5401
|
+
attachUrlPrefix: "/assets",
|
|
5402
|
+
deleteUrlPrefix: "/assets",
|
|
5403
|
+
fetchUrlPostfix: "/asset-attachments"
|
|
5727
5404
|
},
|
|
5728
|
-
[AttachmentModel.
|
|
5729
|
-
name: "
|
|
5730
|
-
attachUrlPrefix: "/
|
|
5731
|
-
deleteUrlPrefix: "/
|
|
5732
|
-
fetchUrlPostfix: "/
|
|
5405
|
+
[AttachmentModel.AssetType]: {
|
|
5406
|
+
name: "asset type",
|
|
5407
|
+
attachUrlPrefix: "/assets/types",
|
|
5408
|
+
deleteUrlPrefix: "/assets/types",
|
|
5409
|
+
fetchUrlPostfix: "/asset-type-attachments"
|
|
5733
5410
|
},
|
|
5734
5411
|
[AttachmentModel.Project]: {
|
|
5735
|
-
name: "
|
|
5412
|
+
name: "project",
|
|
5736
5413
|
attachUrlPrefix: "/projects",
|
|
5737
5414
|
deleteUrlPrefix: "/projects",
|
|
5738
5415
|
fetchUrlPostfix: "/attachments"
|
|
@@ -5748,8 +5425,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5748
5425
|
getNumberOfAttachmentsWithSha1(sha1) {
|
|
5749
5426
|
const {
|
|
5750
5427
|
issueReducer: issueReducer2,
|
|
5751
|
-
|
|
5752
|
-
|
|
5428
|
+
assetReducer: assetReducer2,
|
|
5429
|
+
assetTypeReducer: assetTypeReducer2,
|
|
5753
5430
|
documentsReducer: documentsReducer2,
|
|
5754
5431
|
projectReducer: projectReducer2,
|
|
5755
5432
|
formSubmissionReducer: formSubmissionReducer2,
|
|
@@ -5757,8 +5434,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5757
5434
|
} = this.client.store.getState();
|
|
5758
5435
|
const objectsWithSha1 = [].concat(
|
|
5759
5436
|
Object.values(issueReducer2.attachments),
|
|
5760
|
-
Object.values(
|
|
5761
|
-
Object.values(
|
|
5437
|
+
Object.values(assetReducer2.attachments),
|
|
5438
|
+
Object.values(assetTypeReducer2.attachments),
|
|
5762
5439
|
Object.values(documentsReducer2.attachments),
|
|
5763
5440
|
Object.values(projectReducer2.attachments),
|
|
5764
5441
|
Object.values(formRevisionReducer2.attachments),
|
|
@@ -5880,10 +5557,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5880
5557
|
return promise;
|
|
5881
5558
|
}
|
|
5882
5559
|
}
|
|
5883
|
-
class
|
|
5560
|
+
class AssetAttachmentService extends BaseAttachmentService {
|
|
5884
5561
|
constructor() {
|
|
5885
5562
|
super(...arguments);
|
|
5886
|
-
__publicField(this, "attachmentModel", AttachmentModel.
|
|
5563
|
+
__publicField(this, "attachmentModel", AttachmentModel.Asset);
|
|
5887
5564
|
}
|
|
5888
5565
|
buildOfflineAttachment(data) {
|
|
5889
5566
|
return offline({
|
|
@@ -5894,115 +5571,108 @@ var __publicField = (obj, key, value) => {
|
|
|
5894
5571
|
file_type: data.file.type,
|
|
5895
5572
|
submitted_at: data.submittedAt,
|
|
5896
5573
|
description: data.description,
|
|
5897
|
-
|
|
5574
|
+
asset: data.modelId
|
|
5898
5575
|
});
|
|
5899
5576
|
}
|
|
5900
|
-
async
|
|
5901
|
-
return this.attachFiles(
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
addAttachments: addComponentAttachments,
|
|
5907
|
-
updateAttachments: updateComponentAttachments,
|
|
5908
|
-
removeAttachments: removeComponentAttachments
|
|
5909
|
-
}
|
|
5910
|
-
);
|
|
5577
|
+
async attachFilesToAsset(files, assetId) {
|
|
5578
|
+
return this.attachFiles(files, assetId, this.buildOfflineAttachment.bind(this), {
|
|
5579
|
+
addAttachments: addAssetAttachments,
|
|
5580
|
+
updateAttachments: updateAssetAttachments,
|
|
5581
|
+
removeAttachments: removeAssetAttachments
|
|
5582
|
+
});
|
|
5911
5583
|
}
|
|
5912
|
-
|
|
5584
|
+
deleteAssetAttachment(attachmentId) {
|
|
5913
5585
|
return this.deleteAttachment(
|
|
5914
5586
|
attachmentId,
|
|
5915
5587
|
{
|
|
5916
|
-
setAttachment:
|
|
5917
|
-
removeAttachment:
|
|
5588
|
+
setAttachment: setAssetAttachment,
|
|
5589
|
+
removeAttachment: removeAssetAttachment
|
|
5918
5590
|
},
|
|
5919
5591
|
{
|
|
5920
|
-
selectAttachment:
|
|
5592
|
+
selectAttachment: selectAssetAttachment
|
|
5921
5593
|
}
|
|
5922
5594
|
);
|
|
5923
5595
|
}
|
|
5924
5596
|
async refreshStore() {
|
|
5925
5597
|
return this.getAttachments({
|
|
5926
|
-
setAttachments:
|
|
5598
|
+
setAttachments: setAssetAttachments
|
|
5927
5599
|
});
|
|
5928
5600
|
}
|
|
5929
5601
|
}
|
|
5930
|
-
class
|
|
5931
|
-
add(
|
|
5932
|
-
const
|
|
5602
|
+
class AssetTypeService extends BaseApiService {
|
|
5603
|
+
add(assetType) {
|
|
5604
|
+
const offlineAssetType = offline(assetType);
|
|
5933
5605
|
const { store } = this.client;
|
|
5934
5606
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
5935
|
-
store.dispatch(
|
|
5607
|
+
store.dispatch(addAssetType(offlineAssetType));
|
|
5936
5608
|
const promise = this.client.enqueueRequest({
|
|
5937
|
-
description: "Create
|
|
5609
|
+
description: "Create asset type",
|
|
5938
5610
|
method: HttpMethod.POST,
|
|
5939
|
-
url: `/projects/${activeProjectId}/
|
|
5940
|
-
payload: { ...
|
|
5611
|
+
url: `/projects/${activeProjectId}/asset-types/`,
|
|
5612
|
+
payload: { ...offlineAssetType },
|
|
5941
5613
|
blockers: [],
|
|
5942
|
-
blocks: [
|
|
5614
|
+
blocks: [offlineAssetType.offline_id]
|
|
5943
5615
|
});
|
|
5944
|
-
return [
|
|
5616
|
+
return [offlineAssetType, promise];
|
|
5945
5617
|
}
|
|
5946
|
-
update(
|
|
5947
|
-
this.client.store.dispatch(
|
|
5618
|
+
update(assetType) {
|
|
5619
|
+
this.client.store.dispatch(addAssetType(assetType));
|
|
5948
5620
|
return this.client.enqueueRequest({
|
|
5949
|
-
description: "Update
|
|
5621
|
+
description: "Update asset type",
|
|
5950
5622
|
method: HttpMethod.PATCH,
|
|
5951
|
-
url: `/
|
|
5952
|
-
payload:
|
|
5953
|
-
blockers: [
|
|
5954
|
-
blocks: [
|
|
5623
|
+
url: `/assets/types/${assetType.offline_id}/`,
|
|
5624
|
+
payload: assetType,
|
|
5625
|
+
blockers: [assetType.offline_id],
|
|
5626
|
+
blocks: [assetType.offline_id]
|
|
5955
5627
|
});
|
|
5956
5628
|
}
|
|
5957
|
-
async delete(
|
|
5629
|
+
async delete(assetTypeId) {
|
|
5958
5630
|
const { store } = this.client;
|
|
5959
5631
|
const state = store.getState();
|
|
5960
|
-
const
|
|
5961
|
-
if (!
|
|
5962
|
-
throw new Error(
|
|
5963
|
-
}
|
|
5964
|
-
const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
|
|
5965
|
-
const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
|
|
5966
|
-
store.dispatch(deleteComponentType(componentTypeId));
|
|
5967
|
-
if (stagesOfComponentType.length > 0) {
|
|
5968
|
-
const stagesOfComponentTypeIds = stagesOfComponentType.map(
|
|
5969
|
-
(componentTypeStage) => componentTypeStage.offline_id
|
|
5970
|
-
);
|
|
5971
|
-
store.dispatch(removeStages(stagesOfComponentTypeIds));
|
|
5632
|
+
const assetType = selectAssetType(assetTypeId)(state);
|
|
5633
|
+
if (!assetType) {
|
|
5634
|
+
throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
|
|
5972
5635
|
}
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5636
|
+
const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state) ?? [];
|
|
5637
|
+
const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
|
|
5638
|
+
store.dispatch(deleteAssetType(assetTypeId));
|
|
5639
|
+
if (stagesOfAssetType.length > 0) {
|
|
5640
|
+
const stagesOfAssetTypeIds = stagesOfAssetType.map((assetStage) => assetStage.offline_id);
|
|
5641
|
+
store.dispatch(removeStages(stagesOfAssetTypeIds));
|
|
5642
|
+
}
|
|
5643
|
+
if (attachmentsOfAssetType.length > 0) {
|
|
5644
|
+
const attachmentsOfAssetTypeIds = attachmentsOfAssetType.map(({ offline_id }) => offline_id);
|
|
5645
|
+
store.dispatch(removeAssetTypeAttachments(attachmentsOfAssetTypeIds));
|
|
5976
5646
|
}
|
|
5977
5647
|
return this.client.enqueueRequest({
|
|
5978
|
-
description: "Delete
|
|
5648
|
+
description: "Delete asset type",
|
|
5979
5649
|
method: HttpMethod.DELETE,
|
|
5980
|
-
url: `/
|
|
5981
|
-
blockers: [
|
|
5650
|
+
url: `/assets/types/${assetTypeId}/`,
|
|
5651
|
+
blockers: [assetTypeId],
|
|
5982
5652
|
blocks: []
|
|
5983
5653
|
}).catch((e) => {
|
|
5984
|
-
store.dispatch(
|
|
5985
|
-
store.dispatch(addStages(
|
|
5986
|
-
store.dispatch(
|
|
5654
|
+
store.dispatch(addAssetType(assetType));
|
|
5655
|
+
store.dispatch(addStages(stagesOfAssetType));
|
|
5656
|
+
store.dispatch(addAssetTypeAttachments(attachmentsOfAssetType));
|
|
5987
5657
|
throw e;
|
|
5988
5658
|
});
|
|
5989
5659
|
}
|
|
5990
5660
|
async refreshStore() {
|
|
5991
5661
|
const { store } = this.client;
|
|
5992
5662
|
const result = await this.client.enqueueRequest({
|
|
5993
|
-
description: "Get
|
|
5663
|
+
description: "Get asset types",
|
|
5994
5664
|
method: HttpMethod.GET,
|
|
5995
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5665
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-types/`,
|
|
5996
5666
|
blockers: [],
|
|
5997
5667
|
blocks: []
|
|
5998
5668
|
});
|
|
5999
|
-
store.dispatch(
|
|
5669
|
+
store.dispatch(setAssetTypes(result));
|
|
6000
5670
|
}
|
|
6001
5671
|
}
|
|
6002
|
-
class
|
|
5672
|
+
class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
6003
5673
|
constructor() {
|
|
6004
5674
|
super(...arguments);
|
|
6005
|
-
__publicField(this, "attachmentModel", AttachmentModel.
|
|
5675
|
+
__publicField(this, "attachmentModel", AttachmentModel.AssetType);
|
|
6006
5676
|
}
|
|
6007
5677
|
buildOfflineAttachment(data) {
|
|
6008
5678
|
return offline({
|
|
@@ -6013,36 +5683,36 @@ var __publicField = (obj, key, value) => {
|
|
|
6013
5683
|
file_type: data.file.type,
|
|
6014
5684
|
submitted_at: data.submittedAt,
|
|
6015
5685
|
description: data.description,
|
|
6016
|
-
|
|
5686
|
+
asset_type: data.modelId
|
|
6017
5687
|
});
|
|
6018
5688
|
}
|
|
6019
|
-
async
|
|
5689
|
+
async attachFilesToAssetType(files, assetTypeId) {
|
|
6020
5690
|
return this.attachFiles(
|
|
6021
5691
|
files,
|
|
6022
|
-
|
|
5692
|
+
assetTypeId,
|
|
6023
5693
|
this.buildOfflineAttachment.bind(this),
|
|
6024
5694
|
{
|
|
6025
|
-
addAttachments:
|
|
6026
|
-
updateAttachments:
|
|
6027
|
-
removeAttachments:
|
|
5695
|
+
addAttachments: addAssetTypeAttachments,
|
|
5696
|
+
updateAttachments: updateAssetTypeAttachments,
|
|
5697
|
+
removeAttachments: removeAssetTypeAttachments
|
|
6028
5698
|
}
|
|
6029
5699
|
);
|
|
6030
5700
|
}
|
|
6031
|
-
|
|
5701
|
+
deleteAssetTypeAttachment(attachmentId) {
|
|
6032
5702
|
return this.deleteAttachment(
|
|
6033
5703
|
attachmentId,
|
|
6034
5704
|
{
|
|
6035
|
-
setAttachment:
|
|
6036
|
-
removeAttachment:
|
|
5705
|
+
setAttachment: setAssetTypeAttachment,
|
|
5706
|
+
removeAttachment: removeAssetTypeAttachment
|
|
6037
5707
|
},
|
|
6038
5708
|
{
|
|
6039
|
-
selectAttachment:
|
|
5709
|
+
selectAttachment: selectAssetTypeAttachment
|
|
6040
5710
|
}
|
|
6041
5711
|
);
|
|
6042
5712
|
}
|
|
6043
5713
|
async refreshStore() {
|
|
6044
5714
|
return this.getAttachments({
|
|
6045
|
-
setAttachments:
|
|
5715
|
+
setAttachments: setAssetTypeAttachments
|
|
6046
5716
|
});
|
|
6047
5717
|
}
|
|
6048
5718
|
}
|
|
@@ -6540,8 +6210,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6540
6210
|
});
|
|
6541
6211
|
}
|
|
6542
6212
|
// TODO:
|
|
6543
|
-
// Don't accept updateStore in
|
|
6544
|
-
// overwrite, use
|
|
6213
|
+
// Don't accept updateStore in AssetService.list. Just return the offline objects and promise. Here, if
|
|
6214
|
+
// overwrite, use setAssets. Otherwise, use bulkAddAssets.
|
|
6545
6215
|
// TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
|
|
6546
6216
|
// literally immediately.
|
|
6547
6217
|
async _processInitialData(data, overwrite) {
|
|
@@ -6646,10 +6316,10 @@ var __publicField = (obj, key, value) => {
|
|
|
6646
6316
|
} finally {
|
|
6647
6317
|
store.dispatch(setIsFetchingInitialData(false));
|
|
6648
6318
|
}
|
|
6649
|
-
void this.client.
|
|
6650
|
-
void this.client.
|
|
6651
|
-
void this.client.
|
|
6652
|
-
void this.client.
|
|
6319
|
+
void this.client.assetTypes.refreshStore();
|
|
6320
|
+
void this.client.assetStages.refreshStore();
|
|
6321
|
+
void this.client.assets.refreshStore();
|
|
6322
|
+
void this.client.assetStageCompletions.refreshStore();
|
|
6653
6323
|
void this.client.categories.refreshStore();
|
|
6654
6324
|
void this.client.issueTypes.refreshStore();
|
|
6655
6325
|
void this.client.issues.refreshStore();
|
|
@@ -6664,8 +6334,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6664
6334
|
void this.client.issueUpdates.refreshStore();
|
|
6665
6335
|
void this.client.projectAccesses.refreshStore();
|
|
6666
6336
|
void this.client.projectAttachments.refreshStore();
|
|
6667
|
-
void this.client.
|
|
6668
|
-
void this.client.
|
|
6337
|
+
void this.client.assetTypeAttachments.refreshStore();
|
|
6338
|
+
void this.client.assetAttachments.refreshStore();
|
|
6669
6339
|
}
|
|
6670
6340
|
void this.client.teams.refreshStore();
|
|
6671
6341
|
}
|
|
@@ -7061,7 +6731,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7061
6731
|
});
|
|
7062
6732
|
});
|
|
7063
6733
|
}
|
|
7064
|
-
async add(state, initialRevision, url, ownerUser, ownerOrganization,
|
|
6734
|
+
async add(state, initialRevision, url, ownerUser, ownerOrganization, assetTypeId, issueTypeId) {
|
|
7065
6735
|
if (!!ownerUser === !!ownerOrganization) {
|
|
7066
6736
|
throw new Error("Exactly one of ownerUser and ownerOrganization must be defined.");
|
|
7067
6737
|
}
|
|
@@ -7080,7 +6750,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7080
6750
|
favorite: true,
|
|
7081
6751
|
submitted_at: submittedAt,
|
|
7082
6752
|
created_by: currentUser.id,
|
|
7083
|
-
...
|
|
6753
|
+
...assetTypeId && { asset_type: assetTypeId },
|
|
7084
6754
|
...issueTypeId && { issue_type: issueTypeId },
|
|
7085
6755
|
...ownerAttrs
|
|
7086
6756
|
};
|
|
@@ -7104,11 +6774,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7104
6774
|
} : void 0,
|
|
7105
6775
|
payload: {
|
|
7106
6776
|
...offlineFormPayload,
|
|
7107
|
-
...
|
|
6777
|
+
...assetTypeId && { asset_type: assetTypeId },
|
|
7108
6778
|
...issueTypeId && { issue_type: issueTypeId },
|
|
7109
6779
|
initial_revision: payloadWithoutImage
|
|
7110
6780
|
},
|
|
7111
|
-
blockers:
|
|
6781
|
+
blockers: assetTypeId ? [assetTypeId] : issueTypeId ? [issueTypeId] : [],
|
|
7112
6782
|
blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
|
|
7113
6783
|
});
|
|
7114
6784
|
const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
|
|
@@ -7132,7 +6802,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7132
6802
|
`/forms/in-organization/${activeOrganizationId}/`,
|
|
7133
6803
|
void 0,
|
|
7134
6804
|
activeOrganizationId,
|
|
7135
|
-
attachedTo && "
|
|
6805
|
+
attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
|
|
7136
6806
|
attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
|
|
7137
6807
|
);
|
|
7138
6808
|
}
|
|
@@ -7145,7 +6815,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7145
6815
|
"/forms/my-forms/",
|
|
7146
6816
|
currentUser.id,
|
|
7147
6817
|
void 0,
|
|
7148
|
-
attachedTo && "
|
|
6818
|
+
attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
|
|
7149
6819
|
attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
|
|
7150
6820
|
);
|
|
7151
6821
|
}
|
|
@@ -7313,8 +6983,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7313
6983
|
url: `/forms/submission/${submission.offline_id}/attachments/`,
|
|
7314
6984
|
payload: submissionAttachmentPayload,
|
|
7315
6985
|
blockers: [
|
|
7316
|
-
submission.
|
|
7317
|
-
submission.
|
|
6986
|
+
submission.asset,
|
|
6987
|
+
submission.asset_stage,
|
|
7318
6988
|
submission.issue,
|
|
7319
6989
|
submission.form_revision
|
|
7320
6990
|
].filter((x) => x !== void 0),
|
|
@@ -7350,7 +7020,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7350
7020
|
method: HttpMethod.POST,
|
|
7351
7021
|
url: `/forms/revisions/${payload.form_revision}/respond/`,
|
|
7352
7022
|
payload: { ...offlineSubmission, project: activeProjectId },
|
|
7353
|
-
blockers: [payload.issue, payload.
|
|
7023
|
+
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
7354
7024
|
(x) => x !== void 0
|
|
7355
7025
|
),
|
|
7356
7026
|
blocks: [payload.offline_id]
|
|
@@ -7368,10 +7038,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7368
7038
|
const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
|
|
7369
7039
|
return [offlineSubmission, settledPromise];
|
|
7370
7040
|
}
|
|
7371
|
-
// Note currently the bulkAdd method is specific to form submissions for
|
|
7041
|
+
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
7372
7042
|
// TODO: adapt the support bulk adding to any model type
|
|
7373
7043
|
async bulkAdd(args) {
|
|
7374
|
-
const { formRevision, values: argsValues,
|
|
7044
|
+
const { formRevision, values: argsValues, assetOfflineIds } = args;
|
|
7375
7045
|
const { store } = this.client;
|
|
7376
7046
|
const offlineSubmissions = [];
|
|
7377
7047
|
const offlineAttachments = [];
|
|
@@ -7381,16 +7051,16 @@ var __publicField = (obj, key, value) => {
|
|
|
7381
7051
|
const { values, files } = separateFilesFromValues(argsValues);
|
|
7382
7052
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7383
7053
|
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7384
|
-
for (const
|
|
7054
|
+
for (const assetId of assetOfflineIds) {
|
|
7385
7055
|
const submission = offline({
|
|
7386
7056
|
form_revision: formRevision,
|
|
7387
7057
|
values,
|
|
7388
7058
|
created_by: createdBy,
|
|
7389
7059
|
submitted_at: submittedAt,
|
|
7390
|
-
|
|
7060
|
+
asset: assetId
|
|
7391
7061
|
});
|
|
7392
7062
|
submissionOfflineIds.push(submission.offline_id);
|
|
7393
|
-
submissionsPayload.push({ offline_id: submission.offline_id,
|
|
7063
|
+
submissionsPayload.push({ offline_id: submission.offline_id, asset_id: assetId });
|
|
7394
7064
|
offlineSubmissions.push(submission);
|
|
7395
7065
|
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
7396
7066
|
for (const file of fileArray) {
|
|
@@ -7437,7 +7107,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7437
7107
|
attachments: attachmentsPayload,
|
|
7438
7108
|
files: Object.values(filesRecord)
|
|
7439
7109
|
},
|
|
7440
|
-
blockers:
|
|
7110
|
+
blockers: assetOfflineIds,
|
|
7441
7111
|
blocks: submissionOfflineIds
|
|
7442
7112
|
});
|
|
7443
7113
|
promise.then(({ submissions, attachments, presigned_urls }) => {
|
|
@@ -7480,7 +7150,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7480
7150
|
method: HttpMethod.PATCH,
|
|
7481
7151
|
url: `/forms/submissions/${submission.offline_id}/`,
|
|
7482
7152
|
payload: offlineSubmission,
|
|
7483
|
-
blockers: [offlineSubmission.issue, offlineSubmission.
|
|
7153
|
+
blockers: [offlineSubmission.issue, offlineSubmission.asset, offlineSubmission.asset_stage].filter(
|
|
7484
7154
|
(x) => x !== void 0
|
|
7485
7155
|
),
|
|
7486
7156
|
blocks: [offlineSubmission.offline_id]
|
|
@@ -8327,13 +7997,16 @@ var __publicField = (obj, key, value) => {
|
|
|
8327
7997
|
queryParams: { conversation_id: conversationId }
|
|
8328
7998
|
}).then((response) => {
|
|
8329
7999
|
const conversation = store.getState().agentsReducer.conversations[conversationId];
|
|
8330
|
-
if (!conversation) {
|
|
8000
|
+
if (!(conversation == null ? void 0 : conversation.offline_id)) {
|
|
8331
8001
|
throw new Error("Conversation not found");
|
|
8332
8002
|
}
|
|
8003
|
+
if (!Array.isArray(response)) {
|
|
8004
|
+
response = [response];
|
|
8005
|
+
}
|
|
8333
8006
|
store.dispatch(
|
|
8334
8007
|
updateConversation({
|
|
8335
|
-
|
|
8336
|
-
tiptap_content: [...conversation.tiptap_content || [], response
|
|
8008
|
+
...conversation,
|
|
8009
|
+
tiptap_content: [...conversation.tiptap_content || [], ...response]
|
|
8337
8010
|
})
|
|
8338
8011
|
);
|
|
8339
8012
|
});
|
|
@@ -8566,12 +8239,12 @@ var __publicField = (obj, key, value) => {
|
|
|
8566
8239
|
__publicField(this, "issueAttachments", new IssueAttachmentService(this));
|
|
8567
8240
|
__publicField(this, "workspaces", new WorkspaceService(this));
|
|
8568
8241
|
__publicField(this, "main", new MainService(this));
|
|
8569
|
-
__publicField(this, "
|
|
8570
|
-
__publicField(this, "
|
|
8571
|
-
__publicField(this, "
|
|
8572
|
-
__publicField(this, "
|
|
8573
|
-
__publicField(this, "
|
|
8574
|
-
__publicField(this, "
|
|
8242
|
+
__publicField(this, "assets", new AssetService(this));
|
|
8243
|
+
__publicField(this, "assetAttachments", new AssetAttachmentService(this));
|
|
8244
|
+
__publicField(this, "assetTypes", new AssetTypeService(this));
|
|
8245
|
+
__publicField(this, "assetTypeAttachments", new AssetTypeAttachmentService(this));
|
|
8246
|
+
__publicField(this, "assetStages", new AssetStageService(this));
|
|
8247
|
+
__publicField(this, "assetStageCompletions", new AssetStageCompletionService(this));
|
|
8575
8248
|
__publicField(this, "userForms", new UserFormService(this));
|
|
8576
8249
|
__publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
|
|
8577
8250
|
__publicField(this, "projects", new ProjectService(this));
|
|
@@ -14393,7 +14066,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14393
14066
|
const useFileViewer = () => React.useContext(FileViewerContext);
|
|
14394
14067
|
const FileViewerProvider = React.memo((props) => {
|
|
14395
14068
|
const { children } = props;
|
|
14396
|
-
const [
|
|
14069
|
+
const [config, setConfig] = React.useState(null);
|
|
14397
14070
|
const [fileType, setFileType] = React.useState(null);
|
|
14398
14071
|
const closeFileViewer = React.useCallback(() => {
|
|
14399
14072
|
setConfig(null);
|
|
@@ -14406,16 +14079,16 @@ var __publicField = (obj, key, value) => {
|
|
|
14406
14079
|
[closeFileViewer]
|
|
14407
14080
|
);
|
|
14408
14081
|
const handleClose = React.useCallback(() => {
|
|
14409
|
-
if (!
|
|
14082
|
+
if (!config)
|
|
14410
14083
|
return;
|
|
14411
|
-
if (
|
|
14412
|
-
|
|
14084
|
+
if (config.onClose)
|
|
14085
|
+
config.onClose();
|
|
14413
14086
|
closeFileViewer();
|
|
14414
|
-
}, [closeFileViewer,
|
|
14087
|
+
}, [closeFileViewer, config]);
|
|
14415
14088
|
React.useEffect(() => {
|
|
14416
|
-
if (!
|
|
14089
|
+
if (!config)
|
|
14417
14090
|
return;
|
|
14418
|
-
const { file } =
|
|
14091
|
+
const { file } = config;
|
|
14419
14092
|
if (SUPPORTED_SPREADSHEET_FILE_EXTENSIONS.includes(file.type)) {
|
|
14420
14093
|
setFileType("spreadsheet");
|
|
14421
14094
|
return;
|
|
@@ -14428,14 +14101,14 @@ var __publicField = (obj, key, value) => {
|
|
|
14428
14101
|
setFileType("image");
|
|
14429
14102
|
return;
|
|
14430
14103
|
}
|
|
14431
|
-
}, [
|
|
14104
|
+
}, [config]);
|
|
14432
14105
|
const value = React.useMemo(() => openFileViewer, [openFileViewer]);
|
|
14433
14106
|
return /* @__PURE__ */ jsxRuntime.jsxs(FileViewerContext.Provider, { value, children: [
|
|
14434
14107
|
children,
|
|
14435
|
-
|
|
14436
|
-
fileType === "spreadsheet" && /* @__PURE__ */ jsxRuntime.jsx(SpreadsheetViewer, { file:
|
|
14437
|
-
fileType === "pdf" && /* @__PURE__ */ jsxRuntime.jsx(PDFViewer, { file:
|
|
14438
|
-
fileType === "image" && /* @__PURE__ */ jsxRuntime.jsx(ImageViewer, { file:
|
|
14108
|
+
config && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14109
|
+
fileType === "spreadsheet" && /* @__PURE__ */ jsxRuntime.jsx(SpreadsheetViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose }),
|
|
14110
|
+
fileType === "pdf" && /* @__PURE__ */ jsxRuntime.jsx(PDFViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose }),
|
|
14111
|
+
fileType === "image" && /* @__PURE__ */ jsxRuntime.jsx(ImageViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose })
|
|
14439
14112
|
] })
|
|
14440
14113
|
] });
|
|
14441
14114
|
});
|
|
@@ -15134,7 +14807,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15134
14807
|
};
|
|
15135
14808
|
const useAttachImagesToFormRevisionFields = (revision) => {
|
|
15136
14809
|
const { sdk } = useSDK();
|
|
15137
|
-
const attachments =
|
|
14810
|
+
const attachments = reactRedux.useSelector(selectAttachmentsOfFormRevision((revision == null ? void 0 : revision.offline_id) ?? ""));
|
|
15138
14811
|
return React.useMemo(() => {
|
|
15139
14812
|
if (!revision || !attachments)
|
|
15140
14813
|
return revision;
|
|
@@ -15216,7 +14889,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15216
14889
|
const FormSubmissionViewer = React.memo(
|
|
15217
14890
|
React.forwardRef((props, ref) => {
|
|
15218
14891
|
const { submission, showFormDescription = false, showFormTitle = true } = props;
|
|
15219
|
-
const revision =
|
|
14892
|
+
const revision = reactRedux.useSelector(selectFormRevision(submission.form_revision));
|
|
15220
14893
|
const { sdk } = useSDK();
|
|
15221
14894
|
if (!revision) {
|
|
15222
14895
|
throw new Error(
|
|
@@ -15281,11 +14954,11 @@ var __publicField = (obj, key, value) => {
|
|
|
15281
14954
|
}
|
|
15282
14955
|
return ret;
|
|
15283
14956
|
}, [filter, maxResults, ownerFilter]);
|
|
15284
|
-
const userForms =
|
|
15285
|
-
const userFormMapping =
|
|
15286
|
-
const attachableUserForms = userForms.filter((form) => !form.
|
|
14957
|
+
const userForms = reactRedux.useSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
|
|
14958
|
+
const userFormMapping = reactRedux.useSelector(selectFormMapping);
|
|
14959
|
+
const attachableUserForms = userForms.filter((form) => !form.asset_type && !form.issue_type);
|
|
15287
14960
|
const attachableUserFormMapping = Object.values(userFormMapping).filter(
|
|
15288
|
-
(form) => !form.
|
|
14961
|
+
(form) => !form.asset_type
|
|
15289
14962
|
);
|
|
15290
14963
|
const handleToggleFavorite = React.useCallback(
|
|
15291
14964
|
(form) => {
|
|
@@ -15315,7 +14988,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15315
14988
|
const handleChange = React.useCallback((e) => {
|
|
15316
14989
|
setFilter(e.currentTarget.value);
|
|
15317
14990
|
}, []);
|
|
15318
|
-
const numberOfForms =
|
|
14991
|
+
const numberOfForms = reactRedux.useSelector(selectGeneralFormCount) || 0;
|
|
15319
14992
|
const numberOfHiddenForms = numberOfForms - attachableUserForms.length;
|
|
15320
14993
|
const overflowMessage = attachableUserForms.length == maxResults && numberOfHiddenForms > 0 ? `Only the first ${maxResults} results are shown (${numberOfHiddenForms} hidden)` : numberOfHiddenForms > 0 && `${numberOfHiddenForms} hidden forms`;
|
|
15321
14994
|
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { ref, direction: "column", gap: "2", children: [
|
|
@@ -15350,9 +15023,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15350
15023
|
const FormBrowserEntry = (props) => {
|
|
15351
15024
|
var _a2;
|
|
15352
15025
|
const { form, onSelectForm, isFavoriteEditable, handleToggleFavorite } = props;
|
|
15353
|
-
const ownerOrganization = (_a2 =
|
|
15354
|
-
const ownerUser =
|
|
15355
|
-
const currentUserId =
|
|
15026
|
+
const ownerOrganization = (_a2 = reactRedux.useSelector(selectOrganization(form.owner_organization || -1))) == null ? void 0 : _a2.name;
|
|
15027
|
+
const ownerUser = reactRedux.useSelector(selectUser(form.owner_user || -1));
|
|
15028
|
+
const currentUserId = reactRedux.useSelector(selectCurrentUser).id;
|
|
15356
15029
|
const ownedByCurrentUser = !!ownerUser && ownerUser.id === currentUserId;
|
|
15357
15030
|
const owner = ownerOrganization ?? (ownedByCurrentUser ? "You" : ownerUser == null ? void 0 : ownerUser.username) ?? "Unknown";
|
|
15358
15031
|
const handleFavoriteClick = React.useCallback(
|
|
@@ -15407,15 +15080,15 @@ var __publicField = (obj, key, value) => {
|
|
|
15407
15080
|
const FormSubmissionBrowserEntry = React.memo((props) => {
|
|
15408
15081
|
var _a2;
|
|
15409
15082
|
const { submission, onSubmissionClick, compact, labelType, rowDecorator } = props;
|
|
15410
|
-
const currentUser =
|
|
15411
|
-
const createdBy =
|
|
15083
|
+
const currentUser = reactRedux.useSelector(selectCurrentUser);
|
|
15084
|
+
const createdBy = reactRedux.useSelector(selectUser("created_by" in submission ? submission.created_by : currentUser.id));
|
|
15412
15085
|
const dateToUse = submission.submitted_at;
|
|
15413
15086
|
const formattedDateTime = getLocalDateString(dateToUse);
|
|
15414
|
-
const revision =
|
|
15087
|
+
const revision = reactRedux.useSelector(selectFormRevision(submission.form_revision));
|
|
15415
15088
|
if (!revision) {
|
|
15416
15089
|
throw new Error(`Could not find revision ${submission.form_revision} for submission ${submission.offline_id}.`);
|
|
15417
15090
|
}
|
|
15418
|
-
const latestRevisionNumber = (_a2 =
|
|
15091
|
+
const latestRevisionNumber = (_a2 = reactRedux.useSelector(selectLatestFormRevisionOfForm(revision.form))) == null ? void 0 : _a2.revision;
|
|
15419
15092
|
const creatorProfileSrc = useFileSrc({
|
|
15420
15093
|
file: (createdBy == null ? void 0 : createdBy.profile.file) ?? null,
|
|
15421
15094
|
fileSha1: (createdBy == null ? void 0 : createdBy.profile.file_sha1) ?? null
|
|
@@ -15459,7 +15132,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15459
15132
|
if (!!formId2 === !!propSubmissions) {
|
|
15460
15133
|
throw new Error("Either formId or submissions must be provided, but not both.");
|
|
15461
15134
|
}
|
|
15462
|
-
const submissions =
|
|
15135
|
+
const submissions = reactRedux.useSelector(propSubmissions ? () => propSubmissions : selectFormSubmissionsOfForm(formId2));
|
|
15463
15136
|
const sortedSubmissions = React.useMemo(
|
|
15464
15137
|
() => submissions == null ? void 0 : submissions.sort((a, b) => {
|
|
15465
15138
|
return a.submitted_at.localeCompare(b.submitted_at);
|
|
@@ -15717,7 +15390,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15717
15390
|
const formId = "form-builder";
|
|
15718
15391
|
const fieldsToChoose = [
|
|
15719
15392
|
["string", "text"],
|
|
15720
|
-
["select", "multi-select", "upload"],
|
|
15393
|
+
["select", "multi-select", "upload", "qr"],
|
|
15721
15394
|
["boolean", "date", "number", "multi-string"]
|
|
15722
15395
|
];
|
|
15723
15396
|
const CompleteFieldTypeToClsMapping = {
|
|
@@ -16689,6 +16362,13 @@ var __publicField = (obj, key, value) => {
|
|
|
16689
16362
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16690
16363
|
exports2.APIError = APIError;
|
|
16691
16364
|
exports2.AgentService = AgentService;
|
|
16365
|
+
exports2.AssetAttachmentService = AssetAttachmentService;
|
|
16366
|
+
exports2.AssetService = AssetService;
|
|
16367
|
+
exports2.AssetStageColors = AssetStageColors;
|
|
16368
|
+
exports2.AssetStageCompletionService = AssetStageCompletionService;
|
|
16369
|
+
exports2.AssetStageService = AssetStageService;
|
|
16370
|
+
exports2.AssetTypeAttachmentService = AssetTypeAttachmentService;
|
|
16371
|
+
exports2.AssetTypeService = AssetTypeService;
|
|
16692
16372
|
exports2.AttachmentModel = AttachmentModel;
|
|
16693
16373
|
exports2.AuthService = AuthService;
|
|
16694
16374
|
exports2.BaseApiService = BaseApiService;
|
|
@@ -16700,13 +16380,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16700
16380
|
exports2.ColorPicker = ColorPicker;
|
|
16701
16381
|
exports2.Colors = Colors;
|
|
16702
16382
|
exports2.ColorsToString = ColorsToString;
|
|
16703
|
-
exports2.ComponentAttachmentService = ComponentAttachmentService;
|
|
16704
|
-
exports2.ComponentService = ComponentService;
|
|
16705
|
-
exports2.ComponentStageColors = ComponentStageColors;
|
|
16706
|
-
exports2.ComponentStageCompletionService = ComponentStageCompletionService;
|
|
16707
|
-
exports2.ComponentStageService = ComponentStageService;
|
|
16708
|
-
exports2.ComponentTypeAttachmentService = ComponentTypeAttachmentService;
|
|
16709
|
-
exports2.ComponentTypeService = ComponentTypeService;
|
|
16710
16383
|
exports2.DEFAULT_ISSUE_PRIORITY = DEFAULT_ISSUE_PRIORITY;
|
|
16711
16384
|
exports2.DEFAULT_ISSUE_STATUS = DEFAULT_ISSUE_STATUS;
|
|
16712
16385
|
exports2.DateField = DateField;
|
|
@@ -16798,14 +16471,14 @@ var __publicField = (obj, key, value) => {
|
|
|
16798
16471
|
exports2.acceptProjectInvite = acceptProjectInvite;
|
|
16799
16472
|
exports2.addActiveProjectFormSubmissionsCount = addActiveProjectFormSubmissionsCount;
|
|
16800
16473
|
exports2.addActiveProjectIssuesCount = addActiveProjectIssuesCount;
|
|
16474
|
+
exports2.addAsset = addAsset;
|
|
16475
|
+
exports2.addAssetAttachment = addAssetAttachment;
|
|
16476
|
+
exports2.addAssetAttachments = addAssetAttachments;
|
|
16477
|
+
exports2.addAssetType = addAssetType;
|
|
16478
|
+
exports2.addAssetTypeAttachment = addAssetTypeAttachment;
|
|
16479
|
+
exports2.addAssetTypeAttachments = addAssetTypeAttachments;
|
|
16480
|
+
exports2.addAssetsInBatches = addAssetsInBatches;
|
|
16801
16481
|
exports2.addCategory = addCategory;
|
|
16802
|
-
exports2.addComponent = addComponent;
|
|
16803
|
-
exports2.addComponentAttachment = addComponentAttachment;
|
|
16804
|
-
exports2.addComponentAttachments = addComponentAttachments;
|
|
16805
|
-
exports2.addComponentType = addComponentType;
|
|
16806
|
-
exports2.addComponentTypeAttachment = addComponentTypeAttachment;
|
|
16807
|
-
exports2.addComponentTypeAttachments = addComponentTypeAttachments;
|
|
16808
|
-
exports2.addComponentsInBatches = addComponentsInBatches;
|
|
16809
16482
|
exports2.addConversation = addConversation;
|
|
16810
16483
|
exports2.addDocumentAttachment = addDocumentAttachment;
|
|
16811
16484
|
exports2.addDocumentAttachments = addDocumentAttachments;
|
|
@@ -16850,6 +16523,14 @@ var __publicField = (obj, key, value) => {
|
|
|
16850
16523
|
exports2.agentsReducer = agentsReducer;
|
|
16851
16524
|
exports2.agentsSlice = agentsSlice;
|
|
16852
16525
|
exports2.areArraysEqual = areArraysEqual;
|
|
16526
|
+
exports2.assetReducer = assetReducer;
|
|
16527
|
+
exports2.assetSlice = assetSlice;
|
|
16528
|
+
exports2.assetStageCompletionReducer = assetStageCompletionReducer;
|
|
16529
|
+
exports2.assetStageCompletionSlice = assetStageCompletionSlice;
|
|
16530
|
+
exports2.assetStageReducer = assetStageReducer;
|
|
16531
|
+
exports2.assetStageSlice = assetStageSlice;
|
|
16532
|
+
exports2.assetTypeReducer = assetTypeReducer;
|
|
16533
|
+
exports2.assetTypeSlice = assetTypeSlice;
|
|
16853
16534
|
exports2.authReducer = authReducer;
|
|
16854
16535
|
exports2.authSlice = authSlice;
|
|
16855
16536
|
exports2.blobToBase64 = blobToBase64;
|
|
@@ -16859,14 +16540,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16859
16540
|
exports2.classNames = classNames$1;
|
|
16860
16541
|
exports2.cleanRecentIssues = cleanRecentIssues;
|
|
16861
16542
|
exports2.clearTokens = clearTokens;
|
|
16862
|
-
exports2.componentReducer = componentReducer;
|
|
16863
|
-
exports2.componentSlice = componentSlice;
|
|
16864
|
-
exports2.componentStageCompletionReducer = componentStageCompletionReducer;
|
|
16865
|
-
exports2.componentStageCompletionSlice = componentStageCompletionSlice;
|
|
16866
|
-
exports2.componentStageReducer = componentStageReducer;
|
|
16867
|
-
exports2.componentStageSlice = componentStageSlice;
|
|
16868
|
-
exports2.componentTypeReducer = componentTypeReducer;
|
|
16869
|
-
exports2.componentTypeSlice = componentTypeSlice;
|
|
16870
16543
|
exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
|
|
16871
16544
|
exports2.coordinatesAreEqual = coordinatesAreEqual;
|
|
16872
16545
|
exports2.coordinatesToLiteral = coordinatesToLiteral;
|
|
@@ -16876,8 +16549,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16876
16549
|
exports2.createOfflineAction = createOfflineAction;
|
|
16877
16550
|
exports2.createPointMarker = createPointMarker;
|
|
16878
16551
|
exports2.defaultBadgeColor = defaultBadgeColor;
|
|
16879
|
-
exports2.
|
|
16880
|
-
exports2.deleteComponentType = deleteComponentType;
|
|
16552
|
+
exports2.deleteAssetType = deleteAssetType;
|
|
16881
16553
|
exports2.deleteForm = deleteForm;
|
|
16882
16554
|
exports2.deleteFormRevision = deleteFormRevision;
|
|
16883
16555
|
exports2.deleteFormRevisionAttachment = deleteFormRevisionAttachment;
|
|
@@ -16926,7 +16598,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16926
16598
|
exports2.formSubmissionReducer = formSubmissionReducer;
|
|
16927
16599
|
exports2.formSubmissionSlice = formSubmissionSlice;
|
|
16928
16600
|
exports2.forms = index;
|
|
16929
|
-
exports2.
|
|
16601
|
+
exports2.fullAssetMarkerSize = fullAssetMarkerSize;
|
|
16930
16602
|
exports2.generateBadgeColors = generateBadgeColors;
|
|
16931
16603
|
exports2.genericMemo = genericMemo;
|
|
16932
16604
|
exports2.getFileIdentifier = getFileIdentifier;
|
|
@@ -16976,6 +16648,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16976
16648
|
exports2.overmapEnhancer = overmapEnhancer;
|
|
16977
16649
|
exports2.overmapReducer = overmapReducer;
|
|
16978
16650
|
exports2.overmapReducers = overmapReducers;
|
|
16651
|
+
exports2.overmapRootReducer = overmapRootReducer;
|
|
16979
16652
|
exports2.patchCategory = patchCategory;
|
|
16980
16653
|
exports2.performRequest = performRequest;
|
|
16981
16654
|
exports2.primaryColor = primaryColor;
|
|
@@ -16987,15 +16660,15 @@ var __publicField = (obj, key, value) => {
|
|
|
16987
16660
|
exports2.projectSlice = projectSlice;
|
|
16988
16661
|
exports2.rehydratedReducer = rehydratedReducer;
|
|
16989
16662
|
exports2.rehydratedSlice = rehydratedSlice;
|
|
16990
|
-
exports2.
|
|
16663
|
+
exports2.removeAllAssetsOfType = removeAllAssetsOfType;
|
|
16664
|
+
exports2.removeAsset = removeAsset;
|
|
16665
|
+
exports2.removeAssetAttachment = removeAssetAttachment;
|
|
16666
|
+
exports2.removeAssetAttachments = removeAssetAttachments;
|
|
16667
|
+
exports2.removeAssetTypeAttachment = removeAssetTypeAttachment;
|
|
16668
|
+
exports2.removeAssetTypeAttachments = removeAssetTypeAttachments;
|
|
16991
16669
|
exports2.removeAttachmentsOfIssue = removeAttachmentsOfIssue;
|
|
16992
16670
|
exports2.removeCategory = removeCategory;
|
|
16993
16671
|
exports2.removeColor = removeColor;
|
|
16994
|
-
exports2.removeComponent = removeComponent;
|
|
16995
|
-
exports2.removeComponentAttachment = removeComponentAttachment;
|
|
16996
|
-
exports2.removeComponentAttachments = removeComponentAttachments;
|
|
16997
|
-
exports2.removeComponentTypeAttachment = removeComponentTypeAttachment;
|
|
16998
|
-
exports2.removeComponentTypeAttachments = removeComponentTypeAttachments;
|
|
16999
16672
|
exports2.removeDocumentAttachment = removeDocumentAttachment;
|
|
17000
16673
|
exports2.removeDocumentAttachments = removeDocumentAttachments;
|
|
17001
16674
|
exports2.removeDocuments = removeDocuments;
|
|
@@ -17027,7 +16700,6 @@ var __publicField = (obj, key, value) => {
|
|
|
17027
16700
|
exports2.resetRecentIssues = resetRecentIssues;
|
|
17028
16701
|
exports2.resetStore = resetStore;
|
|
17029
16702
|
exports2.restructureCreateSelectorWithArgs = restructureCreateSelectorWithArgs;
|
|
17030
|
-
exports2.rootReducer = rootReducer;
|
|
17031
16703
|
exports2.saveActiveProjectFileBounds = saveActiveProjectFileBounds;
|
|
17032
16704
|
exports2.searchIssues = searchIssues;
|
|
17033
16705
|
exports2.selectAccessToken = selectAccessToken;
|
|
@@ -17046,16 +16718,31 @@ var __publicField = (obj, key, value) => {
|
|
|
17046
16718
|
exports2.selectActiveWorkspace = selectActiveWorkspace;
|
|
17047
16719
|
exports2.selectActiveWorkspaceId = selectActiveWorkspaceId;
|
|
17048
16720
|
exports2.selectAllAttachments = selectAllAttachments;
|
|
17049
|
-
exports2.selectAllComponentAttachments = selectAllComponentAttachments;
|
|
17050
|
-
exports2.selectAllComponentTypeAttachments = selectAllComponentTypeAttachments;
|
|
17051
16721
|
exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
|
|
17052
16722
|
exports2.selectAllProjectAttachments = selectAllProjectAttachments;
|
|
17053
16723
|
exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
|
|
17054
16724
|
exports2.selectAppearance = selectAppearance;
|
|
17055
|
-
exports2.
|
|
17056
|
-
exports2.
|
|
17057
|
-
exports2.
|
|
17058
|
-
exports2.
|
|
16725
|
+
exports2.selectAsset = selectAsset;
|
|
16726
|
+
exports2.selectAssetAttachment = selectAssetAttachment;
|
|
16727
|
+
exports2.selectAssetAttachmentMapping = selectAssetAttachmentMapping;
|
|
16728
|
+
exports2.selectAssetAttachments = selectAssetAttachments;
|
|
16729
|
+
exports2.selectAssetToAssetTypeMapping = selectAssetToAssetTypeMapping;
|
|
16730
|
+
exports2.selectAssetType = selectAssetType;
|
|
16731
|
+
exports2.selectAssetTypeAttachment = selectAssetTypeAttachment;
|
|
16732
|
+
exports2.selectAssetTypeAttachmentMapping = selectAssetTypeAttachmentMapping;
|
|
16733
|
+
exports2.selectAssetTypeAttachments = selectAssetTypeAttachments;
|
|
16734
|
+
exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
|
|
16735
|
+
exports2.selectAssetTypes = selectAssetTypes;
|
|
16736
|
+
exports2.selectAssetTypesByName = selectAssetTypesByName;
|
|
16737
|
+
exports2.selectAssetTypesFromIds = selectAssetTypesFromIds;
|
|
16738
|
+
exports2.selectAssetTypesMapping = selectAssetTypesMapping;
|
|
16739
|
+
exports2.selectAssets = selectAssets;
|
|
16740
|
+
exports2.selectAssetsMapping = selectAssetsMapping;
|
|
16741
|
+
exports2.selectAssetsOfAssetType = selectAssetsOfAssetType;
|
|
16742
|
+
exports2.selectAttachmentsOfAsset = selectAttachmentsOfAsset;
|
|
16743
|
+
exports2.selectAttachmentsOfAssetByType = selectAttachmentsOfAssetByType;
|
|
16744
|
+
exports2.selectAttachmentsOfAssetType = selectAttachmentsOfAssetType;
|
|
16745
|
+
exports2.selectAttachmentsOfAssetTypeByType = selectAttachmentsOfAssetTypeByType;
|
|
17059
16746
|
exports2.selectAttachmentsOfDocument = selectAttachmentsOfDocument;
|
|
17060
16747
|
exports2.selectAttachmentsOfDocumentByType = selectAttachmentsOfDocumentByType;
|
|
17061
16748
|
exports2.selectAttachmentsOfFormRevision = selectAttachmentsOfFormRevision;
|
|
@@ -17072,25 +16759,8 @@ var __publicField = (obj, key, value) => {
|
|
|
17072
16759
|
exports2.selectCenterMapToProject = selectCenterMapToProject;
|
|
17073
16760
|
exports2.selectCommentMapping = selectCommentMapping;
|
|
17074
16761
|
exports2.selectCommentsOfIssue = selectCommentsOfIssue;
|
|
17075
|
-
exports2.
|
|
16762
|
+
exports2.selectCompletedStageIdsForAsset = selectCompletedStageIdsForAsset;
|
|
17076
16763
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
17077
|
-
exports2.selectComponent = selectComponent;
|
|
17078
|
-
exports2.selectComponentAttachment = selectComponentAttachment;
|
|
17079
|
-
exports2.selectComponentAttachmentMapping = selectComponentAttachmentMapping;
|
|
17080
|
-
exports2.selectComponentType = selectComponentType;
|
|
17081
|
-
exports2.selectComponentTypeAttachment = selectComponentTypeAttachment;
|
|
17082
|
-
exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
|
|
17083
|
-
exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
|
|
17084
|
-
exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
|
|
17085
|
-
exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
|
|
17086
|
-
exports2.selectComponentTypes = selectComponentTypes;
|
|
17087
|
-
exports2.selectComponentTypesByName = selectComponentTypesByName;
|
|
17088
|
-
exports2.selectComponentTypesFromIds = selectComponentTypesFromIds;
|
|
17089
|
-
exports2.selectComponentTypesMapping = selectComponentTypesMapping;
|
|
17090
|
-
exports2.selectComponents = selectComponents;
|
|
17091
|
-
exports2.selectComponentsByType = selectComponentsByType;
|
|
17092
|
-
exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
|
|
17093
|
-
exports2.selectComponentsMapping = selectComponentsMapping;
|
|
17094
16764
|
exports2.selectConversation = selectConversation;
|
|
17095
16765
|
exports2.selectConversationMapping = selectConversationMapping;
|
|
17096
16766
|
exports2.selectConversations = selectConversations;
|
|
@@ -17115,7 +16785,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17115
16785
|
exports2.selectFilteredForms = selectFilteredForms;
|
|
17116
16786
|
exports2.selectForm = selectForm;
|
|
17117
16787
|
exports2.selectFormMapping = selectFormMapping;
|
|
17118
|
-
exports2.
|
|
16788
|
+
exports2.selectFormOfAssetType = selectFormOfAssetType;
|
|
17119
16789
|
exports2.selectFormOfIssueType = selectFormOfIssueType;
|
|
17120
16790
|
exports2.selectFormRevision = selectFormRevision;
|
|
17121
16791
|
exports2.selectFormRevisionMapping = selectFormRevisionMapping;
|
|
@@ -17124,16 +16794,16 @@ var __publicField = (obj, key, value) => {
|
|
|
17124
16794
|
exports2.selectFormSubmission = selectFormSubmission;
|
|
17125
16795
|
exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
|
|
17126
16796
|
exports2.selectFormSubmissions = selectFormSubmissions;
|
|
17127
|
-
exports2.
|
|
16797
|
+
exports2.selectFormSubmissionsByAssets = selectFormSubmissionsByAssets;
|
|
17128
16798
|
exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
|
|
17129
16799
|
exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
|
|
17130
|
-
exports2.
|
|
16800
|
+
exports2.selectFormSubmissionsOfAsset = selectFormSubmissionsOfAsset;
|
|
17131
16801
|
exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
|
|
17132
16802
|
exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
|
|
17133
16803
|
exports2.selectFormsCount = selectFormsCount;
|
|
17134
16804
|
exports2.selectGeneralFormCount = selectGeneralFormCount;
|
|
16805
|
+
exports2.selectHiddenAssetTypeIds = selectHiddenAssetTypeIds;
|
|
17135
16806
|
exports2.selectHiddenCategoryCount = selectHiddenCategoryCount;
|
|
17136
|
-
exports2.selectHiddenComponentTypeIds = selectHiddenComponentTypeIds;
|
|
17137
16807
|
exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
|
|
17138
16808
|
exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
|
|
17139
16809
|
exports2.selectIsLoading = selectIsLoading;
|
|
@@ -17155,7 +16825,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17155
16825
|
exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
|
|
17156
16826
|
exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
|
|
17157
16827
|
exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
|
|
17158
|
-
exports2.
|
|
16828
|
+
exports2.selectLatestFormRevisionsOfAssetTypes = selectLatestFormRevisionsOfAssetTypes;
|
|
17159
16829
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
17160
16830
|
exports2.selectLicense = selectLicense;
|
|
17161
16831
|
exports2.selectLicenseForProject = selectLicenseForProject;
|
|
@@ -17163,8 +16833,8 @@ var __publicField = (obj, key, value) => {
|
|
|
17163
16833
|
exports2.selectLicensesForProjectsMapping = selectLicensesForProjectsMapping;
|
|
17164
16834
|
exports2.selectMainWorkspace = selectMainWorkspace;
|
|
17165
16835
|
exports2.selectMapStyle = selectMapStyle;
|
|
17166
|
-
exports2.
|
|
17167
|
-
exports2.
|
|
16836
|
+
exports2.selectNumberOfAssetTypesMatchingCaseInsensitiveName = selectNumberOfAssetTypesMatchingCaseInsensitiveName;
|
|
16837
|
+
exports2.selectNumberOfAssetsOfAssetType = selectNumberOfAssetsOfAssetType;
|
|
17168
16838
|
exports2.selectOrganization = selectOrganization;
|
|
17169
16839
|
exports2.selectOrganizationAccess = selectOrganizationAccess;
|
|
17170
16840
|
exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
|
|
@@ -17205,9 +16875,9 @@ var __publicField = (obj, key, value) => {
|
|
|
17205
16875
|
exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
|
|
17206
16876
|
exports2.selectStageMapping = selectStageMapping;
|
|
17207
16877
|
exports2.selectStages = selectStages;
|
|
17208
|
-
exports2.
|
|
17209
|
-
exports2.selectStagesFromComponentTypeIds = selectStagesFromComponentTypeIds;
|
|
16878
|
+
exports2.selectStagesFromAssetTypeIds = selectStagesFromAssetTypeIds;
|
|
17210
16879
|
exports2.selectStagesFromStageIds = selectStagesFromStageIds;
|
|
16880
|
+
exports2.selectStagesOfAssetType = selectStagesOfAssetType;
|
|
17211
16881
|
exports2.selectTeam = selectTeam;
|
|
17212
16882
|
exports2.selectTeams = selectTeams;
|
|
17213
16883
|
exports2.selectTeamsMapping = selectTeamsMapping;
|
|
@@ -17229,14 +16899,14 @@ var __publicField = (obj, key, value) => {
|
|
|
17229
16899
|
exports2.setActiveProjectId = setActiveProjectId;
|
|
17230
16900
|
exports2.setActiveWorkspaceId = setActiveWorkspaceId;
|
|
17231
16901
|
exports2.setAppearance = setAppearance;
|
|
16902
|
+
exports2.setAssetAttachment = setAssetAttachment;
|
|
16903
|
+
exports2.setAssetAttachments = setAssetAttachments;
|
|
16904
|
+
exports2.setAssetTypeAttachment = setAssetTypeAttachment;
|
|
16905
|
+
exports2.setAssetTypeAttachments = setAssetTypeAttachments;
|
|
16906
|
+
exports2.setAssetTypes = setAssetTypes;
|
|
16907
|
+
exports2.setAssets = setAssets;
|
|
17232
16908
|
exports2.setCategories = setCategories;
|
|
17233
16909
|
exports2.setCenterMapToProject = setCenterMapToProject;
|
|
17234
|
-
exports2.setComponentAttachment = setComponentAttachment;
|
|
17235
|
-
exports2.setComponentAttachments = setComponentAttachments;
|
|
17236
|
-
exports2.setComponentTypeAttachment = setComponentTypeAttachment;
|
|
17237
|
-
exports2.setComponentTypeAttachments = setComponentTypeAttachments;
|
|
17238
|
-
exports2.setComponentTypes = setComponentTypes;
|
|
17239
|
-
exports2.setComponents = setComponents;
|
|
17240
16910
|
exports2.setConversation = setConversation;
|
|
17241
16911
|
exports2.setConversations = setConversations;
|
|
17242
16912
|
exports2.setCreateProjectType = setCreateProjectType;
|
|
@@ -17299,18 +16969,18 @@ var __publicField = (obj, key, value) => {
|
|
|
17299
16969
|
exports2.teamSlice = teamSlice;
|
|
17300
16970
|
exports2.toFileNameSafeString = toFileNameSafeString;
|
|
17301
16971
|
exports2.toOfflineIdRecord = toOfflineIdRecord;
|
|
17302
|
-
exports2.
|
|
16972
|
+
exports2.toggleAssetTypeVisibility = toggleAssetTypeVisibility;
|
|
17303
16973
|
exports2.truncate = truncate;
|
|
17304
16974
|
exports2.unfavoriteForm = unfavoriteForm;
|
|
17305
16975
|
exports2.unhideAllCategories = unhideAllCategories;
|
|
17306
16976
|
exports2.unhideCategory = unhideCategory;
|
|
17307
16977
|
exports2.unlinkStageToForm = unlinkStageToForm;
|
|
17308
16978
|
exports2.updateActiveOrganization = updateActiveOrganization;
|
|
17309
|
-
exports2.
|
|
17310
|
-
exports2.
|
|
17311
|
-
exports2.
|
|
17312
|
-
exports2.
|
|
17313
|
-
exports2.
|
|
16979
|
+
exports2.updateAsset = updateAsset;
|
|
16980
|
+
exports2.updateAssetAttachment = updateAssetAttachment;
|
|
16981
|
+
exports2.updateAssetAttachments = updateAssetAttachments;
|
|
16982
|
+
exports2.updateAssetTypeAttachment = updateAssetTypeAttachment;
|
|
16983
|
+
exports2.updateAssetTypeAttachments = updateAssetTypeAttachments;
|
|
17314
16984
|
exports2.updateConversation = updateConversation;
|
|
17315
16985
|
exports2.updateDocumentAttachment = updateDocumentAttachment;
|
|
17316
16986
|
exports2.updateDocumentAttachments = updateDocumentAttachments;
|
|
@@ -17330,8 +17000,6 @@ var __publicField = (obj, key, value) => {
|
|
|
17330
17000
|
exports2.updateProjectAttachments = updateProjectAttachments;
|
|
17331
17001
|
exports2.updateStages = updateStages;
|
|
17332
17002
|
exports2.updateTeam = updateTeam;
|
|
17333
|
-
exports2.useAppDispatch = useAppDispatch;
|
|
17334
|
-
exports2.useAppSelector = useAppSelector;
|
|
17335
17003
|
exports2.useFieldInput = useFieldInput;
|
|
17336
17004
|
exports2.useFieldInputs = useFieldInputs;
|
|
17337
17005
|
exports2.useFileSrc = useFileSrc;
|