@rebasepro/admin 0.2.3 → 0.2.5
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/{CollectionEditorDialog-CmGXXSY9.js → CollectionEditorDialog-Cn8-tGyL.js} +89 -79
- package/dist/CollectionEditorDialog-Cn8-tGyL.js.map +1 -0
- package/dist/{CollectionsStudioView-DcLHT5bU.js → CollectionsStudioView-C-Ts1rZt.js} +5 -4
- package/dist/{CollectionsStudioView-DcLHT5bU.js.map → CollectionsStudioView-C-Ts1rZt.js.map} +1 -1
- package/dist/{ExportCollectionAction-BfN34eWX.js → ExportCollectionAction-BRdKM3DF.js} +4 -3
- package/dist/ExportCollectionAction-BRdKM3DF.js.map +1 -0
- package/dist/{ImportCollectionAction-SZrInjhx.js → ImportCollectionAction-U-v7lGxO.js} +3 -2
- package/dist/{ImportCollectionAction-SZrInjhx.js.map → ImportCollectionAction-U-v7lGxO.js.map} +1 -1
- package/dist/{PropertyEditView-Cvryrb3B.js → PropertyEditView-BDNYkfNf.js} +128 -121
- package/dist/PropertyEditView-BDNYkfNf.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
- package/dist/collection_editor/index.d.ts +0 -1
- package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
- package/dist/collection_editor_ui.js +3 -3
- package/dist/components/ArrayContainer.d.ts +2 -2
- package/dist/components/DefaultAppBar.d.ts +18 -1
- package/dist/components/DefaultDrawer.d.ts +51 -3
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
- package/dist/components/EntityEditView.d.ts +2 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
- package/dist/components/PropertyCollectionView.d.ts +1 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
- package/dist/components/admin/index.d.ts +1 -3
- package/dist/components/app/Drawer.d.ts +8 -1
- package/dist/data_export/export/export.d.ts +3 -3
- package/dist/editor/components/editor-bubble.d.ts +5 -1
- package/dist/editor/components/image-bubble.d.ts +5 -1
- package/dist/editor/components/index.d.ts +3 -3
- package/dist/editor/components/table-bubble.d.ts +5 -1
- package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
- package/dist/editor/useProseMirror.d.ts +2 -2
- package/dist/editor/utils/remove_classes.d.ts +1 -1
- package/dist/editor.js +15 -14
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -2
- package/dist/form/components/StorageUploadProgress.d.ts +2 -2
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/validation.d.ts +3 -3
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +1 -1
- package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +3 -7
- package/dist/{index-DjduZG1T.js → index-DHaOV-7A.js} +3 -3
- package/dist/index-DHaOV-7A.js.map +1 -0
- package/dist/{index-MKPc70-v.js → index-DJSL_SCr.js} +3 -3
- package/dist/index-DJSL_SCr.js.map +1 -0
- package/dist/{index-PLIQXpTt.js → index-XMII4H3d.js} +3 -2
- package/dist/{index-PLIQXpTt.js.map → index-XMII4H3d.js.map} +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2688 -452
- package/dist/index.js.map +1 -1
- package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
- package/dist/markdown-DD2JDU1X.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +2 -2
- package/dist/types/fields.d.ts +1 -1
- package/dist/{util-DbWax_sV.js → util-0GYaJqL_.js} +1505 -2043
- package/dist/util-0GYaJqL_.js.map +1 -0
- package/package.json +8 -8
- package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
- package/src/collection_editor/index.ts +1 -3
- package/src/collection_editor/pgColumnToProperty.ts +19 -2
- package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
- package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
- package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
- package/src/components/ArrayContainer.tsx +3 -3
- package/src/components/DefaultAppBar.tsx +52 -31
- package/src/components/DefaultDrawer.tsx +280 -67
- package/src/components/DrawerNavigationItem.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
- package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +4 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +7 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +10 -5
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
- package/src/components/EntityDetailView.tsx +46 -24
- package/src/components/EntityEditView.tsx +51 -28
- package/src/components/EntityEditViewFormActions.tsx +4 -4
- package/src/components/EntityPreview.tsx +9 -4
- package/src/components/HomePage/HomePageDnD.tsx +3 -2
- package/src/components/PropertyCollectionView.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -1
- package/src/components/RebaseNavigation.tsx +2 -2
- package/src/components/RebaseRouteDefs.tsx +6 -11
- package/src/components/RebaseShell.tsx +16 -13
- package/src/components/SearchIconsView.tsx +1 -8
- package/src/components/SelectableTable/SelectableTable.tsx +8 -11
- package/src/components/SelectableTable/SelectionStore.ts +1 -1
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
- package/src/components/SideEntityProvider.tsx +2 -1
- package/src/components/admin/index.ts +1 -3
- package/src/components/app/Drawer.tsx +9 -1
- package/src/components/app/Scaffold.tsx +5 -1
- package/src/components/index.ts +1 -3
- package/src/data_export/export/export.ts +17 -17
- package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
- package/src/editor/components/editor-bubble.tsx +32 -9
- package/src/editor/components/image-bubble.tsx +27 -11
- package/src/editor/components/index.ts +3 -3
- package/src/editor/components/table-bubble.tsx +79 -17
- package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
- package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
- package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
- package/src/editor/schema.ts +135 -59
- package/src/editor/selectors/link-selector.tsx +8 -5
- package/src/editor/useProseMirror.ts +2 -2
- package/src/editor/utils/remove_classes.ts +6 -5
- package/src/form/EntityForm.tsx +15 -15
- package/src/form/EntityFormActions.tsx +2 -2
- package/src/form/PropertyFieldBinding.tsx +64 -64
- package/src/form/components/FieldHelperText.tsx +4 -4
- package/src/form/components/StorageUploadProgress.tsx +2 -2
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
- package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
- package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
- package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
- package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
- package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
- package/src/form/validation.ts +43 -43
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +4 -7
- package/src/hooks/navigation/useResolvedCollections.ts +27 -7
- package/src/hooks/navigation/useResolvedViews.tsx +8 -70
- package/src/index.ts +4 -3
- package/src/preview/PropertyPreview.tsx +2 -2
- package/src/preview/components/ImagePreview.tsx +2 -1
- package/src/preview/components/UrlComponentPreview.tsx +11 -2
- package/src/preview/components/UserPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
- package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
- package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +2 -2
- package/src/types/fields.tsx +2 -2
- package/src/util/previews.ts +9 -1
- package/dist/CollectionEditorDialog-CmGXXSY9.js.map +0 -1
- package/dist/ContentHomePage-C7vFqKSe.js +0 -1784
- package/dist/ContentHomePage-C7vFqKSe.js.map +0 -1
- package/dist/ExportCollectionAction-BfN34eWX.js.map +0 -1
- package/dist/PropertyEditView-Cvryrb3B.js.map +0 -1
- package/dist/RoleChip-QtUFXeTp.js +0 -67
- package/dist/RoleChip-QtUFXeTp.js.map +0 -1
- package/dist/RolesView-BCb7qwWs.js +0 -437
- package/dist/RolesView-BCb7qwWs.js.map +0 -1
- package/dist/UsersView-Cex24r8H.js +0 -408
- package/dist/UsersView-Cex24r8H.js.map +0 -1
- package/dist/collection_editor/types/config_permissions.d.ts +0 -19
- package/dist/components/admin/RoleChip.d.ts +0 -4
- package/dist/components/admin/RolesFilterSelect.d.ts +0 -2
- package/dist/components/admin/RolesView.d.ts +0 -4
- package/dist/components/admin/UserRolesSelectField.d.ts +0 -2
- package/dist/components/admin/UsersView.d.ts +0 -4
- package/dist/index-DjduZG1T.js.map +0 -1
- package/dist/index-MKPc70-v.js.map +0 -1
- package/dist/markdown-z2Ir7Cgo.js.map +0 -1
- package/dist/util-DbWax_sV.js.map +0 -1
- package/src/collection_editor/types/config_permissions.ts +0 -20
- package/src/components/admin/RoleChip.tsx +0 -23
- package/src/components/admin/RolesFilterSelect.tsx +0 -45
- package/src/components/admin/RolesView.tsx +0 -465
- package/src/components/admin/UserRolesSelectField.tsx +0 -50
- package/src/components/admin/UsersView.tsx +0 -687
|
@@ -41,15 +41,15 @@ export function MarkdownPropertyField({
|
|
|
41
41
|
const htmlPath = `${baseMarkdownPath}.html`;
|
|
42
42
|
const transformPastedTextPath = `${baseMarkdownPath}.transformPastedText`;
|
|
43
43
|
|
|
44
|
-
const fileNameValue = getIn(values, fileName) ?? "{rand}_{file}";
|
|
45
|
-
const storagePathValue = getIn(values, storagePath) ?? "/";
|
|
44
|
+
const fileNameValue = (getIn(values, fileName) as string | undefined) ?? "{rand}_{file}";
|
|
45
|
+
const storagePathValue = (getIn(values, storagePath) as string | undefined) ?? "/";
|
|
46
46
|
const maxSizeValue = getIn(values, maxSize);
|
|
47
47
|
|
|
48
48
|
// Markdown config values - check if markdown is an object or boolean
|
|
49
49
|
const markdownValue = getIn(values, "markdown");
|
|
50
50
|
const isMarkdownObject = typeof markdownValue === "object" && markdownValue !== null;
|
|
51
|
-
const htmlValue = isMarkdownObject ? (markdownValue.html ?? true) : true;
|
|
52
|
-
const transformPastedTextValue = isMarkdownObject ? (markdownValue.transformPastedText ?? false) : false;
|
|
51
|
+
const htmlValue = isMarkdownObject ? (((markdownValue as Record<string, unknown>).html as boolean | undefined) ?? true) : true;
|
|
52
|
+
const transformPastedTextValue = isMarkdownObject ? (((markdownValue as Record<string, unknown>).transformPastedText as boolean | undefined) ?? false) : false;
|
|
53
53
|
|
|
54
54
|
const hasFilenameCallback = typeof fileNameValue === "function";
|
|
55
55
|
const hasStoragePathCallback = typeof storagePathValue === "function";
|
|
@@ -209,7 +209,7 @@ export function MarkdownPropertyField({
|
|
|
209
209
|
setFieldValue("defaultValue", e.target.value === "" ? undefined : e.target.value);
|
|
210
210
|
}}
|
|
211
211
|
label={t("default_value")}
|
|
212
|
-
value={getIn(values, "defaultValue") ?? ""}/>
|
|
212
|
+
value={(getIn(values, "defaultValue") as string | undefined) ?? ""}/>
|
|
213
213
|
|
|
214
214
|
</div>
|
|
215
215
|
</>
|
|
@@ -15,12 +15,12 @@ export function NumberPropertyField({ disabled }: {
|
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
|
|
17
17
|
const columnTypePath = "columnType";
|
|
18
|
-
const columnTypeValue: string | undefined = getIn(values, columnTypePath);
|
|
19
|
-
const columnTypeError: string | undefined = getIn(touched, columnTypePath) && getIn(errors, columnTypePath);
|
|
18
|
+
const columnTypeValue: string | undefined = getIn(values, columnTypePath) as string | undefined;
|
|
19
|
+
const columnTypeError: string | undefined = (getIn(touched, columnTypePath) && getIn(errors, columnTypePath)) as string | undefined;
|
|
20
20
|
|
|
21
21
|
const isIdPath = "isId";
|
|
22
|
-
const isIdValue: string | boolean | undefined = getIn(values, isIdPath);
|
|
23
|
-
const isIdError: string | undefined = getIn(touched, isIdPath) && getIn(errors, isIdPath);
|
|
22
|
+
const isIdValue: string | boolean | undefined = getIn(values, isIdPath) as string | boolean | undefined;
|
|
23
|
+
const isIdError: string | undefined = (getIn(touched, isIdPath) && getIn(errors, isIdPath)) as string | undefined;
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<>
|
|
@@ -109,7 +109,7 @@ export function NumberPropertyField({ disabled }: {
|
|
|
109
109
|
setFieldValue("defaultValue", e.target.value === "" ? undefined : parseFloat(e.target.value));
|
|
110
110
|
}}
|
|
111
111
|
label={t("default_value")}
|
|
112
|
-
value={getIn(values, "defaultValue") ?? ""}/>
|
|
112
|
+
value={(getIn(values, "defaultValue") as string | number | undefined) ?? ""}/>
|
|
113
113
|
|
|
114
114
|
</div>
|
|
115
115
|
</>
|
|
@@ -34,8 +34,8 @@ export function ReferencePropertyField({
|
|
|
34
34
|
</div>;
|
|
35
35
|
|
|
36
36
|
const pathPath = asString ? "reference.slug" : (multiple ? "of.slug" : "path");
|
|
37
|
-
const pathValue: string | undefined = getIn(values, pathPath);
|
|
38
|
-
const pathError: string | undefined = showErrors && getIn(errors, pathPath);
|
|
37
|
+
const pathValue: string | undefined = getIn(values, pathPath) as string | undefined;
|
|
38
|
+
const pathError: string | undefined = (showErrors && getIn(errors, pathPath)) as string | undefined;
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<>
|
|
@@ -33,8 +33,8 @@ export function RepeatPropertyField({
|
|
|
33
33
|
} = useFormex<ArrayProperty>();
|
|
34
34
|
|
|
35
35
|
const [propertyDialogOpen, setPropertyDialogOpen] = useState(false);
|
|
36
|
-
const ofProperty = getIn(values, "of");
|
|
37
|
-
const ofPropertyError = getIn(touched, "of") && getIn(errors, "of");
|
|
36
|
+
const ofProperty = getIn(values, "of") as Property | undefined;
|
|
37
|
+
const ofPropertyError = (getIn(touched, "of") && getIn(errors, "of")) as string | undefined;
|
|
38
38
|
|
|
39
39
|
const onPropertyChanged = ({ id, property, namespace }:
|
|
40
40
|
{ id?: string, property: Property, namespace?: string }) => {
|
|
@@ -61,16 +61,16 @@ export function StoragePropertyField({
|
|
|
61
61
|
const imageResizeFormat = `${imageResize}.format`;
|
|
62
62
|
const imageResizeQuality = `${imageResize}.quality`;
|
|
63
63
|
|
|
64
|
-
const fileNameValue = getIn(values, fileName) ?? "{rand}_{file}";
|
|
65
|
-
const storagePathValue = getIn(values, storagePath) ?? "/";
|
|
66
|
-
const maxSizeValue = getIn(values, maxSize);
|
|
64
|
+
const fileNameValue = (getIn(values, fileName) as string | undefined) ?? "{rand}_{file}";
|
|
65
|
+
const storagePathValue = (getIn(values, storagePath) as string | undefined) ?? "/";
|
|
66
|
+
const maxSizeValue = getIn(values, maxSize) as number | undefined;
|
|
67
67
|
|
|
68
68
|
// Image resize values
|
|
69
|
-
const imageResizeMaxWidthValue = getIn(values, imageResizeMaxWidth);
|
|
70
|
-
const imageResizeMaxHeightValue = getIn(values, imageResizeMaxHeight);
|
|
71
|
-
const imageResizeModeValue = getIn(values, imageResizeMode) ?? "cover";
|
|
72
|
-
const imageResizeFormatValue = getIn(values, imageResizeFormat) ?? "original";
|
|
73
|
-
const imageResizeQualityValue = getIn(values, imageResizeQuality);
|
|
69
|
+
const imageResizeMaxWidthValue = getIn(values, imageResizeMaxWidth) as number | undefined;
|
|
70
|
+
const imageResizeMaxHeightValue = getIn(values, imageResizeMaxHeight) as number | undefined;
|
|
71
|
+
const imageResizeModeValue = (getIn(values, imageResizeMode) as string | undefined) ?? "cover";
|
|
72
|
+
const imageResizeFormatValue = (getIn(values, imageResizeFormat) as string | undefined) ?? "original";
|
|
73
|
+
const imageResizeQualityValue = getIn(values, imageResizeQuality) as number | undefined;
|
|
74
74
|
|
|
75
75
|
const storedValue = getIn(values, acceptedFiles);
|
|
76
76
|
const fileTypesValue: string[] | undefined = Array.isArray(storedValue) ? storedValue : undefined;
|
|
@@ -21,12 +21,12 @@ export function StringPropertyField({
|
|
|
21
21
|
const { t } = useTranslation();
|
|
22
22
|
|
|
23
23
|
const columnTypePath = "columnType";
|
|
24
|
-
const columnTypeValue: string | undefined = getIn(values, columnTypePath);
|
|
25
|
-
const columnTypeError: string | undefined = getIn(touched, columnTypePath) && getIn(errors, columnTypePath);
|
|
24
|
+
const columnTypeValue: string | undefined = getIn(values, columnTypePath) as string | undefined;
|
|
25
|
+
const columnTypeError: string | undefined = (getIn(touched, columnTypePath) && getIn(errors, columnTypePath)) as string | undefined;
|
|
26
26
|
|
|
27
27
|
const isIdPath = "isId";
|
|
28
|
-
const isIdValue: string | boolean | undefined = getIn(values, isIdPath);
|
|
29
|
-
const isIdError: string | undefined = getIn(touched, isIdPath) && getIn(errors, isIdPath);
|
|
28
|
+
const isIdValue: string | boolean | undefined = getIn(values, isIdPath) as string | boolean | undefined;
|
|
29
|
+
const isIdError: string | undefined = (getIn(touched, isIdPath) && getIn(errors, isIdPath)) as string | undefined;
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<>
|
|
@@ -140,7 +140,7 @@ export function StringPropertyField({
|
|
|
140
140
|
setFieldValue("defaultValue", e.target.value === "" ? undefined : e.target.value);
|
|
141
141
|
}}
|
|
142
142
|
label={t("default_value")}
|
|
143
|
-
value={getIn(values, "defaultValue") ?? ""}/>
|
|
143
|
+
value={(getIn(values, "defaultValue") as string | undefined) ?? ""}/>
|
|
144
144
|
|
|
145
145
|
</div>
|
|
146
146
|
</>
|
|
@@ -15,7 +15,8 @@ export function UrlPropertyField({
|
|
|
15
15
|
|
|
16
16
|
const { values, setFieldValue } = useFormex();
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const urlRawValue = getIn(values, "url");
|
|
19
|
+
const urlValue = typeof urlRawValue === "string" ? urlRawValue : "[NONE]";
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
22
|
<>
|
|
@@ -82,7 +83,7 @@ export function UrlPropertyField({
|
|
|
82
83
|
setFieldValue("defaultValue", e.target.value === "" ? undefined : e.target.value);
|
|
83
84
|
}}
|
|
84
85
|
label={"Default value"}
|
|
85
|
-
value={getIn(values, "defaultValue") ?? ""}/>
|
|
86
|
+
value={(getIn(values, "defaultValue") as string | undefined) ?? ""}/>
|
|
86
87
|
|
|
87
88
|
</div>
|
|
88
89
|
</>
|
|
@@ -9,8 +9,8 @@ export function VectorPropertyField({ disabled }: {
|
|
|
9
9
|
const { values, setFieldValue, touched, errors } = useFormex();
|
|
10
10
|
|
|
11
11
|
const dimensionsPath = "dimensions";
|
|
12
|
-
const dimensionsValue = getIn(values, dimensionsPath);
|
|
13
|
-
const dimensionsError = getIn(touched, dimensionsPath) && getIn(errors, dimensionsPath);
|
|
12
|
+
const dimensionsValue = getIn(values, dimensionsPath) as number | undefined;
|
|
13
|
+
const dimensionsError = (getIn(touched, dimensionsPath) && getIn(errors, dimensionsPath)) as string | undefined;
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<div className={"col-span-12"}>
|
package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx
CHANGED
|
@@ -30,7 +30,7 @@ export function ArrayPropertyValidation({
|
|
|
30
30
|
<GeneralPropertyValidation disabled={disabled}/>
|
|
31
31
|
|
|
32
32
|
{min && <div className={"col-span-6"}>
|
|
33
|
-
<DebouncedTextField value={getIn(values, validationMin)}
|
|
33
|
+
<DebouncedTextField value={getIn(values, validationMin) as number | undefined}
|
|
34
34
|
disabled={disabled}
|
|
35
35
|
label={t("min_length")}
|
|
36
36
|
name={validationMin}
|
|
@@ -39,7 +39,7 @@ export function ArrayPropertyValidation({
|
|
|
39
39
|
onChange={handleChange}/>
|
|
40
40
|
</div>}
|
|
41
41
|
{max && <div className={"col-span-6"}>
|
|
42
|
-
<DebouncedTextField value={getIn(values, validationMax)}
|
|
42
|
+
<DebouncedTextField value={getIn(values, validationMax) as number | undefined}
|
|
43
43
|
disabled={disabled}
|
|
44
44
|
label={t("max_length")}
|
|
45
45
|
name={validationMax}
|
|
@@ -52,7 +52,7 @@ export function GeneralPropertyValidation({ disabled }: {
|
|
|
52
52
|
{getIn(values, validationRequired) && <div className={"col-span-12"}>
|
|
53
53
|
<DebouncedTextField
|
|
54
54
|
disabled={disabled}
|
|
55
|
-
value={getIn(values, validationRequiredMessage)}
|
|
55
|
+
value={getIn(values, validationRequiredMessage) as string | undefined}
|
|
56
56
|
label={t("required_message")}
|
|
57
57
|
name={validationRequiredMessage}
|
|
58
58
|
size="small"
|
|
@@ -31,7 +31,7 @@ export function NumberPropertyValidation({ disabled }: {
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
<div className={"col-span-6"}>
|
|
34
|
-
<DebouncedTextField value={getIn(values, validationMin)}
|
|
34
|
+
<DebouncedTextField value={getIn(values, validationMin) as number | undefined}
|
|
35
35
|
label={t("min_value")}
|
|
36
36
|
name={validationMin}
|
|
37
37
|
type="number"
|
|
@@ -41,12 +41,11 @@ export function NumberPropertyValidation({ disabled }: {
|
|
|
41
41
|
</div>
|
|
42
42
|
|
|
43
43
|
<div className={"col-span-6"}>
|
|
44
|
-
<DebouncedTextField value={getIn(values, validationMax)}
|
|
44
|
+
<DebouncedTextField value={getIn(values, validationMax) as number | undefined}
|
|
45
45
|
label={t("max_value")}
|
|
46
46
|
name={validationMax}
|
|
47
47
|
type="number"
|
|
48
48
|
size="small"
|
|
49
|
-
|
|
50
49
|
disabled={disabled}
|
|
51
50
|
onChange={handleChange}/>
|
|
52
51
|
</div>
|
|
@@ -54,24 +53,22 @@ export function NumberPropertyValidation({ disabled }: {
|
|
|
54
53
|
|
|
55
54
|
<div className={"col-span-6"}>
|
|
56
55
|
<DebouncedTextField
|
|
57
|
-
value={getIn(values, validationLessThan)}
|
|
56
|
+
value={getIn(values, validationLessThan) as number | undefined}
|
|
58
57
|
label={t("less_than")}
|
|
59
58
|
name={validationLessThan}
|
|
60
59
|
type="number"
|
|
61
60
|
size="small"
|
|
62
|
-
|
|
63
61
|
disabled={disabled}
|
|
64
62
|
onChange={handleChange}/>
|
|
65
63
|
</div>
|
|
66
64
|
|
|
67
65
|
<div className={"col-span-6"}>
|
|
68
66
|
<DebouncedTextField
|
|
69
|
-
value={getIn(values, validationMoreThan)}
|
|
67
|
+
value={getIn(values, validationMoreThan) as number | undefined}
|
|
70
68
|
label={t("more_than")}
|
|
71
69
|
name={validationMoreThan}
|
|
72
70
|
type="number"
|
|
73
71
|
size="small"
|
|
74
|
-
|
|
75
72
|
disabled={disabled}
|
|
76
73
|
onChange={handleChange}/>
|
|
77
74
|
</div>
|
|
@@ -49,7 +49,7 @@ export function StringPropertyValidation({
|
|
|
49
49
|
const matchesError = getIn(errors, validationMatches);
|
|
50
50
|
|
|
51
51
|
const matchesValue = getIn(values, validationMatches);
|
|
52
|
-
const matchesStringValue = typeof matchesValue === "string" ? matchesValue : serializeRegExp(matchesValue);
|
|
52
|
+
const matchesStringValue = typeof matchesValue === "string" ? matchesValue : serializeRegExp(matchesValue as RegExp);
|
|
53
53
|
return (
|
|
54
54
|
<div className={"grid grid-cols-12 gap-2"}>
|
|
55
55
|
|
|
@@ -101,7 +101,7 @@ export function StringPropertyValidation({
|
|
|
101
101
|
<div className={"grid grid-cols-12 gap-2 col-span-12"}>
|
|
102
102
|
{length && <div className={"col-span-4"}>
|
|
103
103
|
<DebouncedTextField
|
|
104
|
-
value={getIn(values, validationLength)}
|
|
104
|
+
value={getIn(values, validationLength) as number | undefined}
|
|
105
105
|
label={t("exact_length")}
|
|
106
106
|
name={validationLength}
|
|
107
107
|
type="number"
|
|
@@ -112,7 +112,7 @@ export function StringPropertyValidation({
|
|
|
112
112
|
</div>}
|
|
113
113
|
|
|
114
114
|
{min && <div className={"col-span-4"}>
|
|
115
|
-
<DebouncedTextField value={getIn(values, validationMin)}
|
|
115
|
+
<DebouncedTextField value={getIn(values, validationMin) as number | undefined}
|
|
116
116
|
label={t("min_length")}
|
|
117
117
|
name={validationMin}
|
|
118
118
|
type="number"
|
|
@@ -123,7 +123,7 @@ export function StringPropertyValidation({
|
|
|
123
123
|
</div>}
|
|
124
124
|
|
|
125
125
|
{max && <div className={"col-span-4"}>
|
|
126
|
-
<DebouncedTextField value={getIn(values, validationMax)}
|
|
126
|
+
<DebouncedTextField value={getIn(values, validationMax) as number | undefined}
|
|
127
127
|
label={t("max_length")}
|
|
128
128
|
name={validationMax}
|
|
129
129
|
type="number"
|
|
@@ -60,7 +60,7 @@ export interface ArrayContainerProps<T> {
|
|
|
60
60
|
max?: number;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
const buildIdsMap = (value:
|
|
63
|
+
const buildIdsMap = (value: unknown[]) =>
|
|
64
64
|
value && Array.isArray(value) && value.length > 0
|
|
65
65
|
? value
|
|
66
66
|
.map((v, index) => {
|
|
@@ -143,7 +143,7 @@ function SortableItem({
|
|
|
143
143
|
type ArrayContainerItemProps = {
|
|
144
144
|
nodeRef: (node: HTMLElement | null) => void;
|
|
145
145
|
style: React.CSSProperties;
|
|
146
|
-
dragHandleProps:
|
|
146
|
+
dragHandleProps: Record<string, unknown>;
|
|
147
147
|
index: number;
|
|
148
148
|
internalId: number;
|
|
149
149
|
size?: "small" | "medium";
|
|
@@ -220,7 +220,7 @@ export function ArrayItemOptions({
|
|
|
220
220
|
sortable,
|
|
221
221
|
addInIndex
|
|
222
222
|
}: {
|
|
223
|
-
dragHandleProps:
|
|
223
|
+
dragHandleProps: Record<string, unknown>;
|
|
224
224
|
direction?: "row" | "column";
|
|
225
225
|
disabled: boolean;
|
|
226
226
|
remove: (index: number) => void;
|
|
@@ -44,8 +44,27 @@ export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
|
44
44
|
|
|
45
45
|
dropDownActions?: React.ReactNode;
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Whether to render the dark/light/system mode toggle in the app bar.
|
|
49
|
+
* Set to `false` when the drawer owns this action.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
47
52
|
includeModeToggle?: boolean;
|
|
48
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Whether to render the language switcher in the app bar.
|
|
56
|
+
* Set to `false` when the drawer owns this action.
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
includeLanguageToggle?: boolean;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Whether to render the user avatar / menu in the app bar.
|
|
63
|
+
* Set to `false` when the drawer owns this action.
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
includeUserMenu?: boolean;
|
|
67
|
+
|
|
49
68
|
className?: string;
|
|
50
69
|
|
|
51
70
|
style?: React.CSSProperties;
|
|
@@ -67,6 +86,8 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
67
86
|
startAdornment,
|
|
68
87
|
dropDownActions,
|
|
69
88
|
includeModeToggle = true,
|
|
89
|
+
includeLanguageToggle = true,
|
|
90
|
+
includeUserMenu = true,
|
|
70
91
|
className,
|
|
71
92
|
style,
|
|
72
93
|
user: userProp,
|
|
@@ -193,8 +214,6 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
193
214
|
</div>
|
|
194
215
|
{startAdornment}
|
|
195
216
|
|
|
196
|
-
{startAdornment}
|
|
197
|
-
|
|
198
217
|
<div className={"grow"}/>
|
|
199
218
|
|
|
200
219
|
{endAdornment &&
|
|
@@ -202,7 +221,7 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
202
221
|
{endAdornment}
|
|
203
222
|
</ErrorBoundary>}
|
|
204
223
|
|
|
205
|
-
<LanguageToggle/>
|
|
224
|
+
{includeLanguageToggle && <LanguageToggle/>}
|
|
206
225
|
|
|
207
226
|
{includeModeToggle &&
|
|
208
227
|
<Menu
|
|
@@ -220,34 +239,36 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
220
239
|
size={iconSize.smallest}/>{t("system_mode")}</MenuItem>
|
|
221
240
|
</Menu>}
|
|
222
241
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
{
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
242
|
+
|
|
243
|
+
{includeUserMenu &&
|
|
244
|
+
<Menu trigger={<div aria-label="User menu" role="button">{avatarComponent}</div>}>
|
|
245
|
+
{user && <div className={"px-4 py-2 mb-2"}>
|
|
246
|
+
{user.displayName && <Typography variant={"body1"} color={"secondary"}>
|
|
247
|
+
{user.displayName}
|
|
248
|
+
</Typography>}
|
|
249
|
+
{user.email && <Typography variant={"body2"} color={"secondary"}>
|
|
250
|
+
{user.email}
|
|
251
|
+
</Typography>}
|
|
252
|
+
</div>}
|
|
253
|
+
|
|
254
|
+
{dropDownActions}
|
|
255
|
+
|
|
256
|
+
{!dropDownActions && <>
|
|
257
|
+
<MenuItem onClick={() => navigate("/settings")}>
|
|
258
|
+
<SettingsIcon/>
|
|
259
|
+
{t("account_settings")}
|
|
260
|
+
</MenuItem>
|
|
261
|
+
<MenuItem onClick={async () => {
|
|
262
|
+
await authController.signOut();
|
|
263
|
+
// replace current route with home
|
|
264
|
+
navigate("/");
|
|
265
|
+
}}>
|
|
266
|
+
<LogOutIcon/>
|
|
267
|
+
{t("log_out")}
|
|
268
|
+
</MenuItem>
|
|
269
|
+
</>}
|
|
270
|
+
|
|
271
|
+
</Menu>}
|
|
251
272
|
|
|
252
273
|
</div>
|
|
253
274
|
);
|