@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
|
@@ -1269,50 +1269,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1269
1269
|
)
|
|
1270
1270
|
);
|
|
1271
1271
|
const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
|
|
1272
|
-
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
1273
|
-
const initialState$t = workspaceAdapter.getInitialState({});
|
|
1274
|
-
const workspaceSlice = toolkit.createSlice({
|
|
1275
|
-
name: "workspace",
|
|
1276
|
-
initialState: initialState$t,
|
|
1277
|
-
reducers: {
|
|
1278
|
-
initializeWorkspaces: workspaceAdapter.initialize,
|
|
1279
|
-
setWorkspaces: workspaceAdapter.setMany,
|
|
1280
|
-
addWorkspace: workspaceAdapter.addOne,
|
|
1281
|
-
updateWorkspace: workspaceAdapter.updateOne,
|
|
1282
|
-
deleteWorkspace: workspaceAdapter.deleteOne
|
|
1283
|
-
}
|
|
1284
|
-
});
|
|
1285
|
-
const { initializeWorkspaces, setWorkspaces, addWorkspace, updateWorkspace, deleteWorkspace } = workspaceSlice.actions;
|
|
1286
|
-
const selectWorkspaceMapping = (state) => state.workspaceReducer.instances;
|
|
1287
|
-
const selectWorkspaces = toolkit.createSelector([selectWorkspaceMapping], (mapping) => Object.values(mapping));
|
|
1288
|
-
const selectMainWorkspace = toolkit.createSelector(
|
|
1289
|
-
[selectWorkspaces],
|
|
1290
|
-
(workspaces) => {
|
|
1291
|
-
return workspaces.find((workspace) => workspace.name.toLowerCase() === "main");
|
|
1292
|
-
}
|
|
1293
|
-
);
|
|
1294
|
-
const selectWorkspaceById = (id) => (state) => {
|
|
1295
|
-
return state.workspaceReducer.instances[id];
|
|
1296
|
-
};
|
|
1297
|
-
const selectPermittedWorkspaceIds = toolkit.createSelector(
|
|
1298
|
-
[selectWorkspaceMapping],
|
|
1299
|
-
(mapping) => {
|
|
1300
|
-
return new Set(
|
|
1301
|
-
Object.values(mapping).filter((workspace) => workspace.permitted).map((workspace) => workspace.offline_id)
|
|
1302
|
-
);
|
|
1303
|
-
}
|
|
1304
|
-
);
|
|
1305
|
-
const workspaceReducer = workspaceSlice.reducer;
|
|
1306
|
-
const maxRecentIssues = 10;
|
|
1307
1272
|
const issueAdapter = createModelAdapter((issue) => issue.offline_id);
|
|
1308
|
-
const initialState$
|
|
1309
|
-
recentIssueIds: []
|
|
1310
|
-
});
|
|
1273
|
+
const initialState$t = issueAdapter.getInitialState({});
|
|
1311
1274
|
const issueSlice = toolkit.createSlice({
|
|
1312
1275
|
name: "issues",
|
|
1313
|
-
initialState: initialState$
|
|
1276
|
+
initialState: initialState$t,
|
|
1314
1277
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1315
|
-
Object.assign(state, initialState$
|
|
1278
|
+
Object.assign(state, initialState$t);
|
|
1316
1279
|
}),
|
|
1317
1280
|
reducers: {
|
|
1318
1281
|
initializeIssues: issueAdapter.initialize,
|
|
@@ -1320,104 +1283,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1320
1283
|
addIssues: issueAdapter.addMany,
|
|
1321
1284
|
updateIssue: issueAdapter.updateOne,
|
|
1322
1285
|
deleteIssue: issueAdapter.deleteOne,
|
|
1323
|
-
deleteIssues: issueAdapter.deleteMany
|
|
1324
|
-
cleanRecentIssues: (state) => {
|
|
1325
|
-
state.recentIssueIds = state.recentIssueIds.filter((recentIssue) => state.instances[recentIssue.offlineId]);
|
|
1326
|
-
},
|
|
1327
|
-
addToRecentIssues: (state, action) => {
|
|
1328
|
-
state.recentIssueIds = state.recentIssueIds.filter(
|
|
1329
|
-
(recentIssue) => recentIssue.offlineId !== action.payload
|
|
1330
|
-
);
|
|
1331
|
-
state.recentIssueIds.push({ offlineId: action.payload.toLowerCase(), lastOpenedEpochTime: Date.now() });
|
|
1332
|
-
if (state.recentIssueIds.length > maxRecentIssues) {
|
|
1333
|
-
state.recentIssueIds.shift();
|
|
1334
|
-
}
|
|
1335
|
-
},
|
|
1336
|
-
resetRecentIssues: (state) => {
|
|
1337
|
-
state.recentIssueIds = [];
|
|
1338
|
-
},
|
|
1339
|
-
removeRecentIssue: (state, action) => {
|
|
1340
|
-
const indexToRemove = state.recentIssueIds.findIndex((item) => {
|
|
1341
|
-
return item.offlineId == action.payload;
|
|
1342
|
-
});
|
|
1343
|
-
if (indexToRemove !== -1) {
|
|
1344
|
-
state.recentIssueIds.splice(indexToRemove, 1);
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1286
|
+
deleteIssues: issueAdapter.deleteMany
|
|
1347
1287
|
}
|
|
1348
1288
|
});
|
|
1349
|
-
const {
|
|
1350
|
-
initializeIssues,
|
|
1351
|
-
addIssue,
|
|
1352
|
-
addIssues,
|
|
1353
|
-
updateIssue,
|
|
1354
|
-
deleteIssue,
|
|
1355
|
-
deleteIssues,
|
|
1356
|
-
addToRecentIssues,
|
|
1357
|
-
cleanRecentIssues,
|
|
1358
|
-
removeRecentIssue,
|
|
1359
|
-
resetRecentIssues
|
|
1360
|
-
} = issueSlice.actions;
|
|
1289
|
+
const { initializeIssues, addIssue, addIssues, updateIssue, deleteIssue, deleteIssues } = issueSlice.actions;
|
|
1361
1290
|
const selectIssueMapping = (state) => state.issueReducer.instances;
|
|
1362
|
-
const selectRecentIssueIds = (state) => state.issueReducer.recentIssueIds;
|
|
1363
1291
|
const selectIssueById = (id) => (state) => {
|
|
1364
1292
|
return state.issueReducer.instances[id];
|
|
1365
1293
|
};
|
|
1366
|
-
const searchIssues = restructureCreateSelectorWithArgs(
|
|
1367
|
-
toolkit.createSelector(
|
|
1368
|
-
[selectIssueMapping, selectWorkspaceMapping, (_state, searchArgs) => searchArgs],
|
|
1369
|
-
(mapping, workspaceMapping, searchArgs) => {
|
|
1370
|
-
let searchTerm = searchArgs.searchTerm;
|
|
1371
|
-
const maxResults = searchArgs.maxResults;
|
|
1372
|
-
searchTerm = searchTerm.toLowerCase();
|
|
1373
|
-
const ret = [];
|
|
1374
|
-
const issues = Object.values(mapping);
|
|
1375
|
-
let nbResults = 0;
|
|
1376
|
-
for (const issue of issues) {
|
|
1377
|
-
if (!issue.index_workspace) {
|
|
1378
|
-
logOnlyOnce(
|
|
1379
|
-
"issue-has-no-index-workspace",
|
|
1380
|
-
issue.offline_id,
|
|
1381
|
-
"warn",
|
|
1382
|
-
`Issue ${issue.offline_id} has no index_workspace and cannot be searched.`
|
|
1383
|
-
);
|
|
1384
|
-
continue;
|
|
1385
|
-
}
|
|
1386
|
-
const workspace = workspaceMapping[issue.index_workspace];
|
|
1387
|
-
if (!workspace) {
|
|
1388
|
-
logOnlyOnce(
|
|
1389
|
-
"issue-has-non-existent-index-workspace",
|
|
1390
|
-
issue.offline_id,
|
|
1391
|
-
"warn",
|
|
1392
|
-
`Encountered issue with an index_workspace that doesn't exist. Issue ${issue.offline_id} has
|
|
1393
|
-
index_workspace = ${issue.index_workspace}, which does not exist in:`,
|
|
1394
|
-
Object.keys(workspaceMapping)
|
|
1395
|
-
);
|
|
1396
|
-
continue;
|
|
1397
|
-
}
|
|
1398
|
-
const workspaceAbbreviation = workspace.abbreviation;
|
|
1399
|
-
if (!workspaceAbbreviation) {
|
|
1400
|
-
logOnlyOnce(
|
|
1401
|
-
"workspace-has-no-abbreviation",
|
|
1402
|
-
workspace.offline_id,
|
|
1403
|
-
"error",
|
|
1404
|
-
`Workspace ${workspace.name} has no abbreviation. Not including any issues in search.`
|
|
1405
|
-
);
|
|
1406
|
-
continue;
|
|
1407
|
-
}
|
|
1408
|
-
const tag = "index" in issue ? `${workspaceAbbreviation.toUpperCase()}-${issue.index}` : null;
|
|
1409
|
-
if ((issue.title || "").toLowerCase().includes(searchTerm) || tag && tag.toLowerCase().includes(searchTerm)) {
|
|
1410
|
-
ret.push(issueToSearchResult(issue, tag));
|
|
1411
|
-
nbResults++;
|
|
1412
|
-
if (maxResults && nbResults >= maxResults) {
|
|
1413
|
-
return ret;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
return ret;
|
|
1418
|
-
}
|
|
1419
|
-
)
|
|
1420
|
-
);
|
|
1421
1294
|
const selectIssuesByIds = restructureCreateSelectorWithArgs(
|
|
1422
1295
|
toolkit.createSelector([selectIssueMapping, (_, issueIds) => issueIds], (issuesMapping, issueIds) => {
|
|
1423
1296
|
const issues = [];
|
|
@@ -1432,48 +1305,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1432
1305
|
return fallbackToEmptyArray(issues);
|
|
1433
1306
|
})
|
|
1434
1307
|
);
|
|
1435
|
-
const selectRecentIssuesAsSearchResults = toolkit.createSelector(
|
|
1436
|
-
[selectIssueMapping, selectRecentIssueIds, selectWorkspaceMapping],
|
|
1437
|
-
(issueMapping, recentIssueIds, workspaceMapping) => {
|
|
1438
|
-
const ret = [];
|
|
1439
|
-
for (const recentIssueResult of recentIssueIds) {
|
|
1440
|
-
const issue = issueMapping[recentIssueResult.offlineId];
|
|
1441
|
-
if (!issue) {
|
|
1442
|
-
console.info("Recent issue no longer exists");
|
|
1443
|
-
continue;
|
|
1444
|
-
}
|
|
1445
|
-
if ("index" in issue && issue.index_workspace) {
|
|
1446
|
-
const indexWorkspace = workspaceMapping[issue.index_workspace];
|
|
1447
|
-
if (!indexWorkspace) {
|
|
1448
|
-
logOnlyOnce(
|
|
1449
|
-
"issue-has-index-but-not-index-workspace",
|
|
1450
|
-
issue.offline_id,
|
|
1451
|
-
"warn",
|
|
1452
|
-
`Issue ${issue.offline_id} has an index but no index_workspace. This may be because the
|
|
1453
|
-
workspace has been deleted, but the new index has not been returned by the server yet. It will not
|
|
1454
|
-
be included in search results.`
|
|
1455
|
-
);
|
|
1456
|
-
continue;
|
|
1457
|
-
}
|
|
1458
|
-
const workspaceTag = `${indexWorkspace.abbreviation}-${issue.index}`;
|
|
1459
|
-
const searchResult = {
|
|
1460
|
-
...issueToSearchResult(issue, workspaceTag),
|
|
1461
|
-
lastOpenedEpochTime: recentIssueResult.lastOpenedEpochTime
|
|
1462
|
-
};
|
|
1463
|
-
ret.push(searchResult);
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
return ret;
|
|
1467
|
-
}
|
|
1468
|
-
);
|
|
1469
1308
|
const issueReducer = issueSlice.reducer;
|
|
1470
1309
|
const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
|
|
1471
|
-
const initialState$
|
|
1310
|
+
const initialState$s = issueTypeAdapter.getInitialState({});
|
|
1472
1311
|
const issueTypeSlice = toolkit.createSlice({
|
|
1473
1312
|
name: "issueTypes",
|
|
1474
|
-
initialState: initialState$
|
|
1313
|
+
initialState: initialState$s,
|
|
1475
1314
|
extraReducers: (builder) => builder.addCase("RESET", (state) => {
|
|
1476
|
-
Object.assign(state, initialState$
|
|
1315
|
+
Object.assign(state, initialState$s);
|
|
1477
1316
|
}),
|
|
1478
1317
|
reducers: {
|
|
1479
1318
|
initializeIssueTypes: issueTypeAdapter.initialize,
|
|
@@ -1530,15 +1369,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1530
1369
|
return selectIssuesOfIssueType(issueTypeId)(state).length;
|
|
1531
1370
|
};
|
|
1532
1371
|
const issueTypeReducer = issueTypeSlice.reducer;
|
|
1533
|
-
const initialState$
|
|
1372
|
+
const initialState$r = {
|
|
1534
1373
|
s3Urls: {}
|
|
1535
1374
|
};
|
|
1536
1375
|
const msPerHour = 1e3 * 60 * 60;
|
|
1537
1376
|
const msPerWeek = msPerHour * 24 * 7;
|
|
1538
1377
|
const fileSlice = toolkit.createSlice({
|
|
1539
1378
|
name: "file",
|
|
1540
|
-
initialState: initialState$
|
|
1541
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1379
|
+
initialState: initialState$r,
|
|
1380
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
|
|
1542
1381
|
reducers: {
|
|
1543
1382
|
setUploadUrl: (state, action) => {
|
|
1544
1383
|
const { url, fields, sha1 } = action.payload;
|
|
@@ -1619,14 +1458,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1619
1458
|
LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
|
|
1620
1459
|
return LicenseStatus2;
|
|
1621
1460
|
})(LicenseStatus || {});
|
|
1622
|
-
const initialState$
|
|
1461
|
+
const initialState$q = {
|
|
1623
1462
|
users: {},
|
|
1624
1463
|
currentUser: null
|
|
1625
1464
|
};
|
|
1626
1465
|
const userSlice = toolkit.createSlice({
|
|
1627
1466
|
name: "users",
|
|
1628
|
-
initialState: initialState$
|
|
1629
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1467
|
+
initialState: initialState$q,
|
|
1468
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1630
1469
|
reducers: {
|
|
1631
1470
|
setUsers: (state, action) => {
|
|
1632
1471
|
const usersMapping = {};
|
|
@@ -1684,11 +1523,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1684
1523
|
const organizationAccessAdapter = createModelAdapter(
|
|
1685
1524
|
(organizationAccess) => organizationAccess.offline_id
|
|
1686
1525
|
);
|
|
1687
|
-
const initialState$
|
|
1526
|
+
const initialState$p = organizationAccessAdapter.getInitialState({});
|
|
1688
1527
|
const organizationAccessSlice = toolkit.createSlice({
|
|
1689
1528
|
name: "organizationAccess",
|
|
1690
|
-
initialState: initialState$
|
|
1691
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1529
|
+
initialState: initialState$p,
|
|
1530
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1692
1531
|
reducers: {
|
|
1693
1532
|
initializeOrganizationAccesses: organizationAccessAdapter.initialize,
|
|
1694
1533
|
updateOrganizationAccess: organizationAccessAdapter.updateOne,
|
|
@@ -1725,11 +1564,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1725
1564
|
};
|
|
1726
1565
|
const organizationAccessReducer = organizationAccessSlice.reducer;
|
|
1727
1566
|
const licenseAdapter = createModelAdapter((license) => license.offline_id);
|
|
1728
|
-
const initialState$
|
|
1567
|
+
const initialState$o = licenseAdapter.getInitialState({});
|
|
1729
1568
|
const licenseSlice = toolkit.createSlice({
|
|
1730
1569
|
name: "license",
|
|
1731
|
-
initialState: initialState$
|
|
1732
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1570
|
+
initialState: initialState$o,
|
|
1571
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1733
1572
|
reducers: {
|
|
1734
1573
|
initializeLicences: licenseAdapter.initialize,
|
|
1735
1574
|
addLicenses: licenseAdapter.addMany,
|
|
@@ -1754,11 +1593,11 @@ var __publicField = (obj, key, value) => {
|
|
|
1754
1593
|
);
|
|
1755
1594
|
const licenseReducer = licenseSlice.reducer;
|
|
1756
1595
|
const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
|
|
1757
|
-
const initialState$
|
|
1596
|
+
const initialState$n = projectAccessAdapter.getInitialState({});
|
|
1758
1597
|
const projectAccessSlice = toolkit.createSlice({
|
|
1759
1598
|
name: "projectAccess",
|
|
1760
|
-
initialState: initialState$
|
|
1761
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1599
|
+
initialState: initialState$n,
|
|
1600
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1762
1601
|
reducers: {
|
|
1763
1602
|
initializeProjectAccesses: projectAccessAdapter.initialize,
|
|
1764
1603
|
updateProjectAccess: projectAccessAdapter.updateOne,
|
|
@@ -1799,14 +1638,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1799
1638
|
return projectAccesses;
|
|
1800
1639
|
};
|
|
1801
1640
|
const projectAccessReducer = projectAccessSlice.reducer;
|
|
1802
|
-
const initialState$
|
|
1641
|
+
const initialState$m = {
|
|
1803
1642
|
projects: {},
|
|
1804
1643
|
activeProjectId: null
|
|
1805
1644
|
};
|
|
1806
1645
|
const projectSlice = toolkit.createSlice({
|
|
1807
1646
|
name: "projects",
|
|
1808
|
-
initialState: initialState$
|
|
1809
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1647
|
+
initialState: initialState$m,
|
|
1648
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
|
|
1810
1649
|
reducers: {
|
|
1811
1650
|
setProjects: (state, action) => {
|
|
1812
1651
|
const projectsMap = {};
|
|
@@ -1913,13 +1752,13 @@ var __publicField = (obj, key, value) => {
|
|
|
1913
1752
|
});
|
|
1914
1753
|
}
|
|
1915
1754
|
);
|
|
1916
|
-
const initialState$
|
|
1755
|
+
const initialState$l = {
|
|
1917
1756
|
organizations: {}
|
|
1918
1757
|
};
|
|
1919
1758
|
const organizationSlice = toolkit.createSlice({
|
|
1920
1759
|
name: "organizations",
|
|
1921
|
-
initialState: initialState$
|
|
1922
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1760
|
+
initialState: initialState$l,
|
|
1761
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1923
1762
|
reducers: {
|
|
1924
1763
|
setOrganizations: (state, action) => {
|
|
1925
1764
|
for (const org of action.payload) {
|
|
@@ -2010,14 +1849,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2010
1849
|
}
|
|
2011
1850
|
};
|
|
2012
1851
|
};
|
|
2013
|
-
const initialState$
|
|
1852
|
+
const initialState$k = {
|
|
2014
1853
|
deletedRequests: [],
|
|
2015
1854
|
latestRetryTime: 0
|
|
2016
1855
|
};
|
|
2017
1856
|
const outboxSlice = toolkit.createSlice({
|
|
2018
1857
|
name: "outbox",
|
|
2019
|
-
initialState: initialState$
|
|
2020
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1858
|
+
initialState: initialState$k,
|
|
1859
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
|
|
2021
1860
|
reducers: {
|
|
2022
1861
|
// enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
|
|
2023
1862
|
// Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
|
|
@@ -2049,15 +1888,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2049
1888
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
2050
1889
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2051
1890
|
const outboxReducer = outboxSlice.reducer;
|
|
2052
|
-
const initialState$
|
|
1891
|
+
const initialState$j = {
|
|
2053
1892
|
projectFiles: {},
|
|
2054
1893
|
activeProjectFileId: null,
|
|
2055
1894
|
isImportingProjectFile: false
|
|
2056
1895
|
};
|
|
2057
1896
|
const projectFileSlice = toolkit.createSlice({
|
|
2058
1897
|
name: "projectFiles",
|
|
2059
|
-
initialState: initialState$
|
|
2060
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1898
|
+
initialState: initialState$j,
|
|
1899
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
2061
1900
|
reducers: {
|
|
2062
1901
|
addOrReplaceProjectFiles: (state, action) => {
|
|
2063
1902
|
for (let fileObj of action.payload) {
|
|
@@ -2144,11 +1983,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2144
1983
|
};
|
|
2145
1984
|
const projectFileReducer = projectFileSlice.reducer;
|
|
2146
1985
|
const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
|
|
2147
|
-
const initialState$
|
|
1986
|
+
const initialState$i = projectAttachmentAdapter.getInitialState({});
|
|
2148
1987
|
const projectAttachmentSlice = toolkit.createSlice({
|
|
2149
1988
|
name: "projectAttachments",
|
|
2150
|
-
initialState: initialState$
|
|
2151
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1989
|
+
initialState: initialState$i,
|
|
1990
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
|
|
2152
1991
|
reducers: {
|
|
2153
1992
|
initializeProjectAttachments: projectAttachmentAdapter.initialize,
|
|
2154
1993
|
addProjectAttachment: projectAttachmentAdapter.addOne,
|
|
@@ -2203,12 +2042,12 @@ var __publicField = (obj, key, value) => {
|
|
|
2203
2042
|
)
|
|
2204
2043
|
);
|
|
2205
2044
|
const projectAttachmentReducer = projectAttachmentSlice.reducer;
|
|
2206
|
-
const initialState$
|
|
2045
|
+
const initialState$h = {
|
|
2207
2046
|
isRehydrated: false
|
|
2208
2047
|
};
|
|
2209
2048
|
const rehydratedSlice = toolkit.createSlice({
|
|
2210
2049
|
name: "rehydrated",
|
|
2211
|
-
initialState: initialState$
|
|
2050
|
+
initialState: initialState$h,
|
|
2212
2051
|
// The `reducers` field lets us define reducers and generate associated actions
|
|
2213
2052
|
reducers: {
|
|
2214
2053
|
setRehydrated: (state, action) => {
|
|
@@ -2233,11 +2072,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2233
2072
|
}
|
|
2234
2073
|
};
|
|
2235
2074
|
const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
|
|
2236
|
-
const initialState$
|
|
2075
|
+
const initialState$g = formRevisionAdapter.getInitialState({});
|
|
2237
2076
|
const formRevisionsSlice = toolkit.createSlice({
|
|
2238
2077
|
name: "formRevisions",
|
|
2239
|
-
initialState: initialState$
|
|
2240
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2078
|
+
initialState: initialState$g,
|
|
2079
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
|
|
2241
2080
|
reducers: {
|
|
2242
2081
|
initializeFormRevisions: formRevisionAdapter.initialize,
|
|
2243
2082
|
setFormRevision: formRevisionAdapter.setOne,
|
|
@@ -2309,11 +2148,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2309
2148
|
});
|
|
2310
2149
|
const formRevisionReducer = formRevisionsSlice.reducer;
|
|
2311
2150
|
const formAdapter = createModelAdapter((form) => form.offline_id);
|
|
2312
|
-
const initialState$
|
|
2151
|
+
const initialState$f = formAdapter.getInitialState({});
|
|
2313
2152
|
const formSlice = toolkit.createSlice({
|
|
2314
2153
|
name: "forms",
|
|
2315
|
-
initialState: initialState$
|
|
2316
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2154
|
+
initialState: initialState$f,
|
|
2155
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
|
|
2317
2156
|
reducers: {
|
|
2318
2157
|
initializeForms: formAdapter.initialize,
|
|
2319
2158
|
setForm: formAdapter.setOne,
|
|
@@ -2382,11 +2221,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2382
2221
|
return Object.values(formsMapping).filter((form) => !form.asset_type).length;
|
|
2383
2222
|
});
|
|
2384
2223
|
const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
|
|
2385
|
-
const initialState$
|
|
2224
|
+
const initialState$e = submissionAdapter.getInitialState({});
|
|
2386
2225
|
const formSubmissionSlice = toolkit.createSlice({
|
|
2387
2226
|
name: "formSubmissions",
|
|
2388
|
-
initialState: initialState$
|
|
2389
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2227
|
+
initialState: initialState$e,
|
|
2228
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
|
|
2390
2229
|
reducers: {
|
|
2391
2230
|
initializeFormSubmissions: submissionAdapter.initialize,
|
|
2392
2231
|
setFormSubmission: submissionAdapter.setOne,
|
|
@@ -2598,11 +2437,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2598
2437
|
const formSubmissionAttachmentAdapter = createModelAdapter(
|
|
2599
2438
|
(attachment) => attachment.offline_id
|
|
2600
2439
|
);
|
|
2601
|
-
const initialState$
|
|
2440
|
+
const initialState$d = formSubmissionAttachmentAdapter.getInitialState({});
|
|
2602
2441
|
const formSubmissionAttachmentSlice = toolkit.createSlice({
|
|
2603
2442
|
name: "formSubmissionAttachments",
|
|
2604
|
-
initialState: initialState$
|
|
2605
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2443
|
+
initialState: initialState$d,
|
|
2444
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
|
|
2606
2445
|
reducers: {
|
|
2607
2446
|
initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
|
|
2608
2447
|
addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
|
|
@@ -2654,11 +2493,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2654
2493
|
const formRevisionAttachmentAdapter = createModelAdapter(
|
|
2655
2494
|
(attachment) => attachment.offline_id
|
|
2656
2495
|
);
|
|
2657
|
-
const initialState$
|
|
2496
|
+
const initialState$c = formRevisionAttachmentAdapter.getInitialState({});
|
|
2658
2497
|
const formRevisionAttachmentSlice = toolkit.createSlice({
|
|
2659
2498
|
name: "formRevisionAttachments",
|
|
2660
|
-
initialState: initialState$
|
|
2661
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
2499
|
+
initialState: initialState$c,
|
|
2500
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
|
|
2662
2501
|
reducers: {
|
|
2663
2502
|
initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
|
|
2664
2503
|
addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
|
|
@@ -2696,6 +2535,40 @@ var __publicField = (obj, key, value) => {
|
|
|
2696
2535
|
)
|
|
2697
2536
|
);
|
|
2698
2537
|
const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
|
|
2538
|
+
const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
|
|
2539
|
+
const initialState$b = workspaceAdapter.getInitialState({});
|
|
2540
|
+
const workspaceSlice = toolkit.createSlice({
|
|
2541
|
+
name: "workspace",
|
|
2542
|
+
initialState: initialState$b,
|
|
2543
|
+
reducers: {
|
|
2544
|
+
initializeWorkspaces: workspaceAdapter.initialize,
|
|
2545
|
+
setWorkspaces: workspaceAdapter.setMany,
|
|
2546
|
+
addWorkspace: workspaceAdapter.addOne,
|
|
2547
|
+
updateWorkspace: workspaceAdapter.updateOne,
|
|
2548
|
+
deleteWorkspace: workspaceAdapter.deleteOne
|
|
2549
|
+
}
|
|
2550
|
+
});
|
|
2551
|
+
const { initializeWorkspaces, setWorkspaces, addWorkspace, updateWorkspace, deleteWorkspace } = workspaceSlice.actions;
|
|
2552
|
+
const selectWorkspaceMapping = (state) => state.workspaceReducer.instances;
|
|
2553
|
+
const selectWorkspaces = toolkit.createSelector([selectWorkspaceMapping], (mapping) => Object.values(mapping));
|
|
2554
|
+
const selectMainWorkspace = toolkit.createSelector(
|
|
2555
|
+
[selectWorkspaces],
|
|
2556
|
+
(workspaces) => {
|
|
2557
|
+
return workspaces.find((workspace) => workspace.name.toLowerCase() === "main");
|
|
2558
|
+
}
|
|
2559
|
+
);
|
|
2560
|
+
const selectWorkspaceById = (id) => (state) => {
|
|
2561
|
+
return state.workspaceReducer.instances[id];
|
|
2562
|
+
};
|
|
2563
|
+
const selectPermittedWorkspaceIds = toolkit.createSelector(
|
|
2564
|
+
[selectWorkspaceMapping],
|
|
2565
|
+
(mapping) => {
|
|
2566
|
+
return new Set(
|
|
2567
|
+
Object.values(mapping).filter((workspace) => workspace.permitted).map((workspace) => workspace.offline_id)
|
|
2568
|
+
);
|
|
2569
|
+
}
|
|
2570
|
+
);
|
|
2571
|
+
const workspaceReducer = workspaceSlice.reducer;
|
|
2699
2572
|
const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
|
|
2700
2573
|
const initialState$a = emailDomainAdapter.getInitialState({});
|
|
2701
2574
|
const emailDomainsSlice = toolkit.createSlice({
|
|
@@ -4880,7 +4753,6 @@ var __publicField = (obj, key, value) => {
|
|
|
4880
4753
|
created_by: createdBy
|
|
4881
4754
|
});
|
|
4882
4755
|
this.dispatch(addIssue(offlineIssue));
|
|
4883
|
-
this.dispatch(addToRecentIssues(offlineIssue.offline_id));
|
|
4884
4756
|
this.dispatch(addActiveProjectIssuesCount(1));
|
|
4885
4757
|
const promise = this.enqueueRequest({
|
|
4886
4758
|
description: "Create issue",
|
|
@@ -7549,7 +7421,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7549
7421
|
exports2.addStageCompletions = addStageCompletions;
|
|
7550
7422
|
exports2.addStages = addStages;
|
|
7551
7423
|
exports2.addTeam = addTeam;
|
|
7552
|
-
exports2.addToRecentIssues = addToRecentIssues;
|
|
7553
7424
|
exports2.addUsers = addUsers;
|
|
7554
7425
|
exports2.addWorkspace = addWorkspace;
|
|
7555
7426
|
exports2.agentsReducer = agentsReducer;
|
|
@@ -7574,7 +7445,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7574
7445
|
exports2.categoryReducer = categoryReducer;
|
|
7575
7446
|
exports2.categorySlice = categorySlice;
|
|
7576
7447
|
exports2.classNames = classNames;
|
|
7577
|
-
exports2.cleanRecentIssues = cleanRecentIssues;
|
|
7578
7448
|
exports2.clearTokens = clearTokens;
|
|
7579
7449
|
exports2.constructUploadedFilePayloads = constructUploadedFilePayloads;
|
|
7580
7450
|
exports2.coordinatesAreEqual = coordinatesAreEqual;
|
|
@@ -7748,16 +7618,13 @@ var __publicField = (obj, key, value) => {
|
|
|
7748
7618
|
exports2.removeIssueType = removeIssueType;
|
|
7749
7619
|
exports2.removeProjectFile = removeProjectFile;
|
|
7750
7620
|
exports2.removeProjectFilesOfProject = removeProjectFilesOfProject;
|
|
7751
|
-
exports2.removeRecentIssue = removeRecentIssue;
|
|
7752
7621
|
exports2.removeStageCompletions = removeStageCompletions;
|
|
7753
7622
|
exports2.removeStages = removeStages;
|
|
7754
7623
|
exports2.removeUser = removeUser;
|
|
7755
7624
|
exports2.resetProjectFileObjectUrls = resetProjectFileObjectUrls;
|
|
7756
|
-
exports2.resetRecentIssues = resetRecentIssues;
|
|
7757
7625
|
exports2.resetStore = resetStore;
|
|
7758
7626
|
exports2.restructureCreateSelectorWithArgs = restructureCreateSelectorWithArgs;
|
|
7759
7627
|
exports2.saveActiveProjectFileBounds = saveActiveProjectFileBounds;
|
|
7760
|
-
exports2.searchIssues = searchIssues;
|
|
7761
7628
|
exports2.selectAccessToken = selectAccessToken;
|
|
7762
7629
|
exports2.selectActiveOrganizationAccess = selectActiveOrganizationAccess;
|
|
7763
7630
|
exports2.selectActiveProject = selectActiveProject;
|
|
@@ -7913,8 +7780,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7913
7780
|
exports2.selectProjectUsersAsMapping = selectProjectUsersAsMapping;
|
|
7914
7781
|
exports2.selectProjectUsersIds = selectProjectUsersIds;
|
|
7915
7782
|
exports2.selectProjectsOfOrganization = selectProjectsOfOrganization;
|
|
7916
|
-
exports2.selectRecentIssueIds = selectRecentIssueIds;
|
|
7917
|
-
exports2.selectRecentIssuesAsSearchResults = selectRecentIssuesAsSearchResults;
|
|
7918
7783
|
exports2.selectRehydrated = selectRehydrated;
|
|
7919
7784
|
exports2.selectRootDocuments = selectRootDocuments;
|
|
7920
7785
|
exports2.selectSortedFormSubmissionsOfForm = selectSortedFormSubmissionsOfForm;
|