@overmap-ai/core 1.0.65-strip-workspace-access.2 → 1.0.65-strip-workspace-access.3
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/overmap-core.js +89 -224
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +89 -224
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/store/slices/issueSlice.d.ts +4 -20
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -1281,50 +1281,13 @@ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
|
|
|
1281
1281
|
)
|
|
1282
1282
|
);
|
|
1283
1283
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1284
|
-
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1285
|
-
const initialState$t = workspaceAdapter.getInitialState({});
|
|
1286
|
-
const workspaceSlice = createSlice({
|
|
1287
|
-
name: "workspace",
|
|
1288
|
-
initialState: initialState$t,
|
|
1289
|
-
reducers: {
|
|
1290
|
-
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1291
|
-
setWorkspaces: workspaceAdapter.setMany,
|
|
1292
|
-
addWorkspace: workspaceAdapter.addOne,
|
|
1293
|
-
updateWorkspace: workspaceAdapter.updateOne,
|
|
1294
|
-
deleteWorkspace: workspaceAdapter.deleteOne
|
|
1295
|
-
}
|
|
1296
|
-
});
|
|
1297
|
-
const { initializeWorkspaces, setWorkspaces, addWorkspace, updateWorkspace, deleteWorkspace } = workspaceSlice.actions;
|
|
1298
|
-
const selectWorkspaceMapping = (state) => state.workspaceReducer.instances;
|
|
1299
|
-
const selectWorkspaces = createSelector([selectWorkspaceMapping], (mapping) => Object.values(mapping));
|
|
1300
|
-
const selectMainWorkspace = createSelector(
|
|
1301
|
-
[selectWorkspaces],
|
|
1302
|
-
(workspaces) => {
|
|
1303
|
-
return workspaces.find((workspace) => workspace.name.toLowerCase() === "main");
|
|
1304
|
-
}
|
|
1305
|
-
);
|
|
1306
|
-
const selectWorkspaceById = (id) => (state) => {
|
|
1307
|
-
return state.workspaceReducer.instances[id];
|
|
1308
|
-
};
|
|
1309
|
-
const selectPermittedWorkspaceIds = createSelector(
|
|
1310
|
-
[selectWorkspaceMapping],
|
|
1311
|
-
(mapping) => {
|
|
1312
|
-
return new Set(
|
|
1313
|
-
Object.values(mapping).filter((workspace) => workspace.permitted).map((workspace) => workspace.offline_id)
|
|
1314
|
-
);
|
|
1315
|
-
}
|
|
1316
|
-
);
|
|
1317
|
-
const workspaceReducer = workspaceSlice.reducer;
|
|
1318
|
-
const maxRecentIssues = 10;
|
|
1319
1284
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1320
|
-
const initialState$
|
|
1321
|
-
recentIssueIds: []
|
|
1322
|
-
});
|
|
1285
|
+
const initialState$t = issueAdapter.getInitialState({});
|
|
1323
1286
|
const issueSlice = createSlice({
|
|
1324
1287
|
name: "issues",
|
|
1325
|
-
initialState: initialState$
|
|
1288
|
+
initialState: initialState$t,
|
|
1326
1289
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1327
|
-
Object.assign(state, initialState$
|
|
1290
|
+
Object.assign(state, initialState$t);
|
|
1328
1291
|
}),
|
|
1329
1292
|
reducers: {
|
|
1330
1293
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1332,104 +1295,14 @@ const issueSlice = createSlice({
|
|
|
1332
1295
|
addIssues: issueAdapter.addMany,
|
|
1333
1296
|
updateIssue: issueAdapter.updateOne,
|
|
1334
1297
|
deleteIssue: issueAdapter.deleteOne,
|
|
1335
|
-
deleteIssues: issueAdapter.deleteMany
|
|
1336
|
-
cleanRecentIssues: (state) => {
|
|
1337
|
-
state.recentIssueIds = state.recentIssueIds.filter((recentIssue) => state.instances[recentIssue.offlineId]);
|
|
1338
|
-
},
|
|
1339
|
-
addToRecentIssues: (state, action) => {
|
|
1340
|
-
state.recentIssueIds = state.recentIssueIds.filter(
|
|
1341
|
-
(recentIssue) => recentIssue.offlineId !== action.payload
|
|
1342
|
-
);
|
|
1343
|
-
state.recentIssueIds.push({ offlineId: action.payload.toLowerCase(), lastOpenedEpochTime: Date.now() });
|
|
1344
|
-
if (state.recentIssueIds.length > maxRecentIssues) {
|
|
1345
|
-
state.recentIssueIds.shift();
|
|
1346
|
-
}
|
|
1347
|
-
},
|
|
1348
|
-
resetRecentIssues: (state) => {
|
|
1349
|
-
state.recentIssueIds = [];
|
|
1350
|
-
},
|
|
1351
|
-
removeRecentIssue: (state, action) => {
|
|
1352
|
-
const indexToRemove = state.recentIssueIds.findIndex((item) => {
|
|
1353
|
-
return item.offlineId == action.payload;
|
|
1354
|
-
});
|
|
1355
|
-
if (indexToRemove !== -1) {
|
|
1356
|
-
state.recentIssueIds.splice(indexToRemove, 1);
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1298
|
+
deleteIssues: issueAdapter.deleteMany
|
|
1359
1299
|
}
|
|
1360
1300
|
});
|
|
1361
|
-
const {
|
|
1362
|
-
initializeIssues,
|
|
1363
|
-
addIssue,
|
|
1364
|
-
addIssues,
|
|
1365
|
-
updateIssue,
|
|
1366
|
-
deleteIssue,
|
|
1367
|
-
deleteIssues,
|
|
1368
|
-
addToRecentIssues,
|
|
1369
|
-
cleanRecentIssues,
|
|
1370
|
-
removeRecentIssue,
|
|
1371
|
-
resetRecentIssues
|
|
1372
|
-
} = issueSlice.actions;
|
|
1301
|
+
const { initializeIssues, addIssue, addIssues, updateIssue, deleteIssue, deleteIssues } = issueSlice.actions;
|
|
1373
1302
|
const selectIssueMapping = (state) => state.issueReducer.instances;
|
|
1374
|
-
const selectRecentIssueIds = (state) => state.issueReducer.recentIssueIds;
|
|
1375
1303
|
const selectIssueById = (id) => (state) => {
|
|
1376
1304
|
return state.issueReducer.instances[id];
|
|
1377
1305
|
};
|
|
1378
|
-
const searchIssues = restructureCreateSelectorWithArgs(
|
|
1379
|
-
createSelector(
|
|
1380
|
-
[selectIssueMapping, selectWorkspaceMapping, (_state, searchArgs) => searchArgs],
|
|
1381
|
-
(mapping, workspaceMapping, searchArgs) => {
|
|
1382
|
-
let searchTerm = searchArgs.searchTerm;
|
|
1383
|
-
const maxResults = searchArgs.maxResults;
|
|
1384
|
-
searchTerm = searchTerm.toLowerCase();
|
|
1385
|
-
const ret = [];
|
|
1386
|
-
const issues = Object.values(mapping);
|
|
1387
|
-
let nbResults = 0;
|
|
1388
|
-
for (const issue of issues) {
|
|
1389
|
-
if (!issue.index_workspace) {
|
|
1390
|
-
logOnlyOnce(
|
|
1391
|
-
"issue-has-no-index-workspace",
|
|
1392
|
-
issue.offline_id,
|
|
1393
|
-
"warn",
|
|
1394
|
-
`Issue ${issue.offline_id} has no index_workspace and cannot be searched.`
|
|
1395
|
-
);
|
|
1396
|
-
continue;
|
|
1397
|
-
}
|
|
1398
|
-
const workspace = workspaceMapping[issue.index_workspace];
|
|
1399
|
-
if (!workspace) {
|
|
1400
|
-
logOnlyOnce(
|
|
1401
|
-
"issue-has-non-existent-index-workspace",
|
|
1402
|
-
issue.offline_id,
|
|
1403
|
-
"warn",
|
|
1404
|
-
`Encountered issue with an index_workspace that doesn't exist. Issue ${issue.offline_id} has
|
|
1405
|
-
index_workspace = ${issue.index_workspace}, which does not exist in:`,
|
|
1406
|
-
Object.keys(workspaceMapping)
|
|
1407
|
-
);
|
|
1408
|
-
continue;
|
|
1409
|
-
}
|
|
1410
|
-
const workspaceAbbreviation = workspace.abbreviation;
|
|
1411
|
-
if (!workspaceAbbreviation) {
|
|
1412
|
-
logOnlyOnce(
|
|
1413
|
-
"workspace-has-no-abbreviation",
|
|
1414
|
-
workspace.offline_id,
|
|
1415
|
-
"error",
|
|
1416
|
-
`Workspace ${workspace.name} has no abbreviation. Not including any issues in search.`
|
|
1417
|
-
);
|
|
1418
|
-
continue;
|
|
1419
|
-
}
|
|
1420
|
-
const tag = "index" in issue ? `${workspaceAbbreviation.toUpperCase()}-${issue.index}` : null;
|
|
1421
|
-
if ((issue.title || "").toLowerCase().includes(searchTerm) || tag && tag.toLowerCase().includes(searchTerm)) {
|
|
1422
|
-
ret.push(issueToSearchResult(issue, tag));
|
|
1423
|
-
nbResults++;
|
|
1424
|
-
if (maxResults && nbResults >= maxResults) {
|
|
1425
|
-
return ret;
|
|
1426
|
-
}
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
return ret;
|
|
1430
|
-
}
|
|
1431
|
-
)
|
|
1432
|
-
);
|
|
1433
1306
|
const selectIssuesByIds = restructureCreateSelectorWithArgs(
|
|
1434
1307
|
createSelector([selectIssueMapping, (_, issueIds) => issueIds], (issuesMapping, issueIds) => {
|
|
1435
1308
|
const issues = [];
|
|
@@ -1444,48 +1317,14 @@ const selectIssuesByIds = restructureCreateSelectorWithArgs(
|
|
|
1444
1317
|
return fallbackToEmptyArray(issues);
|
|
1445
1318
|
})
|
|
1446
1319
|
);
|
|
1447
|
-
const selectRecentIssuesAsSearchResults = createSelector(
|
|
1448
|
-
[selectIssueMapping, selectRecentIssueIds, selectWorkspaceMapping],
|
|
1449
|
-
(issueMapping, recentIssueIds, workspaceMapping) => {
|
|
1450
|
-
const ret = [];
|
|
1451
|
-
for (const recentIssueResult of recentIssueIds) {
|
|
1452
|
-
const issue = issueMapping[recentIssueResult.offlineId];
|
|
1453
|
-
if (!issue) {
|
|
1454
|
-
console.info("Recent issue no longer exists");
|
|
1455
|
-
continue;
|
|
1456
|
-
}
|
|
1457
|
-
if ("index" in issue && issue.index_workspace) {
|
|
1458
|
-
const indexWorkspace = workspaceMapping[issue.index_workspace];
|
|
1459
|
-
if (!indexWorkspace) {
|
|
1460
|
-
logOnlyOnce(
|
|
1461
|
-
"issue-has-index-but-not-index-workspace",
|
|
1462
|
-
issue.offline_id,
|
|
1463
|
-
"warn",
|
|
1464
|
-
`Issue ${issue.offline_id} has an index but no index_workspace. This may be because the
|
|
1465
|
-
workspace has been deleted, but the new index has not been returned by the server yet. It will not
|
|
1466
|
-
be included in search results.`
|
|
1467
|
-
);
|
|
1468
|
-
continue;
|
|
1469
|
-
}
|
|
1470
|
-
const workspaceTag = `${indexWorkspace.abbreviation}-${issue.index}`;
|
|
1471
|
-
const searchResult = {
|
|
1472
|
-
...issueToSearchResult(issue, workspaceTag),
|
|
1473
|
-
lastOpenedEpochTime: recentIssueResult.lastOpenedEpochTime
|
|
1474
|
-
};
|
|
1475
|
-
ret.push(searchResult);
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
return ret;
|
|
1479
|
-
}
|
|
1480
|
-
);
|
|
1481
1320
|
const issueReducer = issueSlice.reducer;
|
|
1482
1321
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1483
|
-
const initialState$
|
|
1322
|
+
const initialState$s = issueTypeAdapter.getInitialState({});
|
|
1484
1323
|
const issueTypeSlice = createSlice({
|
|
1485
1324
|
name: "issueTypes",
|
|
1486
|
-
initialState: initialState$
|
|
1325
|
+
initialState: initialState$s,
|
|
1487
1326
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1488
|
-
Object.assign(state, initialState$
|
|
1327
|
+
Object.assign(state, initialState$s);
|
|
1489
1328
|
}),
|
|
1490
1329
|
reducers: {
|
|
1491
1330
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1542,15 +1381,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
|
|
|
1542
1381
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1543
1382
|
};
|
|
1544
1383
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1545
|
-
const initialState$
|
|
1384
|
+
const initialState$r = {
|
|
1546
1385
|
s3Urls: {}
|
|
1547
1386
|
};
|
|
1548
1387
|
const msPerHour = 1e3 * 60 * 60;
|
|
1549
1388
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1550
1389
|
const fileSlice = createSlice({
|
|
1551
1390
|
name: "file",
|
|
1552
|
-
initialState: initialState$
|
|
1553
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1391
|
+
initialState: initialState$r,
|
|
1392
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1554
1393
|
reducers: {
|
|
1555
1394
|
setUploadUrl: (state, action) => {
|
|
1556
1395
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1631,14 +1470,14 @@ var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
|
1631
1470
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1632
1471
|
return LicenseStatus2;
|
|
1633
1472
|
})(LicenseStatus || {});
|
|
1634
|
-
const initialState$
|
|
1473
|
+
const initialState$q = {
|
|
1635
1474
|
users: {},
|
|
1636
1475
|
currentUser: null
|
|
1637
1476
|
};
|
|
1638
1477
|
const userSlice = createSlice({
|
|
1639
1478
|
name: "users",
|
|
1640
|
-
initialState: initialState$
|
|
1641
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1479
|
+
initialState: initialState$q,
|
|
1480
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1642
1481
|
reducers: {
|
|
1643
1482
|
setUsers: (state, action) => {
|
|
1644
1483
|
const usersMapping = {};
|
|
@@ -1696,11 +1535,11 @@ const selectUsersByIds = restructureCreateSelectorWithArgs(
|
|
|
1696
1535
|
const organizationAccessAdapter = createModelAdapter(
|
|
1697
1536
|
(organizationAccess) => organizationAccess.offline_id
|
|
1698
1537
|
);
|
|
1699
|
-
const initialState$
|
|
1538
|
+
const initialState$p = organizationAccessAdapter.getInitialState({});
|
|
1700
1539
|
const organizationAccessSlice = createSlice({
|
|
1701
1540
|
name: "organizationAccess",
|
|
1702
|
-
initialState: initialState$
|
|
1703
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1541
|
+
initialState: initialState$p,
|
|
1542
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1704
1543
|
reducers: {
|
|
1705
1544
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1706
1545
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1737,11 +1576,11 @@ const selectOrganizationAccessUserMapping = (state) => {
|
|
|
1737
1576
|
};
|
|
1738
1577
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1739
1578
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1740
|
-
const initialState$
|
|
1579
|
+
const initialState$o = licenseAdapter.getInitialState({});
|
|
1741
1580
|
const licenseSlice = createSlice({
|
|
1742
1581
|
name: "license",
|
|
1743
|
-
initialState: initialState$
|
|
1744
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1582
|
+
initialState: initialState$o,
|
|
1583
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1745
1584
|
reducers: {
|
|
1746
1585
|
initializeLicences: licenseAdapter.initialize,
|
|
1747
1586
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1766,11 +1605,11 @@ const selectLicensesForProjectsMapping = createSelector(
|
|
|
1766
1605
|
);
|
|
1767
1606
|
const licenseReducer = licenseSlice.reducer;
|
|
1768
1607
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1769
|
-
const initialState$
|
|
1608
|
+
const initialState$n = projectAccessAdapter.getInitialState({});
|
|
1770
1609
|
const projectAccessSlice = createSlice({
|
|
1771
1610
|
name: "projectAccess",
|
|
1772
|
-
initialState: initialState$
|
|
1773
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1611
|
+
initialState: initialState$n,
|
|
1612
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1774
1613
|
reducers: {
|
|
1775
1614
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1776
1615
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1811,14 +1650,14 @@ const selectProjectAccessUserMapping = (state) => {
|
|
|
1811
1650
|
return projectAccesses;
|
|
1812
1651
|
};
|
|
1813
1652
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1814
|
-
const initialState$
|
|
1653
|
+
const initialState$m = {
|
|
1815
1654
|
projects: {},
|
|
1816
1655
|
activeProjectId: null
|
|
1817
1656
|
};
|
|
1818
1657
|
const projectSlice = createSlice({
|
|
1819
1658
|
name: "projects",
|
|
1820
|
-
initialState: initialState$
|
|
1821
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1659
|
+
initialState: initialState$m,
|
|
1660
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1822
1661
|
reducers: {
|
|
1823
1662
|
setProjects: (state, action) => {
|
|
1824
1663
|
const projectsMap = {};
|
|
@@ -1925,13 +1764,13 @@ const selectSortedProjectUsers = createSelector(
|
|
|
1925
1764
|
});
|
|
1926
1765
|
}
|
|
1927
1766
|
);
|
|
1928
|
-
const initialState$
|
|
1767
|
+
const initialState$l = {
|
|
1929
1768
|
organizations: {}
|
|
1930
1769
|
};
|
|
1931
1770
|
const organizationSlice = createSlice({
|
|
1932
1771
|
name: "organizations",
|
|
1933
|
-
initialState: initialState$
|
|
1934
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1772
|
+
initialState: initialState$l,
|
|
1773
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1935
1774
|
reducers: {
|
|
1936
1775
|
setOrganizations: (state, action) => {
|
|
1937
1776
|
for (const org of action.payload) {
|
|
@@ -2022,14 +1861,14 @@ const createOfflineAction = (request2, baseUrl, serviceName) => {
|
|
|
2022
1861
|
}
|
|
2023
1862
|
};
|
|
2024
1863
|
};
|
|
2025
|
-
const initialState$
|
|
1864
|
+
const initialState$k = {
|
|
2026
1865
|
deletedRequests: [],
|
|
2027
1866
|
latestRetryTime: 0
|
|
2028
1867
|
};
|
|
2029
1868
|
const outboxSlice = createSlice({
|
|
2030
1869
|
name: "outbox",
|
|
2031
|
-
initialState: initialState$
|
|
2032
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1870
|
+
initialState: initialState$k,
|
|
1871
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2033
1872
|
reducers: {
|
|
2034
1873
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2035
1874
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2061,15 +1900,15 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
|
|
|
2061
1900
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2062
1901
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2063
1902
|
const outboxReducer = outboxSlice.reducer;
|
|
2064
|
-
const initialState$
|
|
1903
|
+
const initialState$j = {
|
|
2065
1904
|
projectFiles: {},
|
|
2066
1905
|
activeProjectFileId: null,
|
|
2067
1906
|
isImportingProjectFile: false
|
|
2068
1907
|
};
|
|
2069
1908
|
const projectFileSlice = createSlice({
|
|
2070
1909
|
name: "projectFiles",
|
|
2071
|
-
initialState: initialState$
|
|
2072
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1910
|
+
initialState: initialState$j,
|
|
1911
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2073
1912
|
reducers: {
|
|
2074
1913
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2075
1914
|
for (let fileObj of action.payload) {
|
|
@@ -2156,11 +1995,11 @@ const selectProjectFileById = (id) => (state) => {
|
|
|
2156
1995
|
};
|
|
2157
1996
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2158
1997
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2159
|
-
const initialState$
|
|
1998
|
+
const initialState$i = projectAttachmentAdapter.getInitialState({});
|
|
2160
1999
|
const projectAttachmentSlice = createSlice({
|
|
2161
2000
|
name: "projectAttachments",
|
|
2162
|
-
initialState: initialState$
|
|
2163
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2001
|
+
initialState: initialState$i,
|
|
2002
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2164
2003
|
reducers: {
|
|
2165
2004
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2166
2005
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2215,12 +2054,12 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
|
|
|
2215
2054
|
)
|
|
2216
2055
|
);
|
|
2217
2056
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2218
|
-
const initialState$
|
|
2057
|
+
const initialState$h = {
|
|
2219
2058
|
isRehydrated: false
|
|
2220
2059
|
};
|
|
2221
2060
|
const rehydratedSlice = createSlice({
|
|
2222
2061
|
name: "rehydrated",
|
|
2223
|
-
initialState: initialState$
|
|
2062
|
+
initialState: initialState$h,
|
|
2224
2063
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2225
2064
|
reducers: {
|
|
2226
2065
|
setRehydrated: (state, action) => {
|
|
@@ -2245,11 +2084,11 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
|
|
|
2245
2084
|
}
|
|
2246
2085
|
};
|
|
2247
2086
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2248
|
-
const initialState$
|
|
2087
|
+
const initialState$g = formRevisionAdapter.getInitialState({});
|
|
2249
2088
|
const formRevisionsSlice = createSlice({
|
|
2250
2089
|
name: "formRevisions",
|
|
2251
|
-
initialState: initialState$
|
|
2252
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2090
|
+
initialState: initialState$g,
|
|
2091
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2253
2092
|
reducers: {
|
|
2254
2093
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2255
2094
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2321,11 +2160,11 @@ const selectLatestFormRevisionByForm = createSelector([selectFormRevisionMapping
|
|
|
2321
2160
|
});
|
|
2322
2161
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2323
2162
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2324
|
-
const initialState$
|
|
2163
|
+
const initialState$f = formAdapter.getInitialState({});
|
|
2325
2164
|
const formSlice = createSlice({
|
|
2326
2165
|
name: "forms",
|
|
2327
|
-
initialState: initialState$
|
|
2328
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2166
|
+
initialState: initialState$f,
|
|
2167
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2329
2168
|
reducers: {
|
|
2330
2169
|
initializeForms: formAdapter.initialize,
|
|
2331
2170
|
setForm: formAdapter.setOne,
|
|
@@ -2394,11 +2233,11 @@ const selectGeneralFormCount = createSelector([selectFormMapping], (formsMapping
|
|
|
2394
2233
|
return Object.values(formsMapping).filter((form) => !form.asset_type).length;
|
|
2395
2234
|
});
|
|
2396
2235
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2397
|
-
const initialState$
|
|
2236
|
+
const initialState$e = submissionAdapter.getInitialState({});
|
|
2398
2237
|
const formSubmissionSlice = createSlice({
|
|
2399
2238
|
name: "formSubmissions",
|
|
2400
|
-
initialState: initialState$
|
|
2401
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2239
|
+
initialState: initialState$e,
|
|
2240
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2402
2241
|
reducers: {
|
|
2403
2242
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2404
2243
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2610,11 +2449,11 @@ const formSubmissionReducer = formSubmissionSlice.reducer;
|
|
|
2610
2449
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2611
2450
|
(attachment) => attachment.offline_id
|
|
2612
2451
|
);
|
|
2613
|
-
const initialState$
|
|
2452
|
+
const initialState$d = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2614
2453
|
const formSubmissionAttachmentSlice = createSlice({
|
|
2615
2454
|
name: "formSubmissionAttachments",
|
|
2616
|
-
initialState: initialState$
|
|
2617
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2455
|
+
initialState: initialState$d,
|
|
2456
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2618
2457
|
reducers: {
|
|
2619
2458
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2620
2459
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2666,11 +2505,11 @@ const formSubmissionAttachmentReducer = formSubmissionAttachmentSlice.reducer;
|
|
|
2666
2505
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2667
2506
|
(attachment) => attachment.offline_id
|
|
2668
2507
|
);
|
|
2669
|
-
const initialState$
|
|
2508
|
+
const initialState$c = formRevisionAttachmentAdapter.getInitialState({});
|
|
2670
2509
|
const formRevisionAttachmentSlice = createSlice({
|
|
2671
2510
|
name: "formRevisionAttachments",
|
|
2672
|
-
initialState: initialState$
|
|
2673
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2511
|
+
initialState: initialState$c,
|
|
2512
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2674
2513
|
reducers: {
|
|
2675
2514
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2676
2515
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2708,6 +2547,40 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
|
|
|
2708
2547
|
)
|
|
2709
2548
|
);
|
|
2710
2549
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2550
|
+
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
2551
|
+
const initialState$b = workspaceAdapter.getInitialState({});
|
|
2552
|
+
const workspaceSlice = createSlice({
|
|
2553
|
+
name: "workspace",
|
|
2554
|
+
initialState: initialState$b,
|
|
2555
|
+
reducers: {
|
|
2556
|
+
initializeWorkspaces: workspaceAdapter.initialize,
|
|
2557
|
+
setWorkspaces: workspaceAdapter.setMany,
|
|
2558
|
+
addWorkspace: workspaceAdapter.addOne,
|
|
2559
|
+
updateWorkspace: workspaceAdapter.updateOne,
|
|
2560
|
+
deleteWorkspace: workspaceAdapter.deleteOne
|
|
2561
|
+
}
|
|
2562
|
+
});
|
|
2563
|
+
const { initializeWorkspaces, setWorkspaces, addWorkspace, updateWorkspace, deleteWorkspace } = workspaceSlice.actions;
|
|
2564
|
+
const selectWorkspaceMapping = (state) => state.workspaceReducer.instances;
|
|
2565
|
+
const selectWorkspaces = createSelector([selectWorkspaceMapping], (mapping) => Object.values(mapping));
|
|
2566
|
+
const selectMainWorkspace = createSelector(
|
|
2567
|
+
[selectWorkspaces],
|
|
2568
|
+
(workspaces) => {
|
|
2569
|
+
return workspaces.find((workspace) => workspace.name.toLowerCase() === "main");
|
|
2570
|
+
}
|
|
2571
|
+
);
|
|
2572
|
+
const selectWorkspaceById = (id) => (state) => {
|
|
2573
|
+
return state.workspaceReducer.instances[id];
|
|
2574
|
+
};
|
|
2575
|
+
const selectPermittedWorkspaceIds = createSelector(
|
|
2576
|
+
[selectWorkspaceMapping],
|
|
2577
|
+
(mapping) => {
|
|
2578
|
+
return new Set(
|
|
2579
|
+
Object.values(mapping).filter((workspace) => workspace.permitted).map((workspace) => workspace.offline_id)
|
|
2580
|
+
);
|
|
2581
|
+
}
|
|
2582
|
+
);
|
|
2583
|
+
const workspaceReducer = workspaceSlice.reducer;
|
|
2711
2584
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2712
2585
|
const initialState$a = emailDomainAdapter.getInitialState({});
|
|
2713
2586
|
const emailDomainsSlice = createSlice({
|
|
@@ -4892,7 +4765,6 @@ class IssueService extends BaseApiService {
|
|
|
4892
4765
|
created_by: createdBy
|
|
4893
4766
|
});
|
|
4894
4767
|
this.dispatch(addIssue(offlineIssue));
|
|
4895
|
-
this.dispatch(addToRecentIssues(offlineIssue.offline_id));
|
|
4896
4768
|
this.dispatch(addActiveProjectIssuesCount(1));
|
|
4897
4769
|
const promise = this.enqueueRequest({
|
|
4898
4770
|
description: "Create issue",
|
|
@@ -7562,7 +7434,6 @@ export {
|
|
|
7562
7434
|
addStageCompletions,
|
|
7563
7435
|
addStages,
|
|
7564
7436
|
addTeam,
|
|
7565
|
-
addToRecentIssues,
|
|
7566
7437
|
addUsers,
|
|
7567
7438
|
addWorkspace,
|
|
7568
7439
|
agentsReducer,
|
|
@@ -7587,7 +7458,6 @@ export {
|
|
|
7587
7458
|
categoryReducer,
|
|
7588
7459
|
categorySlice,
|
|
7589
7460
|
classNames,
|
|
7590
|
-
cleanRecentIssues,
|
|
7591
7461
|
clearTokens,
|
|
7592
7462
|
constructUploadedFilePayloads,
|
|
7593
7463
|
coordinatesAreEqual,
|
|
@@ -7761,16 +7631,13 @@ export {
|
|
|
7761
7631
|
removeIssueType,
|
|
7762
7632
|
removeProjectFile,
|
|
7763
7633
|
removeProjectFilesOfProject,
|
|
7764
|
-
removeRecentIssue,
|
|
7765
7634
|
removeStageCompletions,
|
|
7766
7635
|
removeStages,
|
|
7767
7636
|
removeUser,
|
|
7768
7637
|
resetProjectFileObjectUrls,
|
|
7769
|
-
resetRecentIssues,
|
|
7770
7638
|
resetStore,
|
|
7771
7639
|
restructureCreateSelectorWithArgs,
|
|
7772
7640
|
saveActiveProjectFileBounds,
|
|
7773
|
-
searchIssues,
|
|
7774
7641
|
selectAccessToken,
|
|
7775
7642
|
selectActiveOrganizationAccess,
|
|
7776
7643
|
selectActiveProject,
|
|
@@ -7926,8 +7793,6 @@ export {
|
|
|
7926
7793
|
selectProjectUsersAsMapping,
|
|
7927
7794
|
selectProjectUsersIds,
|
|
7928
7795
|
selectProjectsOfOrganization,
|
|
7929
|
-
selectRecentIssueIds,
|
|
7930
|
-
selectRecentIssuesAsSearchResults,
|
|
7931
7796
|
selectRehydrated,
|
|
7932
7797
|
selectRootDocuments,
|
|
7933
7798
|
selectSortedFormSubmissionsOfForm,
|