@overmap-ai/core 1.0.53-attachment-creation-flows.1 → 1.0.53-component-asset-renames.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/ui.d.ts +1 -1
- package/dist/enums/ui.d.ts +1 -1
- package/dist/overmap-core.js +849 -801
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +849 -801
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/sdk.d.ts +7 -7
- package/dist/sdk/services/AgentService.d.ts +6 -32
- 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/MainService.d.ts +4 -11
- package/dist/sdk/services/UserFormService.d.ts +2 -2
- package/dist/sdk/services/UserFormSubmissionService.d.ts +1 -1
- package/dist/sdk/services/index.d.ts +6 -6
- package/dist/store/slices/agentsSlice.d.ts +16 -0
- 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/categorySlice.d.ts +5 -4
- package/dist/store/slices/documentSlice.d.ts +7 -7
- package/dist/store/slices/formRevisionSlice.d.ts +6 -5
- package/dist/store/slices/formSlice.d.ts +7 -7
- package/dist/store/slices/formSubmissionSlice.d.ts +2 -2
- package/dist/store/slices/index.d.ts +5 -4
- package/dist/store/slices/issueSlice.d.ts +5 -4
- package/dist/store/slices/projectFileSlice.d.ts +5 -4
- package/dist/store/slices/workspaceSlice.d.ts +5 -4
- package/dist/store/store.d.ts +16 -13
- package/dist/typings/models/agents.d.ts +40 -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/index.d.ts +1 -0
- package/dist/utils/colors.d.ts +1 -1
- package/package.json +1 -1
- 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/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
|
@@ -668,15 +668,15 @@ var __publicField = (obj, key, value) => {
|
|
|
668
668
|
};
|
|
669
669
|
const migrations = [initialVersioning, signOut, signOut, createOutboxState];
|
|
670
670
|
const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
|
|
671
|
-
const initialState$
|
|
671
|
+
const initialState$s = {
|
|
672
672
|
accessToken: "",
|
|
673
673
|
refreshToken: "",
|
|
674
674
|
isLoggedIn: false
|
|
675
675
|
};
|
|
676
676
|
const authSlice = toolkit.createSlice({
|
|
677
677
|
name: "auth",
|
|
678
|
-
initialState: initialState$
|
|
679
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
678
|
+
initialState: initialState$s,
|
|
679
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
|
|
680
680
|
reducers: {
|
|
681
681
|
setTokens: (state, action) => {
|
|
682
682
|
state.accessToken = action.payload.accessToken;
|
|
@@ -1374,7 +1374,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1374
1374
|
[mint.mint9]: "mint",
|
|
1375
1375
|
[sky.sky9]: "sky"
|
|
1376
1376
|
};
|
|
1377
|
-
const
|
|
1377
|
+
const AssetStageColors = {
|
|
1378
1378
|
indigo: indigo.indigo9,
|
|
1379
1379
|
red: red.red9,
|
|
1380
1380
|
violet: violet.violet9,
|
|
@@ -1396,7 +1396,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1396
1396
|
return { backgroundColor, textColor };
|
|
1397
1397
|
};
|
|
1398
1398
|
function getStageColor(index2) {
|
|
1399
|
-
return Object.values(
|
|
1399
|
+
return Object.values(AssetStageColors)[index2 % Object.keys(AssetStageColors).length];
|
|
1400
1400
|
}
|
|
1401
1401
|
const getLocalDateString = memoize((date) => {
|
|
1402
1402
|
if (!date)
|
|
@@ -1420,7 +1420,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1420
1420
|
return getLocalDateString(date);
|
|
1421
1421
|
return relative.format(days, "days");
|
|
1422
1422
|
});
|
|
1423
|
-
const initialState$
|
|
1423
|
+
const initialState$r = {
|
|
1424
1424
|
categories: {},
|
|
1425
1425
|
usedCategoryColors: [],
|
|
1426
1426
|
categoryVisibility: {
|
|
@@ -1430,8 +1430,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1430
1430
|
};
|
|
1431
1431
|
const categorySlice = toolkit.createSlice({
|
|
1432
1432
|
name: "categories",
|
|
1433
|
-
initialState: initialState$
|
|
1434
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1433
|
+
initialState: initialState$r,
|
|
1434
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1435
1435
|
reducers: {
|
|
1436
1436
|
setCategories: (state, action) => {
|
|
1437
1437
|
if (!Array.isArray(action.payload))
|
|
@@ -1615,167 +1615,274 @@ var __publicField = (obj, key, value) => {
|
|
|
1615
1615
|
delete state.attachments[attachmentId];
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
|
+
const initialState$q = {
|
|
1619
|
+
assetTypes: {},
|
|
1620
|
+
hiddenAssetTypeIds: {},
|
|
1621
|
+
attachments: {}
|
|
1622
|
+
};
|
|
1623
|
+
const assetTypeSlice = toolkit.createSlice({
|
|
1624
|
+
name: "assetTypes",
|
|
1625
|
+
initialState: initialState$q,
|
|
1626
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1627
|
+
reducers: {
|
|
1628
|
+
addAssetType: (state, action) => {
|
|
1629
|
+
state.assetTypes[action.payload.offline_id] = action.payload;
|
|
1630
|
+
},
|
|
1631
|
+
setAssetTypes: (state, action) => {
|
|
1632
|
+
state.assetTypes = toOfflineIdRecord(action.payload);
|
|
1633
|
+
},
|
|
1634
|
+
toggleAssetTypeVisibility: (state, action) => {
|
|
1635
|
+
state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
|
|
1636
|
+
},
|
|
1637
|
+
deleteAssetType: (state, action) => {
|
|
1638
|
+
delete state.assetTypes[action.payload];
|
|
1639
|
+
},
|
|
1640
|
+
// Attachments
|
|
1641
|
+
setAssetTypeAttachment: setAttachment,
|
|
1642
|
+
setAssetTypeAttachments: setAttachments,
|
|
1643
|
+
addAssetTypeAttachment: addAttachment,
|
|
1644
|
+
addAssetTypeAttachments: addAttachments,
|
|
1645
|
+
updateAssetTypeAttachment: updateAttachment,
|
|
1646
|
+
updateAssetTypeAttachments: updateAttachments,
|
|
1647
|
+
removeAssetTypeAttachment: removeAttachment,
|
|
1648
|
+
removeAssetTypeAttachments: removeAttachments
|
|
1649
|
+
}
|
|
1650
|
+
});
|
|
1651
|
+
const {
|
|
1652
|
+
addAssetType,
|
|
1653
|
+
setAssetTypes,
|
|
1654
|
+
toggleAssetTypeVisibility,
|
|
1655
|
+
deleteAssetType,
|
|
1656
|
+
// Attachmet
|
|
1657
|
+
setAssetTypeAttachment,
|
|
1658
|
+
setAssetTypeAttachments,
|
|
1659
|
+
addAssetTypeAttachment,
|
|
1660
|
+
addAssetTypeAttachments,
|
|
1661
|
+
updateAssetTypeAttachment,
|
|
1662
|
+
updateAssetTypeAttachments,
|
|
1663
|
+
removeAssetTypeAttachment,
|
|
1664
|
+
removeAssetTypeAttachments
|
|
1665
|
+
} = assetTypeSlice.actions;
|
|
1666
|
+
const selectAssetTypesMapping = (state) => state.assetTypeReducer.assetTypes;
|
|
1667
|
+
const selectAssetTypes = toolkit.createSelector(
|
|
1668
|
+
[selectAssetTypesMapping],
|
|
1669
|
+
(mapping) => Object.values(mapping)
|
|
1670
|
+
);
|
|
1671
|
+
const selectAssetType = restructureCreateSelectorWithArgs(
|
|
1672
|
+
toolkit.createSelector(
|
|
1673
|
+
[selectAssetTypesMapping, (_state, assetTypeId) => assetTypeId],
|
|
1674
|
+
(mapping, assetTypeId) => mapping[assetTypeId]
|
|
1675
|
+
)
|
|
1676
|
+
);
|
|
1677
|
+
const selectNumberOfAssetTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
|
|
1678
|
+
toolkit.createSelector(
|
|
1679
|
+
[selectAssetTypesMapping, (_state, args) => args],
|
|
1680
|
+
(mapping, args) => {
|
|
1681
|
+
var _a2;
|
|
1682
|
+
const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
|
|
1683
|
+
return Object.values(mapping).filter(
|
|
1684
|
+
(assetType) => {
|
|
1685
|
+
var _a3;
|
|
1686
|
+
return (((_a3 = assetType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && assetType.offline_id !== args.assetTypeId;
|
|
1687
|
+
}
|
|
1688
|
+
).length;
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
);
|
|
1692
|
+
const selectAssetTypesByName = restructureCreateSelectorWithArgs(
|
|
1693
|
+
toolkit.createSelector([selectAssetTypesMapping, (_state, name) => name], (mapping, name) => {
|
|
1694
|
+
name = (name == null ? void 0 : name.toLowerCase()) ?? null;
|
|
1695
|
+
return Object.values(mapping).filter((assetType) => {
|
|
1696
|
+
var _a2;
|
|
1697
|
+
return (((_a2 = assetType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
1698
|
+
});
|
|
1699
|
+
})
|
|
1700
|
+
);
|
|
1701
|
+
const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
|
|
1702
|
+
const selectAssetTypeAttachmentMapping = (state) => state.assetTypeReducer.attachments;
|
|
1703
|
+
const selectAssetTypeAttachments = toolkit.createSelector(
|
|
1704
|
+
[selectAssetTypeAttachmentMapping],
|
|
1705
|
+
(mapping) => Object.values(mapping)
|
|
1706
|
+
);
|
|
1707
|
+
const selectAssetTypeAttachment = (attachmentId) => (state) => {
|
|
1708
|
+
return state.assetTypeReducer.attachments[attachmentId];
|
|
1709
|
+
};
|
|
1710
|
+
const selectAttachmentsOfAssetType = restructureCreateSelectorWithArgs(
|
|
1711
|
+
toolkit.createSelector(
|
|
1712
|
+
[selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
|
|
1713
|
+
(attachments, assetTypeId) => {
|
|
1714
|
+
return attachments.filter(({ asset_type }) => assetTypeId === asset_type);
|
|
1715
|
+
}
|
|
1716
|
+
)
|
|
1717
|
+
);
|
|
1718
|
+
const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
1719
|
+
toolkit.createSelector(
|
|
1720
|
+
[selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
|
|
1721
|
+
(attachments, assetTypeId) => {
|
|
1722
|
+
const attachmentsOfAssetType = attachments.filter(({ asset_type }) => asset_type === assetTypeId);
|
|
1723
|
+
const fileAttachments = attachmentsOfAssetType.filter(
|
|
1724
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1725
|
+
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1726
|
+
);
|
|
1727
|
+
const imageAttachments = attachmentsOfAssetType.filter(
|
|
1728
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1729
|
+
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1730
|
+
);
|
|
1731
|
+
return { fileAttachments, imageAttachments };
|
|
1732
|
+
}
|
|
1733
|
+
)
|
|
1734
|
+
);
|
|
1735
|
+
const assetTypeReducer = assetTypeSlice.reducer;
|
|
1618
1736
|
const initialState$p = {
|
|
1619
|
-
|
|
1737
|
+
assets: {},
|
|
1620
1738
|
attachments: {}
|
|
1621
1739
|
};
|
|
1622
|
-
const
|
|
1623
|
-
name: "
|
|
1740
|
+
const assetSlice = toolkit.createSlice({
|
|
1741
|
+
name: "assets",
|
|
1624
1742
|
initialState: initialState$p,
|
|
1625
1743
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1626
1744
|
reducers: {
|
|
1627
|
-
|
|
1628
|
-
state.
|
|
1629
|
-
|
|
1745
|
+
addAsset: (state, action) => {
|
|
1746
|
+
state.assets[action.payload.offline_id] = action.payload;
|
|
1747
|
+
prevAssets = null;
|
|
1630
1748
|
},
|
|
1631
|
-
|
|
1632
|
-
Object.assign(state.
|
|
1633
|
-
|
|
1749
|
+
addAssetsInBatches: (state, action) => {
|
|
1750
|
+
Object.assign(state.assets, toOfflineIdRecord(action.payload));
|
|
1751
|
+
prevAssets = null;
|
|
1634
1752
|
},
|
|
1635
|
-
|
|
1636
|
-
state.
|
|
1637
|
-
|
|
1753
|
+
setAssets: (state, action) => {
|
|
1754
|
+
state.assets = toOfflineIdRecord(action.payload);
|
|
1755
|
+
prevAssets = null;
|
|
1638
1756
|
},
|
|
1639
|
-
|
|
1640
|
-
if (action.payload.offline_id in state.
|
|
1641
|
-
state.
|
|
1757
|
+
updateAsset: (state, action) => {
|
|
1758
|
+
if (action.payload.offline_id in state.assets) {
|
|
1759
|
+
state.assets[action.payload.offline_id] = action.payload;
|
|
1642
1760
|
} else {
|
|
1643
|
-
throw new Error(`Tried to update
|
|
1761
|
+
throw new Error(`Tried to update asset with ID that doesn't exist: ${action.payload.offline_id}`);
|
|
1644
1762
|
}
|
|
1645
|
-
|
|
1763
|
+
prevAssets = null;
|
|
1646
1764
|
},
|
|
1647
|
-
|
|
1648
|
-
if (action.payload in state.
|
|
1649
|
-
delete state.
|
|
1765
|
+
removeAsset: (state, action) => {
|
|
1766
|
+
if (action.payload in state.assets) {
|
|
1767
|
+
delete state.assets[action.payload];
|
|
1650
1768
|
} else {
|
|
1651
|
-
throw new Error(`Failed to remove
|
|
1769
|
+
throw new Error(`Failed to remove asset because ID doesn't exist: ${action.payload}`);
|
|
1652
1770
|
}
|
|
1653
|
-
|
|
1771
|
+
prevAssets = null;
|
|
1654
1772
|
},
|
|
1655
|
-
|
|
1773
|
+
removeAllAssetsOfType: (state, action) => {
|
|
1656
1774
|
var _a2;
|
|
1657
|
-
for (const componentId in state.
|
|
1658
|
-
if (((_a2 = state.
|
|
1659
|
-
delete state.
|
|
1775
|
+
for (const componentId in state.assets) {
|
|
1776
|
+
if (((_a2 = state.assets[componentId]) == null ? void 0 : _a2.asset_type) === action.payload) {
|
|
1777
|
+
delete state.assets[componentId];
|
|
1660
1778
|
}
|
|
1661
1779
|
}
|
|
1662
|
-
|
|
1780
|
+
prevAssets = null;
|
|
1663
1781
|
},
|
|
1664
1782
|
// Attachments
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1783
|
+
setAssetAttachment: setAttachment,
|
|
1784
|
+
setAssetAttachments: setAttachments,
|
|
1785
|
+
addAssetAttachment: addAttachment,
|
|
1786
|
+
addAssetAttachments: addAttachments,
|
|
1787
|
+
updateAssetAttachment: updateAttachment,
|
|
1788
|
+
updateAssetAttachments: updateAttachments,
|
|
1789
|
+
removeAssetAttachment: removeAttachment,
|
|
1790
|
+
removeAssetAttachments: removeAttachments
|
|
1673
1791
|
}
|
|
1674
1792
|
});
|
|
1675
1793
|
const {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1794
|
+
addAsset,
|
|
1795
|
+
updateAsset,
|
|
1796
|
+
removeAsset,
|
|
1797
|
+
addAssetsInBatches,
|
|
1798
|
+
setAssets,
|
|
1799
|
+
removeAllAssetsOfType,
|
|
1682
1800
|
// Attachments
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
} =
|
|
1692
|
-
let
|
|
1693
|
-
const
|
|
1694
|
-
if (!
|
|
1695
|
-
|
|
1696
|
-
}
|
|
1697
|
-
return
|
|
1801
|
+
setAssetAttachment,
|
|
1802
|
+
setAssetAttachments,
|
|
1803
|
+
addAssetAttachment,
|
|
1804
|
+
addAssetAttachments,
|
|
1805
|
+
updateAssetAttachment,
|
|
1806
|
+
updateAssetAttachments,
|
|
1807
|
+
removeAssetAttachment,
|
|
1808
|
+
removeAssetAttachments
|
|
1809
|
+
} = assetSlice.actions;
|
|
1810
|
+
let prevAssets = null;
|
|
1811
|
+
const selectAssets = (state) => {
|
|
1812
|
+
if (!prevAssets) {
|
|
1813
|
+
prevAssets = Object.values(state.assetReducer.assets);
|
|
1814
|
+
}
|
|
1815
|
+
return prevAssets;
|
|
1698
1816
|
};
|
|
1699
|
-
const
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1702
|
-
return
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
return state.componentReducer.components[componentId];
|
|
1708
|
-
};
|
|
1709
|
-
const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
|
|
1710
|
-
return state.componentTypeReducer.componentTypes[componentTypeId];
|
|
1817
|
+
const selectAssetsMapping = (state) => state.assetReducer.assets;
|
|
1818
|
+
const selectAssetsOfAssetType = restructureCreateSelectorWithArgs(
|
|
1819
|
+
toolkit.createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (components, assetTypeId) => {
|
|
1820
|
+
return components.filter((asset) => asset.asset_type === assetTypeId);
|
|
1821
|
+
})
|
|
1822
|
+
);
|
|
1823
|
+
const selectAsset = (assetId) => (state) => {
|
|
1824
|
+
return state.assetReducer.assets[assetId];
|
|
1711
1825
|
};
|
|
1712
|
-
const
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
Expected all referenced
|
|
1826
|
+
const selectAssetToAssetTypeMapping = toolkit.createSelector(
|
|
1827
|
+
[selectAssets, selectAssetTypesMapping],
|
|
1828
|
+
(assets, assetTypeMapping) => {
|
|
1829
|
+
const ret = {};
|
|
1830
|
+
for (const asset of assets) {
|
|
1831
|
+
const assetType = assetTypeMapping[asset.asset_type];
|
|
1832
|
+
if (!assetType) {
|
|
1833
|
+
console.error(
|
|
1834
|
+
`Asset type with ID ${asset.asset_type} not found.
|
|
1835
|
+
Expected all referenced asset types to be populated.
|
|
1722
1836
|
Returning empty object to avoid fatal errors.`
|
|
1723
|
-
|
|
1724
|
-
|
|
1837
|
+
);
|
|
1838
|
+
return {};
|
|
1839
|
+
}
|
|
1840
|
+
ret[asset.offline_id] = assetType;
|
|
1725
1841
|
}
|
|
1726
|
-
ret
|
|
1842
|
+
return ret;
|
|
1727
1843
|
}
|
|
1728
|
-
return ret;
|
|
1729
|
-
};
|
|
1730
|
-
const selectComponentsByType = restructureCreateSelectorWithArgs(
|
|
1731
|
-
toolkit.createSelector(
|
|
1732
|
-
[selectComponents, (_state, componentTypeId) => componentTypeId],
|
|
1733
|
-
(components, componentTypeId) => {
|
|
1734
|
-
return components.filter((component) => component.component_type === componentTypeId);
|
|
1735
|
-
}
|
|
1736
|
-
)
|
|
1737
1844
|
);
|
|
1738
|
-
const
|
|
1845
|
+
const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
|
|
1739
1846
|
var _a2;
|
|
1740
|
-
if (!
|
|
1847
|
+
if (!assetTypeId)
|
|
1741
1848
|
return 0;
|
|
1742
|
-
return (_a2 =
|
|
1849
|
+
return (_a2 = selectAssetsOfAssetType(assetTypeId)(state)) == null ? void 0 : _a2.length;
|
|
1743
1850
|
};
|
|
1744
|
-
const
|
|
1745
|
-
return
|
|
1746
|
-
const
|
|
1747
|
-
if (
|
|
1748
|
-
acc.push(
|
|
1851
|
+
const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
|
|
1852
|
+
return assetTypeIds.reduce((acc, assetTypeId) => {
|
|
1853
|
+
const assetType = state.assetTypeReducer.assetTypes[assetTypeId];
|
|
1854
|
+
if (assetType) {
|
|
1855
|
+
acc.push(assetType);
|
|
1749
1856
|
}
|
|
1750
1857
|
return acc;
|
|
1751
1858
|
}, []);
|
|
1752
1859
|
};
|
|
1753
|
-
const
|
|
1754
|
-
const
|
|
1755
|
-
[
|
|
1860
|
+
const selectAssetAttachmentMapping = (state) => state.assetReducer.attachments;
|
|
1861
|
+
const selectAssetAttachments = toolkit.createSelector(
|
|
1862
|
+
[selectAssetAttachmentMapping],
|
|
1756
1863
|
(mapping) => Object.values(mapping)
|
|
1757
1864
|
);
|
|
1758
|
-
const
|
|
1759
|
-
return state.
|
|
1865
|
+
const selectAssetAttachment = (attachmentId) => (state) => {
|
|
1866
|
+
return state.assetReducer.attachments[attachmentId];
|
|
1760
1867
|
};
|
|
1761
|
-
const
|
|
1868
|
+
const selectAttachmentsOfAsset = restructureCreateSelectorWithArgs(
|
|
1762
1869
|
toolkit.createSelector(
|
|
1763
|
-
[
|
|
1764
|
-
(attachments,
|
|
1765
|
-
return attachments.filter(({
|
|
1870
|
+
[selectAssetAttachments, (_state, assetId) => assetId],
|
|
1871
|
+
(attachments, assetId) => {
|
|
1872
|
+
return attachments.filter(({ asset }) => assetId === asset);
|
|
1766
1873
|
}
|
|
1767
1874
|
)
|
|
1768
1875
|
);
|
|
1769
|
-
const
|
|
1876
|
+
const selectAttachmentsOfAssetsByType = restructureCreateSelectorWithArgs(
|
|
1770
1877
|
toolkit.createSelector(
|
|
1771
|
-
[
|
|
1772
|
-
(attachments,
|
|
1773
|
-
const
|
|
1774
|
-
const fileAttachments =
|
|
1878
|
+
[selectAssetAttachments, (_state, assetId) => assetId],
|
|
1879
|
+
(attachments, assetId) => {
|
|
1880
|
+
const attachmentsOfAsset = attachments.filter(({ asset }) => assetId === asset);
|
|
1881
|
+
const fileAttachments = attachmentsOfAsset.filter(
|
|
1775
1882
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1776
1883
|
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1777
1884
|
);
|
|
1778
|
-
const imageAttachments =
|
|
1885
|
+
const imageAttachments = attachmentsOfAsset.filter(
|
|
1779
1886
|
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1780
1887
|
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1781
1888
|
);
|
|
@@ -1783,69 +1890,67 @@ var __publicField = (obj, key, value) => {
|
|
|
1783
1890
|
}
|
|
1784
1891
|
)
|
|
1785
1892
|
);
|
|
1786
|
-
const
|
|
1893
|
+
const assetReducer = assetSlice.reducer;
|
|
1787
1894
|
const initialState$o = {
|
|
1788
|
-
|
|
1895
|
+
completionsByAssetId: {}
|
|
1789
1896
|
};
|
|
1790
|
-
const
|
|
1791
|
-
name: "
|
|
1897
|
+
const assetStageCompletionSlice = toolkit.createSlice({
|
|
1898
|
+
name: "assetStageCompletions",
|
|
1792
1899
|
initialState: initialState$o,
|
|
1793
1900
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1794
1901
|
reducers: {
|
|
1795
1902
|
addStageCompletion: (state, action) => {
|
|
1796
|
-
let stageToCompletionDateMapping = state.
|
|
1903
|
+
let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
|
|
1797
1904
|
if (!stageToCompletionDateMapping) {
|
|
1798
1905
|
stageToCompletionDateMapping = {};
|
|
1799
|
-
state.
|
|
1906
|
+
state.completionsByAssetId[action.payload.asset] = stageToCompletionDateMapping;
|
|
1800
1907
|
}
|
|
1801
1908
|
stageToCompletionDateMapping[action.payload.stage] = (/* @__PURE__ */ new Date()).toISOString();
|
|
1802
1909
|
},
|
|
1803
1910
|
addStageCompletions: (state, action) => {
|
|
1804
|
-
for (const [
|
|
1911
|
+
for (const [assetId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
|
|
1805
1912
|
if (Object.keys(stageIdToCompletionDateMapping).length === 0)
|
|
1806
|
-
throw new Error(
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
if (thisComponentCompletions === void 0) {
|
|
1811
|
-
thisComponentCompletions = {};
|
|
1913
|
+
throw new Error(`Encountered empty stageIdToCompletionDateMapping argument for asset ${assetId}`);
|
|
1914
|
+
let thisAssetCompletions = state.completionsByAssetId[assetId];
|
|
1915
|
+
if (thisAssetCompletions === void 0) {
|
|
1916
|
+
thisAssetCompletions = {};
|
|
1812
1917
|
}
|
|
1813
1918
|
for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
|
|
1814
|
-
|
|
1919
|
+
thisAssetCompletions[stageId] = completionDate;
|
|
1815
1920
|
}
|
|
1816
|
-
state.
|
|
1921
|
+
state.completionsByAssetId[assetId] = thisAssetCompletions;
|
|
1817
1922
|
}
|
|
1818
1923
|
},
|
|
1819
1924
|
removeStageCompletions: (state, action) => {
|
|
1820
1925
|
for (const completion of action.payload) {
|
|
1821
|
-
const
|
|
1822
|
-
if (!
|
|
1926
|
+
const thisAssetCompletions = state.completionsByAssetId[completion.asset];
|
|
1927
|
+
if (!thisAssetCompletions || !(completion.stage in thisAssetCompletions)) {
|
|
1823
1928
|
console.warn(
|
|
1824
1929
|
"Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
|
|
1825
1930
|
);
|
|
1826
1931
|
continue;
|
|
1827
1932
|
}
|
|
1828
|
-
delete
|
|
1933
|
+
delete thisAssetCompletions[completion.stage];
|
|
1829
1934
|
}
|
|
1830
1935
|
},
|
|
1831
1936
|
setStageCompletions: (state, action) => {
|
|
1832
|
-
state.
|
|
1937
|
+
state.completionsByAssetId = action.payload;
|
|
1833
1938
|
}
|
|
1834
1939
|
}
|
|
1835
1940
|
});
|
|
1836
|
-
const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } =
|
|
1941
|
+
const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = assetStageCompletionSlice.actions;
|
|
1837
1942
|
const selectCompletedStages = (state) => {
|
|
1838
|
-
return state.
|
|
1943
|
+
return state.assetStageCompletionReducer.completionsByAssetId;
|
|
1839
1944
|
};
|
|
1840
|
-
const
|
|
1841
|
-
return Object.keys(state.
|
|
1945
|
+
const selectCompletedStageIdsForAsset = (asset) => (state) => {
|
|
1946
|
+
return Object.keys(state.assetStageCompletionReducer.completionsByAssetId[asset.offline_id] ?? {});
|
|
1842
1947
|
};
|
|
1843
|
-
const
|
|
1948
|
+
const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
|
|
1844
1949
|
const initialState$n = {
|
|
1845
1950
|
stages: {}
|
|
1846
1951
|
};
|
|
1847
|
-
const
|
|
1848
|
-
name: "
|
|
1952
|
+
const assetStageSlice = toolkit.createSlice({
|
|
1953
|
+
name: "assetStages",
|
|
1849
1954
|
initialState: initialState$n,
|
|
1850
1955
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1851
1956
|
reducers: {
|
|
@@ -1880,60 +1985,48 @@ var __publicField = (obj, key, value) => {
|
|
|
1880
1985
|
}
|
|
1881
1986
|
}
|
|
1882
1987
|
});
|
|
1883
|
-
const selectStageMapping = (state) => state.
|
|
1988
|
+
const selectStageMapping = (state) => state.assetStageReducer.stages;
|
|
1884
1989
|
const selectStage = restructureCreateSelectorWithArgs(
|
|
1885
1990
|
toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
|
|
1886
1991
|
return stageMapping[stageId];
|
|
1887
1992
|
})
|
|
1888
1993
|
);
|
|
1889
|
-
const selectStages = toolkit.createSelector(
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
const ret = {};
|
|
1901
|
-
for (const stage of stages) {
|
|
1902
|
-
if (componentTypeIdsSet.has(stage.component_type)) {
|
|
1903
|
-
if (!ret[stage.component_type]) {
|
|
1904
|
-
ret[stage.component_type] = [];
|
|
1905
|
-
}
|
|
1906
|
-
ret[stage.component_type].push(stage);
|
|
1994
|
+
const selectStages = toolkit.createSelector([selectStageMapping], (stageMapping) => {
|
|
1995
|
+
return Object.values(stageMapping);
|
|
1996
|
+
});
|
|
1997
|
+
const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
|
|
1998
|
+
toolkit.createSelector([selectStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
|
|
1999
|
+
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
2000
|
+
const ret = {};
|
|
2001
|
+
for (const stage of stages) {
|
|
2002
|
+
if (assetTypeIdsSet.has(stage.asset_type)) {
|
|
2003
|
+
if (!ret[stage.asset_type]) {
|
|
2004
|
+
ret[stage.asset_type] = [];
|
|
1907
2005
|
}
|
|
2006
|
+
ret[stage.asset_type].push(stage);
|
|
1908
2007
|
}
|
|
1909
|
-
for (const key in ret) {
|
|
1910
|
-
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
1911
|
-
}
|
|
1912
|
-
return ret;
|
|
1913
2008
|
}
|
|
1914
|
-
|
|
2009
|
+
for (const key in ret) {
|
|
2010
|
+
ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
|
|
2011
|
+
}
|
|
2012
|
+
return ret;
|
|
2013
|
+
})
|
|
1915
2014
|
);
|
|
1916
|
-
const
|
|
1917
|
-
toolkit.createSelector(
|
|
1918
|
-
|
|
1919
|
-
(
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
if (stage.component_type === componentTypeId) {
|
|
1923
|
-
componentTypeStagesMapping[stageId] = stage;
|
|
1924
|
-
}
|
|
2015
|
+
const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
|
|
2016
|
+
toolkit.createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
|
|
2017
|
+
const assetTypeStagesMapping = {};
|
|
2018
|
+
for (const [stageId, stage] of Object.entries(stagesMapping)) {
|
|
2019
|
+
if (stage.asset_type === assetTypeId) {
|
|
2020
|
+
assetTypeStagesMapping[stageId] = stage;
|
|
1925
2021
|
}
|
|
1926
|
-
return componentTypeStagesMapping;
|
|
1927
2022
|
}
|
|
1928
|
-
|
|
2023
|
+
return assetTypeStagesMapping;
|
|
2024
|
+
})
|
|
1929
2025
|
);
|
|
1930
|
-
const
|
|
1931
|
-
toolkit.createSelector(
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
return stages.filter((stage) => stage.component_type === componentTypeId).sort((a, b) => a.priority - b.priority);
|
|
1935
|
-
}
|
|
1936
|
-
)
|
|
2026
|
+
const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
|
|
2027
|
+
toolkit.createSelector([selectStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
|
|
2028
|
+
return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
|
|
2029
|
+
})
|
|
1937
2030
|
);
|
|
1938
2031
|
const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
|
|
1939
2032
|
toolkit.createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
|
|
@@ -1955,140 +2048,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1955
2048
|
return ret;
|
|
1956
2049
|
})
|
|
1957
2050
|
);
|
|
1958
|
-
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } =
|
|
1959
|
-
const
|
|
2051
|
+
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = assetStageSlice.actions;
|
|
2052
|
+
const assetStageReducer = assetStageSlice.reducer;
|
|
1960
2053
|
const initialState$m = {
|
|
1961
|
-
componentTypes: {},
|
|
1962
|
-
hiddenComponentTypeIds: {},
|
|
1963
|
-
attachments: {}
|
|
1964
|
-
};
|
|
1965
|
-
const componentTypeSlice = toolkit.createSlice({
|
|
1966
|
-
name: "componentTypes",
|
|
1967
|
-
initialState: initialState$m,
|
|
1968
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1969
|
-
reducers: {
|
|
1970
|
-
addComponentType: (state, action) => {
|
|
1971
|
-
state.componentTypes[action.payload.offline_id] = action.payload;
|
|
1972
|
-
},
|
|
1973
|
-
setComponentTypes: (state, action) => {
|
|
1974
|
-
state.componentTypes = toOfflineIdRecord(action.payload);
|
|
1975
|
-
},
|
|
1976
|
-
toggleComponentTypeVisibility: (state, action) => {
|
|
1977
|
-
state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
|
|
1978
|
-
},
|
|
1979
|
-
deleteComponentType: (state, action) => {
|
|
1980
|
-
delete state.componentTypes[action.payload];
|
|
1981
|
-
},
|
|
1982
|
-
// Attachments
|
|
1983
|
-
setComponentTypeAttachment: setAttachment,
|
|
1984
|
-
setComponentTypeAttachments: setAttachments,
|
|
1985
|
-
addComponentTypeAttachment: addAttachment,
|
|
1986
|
-
addComponentTypeAttachments: addAttachments,
|
|
1987
|
-
updateComponentTypeAttachment: updateAttachment,
|
|
1988
|
-
updateComponentTypeAttachments: updateAttachments,
|
|
1989
|
-
removeComponentTypeAttachment: removeAttachment,
|
|
1990
|
-
removeComponentTypeAttachments: removeAttachments
|
|
1991
|
-
}
|
|
1992
|
-
});
|
|
1993
|
-
const {
|
|
1994
|
-
addComponentType,
|
|
1995
|
-
setComponentTypes,
|
|
1996
|
-
toggleComponentTypeVisibility,
|
|
1997
|
-
deleteComponentType,
|
|
1998
|
-
// Attachmet
|
|
1999
|
-
setComponentTypeAttachment,
|
|
2000
|
-
setComponentTypeAttachments,
|
|
2001
|
-
addComponentTypeAttachment,
|
|
2002
|
-
addComponentTypeAttachments,
|
|
2003
|
-
updateComponentTypeAttachment,
|
|
2004
|
-
updateComponentTypeAttachments,
|
|
2005
|
-
removeComponentTypeAttachment,
|
|
2006
|
-
removeComponentTypeAttachments
|
|
2007
|
-
} = componentTypeSlice.actions;
|
|
2008
|
-
const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
|
|
2009
|
-
const selectComponentTypes = toolkit.createSelector(
|
|
2010
|
-
[selectComponentTypesMapping],
|
|
2011
|
-
(mapping) => Object.values(mapping)
|
|
2012
|
-
);
|
|
2013
|
-
const selectComponentType = restructureCreateSelectorWithArgs(
|
|
2014
|
-
toolkit.createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
|
|
2015
|
-
);
|
|
2016
|
-
const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
|
|
2017
|
-
toolkit.createSelector(
|
|
2018
|
-
[
|
|
2019
|
-
selectComponentTypesMapping,
|
|
2020
|
-
(_state, args) => args
|
|
2021
|
-
],
|
|
2022
|
-
(mapping, args) => {
|
|
2023
|
-
var _a2;
|
|
2024
|
-
const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
|
|
2025
|
-
return Object.values(mapping).filter(
|
|
2026
|
-
(componentType) => {
|
|
2027
|
-
var _a3;
|
|
2028
|
-
return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
|
|
2029
|
-
}
|
|
2030
|
-
).length;
|
|
2031
|
-
}
|
|
2032
|
-
)
|
|
2033
|
-
);
|
|
2034
|
-
const selectComponentTypesByName = restructureCreateSelectorWithArgs(
|
|
2035
|
-
toolkit.createSelector(
|
|
2036
|
-
[selectComponentTypesMapping, (_state, name) => name],
|
|
2037
|
-
(mapping, name) => {
|
|
2038
|
-
name = (name == null ? void 0 : name.toLowerCase()) ?? null;
|
|
2039
|
-
return Object.values(mapping).filter(
|
|
2040
|
-
(componentType) => {
|
|
2041
|
-
var _a2;
|
|
2042
|
-
return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
2043
|
-
}
|
|
2044
|
-
);
|
|
2045
|
-
}
|
|
2046
|
-
)
|
|
2047
|
-
);
|
|
2048
|
-
const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
|
|
2049
|
-
const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
|
|
2050
|
-
const selectAllComponentTypeAttachments = toolkit.createSelector(
|
|
2051
|
-
[selectComponentTypeAttachmentMapping],
|
|
2052
|
-
(mapping) => Object.values(mapping)
|
|
2053
|
-
);
|
|
2054
|
-
const selectComponentTypeAttachment = (attachmentId) => (state) => {
|
|
2055
|
-
return state.componentTypeReducer.attachments[attachmentId];
|
|
2056
|
-
};
|
|
2057
|
-
const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
|
|
2058
|
-
toolkit.createSelector(
|
|
2059
|
-
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
2060
|
-
(attachments, componentTypeId) => {
|
|
2061
|
-
return attachments.filter(({ component_type }) => componentTypeId === component_type);
|
|
2062
|
-
}
|
|
2063
|
-
)
|
|
2064
|
-
);
|
|
2065
|
-
const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
|
|
2066
|
-
toolkit.createSelector(
|
|
2067
|
-
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
2068
|
-
(attachments, componentTypeId) => {
|
|
2069
|
-
const attachmentsOfComponent = attachments.filter(
|
|
2070
|
-
({ component_type }) => component_type === componentTypeId
|
|
2071
|
-
);
|
|
2072
|
-
const fileAttachments = attachmentsOfComponent.filter(
|
|
2073
|
-
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2074
|
-
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
2075
|
-
);
|
|
2076
|
-
const imageAttachments = attachmentsOfComponent.filter(
|
|
2077
|
-
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2078
|
-
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
2079
|
-
);
|
|
2080
|
-
return { fileAttachments, imageAttachments };
|
|
2081
|
-
}
|
|
2082
|
-
)
|
|
2083
|
-
);
|
|
2084
|
-
const componentTypeReducer = componentTypeSlice.reducer;
|
|
2085
|
-
const initialState$l = {
|
|
2086
2054
|
workspaces: {},
|
|
2087
2055
|
activeWorkspaceId: null
|
|
2088
2056
|
};
|
|
2089
2057
|
const workspaceSlice = toolkit.createSlice({
|
|
2090
2058
|
name: "workspace",
|
|
2091
|
-
initialState: initialState$
|
|
2059
|
+
initialState: initialState$m,
|
|
2092
2060
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2093
2061
|
reducers: {
|
|
2094
2062
|
setWorkspaces: (state, action) => {
|
|
@@ -2145,7 +2113,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2145
2113
|
);
|
|
2146
2114
|
const workspaceReducer = workspaceSlice.reducer;
|
|
2147
2115
|
const maxRecentIssues = 10;
|
|
2148
|
-
const initialState$
|
|
2116
|
+
const initialState$l = {
|
|
2149
2117
|
issues: {},
|
|
2150
2118
|
attachments: {},
|
|
2151
2119
|
comments: {},
|
|
@@ -2157,9 +2125,9 @@ var __publicField = (obj, key, value) => {
|
|
|
2157
2125
|
};
|
|
2158
2126
|
const issueSlice = toolkit.createSlice({
|
|
2159
2127
|
name: "issues",
|
|
2160
|
-
initialState: initialState$
|
|
2128
|
+
initialState: initialState$l,
|
|
2161
2129
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2162
|
-
Object.assign(state, initialState$
|
|
2130
|
+
Object.assign(state, initialState$l);
|
|
2163
2131
|
}),
|
|
2164
2132
|
reducers: {
|
|
2165
2133
|
setIssues: (state, action) => {
|
|
@@ -2592,14 +2560,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2592
2560
|
}
|
|
2593
2561
|
);
|
|
2594
2562
|
const issueReducer = issueSlice.reducer;
|
|
2595
|
-
const initialState$
|
|
2563
|
+
const initialState$k = {
|
|
2596
2564
|
issueTypes: {}
|
|
2597
2565
|
};
|
|
2598
2566
|
const issueTypeSlice = toolkit.createSlice({
|
|
2599
2567
|
name: "issueTypes",
|
|
2600
|
-
initialState: initialState$
|
|
2568
|
+
initialState: initialState$k,
|
|
2601
2569
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
2602
|
-
Object.assign(state, initialState$
|
|
2570
|
+
Object.assign(state, initialState$k);
|
|
2603
2571
|
}),
|
|
2604
2572
|
reducers: {
|
|
2605
2573
|
setIssueTypes: (state, action) => {
|
|
@@ -2666,15 +2634,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2666
2634
|
return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
|
|
2667
2635
|
};
|
|
2668
2636
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
2669
|
-
const initialState$
|
|
2637
|
+
const initialState$j = {
|
|
2670
2638
|
s3Urls: {}
|
|
2671
2639
|
};
|
|
2672
2640
|
const msPerHour = 1e3 * 60 * 60;
|
|
2673
2641
|
const msPerWeek = msPerHour * 24 * 7;
|
|
2674
2642
|
const fileSlice = toolkit.createSlice({
|
|
2675
2643
|
name: "file",
|
|
2676
|
-
initialState: initialState$
|
|
2677
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2644
|
+
initialState: initialState$j,
|
|
2645
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2678
2646
|
reducers: {
|
|
2679
2647
|
setUploadUrl: (state, action) => {
|
|
2680
2648
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -2701,7 +2669,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2701
2669
|
return url;
|
|
2702
2670
|
};
|
|
2703
2671
|
const fileReducer = fileSlice.reducer;
|
|
2704
|
-
const initialState$
|
|
2672
|
+
const initialState$i = {
|
|
2705
2673
|
// TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
|
|
2706
2674
|
mapStyle: MapStyle.SATELLITE,
|
|
2707
2675
|
showTooltips: false,
|
|
@@ -2709,8 +2677,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2709
2677
|
};
|
|
2710
2678
|
const mapSlice = toolkit.createSlice({
|
|
2711
2679
|
name: "map",
|
|
2712
|
-
initialState: initialState$
|
|
2713
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2680
|
+
initialState: initialState$i,
|
|
2681
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2714
2682
|
reducers: {
|
|
2715
2683
|
setMapStyle: (state, action) => {
|
|
2716
2684
|
state.mapStyle = action.payload;
|
|
@@ -2740,8 +2708,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2740
2708
|
})(OrganizationAccessLevel || {});
|
|
2741
2709
|
var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
|
|
2742
2710
|
AttachmentModel2["Issue"] = "issue";
|
|
2743
|
-
AttachmentModel2["
|
|
2744
|
-
AttachmentModel2["
|
|
2711
|
+
AttachmentModel2["Asset"] = "asset";
|
|
2712
|
+
AttachmentModel2["AssetType"] = "asset_type";
|
|
2745
2713
|
AttachmentModel2["Project"] = "project";
|
|
2746
2714
|
AttachmentModel2["Document"] = "document";
|
|
2747
2715
|
return AttachmentModel2;
|
|
@@ -2787,7 +2755,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2787
2755
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
2788
2756
|
return LicenseStatus2;
|
|
2789
2757
|
})(LicenseStatus || {});
|
|
2790
|
-
const initialState$
|
|
2758
|
+
const initialState$h = {
|
|
2791
2759
|
users: {},
|
|
2792
2760
|
currentUser: {
|
|
2793
2761
|
id: 0,
|
|
@@ -2798,8 +2766,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2798
2766
|
};
|
|
2799
2767
|
const userSlice = toolkit.createSlice({
|
|
2800
2768
|
name: "users",
|
|
2801
|
-
initialState: initialState$
|
|
2802
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2769
|
+
initialState: initialState$h,
|
|
2770
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
|
|
2803
2771
|
reducers: {
|
|
2804
2772
|
setUsers: (state, action) => {
|
|
2805
2773
|
const usersMapping = {};
|
|
@@ -2861,13 +2829,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2861
2829
|
const selectUsersAsMapping = (state) => state.userReducer.users;
|
|
2862
2830
|
const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
|
|
2863
2831
|
const userReducer = userSlice.reducer;
|
|
2864
|
-
const initialState$
|
|
2832
|
+
const initialState$g = {
|
|
2865
2833
|
organizationAccesses: {}
|
|
2866
2834
|
};
|
|
2867
2835
|
const organizationAccessSlice = toolkit.createSlice({
|
|
2868
2836
|
name: "organizationAccess",
|
|
2869
|
-
initialState: initialState$
|
|
2870
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2837
|
+
initialState: initialState$g,
|
|
2838
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2871
2839
|
reducers: {
|
|
2872
2840
|
setOrganizationAccesses: (state, action) => {
|
|
2873
2841
|
if (!Array.isArray(action.payload))
|
|
@@ -2930,13 +2898,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2930
2898
|
return organizationAccesses;
|
|
2931
2899
|
};
|
|
2932
2900
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
2933
|
-
const initialState$
|
|
2901
|
+
const initialState$f = {
|
|
2934
2902
|
licenses: {}
|
|
2935
2903
|
};
|
|
2936
2904
|
const licenseSlice = toolkit.createSlice({
|
|
2937
2905
|
name: "license",
|
|
2938
|
-
initialState: initialState$
|
|
2939
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2906
|
+
initialState: initialState$f,
|
|
2907
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2940
2908
|
reducers: {
|
|
2941
2909
|
setLicenses: (state, action) => {
|
|
2942
2910
|
if (!Array.isArray(action.payload))
|
|
@@ -2981,13 +2949,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2981
2949
|
(licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
|
|
2982
2950
|
);
|
|
2983
2951
|
const licenseReducer = licenseSlice.reducer;
|
|
2984
|
-
const initialState$
|
|
2952
|
+
const initialState$e = {
|
|
2985
2953
|
projectAccesses: {}
|
|
2986
2954
|
};
|
|
2987
2955
|
const projectAccessSlice = toolkit.createSlice({
|
|
2988
2956
|
name: "projectAccess",
|
|
2989
|
-
initialState: initialState$
|
|
2990
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2957
|
+
initialState: initialState$e,
|
|
2958
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2991
2959
|
reducers: {
|
|
2992
2960
|
setProjectAccesses: (state, action) => {
|
|
2993
2961
|
if (!Array.isArray(action.payload))
|
|
@@ -3055,7 +3023,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3055
3023
|
return projectAccesses;
|
|
3056
3024
|
};
|
|
3057
3025
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
3058
|
-
const initialState$
|
|
3026
|
+
const initialState$d = {
|
|
3059
3027
|
projects: {},
|
|
3060
3028
|
activeProjectId: null,
|
|
3061
3029
|
recentProjectIds: [],
|
|
@@ -3065,7 +3033,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3065
3033
|
};
|
|
3066
3034
|
const projectSlice = toolkit.createSlice({
|
|
3067
3035
|
name: "projects",
|
|
3068
|
-
initialState: initialState$
|
|
3036
|
+
initialState: initialState$d,
|
|
3069
3037
|
reducers: {
|
|
3070
3038
|
setProjects: (state, action) => {
|
|
3071
3039
|
const projectsMap = {};
|
|
@@ -3259,14 +3227,14 @@ var __publicField = (obj, key, value) => {
|
|
|
3259
3227
|
}
|
|
3260
3228
|
)
|
|
3261
3229
|
);
|
|
3262
|
-
const initialState$
|
|
3230
|
+
const initialState$c = {
|
|
3263
3231
|
organizations: {},
|
|
3264
3232
|
activeOrganizationId: null
|
|
3265
3233
|
};
|
|
3266
3234
|
const organizationSlice = toolkit.createSlice({
|
|
3267
3235
|
name: "organizations",
|
|
3268
|
-
initialState: initialState$
|
|
3269
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3236
|
+
initialState: initialState$c,
|
|
3237
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
3270
3238
|
reducers: {
|
|
3271
3239
|
setOrganizations: (state, action) => {
|
|
3272
3240
|
for (const org of action.payload) {
|
|
@@ -3385,14 +3353,14 @@ var __publicField = (obj, key, value) => {
|
|
|
3385
3353
|
}
|
|
3386
3354
|
};
|
|
3387
3355
|
};
|
|
3388
|
-
const initialState$
|
|
3356
|
+
const initialState$b = {
|
|
3389
3357
|
deletedRequests: [],
|
|
3390
3358
|
latestRetryTime: 0
|
|
3391
3359
|
};
|
|
3392
3360
|
const outboxSlice = toolkit.createSlice({
|
|
3393
3361
|
name: "outbox",
|
|
3394
|
-
initialState: initialState$
|
|
3395
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3362
|
+
initialState: initialState$b,
|
|
3363
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
|
|
3396
3364
|
reducers: {
|
|
3397
3365
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
3398
3366
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -3424,7 +3392,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3424
3392
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
3425
3393
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
3426
3394
|
const outboxReducer = outboxSlice.reducer;
|
|
3427
|
-
const initialState$
|
|
3395
|
+
const initialState$a = {
|
|
3428
3396
|
projectFiles: {},
|
|
3429
3397
|
activeProjectFileId: null,
|
|
3430
3398
|
isImportingProjectFile: false,
|
|
@@ -3432,8 +3400,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3432
3400
|
};
|
|
3433
3401
|
const projectFileSlice = toolkit.createSlice({
|
|
3434
3402
|
name: "projectFiles",
|
|
3435
|
-
initialState: initialState$
|
|
3436
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3403
|
+
initialState: initialState$a,
|
|
3404
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
|
|
3437
3405
|
reducers: {
|
|
3438
3406
|
addOrReplaceProjectFiles: (state, action) => {
|
|
3439
3407
|
for (let fileObj of action.payload) {
|
|
@@ -3534,12 +3502,12 @@ var __publicField = (obj, key, value) => {
|
|
|
3534
3502
|
const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
|
|
3535
3503
|
const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
|
|
3536
3504
|
const projectFileReducer = projectFileSlice.reducer;
|
|
3537
|
-
const initialState$
|
|
3505
|
+
const initialState$9 = {
|
|
3538
3506
|
isRehydrated: false
|
|
3539
3507
|
};
|
|
3540
3508
|
const rehydratedSlice = toolkit.createSlice({
|
|
3541
3509
|
name: "rehydrated",
|
|
3542
|
-
initialState: initialState$
|
|
3510
|
+
initialState: initialState$9,
|
|
3543
3511
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
3544
3512
|
reducers: {
|
|
3545
3513
|
setRehydrated: (state, action) => {
|
|
@@ -3549,11 +3517,12 @@ var __publicField = (obj, key, value) => {
|
|
|
3549
3517
|
});
|
|
3550
3518
|
const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
|
|
3551
3519
|
const rehydratedReducer = rehydratedSlice.reducer;
|
|
3552
|
-
const initialState$
|
|
3520
|
+
const initialState$8 = {
|
|
3553
3521
|
useIssueTemplate: false,
|
|
3554
3522
|
placementMode: false,
|
|
3555
3523
|
enableClustering: false,
|
|
3556
3524
|
svgLayout: false,
|
|
3525
|
+
// TODO: this is no longer used
|
|
3557
3526
|
expandedSections: {
|
|
3558
3527
|
Issues: true,
|
|
3559
3528
|
"Map Layers": false,
|
|
@@ -3566,8 +3535,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3566
3535
|
};
|
|
3567
3536
|
const settingSlice = toolkit.createSlice({
|
|
3568
3537
|
name: "settings",
|
|
3569
|
-
initialState: initialState$
|
|
3570
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3538
|
+
initialState: initialState$8,
|
|
3539
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
|
|
3571
3540
|
reducers: {
|
|
3572
3541
|
setEnableDuplicateIssues: (state, action) => {
|
|
3573
3542
|
state.useIssueTemplate = action.payload;
|
|
@@ -3626,14 +3595,14 @@ var __publicField = (obj, key, value) => {
|
|
|
3626
3595
|
return revisionA < revisionB ? -1 : 1;
|
|
3627
3596
|
}
|
|
3628
3597
|
};
|
|
3629
|
-
const initialState$
|
|
3598
|
+
const initialState$7 = {
|
|
3630
3599
|
formRevisions: {},
|
|
3631
3600
|
attachments: {}
|
|
3632
3601
|
};
|
|
3633
3602
|
const formRevisionsSlice = toolkit.createSlice({
|
|
3634
3603
|
name: "formRevisions",
|
|
3635
|
-
initialState: initialState$
|
|
3636
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3604
|
+
initialState: initialState$7,
|
|
3605
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
|
|
3637
3606
|
reducers: {
|
|
3638
3607
|
// revision related actions
|
|
3639
3608
|
setFormRevision: (state, action) => {
|
|
@@ -3764,27 +3733,27 @@ var __publicField = (obj, key, value) => {
|
|
|
3764
3733
|
});
|
|
3765
3734
|
})
|
|
3766
3735
|
);
|
|
3767
|
-
const
|
|
3736
|
+
const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
|
|
3768
3737
|
toolkit.createSelector(
|
|
3769
3738
|
[
|
|
3770
3739
|
(state) => state.formReducer.forms,
|
|
3771
3740
|
selectFormRevisionMapping,
|
|
3772
|
-
(_state,
|
|
3741
|
+
(_state, assetTypeIds) => assetTypeIds
|
|
3773
3742
|
],
|
|
3774
|
-
(userForms, revisions,
|
|
3775
|
-
const
|
|
3776
|
-
const
|
|
3743
|
+
(userForms, revisions, assetTypeIds) => {
|
|
3744
|
+
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
3745
|
+
const formsOfAssetTypes = {};
|
|
3777
3746
|
const ret = {};
|
|
3778
3747
|
for (const form of Object.values(userForms)) {
|
|
3779
|
-
if (form.
|
|
3780
|
-
|
|
3748
|
+
if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
|
|
3749
|
+
formsOfAssetTypes[form.offline_id] = form;
|
|
3781
3750
|
}
|
|
3782
3751
|
}
|
|
3783
3752
|
for (const revision of Object.values(revisions)) {
|
|
3784
|
-
const form =
|
|
3785
|
-
if (!form || !form.
|
|
3753
|
+
const form = formsOfAssetTypes[revision.form];
|
|
3754
|
+
if (!form || !form.asset_type || ret[form.asset_type] && formRevisionSortFn(ret[form.asset_type], revision) > 0)
|
|
3786
3755
|
continue;
|
|
3787
|
-
ret[form.
|
|
3756
|
+
ret[form.asset_type] = revision;
|
|
3788
3757
|
}
|
|
3789
3758
|
return ret;
|
|
3790
3759
|
}
|
|
@@ -3813,13 +3782,13 @@ var __publicField = (obj, key, value) => {
|
|
|
3813
3782
|
)
|
|
3814
3783
|
);
|
|
3815
3784
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
3816
|
-
const initialState$
|
|
3785
|
+
const initialState$6 = {
|
|
3817
3786
|
forms: {}
|
|
3818
3787
|
};
|
|
3819
3788
|
const formSlice = toolkit.createSlice({
|
|
3820
3789
|
name: "forms",
|
|
3821
|
-
initialState: initialState$
|
|
3822
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3790
|
+
initialState: initialState$6,
|
|
3791
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
|
|
3823
3792
|
reducers: {
|
|
3824
3793
|
setForms: (state, action) => {
|
|
3825
3794
|
state.forms = {};
|
|
@@ -3901,11 +3870,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3901
3870
|
const selectFormMapping = (state) => {
|
|
3902
3871
|
return state.formReducer.forms;
|
|
3903
3872
|
};
|
|
3904
|
-
const
|
|
3873
|
+
const selectFormOfAssetType = restructureCreateSelectorWithArgs(
|
|
3905
3874
|
toolkit.createSelector(
|
|
3906
|
-
[selectFormMapping, (_state,
|
|
3907
|
-
(userForms,
|
|
3908
|
-
return Object.values(userForms).find((userForm) => userForm.
|
|
3875
|
+
[selectFormMapping, (_state, assetTypeId) => assetTypeId],
|
|
3876
|
+
(userForms, assetTypeId) => {
|
|
3877
|
+
return Object.values(userForms).find((userForm) => userForm.asset_type === assetTypeId);
|
|
3909
3878
|
}
|
|
3910
3879
|
)
|
|
3911
3880
|
);
|
|
@@ -3921,17 +3890,17 @@ var __publicField = (obj, key, value) => {
|
|
|
3921
3890
|
return Object.keys(userForms).length;
|
|
3922
3891
|
});
|
|
3923
3892
|
const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (userForms) => {
|
|
3924
|
-
return Object.values(userForms).filter((form) => !form.
|
|
3893
|
+
return Object.values(userForms).filter((form) => !form.asset_type).length;
|
|
3925
3894
|
});
|
|
3926
3895
|
const formReducer = formSlice.reducer;
|
|
3927
|
-
const initialState$
|
|
3896
|
+
const initialState$5 = {
|
|
3928
3897
|
formSubmissions: {},
|
|
3929
3898
|
attachments: {}
|
|
3930
3899
|
};
|
|
3931
3900
|
const formSubmissionSlice = toolkit.createSlice({
|
|
3932
3901
|
name: "formSubmissions",
|
|
3933
|
-
initialState: initialState$
|
|
3934
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
3902
|
+
initialState: initialState$5,
|
|
3903
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
|
|
3935
3904
|
reducers: {
|
|
3936
3905
|
setFormSubmission: (state, action) => {
|
|
3937
3906
|
state.formSubmissions[action.payload.offline_id] = action.payload;
|
|
@@ -4129,31 +4098,31 @@ var __publicField = (obj, key, value) => {
|
|
|
4129
4098
|
}
|
|
4130
4099
|
)
|
|
4131
4100
|
);
|
|
4132
|
-
const
|
|
4101
|
+
const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
|
|
4133
4102
|
toolkit.createSelector(
|
|
4134
|
-
[selectFormSubmissions, (_state,
|
|
4135
|
-
(submissions,
|
|
4103
|
+
[selectFormSubmissions, (_state, assetId) => assetId],
|
|
4104
|
+
(submissions, assetId) => {
|
|
4136
4105
|
return submissions.filter((submission) => {
|
|
4137
|
-
return submission.
|
|
4106
|
+
return submission.asset === assetId;
|
|
4138
4107
|
});
|
|
4139
4108
|
}
|
|
4140
4109
|
)
|
|
4141
4110
|
);
|
|
4142
|
-
const
|
|
4143
|
-
[selectFormSubmissionsMapping,
|
|
4144
|
-
(submissions,
|
|
4111
|
+
const selectFormSubmissionsByAssets = toolkit.createSelector(
|
|
4112
|
+
[selectFormSubmissionsMapping, selectAssetsMapping],
|
|
4113
|
+
(submissions, assets) => {
|
|
4145
4114
|
var _a2;
|
|
4146
|
-
const
|
|
4147
|
-
for (const
|
|
4148
|
-
|
|
4115
|
+
const assetSubmissionMapping = {};
|
|
4116
|
+
for (const assetId in assets) {
|
|
4117
|
+
assetSubmissionMapping[assetId] = [];
|
|
4149
4118
|
}
|
|
4150
4119
|
for (const submissionId in submissions) {
|
|
4151
4120
|
const submission = submissions[submissionId];
|
|
4152
|
-
if (submission.
|
|
4153
|
-
(_a2 =
|
|
4121
|
+
if (submission.asset) {
|
|
4122
|
+
(_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
|
|
4154
4123
|
}
|
|
4155
4124
|
}
|
|
4156
|
-
return
|
|
4125
|
+
return assetSubmissionMapping;
|
|
4157
4126
|
}
|
|
4158
4127
|
);
|
|
4159
4128
|
const selectFormSubmissionAttachmentsMapping = (state) => {
|
|
@@ -4168,12 +4137,12 @@ var __publicField = (obj, key, value) => {
|
|
|
4168
4137
|
)
|
|
4169
4138
|
);
|
|
4170
4139
|
const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
4171
|
-
const initialState$
|
|
4140
|
+
const initialState$4 = {
|
|
4172
4141
|
emailDomains: {}
|
|
4173
4142
|
};
|
|
4174
4143
|
const emailDomainsSlice = toolkit.createSlice({
|
|
4175
4144
|
name: "emailDomains",
|
|
4176
|
-
initialState: initialState$
|
|
4145
|
+
initialState: initialState$4,
|
|
4177
4146
|
reducers: {
|
|
4178
4147
|
setEmailDomains: (state, action) => {
|
|
4179
4148
|
const emailDomains = {};
|
|
@@ -4200,15 +4169,15 @@ var __publicField = (obj, key, value) => {
|
|
|
4200
4169
|
(ed1, ed2) => ed1.domain.localeCompare(ed2.domain)
|
|
4201
4170
|
);
|
|
4202
4171
|
const emailDomainsReducer = emailDomainsSlice.reducer;
|
|
4203
|
-
const initialState$
|
|
4172
|
+
const initialState$3 = {
|
|
4204
4173
|
documents: {},
|
|
4205
4174
|
attachments: {}
|
|
4206
4175
|
};
|
|
4207
4176
|
const documentSlice = toolkit.createSlice({
|
|
4208
4177
|
name: "documents",
|
|
4209
|
-
initialState: initialState$
|
|
4178
|
+
initialState: initialState$3,
|
|
4210
4179
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
4211
|
-
Object.assign(state, initialState$
|
|
4180
|
+
Object.assign(state, initialState$3);
|
|
4212
4181
|
}),
|
|
4213
4182
|
reducers: {
|
|
4214
4183
|
setDocuments: (state, action) => {
|
|
@@ -4439,13 +4408,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4439
4408
|
)
|
|
4440
4409
|
);
|
|
4441
4410
|
const documentsReducer = documentSlice.reducer;
|
|
4442
|
-
const initialState$
|
|
4411
|
+
const initialState$2 = {
|
|
4443
4412
|
teams: {}
|
|
4444
4413
|
};
|
|
4445
4414
|
const teamSlice = toolkit.createSlice({
|
|
4446
4415
|
name: "teams",
|
|
4447
|
-
initialState: initialState$
|
|
4448
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
4416
|
+
initialState: initialState$2,
|
|
4417
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
|
|
4449
4418
|
reducers: {
|
|
4450
4419
|
setTeam: (state, action) => {
|
|
4451
4420
|
state.teams[action.payload.offline_id] = action.payload;
|
|
@@ -4495,6 +4464,54 @@ var __publicField = (obj, key, value) => {
|
|
|
4495
4464
|
})
|
|
4496
4465
|
);
|
|
4497
4466
|
const teamReducer = teamSlice.reducer;
|
|
4467
|
+
const initialState$1 = {
|
|
4468
|
+
conversations: {}
|
|
4469
|
+
};
|
|
4470
|
+
const agentsSlice = toolkit.createSlice({
|
|
4471
|
+
name: "agents",
|
|
4472
|
+
initialState: initialState$1,
|
|
4473
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
|
|
4474
|
+
reducers: {
|
|
4475
|
+
setConversations: (state, action) => {
|
|
4476
|
+
state.conversations = {};
|
|
4477
|
+
for (const conversation of action.payload) {
|
|
4478
|
+
state.conversations[conversation.offline_id] = conversation;
|
|
4479
|
+
}
|
|
4480
|
+
},
|
|
4481
|
+
addConversation: (state, action) => {
|
|
4482
|
+
if (action.payload.offline_id in state.conversations) {
|
|
4483
|
+
throw new Error("Conversation already exists in history");
|
|
4484
|
+
}
|
|
4485
|
+
state.conversations[action.payload.offline_id] = action.payload;
|
|
4486
|
+
},
|
|
4487
|
+
setConversation: (state, action) => {
|
|
4488
|
+
if (!(action.payload.offline_id in state.conversations)) {
|
|
4489
|
+
throw new Error("Conversation does not exist in history");
|
|
4490
|
+
}
|
|
4491
|
+
state.conversations[action.payload.offline_id] = action.payload;
|
|
4492
|
+
},
|
|
4493
|
+
updateConversation: (state, action) => {
|
|
4494
|
+
const existing = state.conversations[action.payload.offline_id];
|
|
4495
|
+
if (!existing) {
|
|
4496
|
+
throw new Error("Conversation does not exist in history");
|
|
4497
|
+
}
|
|
4498
|
+
state.conversations[action.payload.offline_id] = { ...existing, ...action.payload };
|
|
4499
|
+
}
|
|
4500
|
+
}
|
|
4501
|
+
});
|
|
4502
|
+
const { setConversations, addConversation, setConversation, updateConversation } = agentsSlice.actions;
|
|
4503
|
+
const selectConversationMapping = (state) => state.agentsReducer.conversations;
|
|
4504
|
+
const selectConversations = toolkit.createSelector(
|
|
4505
|
+
[selectConversationMapping],
|
|
4506
|
+
(conversationMapping) => Object.values(conversationMapping)
|
|
4507
|
+
);
|
|
4508
|
+
const selectConversation = restructureCreateSelectorWithArgs(
|
|
4509
|
+
toolkit.createSelector(
|
|
4510
|
+
[selectConversationMapping, (_state, conversationId) => conversationId],
|
|
4511
|
+
(conversationMapping, conversationId) => conversationMapping[conversationId]
|
|
4512
|
+
)
|
|
4513
|
+
);
|
|
4514
|
+
const agentsReducer = agentsSlice.reducer;
|
|
4498
4515
|
const initialState = {
|
|
4499
4516
|
version: 0
|
|
4500
4517
|
};
|
|
@@ -4504,7 +4521,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4504
4521
|
reducers: {}
|
|
4505
4522
|
});
|
|
4506
4523
|
const versioningReducer = versioningSlice.reducer;
|
|
4507
|
-
const
|
|
4524
|
+
const fullAssetMarkerSize = 45;
|
|
4508
4525
|
const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
|
|
4509
4526
|
const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
|
|
4510
4527
|
const OUTBOX_RETRY_DELAY = 5e3;
|
|
@@ -4522,10 +4539,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4522
4539
|
fileReducer,
|
|
4523
4540
|
authReducer,
|
|
4524
4541
|
categoryReducer,
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4542
|
+
assetReducer,
|
|
4543
|
+
assetStageCompletionReducer,
|
|
4544
|
+
assetStageReducer,
|
|
4545
|
+
assetTypeReducer,
|
|
4529
4546
|
issueReducer,
|
|
4530
4547
|
issueTypeReducer,
|
|
4531
4548
|
mapReducer,
|
|
@@ -4545,7 +4562,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4545
4562
|
emailDomainsReducer,
|
|
4546
4563
|
licenseReducer,
|
|
4547
4564
|
documentsReducer,
|
|
4548
|
-
teamReducer
|
|
4565
|
+
teamReducer,
|
|
4566
|
+
agentsReducer
|
|
4549
4567
|
};
|
|
4550
4568
|
const overmapReducer = toolkit.combineReducers(overmapReducers);
|
|
4551
4569
|
const resetStore = "RESET";
|
|
@@ -5305,6 +5323,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5305
5323
|
}
|
|
5306
5324
|
async setTourStep(stepIndex) {
|
|
5307
5325
|
this.client.store.dispatch(setTourStep(stepIndex));
|
|
5326
|
+
const currentStep = this.client.store.getState().userReducer.currentUser.profile.tour_step;
|
|
5327
|
+
if (currentStep === stepIndex)
|
|
5328
|
+
return Promise.resolve(void 0);
|
|
5308
5329
|
return this.enqueueRequest({
|
|
5309
5330
|
description: "Set tour step",
|
|
5310
5331
|
method: HttpMethod.PATCH,
|
|
@@ -5423,244 +5444,234 @@ var __publicField = (obj, key, value) => {
|
|
|
5423
5444
|
store.dispatch(setCategories(result));
|
|
5424
5445
|
}
|
|
5425
5446
|
}
|
|
5426
|
-
class
|
|
5447
|
+
class AssetService extends BaseApiService {
|
|
5427
5448
|
// Basic CRUD functions
|
|
5428
|
-
add(
|
|
5429
|
-
const
|
|
5430
|
-
this.client.store.dispatch(
|
|
5449
|
+
add(asset, workspaceId) {
|
|
5450
|
+
const offlineAsset = offline(asset);
|
|
5451
|
+
this.client.store.dispatch(addAsset(offlineAsset));
|
|
5431
5452
|
const promise = this.enqueueRequest({
|
|
5432
|
-
description: "Create
|
|
5453
|
+
description: "Create asset",
|
|
5433
5454
|
method: HttpMethod.POST,
|
|
5434
|
-
url: `/
|
|
5455
|
+
url: `/assets/types/${offlineAsset.asset_type}/add-assets/`,
|
|
5435
5456
|
queryParams: {
|
|
5436
5457
|
workspace_id: workspaceId.toString()
|
|
5437
5458
|
},
|
|
5438
|
-
payload: {
|
|
5459
|
+
payload: { assets: [offlineAsset] },
|
|
5439
5460
|
blockers: [],
|
|
5440
|
-
blocks: [
|
|
5461
|
+
blocks: [offlineAsset.offline_id]
|
|
5441
5462
|
});
|
|
5442
|
-
return [
|
|
5463
|
+
return [offlineAsset, promise];
|
|
5443
5464
|
}
|
|
5444
|
-
update(
|
|
5445
|
-
this.client.store.dispatch(
|
|
5465
|
+
update(asset, workspaceId) {
|
|
5466
|
+
this.client.store.dispatch(updateAsset(asset));
|
|
5446
5467
|
const promise = this.enqueueRequest({
|
|
5447
|
-
description: "Edit
|
|
5468
|
+
description: "Edit asset",
|
|
5448
5469
|
method: HttpMethod.PATCH,
|
|
5449
|
-
url: `/
|
|
5470
|
+
url: `/assets/${asset.offline_id}/`,
|
|
5450
5471
|
queryParams: {
|
|
5451
5472
|
workspace_id: workspaceId.toString()
|
|
5452
5473
|
},
|
|
5453
|
-
payload:
|
|
5454
|
-
blockers: [
|
|
5455
|
-
blocks: [
|
|
5474
|
+
payload: asset,
|
|
5475
|
+
blockers: [asset.offline_id],
|
|
5476
|
+
blocks: [asset.offline_id]
|
|
5456
5477
|
});
|
|
5457
|
-
return [
|
|
5478
|
+
return [asset, promise];
|
|
5458
5479
|
}
|
|
5459
|
-
async remove(
|
|
5480
|
+
async remove(assetId) {
|
|
5460
5481
|
const { store } = this.client;
|
|
5461
|
-
const
|
|
5462
|
-
if (!
|
|
5463
|
-
throw new Error(`No
|
|
5464
|
-
const
|
|
5465
|
-
store.dispatch(
|
|
5466
|
-
if (
|
|
5467
|
-
const
|
|
5468
|
-
store.dispatch(
|
|
5482
|
+
const assetToBeDeleted = selectAsset(assetId)(store.getState());
|
|
5483
|
+
if (!assetToBeDeleted)
|
|
5484
|
+
throw new Error(`No asset with id ${assetId} found in the store`);
|
|
5485
|
+
const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(store.getState());
|
|
5486
|
+
store.dispatch(removeAsset(assetId));
|
|
5487
|
+
if (attachmentsOfAssets.length > 0) {
|
|
5488
|
+
const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
|
|
5489
|
+
store.dispatch(removeAssetAttachments(attachmentsOfAssetIds));
|
|
5469
5490
|
}
|
|
5470
5491
|
return this.enqueueRequest({
|
|
5471
|
-
description: "Delete
|
|
5492
|
+
description: "Delete asset",
|
|
5472
5493
|
method: HttpMethod.DELETE,
|
|
5473
|
-
url: `/
|
|
5474
|
-
blockers: [
|
|
5494
|
+
url: `/assets/${assetId}/`,
|
|
5495
|
+
blockers: [assetId],
|
|
5475
5496
|
blocks: []
|
|
5476
5497
|
}).catch((err) => {
|
|
5477
|
-
store.dispatch(
|
|
5478
|
-
store.dispatch(
|
|
5498
|
+
store.dispatch(addAsset(assetToBeDeleted));
|
|
5499
|
+
store.dispatch(addAssetAttachments(attachmentsOfAssets));
|
|
5479
5500
|
throw err;
|
|
5480
5501
|
});
|
|
5481
5502
|
}
|
|
5482
|
-
async
|
|
5483
|
-
const clientStore2 = this.client.store;
|
|
5484
|
-
const allComponentsOfType = selectComponentsFromComponentType(componentTypeId)(clientStore2.getState());
|
|
5485
|
-
const affectedComponentIds = (allComponentsOfType || []).map((c) => c.offline_id);
|
|
5486
|
-
const affectedOfflineIds = [componentTypeId, ...affectedComponentIds];
|
|
5503
|
+
async deleteAllAssetsOfAssetType(assetTypeId) {
|
|
5487
5504
|
const { store } = this.client;
|
|
5488
5505
|
const state = store.getState();
|
|
5489
|
-
const
|
|
5490
|
-
|
|
5506
|
+
const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
|
|
5507
|
+
const allAssetsOfAssetTypeIds = (allAssetsOfAssetType || []).map((c) => c.offline_id);
|
|
5508
|
+
const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
|
|
5509
|
+
store.dispatch(removeAllAssetsOfType(assetTypeId));
|
|
5491
5510
|
return this.enqueueRequest({
|
|
5492
|
-
description: "
|
|
5511
|
+
description: "Delete all assets of asset type",
|
|
5493
5512
|
method: HttpMethod.DELETE,
|
|
5494
|
-
url: `/
|
|
5513
|
+
url: `/assets/types/${assetTypeId}/delete-all-of-type/`,
|
|
5495
5514
|
blockers: affectedOfflineIds,
|
|
5496
5515
|
blocks: affectedOfflineIds
|
|
5497
5516
|
}).catch((err) => {
|
|
5498
|
-
if (
|
|
5499
|
-
store.dispatch(
|
|
5517
|
+
if (allAssetsOfAssetType) {
|
|
5518
|
+
store.dispatch(addAssetsInBatches(allAssetsOfAssetType));
|
|
5500
5519
|
}
|
|
5501
5520
|
throw err;
|
|
5502
5521
|
});
|
|
5503
5522
|
}
|
|
5504
|
-
async addBatch(
|
|
5505
|
-
const
|
|
5506
|
-
return { ...offline(
|
|
5523
|
+
async addBatch(assetsToCreate, workspaceId, assetTypeId) {
|
|
5524
|
+
const fullAssets = assetsToCreate.map((asset) => {
|
|
5525
|
+
return { ...offline(asset), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
5507
5526
|
});
|
|
5508
5527
|
const { store } = this.client;
|
|
5509
|
-
store.dispatch(
|
|
5528
|
+
store.dispatch(addAssetsInBatches(fullAssets));
|
|
5510
5529
|
const promise = this.enqueueRequest({
|
|
5511
|
-
description: "Batch create
|
|
5530
|
+
description: "Batch create assets",
|
|
5512
5531
|
method: HttpMethod.POST,
|
|
5513
|
-
url: `/
|
|
5532
|
+
url: `/assets/types/${assetTypeId}/add-assets/`,
|
|
5514
5533
|
queryParams: {
|
|
5515
5534
|
workspace_id: workspaceId.toString()
|
|
5516
5535
|
},
|
|
5517
5536
|
payload: {
|
|
5518
|
-
|
|
5537
|
+
assets: fullAssets
|
|
5519
5538
|
},
|
|
5520
|
-
blockers: [
|
|
5521
|
-
blocks:
|
|
5539
|
+
blockers: [assetTypeId],
|
|
5540
|
+
blocks: fullAssets.map((c) => c.offline_id)
|
|
5522
5541
|
});
|
|
5523
5542
|
void promise.then((result) => {
|
|
5524
|
-
for (const
|
|
5525
|
-
store.dispatch(
|
|
5543
|
+
for (const assets of Object.values(result)) {
|
|
5544
|
+
store.dispatch(updateAsset(assets));
|
|
5526
5545
|
}
|
|
5527
5546
|
}).catch((e) => {
|
|
5528
|
-
for (const
|
|
5529
|
-
store.dispatch(
|
|
5547
|
+
for (const asset of fullAssets) {
|
|
5548
|
+
store.dispatch(removeAsset(asset.offline_id));
|
|
5530
5549
|
}
|
|
5531
5550
|
throw e;
|
|
5532
5551
|
});
|
|
5533
5552
|
return promise;
|
|
5534
5553
|
}
|
|
5535
|
-
async refreshStore(
|
|
5554
|
+
async refreshStore() {
|
|
5536
5555
|
const { store } = this.client;
|
|
5537
5556
|
const result = await this.enqueueRequest({
|
|
5538
|
-
description: "Get
|
|
5557
|
+
description: "Get assets",
|
|
5539
5558
|
method: HttpMethod.GET,
|
|
5540
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5559
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/assets/`,
|
|
5541
5560
|
blockers: [],
|
|
5542
5561
|
blocks: []
|
|
5543
5562
|
});
|
|
5544
|
-
|
|
5545
|
-
store.dispatch(setComponents(result));
|
|
5546
|
-
} else {
|
|
5547
|
-
store.dispatch(addComponentsInBatches(result));
|
|
5548
|
-
}
|
|
5563
|
+
store.dispatch(setAssets(result));
|
|
5549
5564
|
}
|
|
5550
5565
|
}
|
|
5551
|
-
class
|
|
5552
|
-
add(
|
|
5566
|
+
class AssetStageCompletionService extends BaseApiService {
|
|
5567
|
+
add(assetId, stageId) {
|
|
5553
5568
|
var _a2;
|
|
5554
5569
|
const { store } = this.client;
|
|
5555
|
-
const
|
|
5556
|
-
if (!
|
|
5557
|
-
throw new Error(`
|
|
5570
|
+
const assetTypeId = (_a2 = store.getState().assetReducer.assets[assetId]) == null ? void 0 : _a2.asset_type;
|
|
5571
|
+
if (!assetTypeId) {
|
|
5572
|
+
throw new Error(`Asset with offline_id ${assetId} not found`);
|
|
5558
5573
|
}
|
|
5559
|
-
const
|
|
5560
|
-
|
|
5574
|
+
const offlineStageCompletion = offline({
|
|
5575
|
+
asset: assetId,
|
|
5561
5576
|
stage: stageId
|
|
5562
5577
|
});
|
|
5563
|
-
store.dispatch(addStageCompletion(
|
|
5578
|
+
store.dispatch(addStageCompletion(offlineStageCompletion));
|
|
5564
5579
|
const promise = this.enqueueRequest({
|
|
5565
|
-
description: "
|
|
5580
|
+
description: "Complete stage",
|
|
5566
5581
|
method: HttpMethod.POST,
|
|
5567
|
-
url: `/
|
|
5582
|
+
url: `/assets/types/${assetTypeId}/complete-stages/`,
|
|
5568
5583
|
// TODO: Add submitted_at to model
|
|
5569
|
-
payload: { completions: [{ ...
|
|
5570
|
-
blockers: [
|
|
5571
|
-
blocks: [
|
|
5584
|
+
payload: { completions: [{ ...offlineStageCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
|
|
5585
|
+
blockers: [assetId, stageId],
|
|
5586
|
+
blocks: [offlineStageCompletion.offline_id]
|
|
5572
5587
|
});
|
|
5573
|
-
return [
|
|
5588
|
+
return [offlineStageCompletion, promise];
|
|
5574
5589
|
}
|
|
5575
5590
|
async refreshStore() {
|
|
5576
5591
|
const { store } = this.client;
|
|
5577
5592
|
const result = await this.enqueueRequest({
|
|
5578
|
-
description: "Get
|
|
5593
|
+
description: "Get stage completions",
|
|
5579
5594
|
method: HttpMethod.GET,
|
|
5580
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5595
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stage-completions/`,
|
|
5581
5596
|
blockers: [],
|
|
5582
5597
|
blocks: []
|
|
5583
5598
|
});
|
|
5584
5599
|
store.dispatch(addStageCompletions(result));
|
|
5585
5600
|
}
|
|
5586
5601
|
/**
|
|
5587
|
-
* Creates a collection of
|
|
5588
|
-
*
|
|
5589
|
-
* @param
|
|
5590
|
-
* stages for one
|
|
5602
|
+
* Creates a collection of AssetStageCompletions, marking the referenced stages as completed for the referenced
|
|
5603
|
+
* assets. It's REQUIRED that all assets referenced all have the SAME asset type.
|
|
5604
|
+
* @param assetTypeId The ID of the asset type for which we are completing stages (we can only complete
|
|
5605
|
+
* stages for one asset type at a time)
|
|
5591
5606
|
* @param stageCompletions
|
|
5592
5607
|
*/
|
|
5593
|
-
async bulkAdd(
|
|
5594
|
-
const
|
|
5608
|
+
async bulkAdd(assetTypeId, stageCompletions) {
|
|
5609
|
+
const offlineStageCompletions = stageCompletions.map((completion) => {
|
|
5595
5610
|
return offline(completion);
|
|
5596
5611
|
});
|
|
5597
5612
|
const asMapping = {};
|
|
5598
5613
|
for (const completion of stageCompletions) {
|
|
5599
|
-
const stageToCompletionDateMapping = asMapping[completion.
|
|
5614
|
+
const stageToCompletionDateMapping = asMapping[completion.asset] || {};
|
|
5600
5615
|
stageToCompletionDateMapping[completion.stage] = (/* @__PURE__ */ new Date()).toISOString();
|
|
5601
|
-
asMapping[completion.
|
|
5616
|
+
asMapping[completion.asset] = stageToCompletionDateMapping;
|
|
5602
5617
|
}
|
|
5603
5618
|
this.client.store.dispatch(addStageCompletions(asMapping));
|
|
5604
5619
|
await this.enqueueRequest({
|
|
5605
|
-
description: "
|
|
5620
|
+
description: "Bulk complete stages",
|
|
5606
5621
|
method: HttpMethod.POST,
|
|
5607
|
-
url: `/
|
|
5622
|
+
url: `/assets/types/${assetTypeId}/complete-stages/`,
|
|
5608
5623
|
payload: {
|
|
5609
|
-
completions:
|
|
5624
|
+
completions: offlineStageCompletions
|
|
5610
5625
|
},
|
|
5611
|
-
blockers: [
|
|
5612
|
-
|
|
5613
|
-
...stageCompletions.map((c) => c.component),
|
|
5614
|
-
...stageCompletions.map((c) => c.stage)
|
|
5615
|
-
],
|
|
5616
|
-
blocks: offlineStagesCompletions.map((c) => c.offline_id)
|
|
5626
|
+
blockers: [assetTypeId, ...stageCompletions.map((c) => c.asset), ...stageCompletions.map((c) => c.stage)],
|
|
5627
|
+
blocks: offlineStageCompletions.map((c) => c.offline_id)
|
|
5617
5628
|
});
|
|
5618
5629
|
}
|
|
5619
|
-
bulkDelete(stageId,
|
|
5620
|
-
const
|
|
5630
|
+
bulkDelete(stageId, assetIds) {
|
|
5631
|
+
const stageCompletionsToRemove = assetIds.map((assetId) => {
|
|
5621
5632
|
return {
|
|
5622
|
-
|
|
5633
|
+
asset: assetId,
|
|
5623
5634
|
stage: stageId
|
|
5624
5635
|
};
|
|
5625
5636
|
});
|
|
5626
|
-
this.client.store.dispatch(removeStageCompletions(
|
|
5637
|
+
this.client.store.dispatch(removeStageCompletions(stageCompletionsToRemove));
|
|
5627
5638
|
return this.enqueueRequest({
|
|
5628
|
-
description: `Undo stage for ${
|
|
5639
|
+
description: `Undo stage for ${assetIds.length} assets(s)`,
|
|
5629
5640
|
// TODO: Rename to setCompletedStages
|
|
5630
5641
|
method: HttpMethod.DELETE,
|
|
5631
|
-
url: `/
|
|
5642
|
+
url: `/assets/stages/${stageId}/undo-stages/`,
|
|
5632
5643
|
payload: {
|
|
5633
|
-
|
|
5644
|
+
assets: assetIds
|
|
5634
5645
|
},
|
|
5635
|
-
blockers: [stageId, ...
|
|
5646
|
+
blockers: [stageId, ...assetIds],
|
|
5636
5647
|
blocks: []
|
|
5637
5648
|
});
|
|
5638
5649
|
}
|
|
5639
5650
|
}
|
|
5640
|
-
class
|
|
5641
|
-
async bulkCreateStages(stagesToSubmit,
|
|
5651
|
+
class AssetStageService extends BaseApiService {
|
|
5652
|
+
async bulkCreateStages(stagesToSubmit, assetTypeId, workspaceId) {
|
|
5642
5653
|
const payload = stagesToSubmit.map((stage) => {
|
|
5643
5654
|
return offline(stage);
|
|
5644
5655
|
});
|
|
5645
5656
|
const fullStages = payload.map((stage) => {
|
|
5646
|
-
return { ...stage,
|
|
5657
|
+
return { ...stage, asset_type: assetTypeId };
|
|
5647
5658
|
});
|
|
5648
5659
|
this.client.store.dispatch(addStages(fullStages));
|
|
5649
5660
|
return this.enqueueRequest({
|
|
5650
|
-
description: "Add
|
|
5661
|
+
description: "Add asset stages",
|
|
5651
5662
|
method: HttpMethod.POST,
|
|
5652
|
-
url: `/
|
|
5663
|
+
url: `/assets/types/${assetTypeId}/add-stages/`,
|
|
5653
5664
|
payload: {
|
|
5654
5665
|
stages: payload
|
|
5655
5666
|
},
|
|
5656
5667
|
queryParams: {
|
|
5657
5668
|
workspace_id: workspaceId.toString()
|
|
5658
5669
|
},
|
|
5659
|
-
blockers: [
|
|
5670
|
+
blockers: [assetTypeId, workspaceId],
|
|
5660
5671
|
blocks: payload.map(({ offline_id }) => offline_id)
|
|
5661
5672
|
});
|
|
5662
5673
|
}
|
|
5663
|
-
async bulkUpdateStages(stagesToUpdate,
|
|
5674
|
+
async bulkUpdateStages(stagesToUpdate, assetTypeId) {
|
|
5664
5675
|
const store = this.client.store;
|
|
5665
5676
|
const state = store.getState();
|
|
5666
5677
|
const prevStages = selectStagesFromStageIds(
|
|
@@ -5671,13 +5682,13 @@ var __publicField = (obj, key, value) => {
|
|
|
5671
5682
|
}
|
|
5672
5683
|
store.dispatch(updateStages(stagesToUpdate));
|
|
5673
5684
|
return this.enqueueRequest({
|
|
5674
|
-
description: "Edit
|
|
5685
|
+
description: "Edit asset stages",
|
|
5675
5686
|
method: HttpMethod.PATCH,
|
|
5676
|
-
url: `/
|
|
5687
|
+
url: `/assets/types/${assetTypeId}/bulk-update-stages/`,
|
|
5677
5688
|
payload: {
|
|
5678
5689
|
stages: stagesToUpdate
|
|
5679
5690
|
},
|
|
5680
|
-
blockers: [
|
|
5691
|
+
blockers: [assetTypeId],
|
|
5681
5692
|
blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
|
|
5682
5693
|
}).catch((e) => {
|
|
5683
5694
|
store.dispatch(updateStages(prevStages));
|
|
@@ -5687,9 +5698,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5687
5698
|
async bulkDelete(idsToDelete) {
|
|
5688
5699
|
this.client.store.dispatch(removeStages(idsToDelete));
|
|
5689
5700
|
return this.enqueueRequest({
|
|
5690
|
-
description: "Delete
|
|
5701
|
+
description: "Delete asset stages",
|
|
5691
5702
|
method: HttpMethod.DELETE,
|
|
5692
|
-
url: "/
|
|
5703
|
+
url: "/assets/stages/bulk-delete/",
|
|
5693
5704
|
payload: {
|
|
5694
5705
|
stage_ids: idsToDelete
|
|
5695
5706
|
},
|
|
@@ -5697,15 +5708,15 @@ var __publicField = (obj, key, value) => {
|
|
|
5697
5708
|
blocks: []
|
|
5698
5709
|
});
|
|
5699
5710
|
}
|
|
5700
|
-
async update(
|
|
5701
|
-
this.client.store.dispatch(addStages([
|
|
5711
|
+
async update(assetStage) {
|
|
5712
|
+
this.client.store.dispatch(addStages([assetStage]));
|
|
5702
5713
|
return this.enqueueRequest({
|
|
5703
|
-
description: "Update
|
|
5714
|
+
description: "Update asset stage",
|
|
5704
5715
|
method: HttpMethod.PATCH,
|
|
5705
|
-
url: `/
|
|
5706
|
-
payload:
|
|
5707
|
-
blockers: [
|
|
5708
|
-
blocks: [
|
|
5716
|
+
url: `/assets/stages/${assetStage.offline_id}/`,
|
|
5717
|
+
payload: assetStage,
|
|
5718
|
+
blockers: [assetStage.offline_id],
|
|
5719
|
+
blocks: [assetStage.offline_id]
|
|
5709
5720
|
});
|
|
5710
5721
|
}
|
|
5711
5722
|
async linkForm(stageId, formId2) {
|
|
@@ -5713,9 +5724,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5713
5724
|
store.dispatch(linkStageToForm({ stageId, formId: formId2 }));
|
|
5714
5725
|
try {
|
|
5715
5726
|
await this.enqueueRequest({
|
|
5716
|
-
description: "Link
|
|
5727
|
+
description: "Link asset stage to form",
|
|
5717
5728
|
method: HttpMethod.POST,
|
|
5718
|
-
url: `/
|
|
5729
|
+
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
5719
5730
|
payload: { user_form: formId2 },
|
|
5720
5731
|
blockers: [stageId, formId2],
|
|
5721
5732
|
blocks: [stageId]
|
|
@@ -5730,9 +5741,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5730
5741
|
store.dispatch(unlinkStageToForm({ stageId }));
|
|
5731
5742
|
try {
|
|
5732
5743
|
await this.enqueueRequest({
|
|
5733
|
-
description: "Unlink
|
|
5744
|
+
description: "Unlink asset stage from form",
|
|
5734
5745
|
method: HttpMethod.DELETE,
|
|
5735
|
-
url: `/
|
|
5746
|
+
url: `/assets/stages/${stageId}/associate-with-form/`,
|
|
5736
5747
|
blockers: [stageId, formId2],
|
|
5737
5748
|
blocks: [stageId]
|
|
5738
5749
|
});
|
|
@@ -5744,9 +5755,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5744
5755
|
async refreshStore() {
|
|
5745
5756
|
const { store } = this.client;
|
|
5746
5757
|
const result = await this.enqueueRequest({
|
|
5747
|
-
description: "Get
|
|
5758
|
+
description: "Get asset stages",
|
|
5748
5759
|
method: HttpMethod.GET,
|
|
5749
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
5760
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stages/`,
|
|
5750
5761
|
blockers: [],
|
|
5751
5762
|
blocks: []
|
|
5752
5763
|
});
|
|
@@ -5760,20 +5771,20 @@ var __publicField = (obj, key, value) => {
|
|
|
5760
5771
|
deleteUrlPrefix: "/issues",
|
|
5761
5772
|
fetchUrlPostfix: "/issue-attachments"
|
|
5762
5773
|
},
|
|
5763
|
-
[AttachmentModel.
|
|
5764
|
-
name: "
|
|
5765
|
-
attachUrlPrefix: "/
|
|
5766
|
-
deleteUrlPrefix: "/
|
|
5767
|
-
fetchUrlPostfix: "/
|
|
5774
|
+
[AttachmentModel.Asset]: {
|
|
5775
|
+
name: "asset",
|
|
5776
|
+
attachUrlPrefix: "/assets",
|
|
5777
|
+
deleteUrlPrefix: "/assets",
|
|
5778
|
+
fetchUrlPostfix: "/asset-attachments"
|
|
5768
5779
|
},
|
|
5769
|
-
[AttachmentModel.
|
|
5770
|
-
name: "
|
|
5771
|
-
attachUrlPrefix: "/
|
|
5772
|
-
deleteUrlPrefix: "/
|
|
5773
|
-
fetchUrlPostfix: "/
|
|
5780
|
+
[AttachmentModel.AssetType]: {
|
|
5781
|
+
name: "asset type",
|
|
5782
|
+
attachUrlPrefix: "/assets/types",
|
|
5783
|
+
deleteUrlPrefix: "/assets/types",
|
|
5784
|
+
fetchUrlPostfix: "/asset-type-attachments"
|
|
5774
5785
|
},
|
|
5775
5786
|
[AttachmentModel.Project]: {
|
|
5776
|
-
name: "
|
|
5787
|
+
name: "project",
|
|
5777
5788
|
attachUrlPrefix: "/projects",
|
|
5778
5789
|
deleteUrlPrefix: "/projects",
|
|
5779
5790
|
fetchUrlPostfix: "/attachments"
|
|
@@ -5789,8 +5800,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5789
5800
|
getNumberOfAttachmentsWithSha1(sha1) {
|
|
5790
5801
|
const {
|
|
5791
5802
|
issueReducer: issueReducer2,
|
|
5792
|
-
|
|
5793
|
-
|
|
5803
|
+
assetReducer: assetReducer2,
|
|
5804
|
+
assetTypeReducer: assetTypeReducer2,
|
|
5794
5805
|
documentsReducer: documentsReducer2,
|
|
5795
5806
|
projectReducer: projectReducer2,
|
|
5796
5807
|
formSubmissionReducer: formSubmissionReducer2,
|
|
@@ -5798,8 +5809,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5798
5809
|
} = this.client.store.getState();
|
|
5799
5810
|
const objectsWithSha1 = [].concat(
|
|
5800
5811
|
Object.values(issueReducer2.attachments),
|
|
5801
|
-
Object.values(
|
|
5802
|
-
Object.values(
|
|
5812
|
+
Object.values(assetReducer2.attachments),
|
|
5813
|
+
Object.values(assetTypeReducer2.attachments),
|
|
5803
5814
|
Object.values(documentsReducer2.attachments),
|
|
5804
5815
|
Object.values(projectReducer2.attachments),
|
|
5805
5816
|
Object.values(formRevisionReducer2.attachments),
|
|
@@ -5921,10 +5932,10 @@ var __publicField = (obj, key, value) => {
|
|
|
5921
5932
|
return promise;
|
|
5922
5933
|
}
|
|
5923
5934
|
}
|
|
5924
|
-
class
|
|
5935
|
+
class AssetAttachmentService extends BaseAttachmentService {
|
|
5925
5936
|
constructor() {
|
|
5926
5937
|
super(...arguments);
|
|
5927
|
-
__publicField(this, "attachmentModel", AttachmentModel.
|
|
5938
|
+
__publicField(this, "attachmentModel", AttachmentModel.Asset);
|
|
5928
5939
|
}
|
|
5929
5940
|
buildOfflineAttachment(data) {
|
|
5930
5941
|
return offline({
|
|
@@ -5935,115 +5946,108 @@ var __publicField = (obj, key, value) => {
|
|
|
5935
5946
|
file_type: data.file.type,
|
|
5936
5947
|
submitted_at: data.submittedAt,
|
|
5937
5948
|
description: data.description,
|
|
5938
|
-
|
|
5949
|
+
asset: data.modelId
|
|
5939
5950
|
});
|
|
5940
5951
|
}
|
|
5941
|
-
async
|
|
5942
|
-
return this.attachFiles(
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
addAttachments: addComponentAttachments,
|
|
5948
|
-
updateAttachments: updateComponentAttachments,
|
|
5949
|
-
removeAttachments: removeComponentAttachments
|
|
5950
|
-
}
|
|
5951
|
-
);
|
|
5952
|
+
async attachFilesToAsset(files, assetId) {
|
|
5953
|
+
return this.attachFiles(files, assetId, this.buildOfflineAttachment.bind(this), {
|
|
5954
|
+
addAttachments: addAssetAttachments,
|
|
5955
|
+
updateAttachments: updateAssetAttachments,
|
|
5956
|
+
removeAttachments: removeAssetAttachments
|
|
5957
|
+
});
|
|
5952
5958
|
}
|
|
5953
|
-
|
|
5959
|
+
deleteAssetAttachment(attachmentId) {
|
|
5954
5960
|
return this.deleteAttachment(
|
|
5955
5961
|
attachmentId,
|
|
5956
5962
|
{
|
|
5957
|
-
setAttachment:
|
|
5958
|
-
removeAttachment:
|
|
5963
|
+
setAttachment: setAssetAttachment,
|
|
5964
|
+
removeAttachment: removeAssetAttachment
|
|
5959
5965
|
},
|
|
5960
5966
|
{
|
|
5961
|
-
selectAttachment:
|
|
5967
|
+
selectAttachment: selectAssetAttachment
|
|
5962
5968
|
}
|
|
5963
5969
|
);
|
|
5964
5970
|
}
|
|
5965
5971
|
async refreshStore() {
|
|
5966
5972
|
return this.getAttachments({
|
|
5967
|
-
setAttachments:
|
|
5973
|
+
setAttachments: setAssetAttachments
|
|
5968
5974
|
});
|
|
5969
5975
|
}
|
|
5970
5976
|
}
|
|
5971
|
-
class
|
|
5972
|
-
add(
|
|
5973
|
-
const
|
|
5977
|
+
class AssetTypeService extends BaseApiService {
|
|
5978
|
+
add(assetType) {
|
|
5979
|
+
const offlineAssetType = offline(assetType);
|
|
5974
5980
|
const { store } = this.client;
|
|
5975
5981
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
5976
|
-
store.dispatch(
|
|
5982
|
+
store.dispatch(addAssetType(offlineAssetType));
|
|
5977
5983
|
const promise = this.enqueueRequest({
|
|
5978
|
-
description: "Create
|
|
5984
|
+
description: "Create asset type",
|
|
5979
5985
|
method: HttpMethod.POST,
|
|
5980
|
-
url: `/projects/${activeProjectId}/
|
|
5981
|
-
payload: { ...
|
|
5986
|
+
url: `/projects/${activeProjectId}/asset-types/`,
|
|
5987
|
+
payload: { ...offlineAssetType },
|
|
5982
5988
|
blockers: [],
|
|
5983
|
-
blocks: [
|
|
5989
|
+
blocks: [offlineAssetType.offline_id]
|
|
5984
5990
|
});
|
|
5985
|
-
return [
|
|
5991
|
+
return [offlineAssetType, promise];
|
|
5986
5992
|
}
|
|
5987
|
-
update(
|
|
5988
|
-
this.client.store.dispatch(
|
|
5993
|
+
update(assetType) {
|
|
5994
|
+
this.client.store.dispatch(addAssetType(assetType));
|
|
5989
5995
|
return this.enqueueRequest({
|
|
5990
|
-
description: "Update
|
|
5996
|
+
description: "Update asset type",
|
|
5991
5997
|
method: HttpMethod.PATCH,
|
|
5992
|
-
url: `/
|
|
5993
|
-
payload:
|
|
5994
|
-
blockers: [
|
|
5995
|
-
blocks: [
|
|
5998
|
+
url: `/assets/types/${assetType.offline_id}/`,
|
|
5999
|
+
payload: assetType,
|
|
6000
|
+
blockers: [assetType.offline_id],
|
|
6001
|
+
blocks: [assetType.offline_id]
|
|
5996
6002
|
});
|
|
5997
6003
|
}
|
|
5998
|
-
async delete(
|
|
6004
|
+
async delete(assetTypeId) {
|
|
5999
6005
|
const { store } = this.client;
|
|
6000
6006
|
const state = store.getState();
|
|
6001
|
-
const
|
|
6002
|
-
if (!
|
|
6003
|
-
throw new Error(
|
|
6004
|
-
}
|
|
6005
|
-
const
|
|
6006
|
-
const
|
|
6007
|
-
store.dispatch(
|
|
6008
|
-
if (
|
|
6009
|
-
const
|
|
6010
|
-
|
|
6011
|
-
);
|
|
6012
|
-
store.dispatch(removeStages(stagesOfComponentTypeIds));
|
|
6007
|
+
const assetType = selectAssetType(assetTypeId)(state);
|
|
6008
|
+
if (!assetType) {
|
|
6009
|
+
throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
|
|
6010
|
+
}
|
|
6011
|
+
const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state) ?? [];
|
|
6012
|
+
const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
|
|
6013
|
+
store.dispatch(deleteAssetType(assetTypeId));
|
|
6014
|
+
if (stagesOfAssetType.length > 0) {
|
|
6015
|
+
const stagesOfAssetTypeIds = stagesOfAssetType.map((assetStage) => assetStage.offline_id);
|
|
6016
|
+
store.dispatch(removeStages(stagesOfAssetTypeIds));
|
|
6013
6017
|
}
|
|
6014
|
-
if (
|
|
6015
|
-
const
|
|
6016
|
-
store.dispatch(
|
|
6018
|
+
if (attachmentsOfAssetType.length > 0) {
|
|
6019
|
+
const attachmentsOfAssetTypeIds = attachmentsOfAssetType.map(({ offline_id }) => offline_id);
|
|
6020
|
+
store.dispatch(removeAssetTypeAttachments(attachmentsOfAssetTypeIds));
|
|
6017
6021
|
}
|
|
6018
6022
|
return this.enqueueRequest({
|
|
6019
|
-
description: "Delete
|
|
6023
|
+
description: "Delete asset type",
|
|
6020
6024
|
method: HttpMethod.DELETE,
|
|
6021
|
-
url: `/
|
|
6022
|
-
blockers: [
|
|
6025
|
+
url: `/assets/types/${assetTypeId}/`,
|
|
6026
|
+
blockers: [assetTypeId],
|
|
6023
6027
|
blocks: []
|
|
6024
6028
|
}).catch((e) => {
|
|
6025
|
-
store.dispatch(
|
|
6026
|
-
store.dispatch(addStages(
|
|
6027
|
-
store.dispatch(
|
|
6029
|
+
store.dispatch(addAssetType(assetType));
|
|
6030
|
+
store.dispatch(addStages(stagesOfAssetType));
|
|
6031
|
+
store.dispatch(addAssetTypeAttachments(attachmentsOfAssetType));
|
|
6028
6032
|
throw e;
|
|
6029
6033
|
});
|
|
6030
6034
|
}
|
|
6031
6035
|
async refreshStore() {
|
|
6032
6036
|
const { store } = this.client;
|
|
6033
6037
|
const result = await this.enqueueRequest({
|
|
6034
|
-
description: "Get
|
|
6038
|
+
description: "Get asset types",
|
|
6035
6039
|
method: HttpMethod.GET,
|
|
6036
|
-
url: `/projects/${store.getState().projectReducer.activeProjectId}/
|
|
6040
|
+
url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-types/`,
|
|
6037
6041
|
blockers: [],
|
|
6038
6042
|
blocks: []
|
|
6039
6043
|
});
|
|
6040
|
-
store.dispatch(
|
|
6044
|
+
store.dispatch(setAssetTypes(result));
|
|
6041
6045
|
}
|
|
6042
6046
|
}
|
|
6043
|
-
class
|
|
6047
|
+
class AssetTypeAttachmentService extends BaseAttachmentService {
|
|
6044
6048
|
constructor() {
|
|
6045
6049
|
super(...arguments);
|
|
6046
|
-
__publicField(this, "attachmentModel", AttachmentModel.
|
|
6050
|
+
__publicField(this, "attachmentModel", AttachmentModel.AssetType);
|
|
6047
6051
|
}
|
|
6048
6052
|
buildOfflineAttachment(data) {
|
|
6049
6053
|
return offline({
|
|
@@ -6054,36 +6058,36 @@ var __publicField = (obj, key, value) => {
|
|
|
6054
6058
|
file_type: data.file.type,
|
|
6055
6059
|
submitted_at: data.submittedAt,
|
|
6056
6060
|
description: data.description,
|
|
6057
|
-
|
|
6061
|
+
asset_type: data.modelId
|
|
6058
6062
|
});
|
|
6059
6063
|
}
|
|
6060
|
-
async
|
|
6064
|
+
async attachFilesToAssetType(files, assetTypeId) {
|
|
6061
6065
|
return this.attachFiles(
|
|
6062
6066
|
files,
|
|
6063
|
-
|
|
6067
|
+
assetTypeId,
|
|
6064
6068
|
this.buildOfflineAttachment.bind(this),
|
|
6065
6069
|
{
|
|
6066
|
-
addAttachments:
|
|
6067
|
-
updateAttachments:
|
|
6068
|
-
removeAttachments:
|
|
6070
|
+
addAttachments: addAssetTypeAttachments,
|
|
6071
|
+
updateAttachments: updateAssetTypeAttachments,
|
|
6072
|
+
removeAttachments: removeAssetTypeAttachments
|
|
6069
6073
|
}
|
|
6070
6074
|
);
|
|
6071
6075
|
}
|
|
6072
|
-
|
|
6076
|
+
deleteAssetTypeAttachment(attachmentId) {
|
|
6073
6077
|
return this.deleteAttachment(
|
|
6074
6078
|
attachmentId,
|
|
6075
6079
|
{
|
|
6076
|
-
setAttachment:
|
|
6077
|
-
removeAttachment:
|
|
6080
|
+
setAttachment: setAssetTypeAttachment,
|
|
6081
|
+
removeAttachment: removeAssetTypeAttachment
|
|
6078
6082
|
},
|
|
6079
6083
|
{
|
|
6080
|
-
selectAttachment:
|
|
6084
|
+
selectAttachment: selectAssetTypeAttachment
|
|
6081
6085
|
}
|
|
6082
6086
|
);
|
|
6083
6087
|
}
|
|
6084
6088
|
async refreshStore() {
|
|
6085
6089
|
return this.getAttachments({
|
|
6086
|
-
setAttachments:
|
|
6090
|
+
setAttachments: setAssetTypeAttachments
|
|
6087
6091
|
});
|
|
6088
6092
|
}
|
|
6089
6093
|
}
|
|
@@ -6274,7 +6278,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6274
6278
|
if (error2 instanceof APIError) {
|
|
6275
6279
|
(_a2 = blocks.unsafeShowToast) == null ? void 0 : _a2.call(blocks, {
|
|
6276
6280
|
title: "Could not create issue",
|
|
6277
|
-
description:
|
|
6281
|
+
description: error2.message,
|
|
6282
|
+
severity: "danger"
|
|
6278
6283
|
});
|
|
6279
6284
|
}
|
|
6280
6285
|
store.dispatch(removeIssue(issuePayload.offline_id));
|
|
@@ -6545,7 +6550,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6545
6550
|
if (replaceExisting) {
|
|
6546
6551
|
this.client.store.dispatch(setIsFetchingInitialData(true));
|
|
6547
6552
|
}
|
|
6548
|
-
|
|
6553
|
+
const result = await this.enqueueRequest({
|
|
6549
6554
|
uuid: uuid2,
|
|
6550
6555
|
description: "Get initial data",
|
|
6551
6556
|
method: HttpMethod.GET,
|
|
@@ -6554,18 +6559,20 @@ var __publicField = (obj, key, value) => {
|
|
|
6554
6559
|
isAuthNeeded: true,
|
|
6555
6560
|
blockers: [],
|
|
6556
6561
|
blocks: []
|
|
6557
|
-
}).then((result) => {
|
|
6558
|
-
void this._processInitialData(result, replaceExisting);
|
|
6559
|
-
return result;
|
|
6560
6562
|
});
|
|
6563
|
+
void this._processInitialData(result, replaceExisting);
|
|
6561
6564
|
}
|
|
6562
|
-
async fetchProjectUsers(
|
|
6565
|
+
async fetchProjectUsers() {
|
|
6566
|
+
const projectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
6563
6567
|
return this.enqueueRequest({
|
|
6564
6568
|
description: "Fetch users",
|
|
6565
6569
|
method: HttpMethod.GET,
|
|
6566
6570
|
url: `/projects/${projectId}/users/`,
|
|
6567
6571
|
blockers: [],
|
|
6568
6572
|
blocks: []
|
|
6573
|
+
}).then((users) => {
|
|
6574
|
+
this.client.store.dispatch(addUsers(users));
|
|
6575
|
+
return users;
|
|
6569
6576
|
});
|
|
6570
6577
|
}
|
|
6571
6578
|
async fetchOrganizationUsers(orgId) {
|
|
@@ -6578,13 +6585,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6578
6585
|
});
|
|
6579
6586
|
}
|
|
6580
6587
|
// TODO:
|
|
6581
|
-
// Don't accept updateStore in
|
|
6582
|
-
// overwrite, use
|
|
6588
|
+
// Don't accept updateStore in AssetService.list. Just return the offline objects and promise. Here, if
|
|
6589
|
+
// overwrite, use setAssets. Otherwise, use bulkAddAssets.
|
|
6590
|
+
// TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
|
|
6591
|
+
// literally immediately.
|
|
6583
6592
|
async _processInitialData(data, overwrite) {
|
|
6584
6593
|
var _a2, _b, _c;
|
|
6585
6594
|
const workspaces = {};
|
|
6586
6595
|
const projects = [];
|
|
6587
|
-
const categories = [];
|
|
6588
6596
|
const projectsData = data.projects;
|
|
6589
6597
|
const { store } = this.client;
|
|
6590
6598
|
const oldProjectId = (_a2 = projectsData.find(
|
|
@@ -6608,18 +6616,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6608
6616
|
isProjectIdValid = true;
|
|
6609
6617
|
for (const workspaceData of projectData.workspaces) {
|
|
6610
6618
|
const workspace = { ...workspaceData, project: projectData.id };
|
|
6611
|
-
if (workspace.categories) {
|
|
6612
|
-
for (const category of workspace.categories) {
|
|
6613
|
-
categories.push(category);
|
|
6614
|
-
}
|
|
6615
|
-
}
|
|
6616
|
-
delete workspace.categories;
|
|
6617
6619
|
workspaces[workspace.offline_id] = workspace;
|
|
6618
6620
|
}
|
|
6619
6621
|
}
|
|
6620
6622
|
}
|
|
6621
6623
|
store.dispatch(setCurrentUser(data.user));
|
|
6622
|
-
store.dispatch(addUsers(data.project_owners));
|
|
6623
6624
|
store.dispatch(setLicenses(data.licenses));
|
|
6624
6625
|
const organizationsData = data.organizations;
|
|
6625
6626
|
store.dispatch(setOrganizations(organizationsData));
|
|
@@ -6640,8 +6641,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6640
6641
|
currentOrgId = firstOrg.id;
|
|
6641
6642
|
}
|
|
6642
6643
|
if (currentOrgId) {
|
|
6643
|
-
await this.client.organizations.fetchInitialOrganizationData(currentOrgId, false);
|
|
6644
|
-
|
|
6644
|
+
const initialOrgData = await this.client.organizations.fetchInitialOrganizationData(currentOrgId, false);
|
|
6645
|
+
currentOrgId = initialOrgData.organization.id;
|
|
6646
|
+
}
|
|
6647
|
+
if (!currentOrgId) {
|
|
6648
|
+
throw new Error("No organization found");
|
|
6645
6649
|
}
|
|
6646
6650
|
if (!isProjectIdValid) {
|
|
6647
6651
|
if (validProjects.length !== 0) {
|
|
@@ -6651,12 +6655,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6651
6655
|
if (projectData) {
|
|
6652
6656
|
for (const workspaceData of projectData.workspaces) {
|
|
6653
6657
|
const workspace = { ...workspaceData, project: projectData.id };
|
|
6654
|
-
if (workspace.categories) {
|
|
6655
|
-
for (const category of workspace.categories) {
|
|
6656
|
-
categories.push(category);
|
|
6657
|
-
}
|
|
6658
|
-
}
|
|
6659
|
-
delete workspace.categories;
|
|
6660
6658
|
workspaces[workspace.offline_id] = workspace;
|
|
6661
6659
|
}
|
|
6662
6660
|
}
|
|
@@ -6665,14 +6663,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6665
6663
|
store.dispatch(setActiveProjectId(currentProjectId));
|
|
6666
6664
|
}
|
|
6667
6665
|
}
|
|
6668
|
-
if (currentProjectId) {
|
|
6669
|
-
const usersResultPromise = this.fetchProjectUsers(currentProjectId);
|
|
6670
|
-
const projectAccessRefreshPromise = this.client.projectAccesses.refreshStore();
|
|
6671
|
-
const usersResult = await usersResultPromise;
|
|
6672
|
-
await projectAccessRefreshPromise;
|
|
6673
|
-
store.dispatch(addUsers(usersResult));
|
|
6674
|
-
void this.client.projectAttachments.refreshStore();
|
|
6675
|
-
}
|
|
6676
6666
|
let currentWorkspaceId;
|
|
6677
6667
|
const oldWorkspaceId = this.client.store.getState().workspaceReducer.activeWorkspaceId;
|
|
6678
6668
|
if (overwrite || !oldWorkspaceId) {
|
|
@@ -6680,51 +6670,49 @@ var __publicField = (obj, key, value) => {
|
|
|
6680
6670
|
} else {
|
|
6681
6671
|
currentWorkspaceId = oldWorkspaceId;
|
|
6682
6672
|
}
|
|
6683
|
-
if (currentWorkspaceId
|
|
6673
|
+
if (currentWorkspaceId) {
|
|
6684
6674
|
store.dispatch(setActiveWorkspaceId(currentWorkspaceId));
|
|
6685
|
-
void this.client.categories.refreshStore().then(() => {
|
|
6686
|
-
void this.client.issues.refreshStore().then(() => {
|
|
6687
|
-
void this.client.issueAttachments.refreshStore().then();
|
|
6688
|
-
void this.client.issueComments.refreshStore().then();
|
|
6689
|
-
void this.client.issueUpdates.refreshStore().then();
|
|
6690
|
-
});
|
|
6691
|
-
});
|
|
6692
|
-
void this.client.projectFiles.refreshStore().then();
|
|
6693
|
-
void this.client.componentTypes.refreshStore().then(() => {
|
|
6694
|
-
void this.client.componentTypeAttachments.refreshStore().then(() => {
|
|
6695
|
-
void this.client.componentStages.refreshStore().then(() => {
|
|
6696
|
-
void this.client.components.refreshStore(overwrite).then(() => {
|
|
6697
|
-
void this.client.componentAttachments.refreshStore().then();
|
|
6698
|
-
});
|
|
6699
|
-
});
|
|
6700
|
-
void this.client.componentStageCompletions.refreshStore().then();
|
|
6701
|
-
});
|
|
6702
|
-
});
|
|
6703
|
-
void this.client.userForms.refreshStore().then(() => {
|
|
6704
|
-
void this.client.userFormSubmissions.refreshStore().then();
|
|
6705
|
-
});
|
|
6706
|
-
}
|
|
6707
|
-
if (currentProjectId) {
|
|
6708
|
-
void this.client.documents.refreshStore().then(() => {
|
|
6709
|
-
void this.client.documentAttachments.refreshStore().then();
|
|
6710
|
-
});
|
|
6711
|
-
void this.client.documents.refreshStore();
|
|
6712
|
-
void this.client.issueUpdates.refreshStore();
|
|
6713
|
-
void this.client.issueTypes.refreshStore();
|
|
6714
6675
|
}
|
|
6715
|
-
store.dispatch(setIsFetchingInitialData(false));
|
|
6716
6676
|
if (overwrite) {
|
|
6717
6677
|
console.log("Overwriting data");
|
|
6718
6678
|
store.dispatch(setProjects(projects));
|
|
6719
6679
|
store.dispatch(setWorkspaces(workspaces));
|
|
6720
|
-
store.dispatch(setCategories(categories));
|
|
6721
6680
|
store.dispatch(resetRecentIssues());
|
|
6722
6681
|
} else {
|
|
6723
6682
|
console.log("Updating data (collisions will be replaced)");
|
|
6724
6683
|
store.dispatch(addOrReplaceProjects(projects));
|
|
6725
6684
|
store.dispatch(addOrReplaceWorkspaces(workspaces));
|
|
6726
|
-
store.dispatch(addOrReplaceCategories(categories));
|
|
6727
6685
|
}
|
|
6686
|
+
if (!currentProjectId) {
|
|
6687
|
+
store.dispatch(setIsFetchingInitialData(false));
|
|
6688
|
+
} else {
|
|
6689
|
+
try {
|
|
6690
|
+
await this.client.projectFiles.refreshStore();
|
|
6691
|
+
} finally {
|
|
6692
|
+
store.dispatch(setIsFetchingInitialData(false));
|
|
6693
|
+
}
|
|
6694
|
+
void this.client.assetTypes.refreshStore();
|
|
6695
|
+
void this.client.assetStages.refreshStore();
|
|
6696
|
+
void this.client.assets.refreshStore();
|
|
6697
|
+
void this.client.assetStageCompletions.refreshStore();
|
|
6698
|
+
void this.client.categories.refreshStore();
|
|
6699
|
+
void this.client.issueTypes.refreshStore();
|
|
6700
|
+
void this.client.issues.refreshStore();
|
|
6701
|
+
void this.fetchProjectUsers();
|
|
6702
|
+
void this.client.documents.refreshStore();
|
|
6703
|
+
void this.client.userForms.refreshStore();
|
|
6704
|
+
void this.client.documentAttachments.refreshStore();
|
|
6705
|
+
void this.client.userFormSubmissions.refreshStore();
|
|
6706
|
+
void this.client.agent.refreshStore();
|
|
6707
|
+
void this.client.issueAttachments.refreshStore();
|
|
6708
|
+
void this.client.issueComments.refreshStore();
|
|
6709
|
+
void this.client.issueUpdates.refreshStore();
|
|
6710
|
+
void this.client.projectAccesses.refreshStore();
|
|
6711
|
+
void this.client.projectAttachments.refreshStore();
|
|
6712
|
+
void this.client.assetTypeAttachments.refreshStore();
|
|
6713
|
+
void this.client.assetAttachments.refreshStore();
|
|
6714
|
+
}
|
|
6715
|
+
void this.client.teams.refreshStore();
|
|
6728
6716
|
}
|
|
6729
6717
|
}
|
|
6730
6718
|
class ProjectAccessService extends BaseApiService {
|
|
@@ -6764,16 +6752,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6764
6752
|
const { store } = this.client;
|
|
6765
6753
|
const state = store.getState();
|
|
6766
6754
|
const projectId = state.projectReducer.activeProjectId;
|
|
6767
|
-
const currentUser = state.userReducer.currentUser;
|
|
6768
6755
|
if (!projectId) {
|
|
6769
6756
|
throw new Error("No active project");
|
|
6770
6757
|
}
|
|
6771
6758
|
const promise = this.fetchAll(projectId);
|
|
6772
6759
|
const result = await promise;
|
|
6773
|
-
const activeProjectAccess = result.find((projectAccess) => projectAccess.user === currentUser.id);
|
|
6774
|
-
if (!activeProjectAccess) {
|
|
6775
|
-
throw new Error("Current user does not have a project access instance");
|
|
6776
|
-
}
|
|
6777
6760
|
store.dispatch(setProjectAccesses(result));
|
|
6778
6761
|
}
|
|
6779
6762
|
}
|
|
@@ -7123,7 +7106,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7123
7106
|
});
|
|
7124
7107
|
});
|
|
7125
7108
|
}
|
|
7126
|
-
async add(state, initialRevision, url, ownerUser, ownerOrganization,
|
|
7109
|
+
async add(state, initialRevision, url, ownerUser, ownerOrganization, assetTypeId, issueTypeId) {
|
|
7127
7110
|
if (!!ownerUser === !!ownerOrganization) {
|
|
7128
7111
|
throw new Error("Exactly one of ownerUser and ownerOrganization must be defined.");
|
|
7129
7112
|
}
|
|
@@ -7142,7 +7125,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7142
7125
|
favorite: true,
|
|
7143
7126
|
submitted_at: submittedAt,
|
|
7144
7127
|
created_by: currentUser.id,
|
|
7145
|
-
...
|
|
7128
|
+
...assetTypeId && { asset_type: assetTypeId },
|
|
7146
7129
|
...issueTypeId && { issue_type: issueTypeId },
|
|
7147
7130
|
...ownerAttrs
|
|
7148
7131
|
};
|
|
@@ -7166,11 +7149,11 @@ var __publicField = (obj, key, value) => {
|
|
|
7166
7149
|
} : void 0,
|
|
7167
7150
|
payload: {
|
|
7168
7151
|
...offlineFormPayload,
|
|
7169
|
-
...
|
|
7152
|
+
...assetTypeId && { asset_type: assetTypeId },
|
|
7170
7153
|
...issueTypeId && { issue_type: issueTypeId },
|
|
7171
7154
|
initial_revision: payloadWithoutImage
|
|
7172
7155
|
},
|
|
7173
|
-
blockers:
|
|
7156
|
+
blockers: assetTypeId ? [assetTypeId] : issueTypeId ? [issueTypeId] : [],
|
|
7174
7157
|
blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
|
|
7175
7158
|
});
|
|
7176
7159
|
const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
|
|
@@ -7194,7 +7177,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7194
7177
|
`/forms/in-organization/${activeOrganizationId}/`,
|
|
7195
7178
|
void 0,
|
|
7196
7179
|
activeOrganizationId,
|
|
7197
|
-
attachedTo && "
|
|
7180
|
+
attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
|
|
7198
7181
|
attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
|
|
7199
7182
|
);
|
|
7200
7183
|
}
|
|
@@ -7207,7 +7190,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7207
7190
|
"/forms/my-forms/",
|
|
7208
7191
|
currentUser.id,
|
|
7209
7192
|
void 0,
|
|
7210
|
-
attachedTo && "
|
|
7193
|
+
attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
|
|
7211
7194
|
attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
|
|
7212
7195
|
);
|
|
7213
7196
|
}
|
|
@@ -7375,8 +7358,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7375
7358
|
url: `/forms/submission/${submission.offline_id}/attachments/`,
|
|
7376
7359
|
payload: submissionAttachmentPayload,
|
|
7377
7360
|
blockers: [
|
|
7378
|
-
submission.
|
|
7379
|
-
submission.
|
|
7361
|
+
submission.asset,
|
|
7362
|
+
submission.asset_stage,
|
|
7380
7363
|
submission.issue,
|
|
7381
7364
|
submission.form_revision
|
|
7382
7365
|
].filter((x) => x !== void 0),
|
|
@@ -7412,7 +7395,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7412
7395
|
method: HttpMethod.POST,
|
|
7413
7396
|
url: `/forms/revisions/${payload.form_revision}/respond/`,
|
|
7414
7397
|
payload: { ...offlineSubmission, project: activeProjectId },
|
|
7415
|
-
blockers: [payload.issue, payload.
|
|
7398
|
+
blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
|
|
7416
7399
|
(x) => x !== void 0
|
|
7417
7400
|
),
|
|
7418
7401
|
blocks: [payload.offline_id]
|
|
@@ -7430,10 +7413,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7430
7413
|
const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
|
|
7431
7414
|
return [offlineSubmission, settledPromise];
|
|
7432
7415
|
}
|
|
7433
|
-
// Note currently the bulkAdd method is specific to form submissions for
|
|
7416
|
+
// Note currently the bulkAdd method is specific to form submissions for assets
|
|
7434
7417
|
// TODO: adapt the support bulk adding to any model type
|
|
7435
7418
|
async bulkAdd(args) {
|
|
7436
|
-
const { formRevision, values: argsValues,
|
|
7419
|
+
const { formRevision, values: argsValues, assetOfflineIds } = args;
|
|
7437
7420
|
const { store } = this.client;
|
|
7438
7421
|
const offlineSubmissions = [];
|
|
7439
7422
|
const offlineAttachments = [];
|
|
@@ -7443,16 +7426,16 @@ var __publicField = (obj, key, value) => {
|
|
|
7443
7426
|
const { values, files } = separateFilesFromValues(argsValues);
|
|
7444
7427
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7445
7428
|
const createdBy = store.getState().userReducer.currentUser.id;
|
|
7446
|
-
for (const
|
|
7429
|
+
for (const assetId of assetOfflineIds) {
|
|
7447
7430
|
const submission = offline({
|
|
7448
7431
|
form_revision: formRevision,
|
|
7449
7432
|
values,
|
|
7450
7433
|
created_by: createdBy,
|
|
7451
7434
|
submitted_at: submittedAt,
|
|
7452
|
-
|
|
7435
|
+
asset: assetId
|
|
7453
7436
|
});
|
|
7454
7437
|
submissionOfflineIds.push(submission.offline_id);
|
|
7455
|
-
submissionsPayload.push({ offline_id: submission.offline_id,
|
|
7438
|
+
submissionsPayload.push({ offline_id: submission.offline_id, asset_id: assetId });
|
|
7456
7439
|
offlineSubmissions.push(submission);
|
|
7457
7440
|
for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
|
|
7458
7441
|
for (const file of fileArray) {
|
|
@@ -7499,7 +7482,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7499
7482
|
attachments: attachmentsPayload,
|
|
7500
7483
|
files: Object.values(filesRecord)
|
|
7501
7484
|
},
|
|
7502
|
-
blockers:
|
|
7485
|
+
blockers: assetOfflineIds,
|
|
7503
7486
|
blocks: submissionOfflineIds
|
|
7504
7487
|
});
|
|
7505
7488
|
promise.then(({ submissions, attachments, presigned_urls }) => {
|
|
@@ -7542,7 +7525,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7542
7525
|
method: HttpMethod.PATCH,
|
|
7543
7526
|
url: `/forms/submissions/${submission.offline_id}/`,
|
|
7544
7527
|
payload: offlineSubmission,
|
|
7545
|
-
blockers: [offlineSubmission.issue, offlineSubmission.
|
|
7528
|
+
blockers: [offlineSubmission.issue, offlineSubmission.asset, offlineSubmission.asset_stage].filter(
|
|
7546
7529
|
(x) => x !== void 0
|
|
7547
7530
|
),
|
|
7548
7531
|
blocks: [offlineSubmission.offline_id]
|
|
@@ -8351,24 +8334,70 @@ var __publicField = (obj, key, value) => {
|
|
|
8351
8334
|
}
|
|
8352
8335
|
}
|
|
8353
8336
|
class AgentService extends BaseApiService {
|
|
8337
|
+
async startConversation(prompt) {
|
|
8338
|
+
const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
8339
|
+
return this.enqueueRequest({
|
|
8340
|
+
description: "Start agent conversation",
|
|
8341
|
+
method: HttpMethod.POST,
|
|
8342
|
+
url: "/agents/prompt/",
|
|
8343
|
+
payload: {
|
|
8344
|
+
prompt,
|
|
8345
|
+
active_project: activeProjectId
|
|
8346
|
+
},
|
|
8347
|
+
blockers: ["prompt"],
|
|
8348
|
+
blocks: ["prompt"]
|
|
8349
|
+
}).then((response) => {
|
|
8350
|
+
if (response.conversation) {
|
|
8351
|
+
this.client.store.dispatch(addConversation(response.conversation));
|
|
8352
|
+
return response.conversation;
|
|
8353
|
+
}
|
|
8354
|
+
throw new Error("Unexpected response from agent");
|
|
8355
|
+
});
|
|
8356
|
+
}
|
|
8354
8357
|
/**
|
|
8355
8358
|
* Prompt the agent with a message.
|
|
8356
|
-
* @param
|
|
8359
|
+
* @param prompt The message to prompt the agent with.
|
|
8357
8360
|
* @param conversationId If continuing an existing message, the UUID of that conversation.
|
|
8358
8361
|
*/
|
|
8359
|
-
async prompt
|
|
8360
|
-
const
|
|
8362
|
+
async continueConversation(prompt, conversationId) {
|
|
8363
|
+
const { store } = this.client;
|
|
8364
|
+
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
8361
8365
|
return this.enqueueRequest({
|
|
8362
8366
|
description: "Prompt agent",
|
|
8363
8367
|
method: HttpMethod.POST,
|
|
8364
8368
|
url: "/agents/prompt/",
|
|
8365
8369
|
payload: {
|
|
8366
|
-
prompt
|
|
8370
|
+
prompt,
|
|
8367
8371
|
active_project: activeProjectId
|
|
8368
8372
|
},
|
|
8369
8373
|
blockers: ["prompt"],
|
|
8370
8374
|
blocks: ["prompt"],
|
|
8371
|
-
queryParams:
|
|
8375
|
+
queryParams: { conversation_id: conversationId }
|
|
8376
|
+
}).then((response) => {
|
|
8377
|
+
if (response.response) {
|
|
8378
|
+
const conversation = store.getState().agentsReducer.conversations[conversationId];
|
|
8379
|
+
if (!conversation) {
|
|
8380
|
+
throw new Error("Conversation not found");
|
|
8381
|
+
}
|
|
8382
|
+
store.dispatch(
|
|
8383
|
+
updateConversation({
|
|
8384
|
+
offline_id: conversationId,
|
|
8385
|
+
tiptap_content: [...conversation.tiptap_content || [], response.response]
|
|
8386
|
+
})
|
|
8387
|
+
);
|
|
8388
|
+
}
|
|
8389
|
+
throw new Error("Unexpected response from agent");
|
|
8390
|
+
});
|
|
8391
|
+
}
|
|
8392
|
+
async fetchDetails(conversationId) {
|
|
8393
|
+
return this.enqueueRequest({
|
|
8394
|
+
description: "Get agent conversation",
|
|
8395
|
+
method: HttpMethod.GET,
|
|
8396
|
+
url: `/agents/conversations/${conversationId}/`,
|
|
8397
|
+
blockers: ["conversation"],
|
|
8398
|
+
blocks: ["conversation"]
|
|
8399
|
+
}).then((response) => {
|
|
8400
|
+
this.client.store.dispatch(setConversation(response));
|
|
8372
8401
|
});
|
|
8373
8402
|
}
|
|
8374
8403
|
async rate(responseId, rating) {
|
|
@@ -8381,6 +8410,18 @@ var __publicField = (obj, key, value) => {
|
|
|
8381
8410
|
blocks: ["rate"]
|
|
8382
8411
|
});
|
|
8383
8412
|
}
|
|
8413
|
+
async refreshStore() {
|
|
8414
|
+
const { store } = this.client;
|
|
8415
|
+
const activeProject = store.getState().projectReducer.activeProjectId;
|
|
8416
|
+
const result = await this.enqueueRequest({
|
|
8417
|
+
description: "Get agent conversation history",
|
|
8418
|
+
method: HttpMethod.GET,
|
|
8419
|
+
url: `/projects/${activeProject}/agent-conversations/`,
|
|
8420
|
+
blockers: ["agent-conversations"],
|
|
8421
|
+
blocks: ["agent-conversations"]
|
|
8422
|
+
});
|
|
8423
|
+
store.dispatch(setConversations(result));
|
|
8424
|
+
}
|
|
8384
8425
|
}
|
|
8385
8426
|
class TeamService extends BaseApiService {
|
|
8386
8427
|
add(teamPayload) {
|
|
@@ -8536,12 +8577,12 @@ var __publicField = (obj, key, value) => {
|
|
|
8536
8577
|
__publicField(this, "issueAttachments", new IssueAttachmentService(this));
|
|
8537
8578
|
__publicField(this, "workspaces", new WorkspaceService(this));
|
|
8538
8579
|
__publicField(this, "main", new MainService(this));
|
|
8539
|
-
__publicField(this, "
|
|
8540
|
-
__publicField(this, "
|
|
8541
|
-
__publicField(this, "
|
|
8542
|
-
__publicField(this, "
|
|
8543
|
-
__publicField(this, "
|
|
8544
|
-
__publicField(this, "
|
|
8580
|
+
__publicField(this, "assets", new AssetService(this));
|
|
8581
|
+
__publicField(this, "assetAttachments", new AssetAttachmentService(this));
|
|
8582
|
+
__publicField(this, "assetTypes", new AssetTypeService(this));
|
|
8583
|
+
__publicField(this, "assetTypeAttachments", new AssetTypeAttachmentService(this));
|
|
8584
|
+
__publicField(this, "assetStages", new AssetStageService(this));
|
|
8585
|
+
__publicField(this, "assetStageCompletions", new AssetStageCompletionService(this));
|
|
8545
8586
|
__publicField(this, "userForms", new UserFormService(this));
|
|
8546
8587
|
__publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
|
|
8547
8588
|
__publicField(this, "projects", new ProjectService(this));
|
|
@@ -15172,9 +15213,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15172
15213
|
}, [filter, maxResults, ownerFilter]);
|
|
15173
15214
|
const userForms = useAppSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
|
|
15174
15215
|
const userFormMapping = useAppSelector(selectFormMapping);
|
|
15175
|
-
const attachableUserForms = userForms.filter((form) => !form.
|
|
15216
|
+
const attachableUserForms = userForms.filter((form) => !form.asset_type && !form.issue_type);
|
|
15176
15217
|
const attachableUserFormMapping = Object.values(userFormMapping).filter(
|
|
15177
|
-
(form) => !form.
|
|
15218
|
+
(form) => !form.asset_type
|
|
15178
15219
|
);
|
|
15179
15220
|
const handleToggleFavorite = React.useCallback(
|
|
15180
15221
|
(form) => {
|
|
@@ -16578,6 +16619,13 @@ var __publicField = (obj, key, value) => {
|
|
|
16578
16619
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16579
16620
|
exports2.APIError = APIError;
|
|
16580
16621
|
exports2.AgentService = AgentService;
|
|
16622
|
+
exports2.AssetAttachmentService = AssetAttachmentService;
|
|
16623
|
+
exports2.AssetService = AssetService;
|
|
16624
|
+
exports2.AssetStageColors = AssetStageColors;
|
|
16625
|
+
exports2.AssetStageCompletionService = AssetStageCompletionService;
|
|
16626
|
+
exports2.AssetStageService = AssetStageService;
|
|
16627
|
+
exports2.AssetTypeAttachmentService = AssetTypeAttachmentService;
|
|
16628
|
+
exports2.AssetTypeService = AssetTypeService;
|
|
16581
16629
|
exports2.AttachmentModel = AttachmentModel;
|
|
16582
16630
|
exports2.AuthService = AuthService;
|
|
16583
16631
|
exports2.BaseApiService = BaseApiService;
|
|
@@ -16589,13 +16637,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16589
16637
|
exports2.ColorPicker = ColorPicker;
|
|
16590
16638
|
exports2.Colors = Colors;
|
|
16591
16639
|
exports2.ColorsToString = ColorsToString;
|
|
16592
|
-
exports2.ComponentAttachmentService = ComponentAttachmentService;
|
|
16593
|
-
exports2.ComponentService = ComponentService;
|
|
16594
|
-
exports2.ComponentStageColors = ComponentStageColors;
|
|
16595
|
-
exports2.ComponentStageCompletionService = ComponentStageCompletionService;
|
|
16596
|
-
exports2.ComponentStageService = ComponentStageService;
|
|
16597
|
-
exports2.ComponentTypeAttachmentService = ComponentTypeAttachmentService;
|
|
16598
|
-
exports2.ComponentTypeService = ComponentTypeService;
|
|
16599
16640
|
exports2.DEFAULT_ISSUE_PRIORITY = DEFAULT_ISSUE_PRIORITY;
|
|
16600
16641
|
exports2.DEFAULT_ISSUE_STATUS = DEFAULT_ISSUE_STATUS;
|
|
16601
16642
|
exports2.DateField = DateField;
|
|
@@ -16687,14 +16728,15 @@ var __publicField = (obj, key, value) => {
|
|
|
16687
16728
|
exports2.acceptProjectInvite = acceptProjectInvite;
|
|
16688
16729
|
exports2.addActiveProjectFormSubmissionsCount = addActiveProjectFormSubmissionsCount;
|
|
16689
16730
|
exports2.addActiveProjectIssuesCount = addActiveProjectIssuesCount;
|
|
16731
|
+
exports2.addAsset = addAsset;
|
|
16732
|
+
exports2.addAssetAttachment = addAssetAttachment;
|
|
16733
|
+
exports2.addAssetAttachments = addAssetAttachments;
|
|
16734
|
+
exports2.addAssetType = addAssetType;
|
|
16735
|
+
exports2.addAssetTypeAttachment = addAssetTypeAttachment;
|
|
16736
|
+
exports2.addAssetTypeAttachments = addAssetTypeAttachments;
|
|
16737
|
+
exports2.addAssetsInBatches = addAssetsInBatches;
|
|
16690
16738
|
exports2.addCategory = addCategory;
|
|
16691
|
-
exports2.
|
|
16692
|
-
exports2.addComponentAttachment = addComponentAttachment;
|
|
16693
|
-
exports2.addComponentAttachments = addComponentAttachments;
|
|
16694
|
-
exports2.addComponentType = addComponentType;
|
|
16695
|
-
exports2.addComponentTypeAttachment = addComponentTypeAttachment;
|
|
16696
|
-
exports2.addComponentTypeAttachments = addComponentTypeAttachments;
|
|
16697
|
-
exports2.addComponentsInBatches = addComponentsInBatches;
|
|
16739
|
+
exports2.addConversation = addConversation;
|
|
16698
16740
|
exports2.addDocumentAttachment = addDocumentAttachment;
|
|
16699
16741
|
exports2.addDocumentAttachments = addDocumentAttachments;
|
|
16700
16742
|
exports2.addDocuments = addDocuments;
|
|
@@ -16735,7 +16777,17 @@ var __publicField = (obj, key, value) => {
|
|
|
16735
16777
|
exports2.addToRecentIssues = addToRecentIssues;
|
|
16736
16778
|
exports2.addUsers = addUsers;
|
|
16737
16779
|
exports2.addWorkspace = addWorkspace;
|
|
16780
|
+
exports2.agentsReducer = agentsReducer;
|
|
16781
|
+
exports2.agentsSlice = agentsSlice;
|
|
16738
16782
|
exports2.areArraysEqual = areArraysEqual;
|
|
16783
|
+
exports2.assetReducer = assetReducer;
|
|
16784
|
+
exports2.assetSlice = assetSlice;
|
|
16785
|
+
exports2.assetStageCompletionReducer = assetStageCompletionReducer;
|
|
16786
|
+
exports2.assetStageCompletionSlice = assetStageCompletionSlice;
|
|
16787
|
+
exports2.assetStageReducer = assetStageReducer;
|
|
16788
|
+
exports2.assetStageSlice = assetStageSlice;
|
|
16789
|
+
exports2.assetTypeReducer = assetTypeReducer;
|
|
16790
|
+
exports2.assetTypeSlice = assetTypeSlice;
|
|
16739
16791
|
exports2.authReducer = authReducer;
|
|
16740
16792
|
exports2.authSlice = authSlice;
|
|
16741
16793
|
exports2.blobToBase64 = blobToBase64;
|
|
@@ -16745,14 +16797,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16745
16797
|
exports2.classNames = classNames$1;
|
|
16746
16798
|
exports2.cleanRecentIssues = cleanRecentIssues;
|
|
16747
16799
|
exports2.clearTokens = clearTokens;
|
|
16748
|
-
exports2.componentReducer = componentReducer;
|
|
16749
|
-
exports2.componentSlice = componentSlice;
|
|
16750
|
-
exports2.componentStageCompletionReducer = componentStageCompletionReducer;
|
|
16751
|
-
exports2.componentStageCompletionSlice = componentStageCompletionSlice;
|
|
16752
|
-
exports2.componentStageReducer = componentStageReducer;
|
|
16753
|
-
exports2.componentStageSlice = componentStageSlice;
|
|
16754
|
-
exports2.componentTypeReducer = componentTypeReducer;
|
|
16755
|
-
exports2.componentTypeSlice = componentTypeSlice;
|
|
16756
16800
|
exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
|
|
16757
16801
|
exports2.coordinatesAreEqual = coordinatesAreEqual;
|
|
16758
16802
|
exports2.coordinatesToLiteral = coordinatesToLiteral;
|
|
@@ -16763,7 +16807,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16763
16807
|
exports2.createPointMarker = createPointMarker;
|
|
16764
16808
|
exports2.defaultBadgeColor = defaultBadgeColor;
|
|
16765
16809
|
exports2.defaultStore = defaultStore;
|
|
16766
|
-
exports2.
|
|
16810
|
+
exports2.deleteAssetType = deleteAssetType;
|
|
16767
16811
|
exports2.deleteForm = deleteForm;
|
|
16768
16812
|
exports2.deleteFormRevision = deleteFormRevision;
|
|
16769
16813
|
exports2.deleteFormRevisionAttachment = deleteFormRevisionAttachment;
|
|
@@ -16812,7 +16856,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16812
16856
|
exports2.formSubmissionReducer = formSubmissionReducer;
|
|
16813
16857
|
exports2.formSubmissionSlice = formSubmissionSlice;
|
|
16814
16858
|
exports2.forms = index;
|
|
16815
|
-
exports2.
|
|
16859
|
+
exports2.fullAssetMarkerSize = fullAssetMarkerSize;
|
|
16816
16860
|
exports2.generateBadgeColors = generateBadgeColors;
|
|
16817
16861
|
exports2.genericMemo = genericMemo;
|
|
16818
16862
|
exports2.getFileIdentifier = getFileIdentifier;
|
|
@@ -16872,15 +16916,15 @@ var __publicField = (obj, key, value) => {
|
|
|
16872
16916
|
exports2.projectSlice = projectSlice;
|
|
16873
16917
|
exports2.rehydratedReducer = rehydratedReducer;
|
|
16874
16918
|
exports2.rehydratedSlice = rehydratedSlice;
|
|
16875
|
-
exports2.
|
|
16919
|
+
exports2.removeAllAssetsOfType = removeAllAssetsOfType;
|
|
16920
|
+
exports2.removeAsset = removeAsset;
|
|
16921
|
+
exports2.removeAssetAttachment = removeAssetAttachment;
|
|
16922
|
+
exports2.removeAssetAttachments = removeAssetAttachments;
|
|
16923
|
+
exports2.removeAssetTypeAttachment = removeAssetTypeAttachment;
|
|
16924
|
+
exports2.removeAssetTypeAttachments = removeAssetTypeAttachments;
|
|
16876
16925
|
exports2.removeAttachmentsOfIssue = removeAttachmentsOfIssue;
|
|
16877
16926
|
exports2.removeCategory = removeCategory;
|
|
16878
16927
|
exports2.removeColor = removeColor;
|
|
16879
|
-
exports2.removeComponent = removeComponent;
|
|
16880
|
-
exports2.removeComponentAttachment = removeComponentAttachment;
|
|
16881
|
-
exports2.removeComponentAttachments = removeComponentAttachments;
|
|
16882
|
-
exports2.removeComponentTypeAttachment = removeComponentTypeAttachment;
|
|
16883
|
-
exports2.removeComponentTypeAttachments = removeComponentTypeAttachments;
|
|
16884
16928
|
exports2.removeDocumentAttachment = removeDocumentAttachment;
|
|
16885
16929
|
exports2.removeDocumentAttachments = removeDocumentAttachments;
|
|
16886
16930
|
exports2.removeDocuments = removeDocuments;
|
|
@@ -16931,16 +16975,31 @@ var __publicField = (obj, key, value) => {
|
|
|
16931
16975
|
exports2.selectActiveWorkspace = selectActiveWorkspace;
|
|
16932
16976
|
exports2.selectActiveWorkspaceId = selectActiveWorkspaceId;
|
|
16933
16977
|
exports2.selectAllAttachments = selectAllAttachments;
|
|
16934
|
-
exports2.selectAllComponentAttachments = selectAllComponentAttachments;
|
|
16935
|
-
exports2.selectAllComponentTypeAttachments = selectAllComponentTypeAttachments;
|
|
16936
16978
|
exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
|
|
16937
16979
|
exports2.selectAllProjectAttachments = selectAllProjectAttachments;
|
|
16938
16980
|
exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
|
|
16939
16981
|
exports2.selectAppearance = selectAppearance;
|
|
16940
|
-
exports2.
|
|
16941
|
-
exports2.
|
|
16942
|
-
exports2.
|
|
16943
|
-
exports2.
|
|
16982
|
+
exports2.selectAsset = selectAsset;
|
|
16983
|
+
exports2.selectAssetAttachment = selectAssetAttachment;
|
|
16984
|
+
exports2.selectAssetAttachmentMapping = selectAssetAttachmentMapping;
|
|
16985
|
+
exports2.selectAssetAttachments = selectAssetAttachments;
|
|
16986
|
+
exports2.selectAssetToAssetTypeMapping = selectAssetToAssetTypeMapping;
|
|
16987
|
+
exports2.selectAssetType = selectAssetType;
|
|
16988
|
+
exports2.selectAssetTypeAttachment = selectAssetTypeAttachment;
|
|
16989
|
+
exports2.selectAssetTypeAttachmentMapping = selectAssetTypeAttachmentMapping;
|
|
16990
|
+
exports2.selectAssetTypeAttachments = selectAssetTypeAttachments;
|
|
16991
|
+
exports2.selectAssetTypeStagesMapping = selectAssetTypeStagesMapping;
|
|
16992
|
+
exports2.selectAssetTypes = selectAssetTypes;
|
|
16993
|
+
exports2.selectAssetTypesByName = selectAssetTypesByName;
|
|
16994
|
+
exports2.selectAssetTypesFromIds = selectAssetTypesFromIds;
|
|
16995
|
+
exports2.selectAssetTypesMapping = selectAssetTypesMapping;
|
|
16996
|
+
exports2.selectAssets = selectAssets;
|
|
16997
|
+
exports2.selectAssetsMapping = selectAssetsMapping;
|
|
16998
|
+
exports2.selectAssetsOfAssetType = selectAssetsOfAssetType;
|
|
16999
|
+
exports2.selectAttachmentsOfAsset = selectAttachmentsOfAsset;
|
|
17000
|
+
exports2.selectAttachmentsOfAssetType = selectAttachmentsOfAssetType;
|
|
17001
|
+
exports2.selectAttachmentsOfAssetTypeByType = selectAttachmentsOfAssetTypeByType;
|
|
17002
|
+
exports2.selectAttachmentsOfAssetsByType = selectAttachmentsOfAssetsByType;
|
|
16944
17003
|
exports2.selectAttachmentsOfDocument = selectAttachmentsOfDocument;
|
|
16945
17004
|
exports2.selectAttachmentsOfDocumentByType = selectAttachmentsOfDocumentByType;
|
|
16946
17005
|
exports2.selectAttachmentsOfFormRevision = selectAttachmentsOfFormRevision;
|
|
@@ -16957,25 +17016,11 @@ var __publicField = (obj, key, value) => {
|
|
|
16957
17016
|
exports2.selectCenterMapToProject = selectCenterMapToProject;
|
|
16958
17017
|
exports2.selectCommentMapping = selectCommentMapping;
|
|
16959
17018
|
exports2.selectCommentsOfIssue = selectCommentsOfIssue;
|
|
16960
|
-
exports2.
|
|
17019
|
+
exports2.selectCompletedStageIdsForAsset = selectCompletedStageIdsForAsset;
|
|
16961
17020
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
16962
|
-
exports2.
|
|
16963
|
-
exports2.
|
|
16964
|
-
exports2.
|
|
16965
|
-
exports2.selectComponentType = selectComponentType;
|
|
16966
|
-
exports2.selectComponentTypeAttachment = selectComponentTypeAttachment;
|
|
16967
|
-
exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
|
|
16968
|
-
exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
|
|
16969
|
-
exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
|
|
16970
|
-
exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
|
|
16971
|
-
exports2.selectComponentTypes = selectComponentTypes;
|
|
16972
|
-
exports2.selectComponentTypesByName = selectComponentTypesByName;
|
|
16973
|
-
exports2.selectComponentTypesFromIds = selectComponentTypesFromIds;
|
|
16974
|
-
exports2.selectComponentTypesMapping = selectComponentTypesMapping;
|
|
16975
|
-
exports2.selectComponents = selectComponents;
|
|
16976
|
-
exports2.selectComponentsByType = selectComponentsByType;
|
|
16977
|
-
exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
|
|
16978
|
-
exports2.selectComponentsMapping = selectComponentsMapping;
|
|
17021
|
+
exports2.selectConversation = selectConversation;
|
|
17022
|
+
exports2.selectConversationMapping = selectConversationMapping;
|
|
17023
|
+
exports2.selectConversations = selectConversations;
|
|
16979
17024
|
exports2.selectCreateProjectType = selectCreateProjectType;
|
|
16980
17025
|
exports2.selectCurrentUser = selectCurrentUser;
|
|
16981
17026
|
exports2.selectDeletedRequests = selectDeletedRequests;
|
|
@@ -16997,7 +17042,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16997
17042
|
exports2.selectFilteredForms = selectFilteredForms;
|
|
16998
17043
|
exports2.selectForm = selectForm;
|
|
16999
17044
|
exports2.selectFormMapping = selectFormMapping;
|
|
17000
|
-
exports2.
|
|
17045
|
+
exports2.selectFormOfAssetType = selectFormOfAssetType;
|
|
17001
17046
|
exports2.selectFormOfIssueType = selectFormOfIssueType;
|
|
17002
17047
|
exports2.selectFormRevision = selectFormRevision;
|
|
17003
17048
|
exports2.selectFormRevisionMapping = selectFormRevisionMapping;
|
|
@@ -17006,16 +17051,16 @@ var __publicField = (obj, key, value) => {
|
|
|
17006
17051
|
exports2.selectFormSubmission = selectFormSubmission;
|
|
17007
17052
|
exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
|
|
17008
17053
|
exports2.selectFormSubmissions = selectFormSubmissions;
|
|
17009
|
-
exports2.
|
|
17054
|
+
exports2.selectFormSubmissionsByAssets = selectFormSubmissionsByAssets;
|
|
17010
17055
|
exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
|
|
17011
17056
|
exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
|
|
17012
|
-
exports2.
|
|
17057
|
+
exports2.selectFormSubmissionsOfAsset = selectFormSubmissionsOfAsset;
|
|
17013
17058
|
exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
|
|
17014
17059
|
exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
|
|
17015
17060
|
exports2.selectFormsCount = selectFormsCount;
|
|
17016
17061
|
exports2.selectGeneralFormCount = selectGeneralFormCount;
|
|
17062
|
+
exports2.selectHiddenAssetTypeIds = selectHiddenAssetTypeIds;
|
|
17017
17063
|
exports2.selectHiddenCategoryCount = selectHiddenCategoryCount;
|
|
17018
|
-
exports2.selectHiddenComponentTypeIds = selectHiddenComponentTypeIds;
|
|
17019
17064
|
exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
|
|
17020
17065
|
exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
|
|
17021
17066
|
exports2.selectIsLoading = selectIsLoading;
|
|
@@ -17037,7 +17082,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17037
17082
|
exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
|
|
17038
17083
|
exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
|
|
17039
17084
|
exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
|
|
17040
|
-
exports2.
|
|
17085
|
+
exports2.selectLatestFormRevisionsOfAssetTypes = selectLatestFormRevisionsOfAssetTypes;
|
|
17041
17086
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
17042
17087
|
exports2.selectLicense = selectLicense;
|
|
17043
17088
|
exports2.selectLicenseForProject = selectLicenseForProject;
|
|
@@ -17045,8 +17090,8 @@ var __publicField = (obj, key, value) => {
|
|
|
17045
17090
|
exports2.selectLicensesForProjectsMapping = selectLicensesForProjectsMapping;
|
|
17046
17091
|
exports2.selectMainWorkspace = selectMainWorkspace;
|
|
17047
17092
|
exports2.selectMapStyle = selectMapStyle;
|
|
17048
|
-
exports2.
|
|
17049
|
-
exports2.
|
|
17093
|
+
exports2.selectNumberOfAssetTypesMatchingCaseInsensitiveName = selectNumberOfAssetTypesMatchingCaseInsensitiveName;
|
|
17094
|
+
exports2.selectNumberOfAssetsOfAssetType = selectNumberOfAssetsOfAssetType;
|
|
17050
17095
|
exports2.selectOrganization = selectOrganization;
|
|
17051
17096
|
exports2.selectOrganizationAccess = selectOrganizationAccess;
|
|
17052
17097
|
exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
|
|
@@ -17087,9 +17132,9 @@ var __publicField = (obj, key, value) => {
|
|
|
17087
17132
|
exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
|
|
17088
17133
|
exports2.selectStageMapping = selectStageMapping;
|
|
17089
17134
|
exports2.selectStages = selectStages;
|
|
17090
|
-
exports2.
|
|
17091
|
-
exports2.selectStagesFromComponentTypeIds = selectStagesFromComponentTypeIds;
|
|
17135
|
+
exports2.selectStagesFromAssetTypeIds = selectStagesFromAssetTypeIds;
|
|
17092
17136
|
exports2.selectStagesFromStageIds = selectStagesFromStageIds;
|
|
17137
|
+
exports2.selectStagesOfAssetType = selectStagesOfAssetType;
|
|
17093
17138
|
exports2.selectTeam = selectTeam;
|
|
17094
17139
|
exports2.selectTeams = selectTeams;
|
|
17095
17140
|
exports2.selectTeamsMapping = selectTeamsMapping;
|
|
@@ -17111,14 +17156,16 @@ var __publicField = (obj, key, value) => {
|
|
|
17111
17156
|
exports2.setActiveProjectId = setActiveProjectId;
|
|
17112
17157
|
exports2.setActiveWorkspaceId = setActiveWorkspaceId;
|
|
17113
17158
|
exports2.setAppearance = setAppearance;
|
|
17159
|
+
exports2.setAssetAttachment = setAssetAttachment;
|
|
17160
|
+
exports2.setAssetAttachments = setAssetAttachments;
|
|
17161
|
+
exports2.setAssetTypeAttachment = setAssetTypeAttachment;
|
|
17162
|
+
exports2.setAssetTypeAttachments = setAssetTypeAttachments;
|
|
17163
|
+
exports2.setAssetTypes = setAssetTypes;
|
|
17164
|
+
exports2.setAssets = setAssets;
|
|
17114
17165
|
exports2.setCategories = setCategories;
|
|
17115
17166
|
exports2.setCenterMapToProject = setCenterMapToProject;
|
|
17116
|
-
exports2.
|
|
17117
|
-
exports2.
|
|
17118
|
-
exports2.setComponentTypeAttachment = setComponentTypeAttachment;
|
|
17119
|
-
exports2.setComponentTypeAttachments = setComponentTypeAttachments;
|
|
17120
|
-
exports2.setComponentTypes = setComponentTypes;
|
|
17121
|
-
exports2.setComponents = setComponents;
|
|
17167
|
+
exports2.setConversation = setConversation;
|
|
17168
|
+
exports2.setConversations = setConversations;
|
|
17122
17169
|
exports2.setCreateProjectType = setCreateProjectType;
|
|
17123
17170
|
exports2.setCurrentUser = setCurrentUser;
|
|
17124
17171
|
exports2.setDocumentAttachment = setDocumentAttachment;
|
|
@@ -17179,18 +17226,19 @@ var __publicField = (obj, key, value) => {
|
|
|
17179
17226
|
exports2.teamSlice = teamSlice;
|
|
17180
17227
|
exports2.toFileNameSafeString = toFileNameSafeString;
|
|
17181
17228
|
exports2.toOfflineIdRecord = toOfflineIdRecord;
|
|
17182
|
-
exports2.
|
|
17229
|
+
exports2.toggleAssetTypeVisibility = toggleAssetTypeVisibility;
|
|
17183
17230
|
exports2.truncate = truncate;
|
|
17184
17231
|
exports2.unfavoriteForm = unfavoriteForm;
|
|
17185
17232
|
exports2.unhideAllCategories = unhideAllCategories;
|
|
17186
17233
|
exports2.unhideCategory = unhideCategory;
|
|
17187
17234
|
exports2.unlinkStageToForm = unlinkStageToForm;
|
|
17188
17235
|
exports2.updateActiveOrganization = updateActiveOrganization;
|
|
17189
|
-
exports2.
|
|
17190
|
-
exports2.
|
|
17191
|
-
exports2.
|
|
17192
|
-
exports2.
|
|
17193
|
-
exports2.
|
|
17236
|
+
exports2.updateAsset = updateAsset;
|
|
17237
|
+
exports2.updateAssetAttachment = updateAssetAttachment;
|
|
17238
|
+
exports2.updateAssetAttachments = updateAssetAttachments;
|
|
17239
|
+
exports2.updateAssetTypeAttachment = updateAssetTypeAttachment;
|
|
17240
|
+
exports2.updateAssetTypeAttachments = updateAssetTypeAttachments;
|
|
17241
|
+
exports2.updateConversation = updateConversation;
|
|
17194
17242
|
exports2.updateDocumentAttachment = updateDocumentAttachment;
|
|
17195
17243
|
exports2.updateDocumentAttachments = updateDocumentAttachments;
|
|
17196
17244
|
exports2.updateDocuments = updateDocuments;
|