@overmap-ai/core 1.0.38-component-fields.10 → 1.0.38-component-fields.12
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.
|
@@ -3237,31 +3237,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3237
3237
|
const selectUserFormMapping = (state) => {
|
|
3238
3238
|
return state.userFormReducer.userForms;
|
|
3239
3239
|
};
|
|
3240
|
-
const
|
|
3240
|
+
const selectComponentTypeForm = restructureCreateSelectorWithArgs(
|
|
3241
3241
|
toolkit.createSelector(
|
|
3242
3242
|
[selectUserFormMapping, (_state, componentTypeId) => componentTypeId],
|
|
3243
3243
|
(userForms, componentTypeId) => {
|
|
3244
|
-
return Object.values(userForms).
|
|
3245
|
-
return userForm.component_type === componentTypeId;
|
|
3246
|
-
});
|
|
3247
|
-
}
|
|
3248
|
-
)
|
|
3249
|
-
);
|
|
3250
|
-
const selectLatestRevisionsForComponentTypeForms = restructureCreateSelectorWithArgs(
|
|
3251
|
-
toolkit.createSelector(
|
|
3252
|
-
[
|
|
3253
|
-
selectUserFormMapping,
|
|
3254
|
-
selectRevisionMapping,
|
|
3255
|
-
(_state, componentTypeId) => componentTypeId
|
|
3256
|
-
],
|
|
3257
|
-
(userForms, revisions, componentTypeId) => {
|
|
3258
|
-
const latestRevisions = [];
|
|
3259
|
-
for (const form of Object.values(userForms)) {
|
|
3260
|
-
if (form.component_type === componentTypeId) {
|
|
3261
|
-
latestRevisions.push(_selectLatestFormRevision(revisions, form.offline_id));
|
|
3262
|
-
}
|
|
3263
|
-
}
|
|
3264
|
-
return latestRevisions;
|
|
3244
|
+
return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
|
|
3265
3245
|
}
|
|
3266
3246
|
)
|
|
3267
3247
|
);
|
|
@@ -10417,6 +10397,10 @@ var __publicField = (obj, key, value) => {
|
|
|
10417
10397
|
}, [filter, maxResults, ownerFilter]);
|
|
10418
10398
|
const userForms = useAppSelector(selectFilteredUserForms(ownerFilterOptions)) ?? [];
|
|
10419
10399
|
const userFormMapping = useAppSelector(selectUserFormMapping);
|
|
10400
|
+
const attachableUserForms = userForms.filter((form) => !form.component_type && !form.component_stage);
|
|
10401
|
+
const attachableUserFormMapping = Object.values(userFormMapping).filter(
|
|
10402
|
+
(form) => !form.component_type && !form.component_stage
|
|
10403
|
+
);
|
|
10420
10404
|
const handleToggleFavorite = React.useCallback(
|
|
10421
10405
|
(form) => {
|
|
10422
10406
|
if (form.favorite) {
|
|
@@ -10430,7 +10414,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10430
10414
|
const options = React.useMemo(() => {
|
|
10431
10415
|
const state = sdk.store.getState();
|
|
10432
10416
|
const accumulator = {};
|
|
10433
|
-
for (const form of
|
|
10417
|
+
for (const form of attachableUserFormMapping) {
|
|
10434
10418
|
const organization = selectOrganization(form.owner_organization || -1)(state);
|
|
10435
10419
|
if (organization) {
|
|
10436
10420
|
accumulator[`${orgOptionPrefix}${organization.id}`] = organization.name;
|
|
@@ -10441,13 +10425,13 @@ var __publicField = (obj, key, value) => {
|
|
|
10441
10425
|
}
|
|
10442
10426
|
}
|
|
10443
10427
|
return Object.entries(accumulator).map(([value, label]) => ({ itemContent: label, value }));
|
|
10444
|
-
}, [
|
|
10428
|
+
}, [sdk.store, attachableUserFormMapping]);
|
|
10445
10429
|
const handleChange = React.useCallback((e) => {
|
|
10446
10430
|
setFilter(e.currentTarget.value);
|
|
10447
10431
|
}, []);
|
|
10448
|
-
const numberOfForms = useAppSelector(selectNumberOfUserForms)
|
|
10449
|
-
const numberOfHiddenForms = numberOfForms -
|
|
10450
|
-
const overflowMessage =
|
|
10432
|
+
const numberOfForms = useAppSelector(selectNumberOfUserForms) - (userForms.length - attachableUserForms.length);
|
|
10433
|
+
const numberOfHiddenForms = numberOfForms - attachableUserForms.length;
|
|
10434
|
+
const overflowMessage = attachableUserForms.length == maxResults && numberOfHiddenForms > 0 ? `Only the first ${maxResults} results are shown (${numberOfHiddenForms} hidden)` : numberOfHiddenForms > 0 && `${numberOfHiddenForms} hidden forms`;
|
|
10451
10435
|
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { ref, direction: "column", gap: "2", children: [
|
|
10452
10436
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { gap: "2", grow: "1", children: [
|
|
10453
10437
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { grow: "1", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(TextField$1.Root, { size: "3", children: /* @__PURE__ */ jsxRuntime.jsx(TextField$1.Input, { placeholder: "Filter", value: filter, onChange: handleChange }) }) }),
|
|
@@ -10462,7 +10446,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10462
10446
|
}
|
|
10463
10447
|
)
|
|
10464
10448
|
] }),
|
|
10465
|
-
|
|
10449
|
+
attachableUserForms.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(blocks.ButtonList.Root, { children: attachableUserForms.map((form) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10466
10450
|
FormBrowserEntry,
|
|
10467
10451
|
{
|
|
10468
10452
|
...entryProps,
|
|
@@ -12091,6 +12075,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12091
12075
|
exports2.selectCompletedStages = selectCompletedStages;
|
|
12092
12076
|
exports2.selectComponent = selectComponent;
|
|
12093
12077
|
exports2.selectComponentType = selectComponentType;
|
|
12078
|
+
exports2.selectComponentTypeForm = selectComponentTypeForm;
|
|
12094
12079
|
exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
|
|
12095
12080
|
exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
|
|
12096
12081
|
exports2.selectComponentTypes = selectComponentTypes;
|
|
@@ -12115,7 +12100,6 @@ var __publicField = (obj, key, value) => {
|
|
|
12115
12100
|
exports2.selectFileAttachmentsOfIssue = selectFileAttachmentsOfIssue;
|
|
12116
12101
|
exports2.selectFilteredUserForms = selectFilteredUserForms;
|
|
12117
12102
|
exports2.selectFormRevision = selectFormRevision;
|
|
12118
|
-
exports2.selectFormsForComponentType = selectFormsForComponentType;
|
|
12119
12103
|
exports2.selectHiddenCategoryCount = selectHiddenCategoryCount;
|
|
12120
12104
|
exports2.selectHiddenComponentTypeIds = selectHiddenComponentTypeIds;
|
|
12121
12105
|
exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
|
|
@@ -12130,7 +12114,6 @@ var __publicField = (obj, key, value) => {
|
|
|
12130
12114
|
exports2.selectLatestRetryTime = selectLatestRetryTime;
|
|
12131
12115
|
exports2.selectLatestRevisionByFormId = selectLatestRevisionByFormId;
|
|
12132
12116
|
exports2.selectLatestRevisionsForComponentStageForms = selectLatestRevisionsForComponentStageForms;
|
|
12133
|
-
exports2.selectLatestRevisionsForComponentTypeForms = selectLatestRevisionsForComponentTypeForms;
|
|
12134
12117
|
exports2.selectLatestRevisionsFromComponentTypeIds = selectLatestRevisionsFromComponentTypeIds;
|
|
12135
12118
|
exports2.selectMainWorkspace = selectMainWorkspace;
|
|
12136
12119
|
exports2.selectMapStyle = selectMapStyle;
|