@firecms/collection_editor 3.1.0-canary.1df3b2c → 3.1.0-canary.501d471
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/index.es.js +7010 -3754
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7008 -3752
- package/dist/index.umd.js.map +1 -1
- package/dist/locales/de.d.ts +120 -0
- package/dist/locales/en.d.ts +120 -0
- package/dist/locales/es.d.ts +120 -0
- package/dist/locales/fr.d.ts +120 -0
- package/dist/locales/hi.d.ts +120 -0
- package/dist/locales/it.d.ts +120 -0
- package/dist/locales/pt.d.ts +120 -0
- package/dist/ui/collection_editor/AICollectionGeneratorPopover.d.ts +5 -1
- package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +4 -0
- package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -1
- package/package.json +12 -12
- package/src/ConfigControllerProvider.tsx +1 -0
- package/src/locales/de.ts +125 -0
- package/src/locales/en.ts +145 -0
- package/src/locales/es.ts +125 -0
- package/src/locales/fr.ts +125 -0
- package/src/locales/hi.ts +125 -0
- package/src/locales/it.ts +125 -0
- package/src/locales/pt.ts +125 -0
- package/src/ui/EditorCollectionAction.tsx +3 -3
- package/src/ui/EditorEntityAction.tsx +3 -2
- package/src/ui/NewCollectionButton.tsx +3 -1
- package/src/ui/NewCollectionCard.tsx +7 -4
- package/src/ui/PropertyAddColumnComponent.tsx +3 -2
- package/src/ui/collection_editor/AICollectionGeneratorPopover.tsx +29 -11
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +28 -25
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +55 -42
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +23 -19
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +12 -10
- package/src/ui/collection_editor/DisplaySettingsForm.tsx +19 -17
- package/src/ui/collection_editor/EntityActionsEditTab.tsx +11 -12
- package/src/ui/collection_editor/EntityActionsSelectDialog.tsx +5 -6
- package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +5 -5
- package/src/ui/collection_editor/EnumForm.tsx +6 -2
- package/src/ui/collection_editor/ExtendSettingsForm.tsx +8 -7
- package/src/ui/collection_editor/GeneralSettingsForm.tsx +42 -42
- package/src/ui/collection_editor/GetCodeDialog.tsx +13 -12
- package/src/ui/collection_editor/KanbanConfigSection.tsx +11 -9
- package/src/ui/collection_editor/LayoutModeSwitch.tsx +7 -4
- package/src/ui/collection_editor/PropertyEditView.tsx +75 -66
- package/src/ui/collection_editor/SubcollectionsEditTab.tsx +16 -19
- package/src/ui/collection_editor/ViewModeSwitch.tsx +8 -6
- package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +6 -3
- package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +5 -2
- package/src/ui/collection_editor/properties/BooleanPropertyField.tsx +3 -1
- package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +6 -4
- package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +20 -18
- package/src/ui/collection_editor/properties/EnumPropertyField.tsx +5 -4
- package/src/ui/collection_editor/properties/MapPropertyField.tsx +8 -7
- package/src/ui/collection_editor/properties/MarkdownPropertyField.tsx +22 -23
- package/src/ui/collection_editor/properties/NumberPropertyField.tsx +3 -1
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +5 -4
- package/src/ui/collection_editor/properties/StoragePropertyField.tsx +46 -51
- package/src/ui/collection_editor/properties/StringPropertyField.tsx +3 -1
- package/src/ui/collection_editor/properties/UrlPropertyField.tsx +12 -10
- package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +23 -4
- package/src/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +8 -3
- package/src/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +5 -2
- package/src/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +7 -5
- package/src/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +10 -7
- package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +11 -9
- package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +4 -1
- package/src/useCollectionEditorPlugin.tsx +22 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectionActionsProps, useAuthController, useNavigationController } from "@firecms/core";
|
|
1
|
+
import { CollectionActionsProps, useAuthController, useNavigationController, useTranslation } from "@firecms/core";
|
|
2
2
|
import { IconButton, SettingsIcon, Tooltip, } from "@firecms/ui";
|
|
3
3
|
|
|
4
4
|
import { useCollectionEditorController } from "../useCollectionEditorController";
|
|
@@ -16,7 +16,7 @@ export function EditorCollectionAction({
|
|
|
16
16
|
const collectionEditorController = useCollectionEditorController();
|
|
17
17
|
|
|
18
18
|
const parentCollection = navigationController.getCollectionFromIds(parentCollectionIds);
|
|
19
|
-
|
|
19
|
+
const { t } = useTranslation();
|
|
20
20
|
const canEditCollection = collectionEditorController.configPermissions
|
|
21
21
|
? collectionEditorController.configPermissions({
|
|
22
22
|
user: authController.user,
|
|
@@ -26,7 +26,7 @@ export function EditorCollectionAction({
|
|
|
26
26
|
|
|
27
27
|
const editorButton = <Tooltip
|
|
28
28
|
asChild={true}
|
|
29
|
-
title={canEditCollection ? "
|
|
29
|
+
title={canEditCollection ? t("edit_collection") : t("no_permissions_edit_collection")}>
|
|
30
30
|
<IconButton
|
|
31
31
|
size={"small"}
|
|
32
32
|
color={"primary"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginFormActionProps, useAuthController, useNavigationController } from "@firecms/core";
|
|
1
|
+
import { PluginFormActionProps, useAuthController, useNavigationController, useTranslation } from "@firecms/core";
|
|
2
2
|
import { IconButton, SettingsIcon, Tooltip, } from "@firecms/ui";
|
|
3
3
|
|
|
4
4
|
import { useCollectionEditorController } from "../useCollectionEditorController";
|
|
@@ -14,6 +14,7 @@ export function EditorEntityAction({
|
|
|
14
14
|
const authController = useAuthController();
|
|
15
15
|
const navigationController = useNavigationController();
|
|
16
16
|
const collectionEditorController = useCollectionEditorController();
|
|
17
|
+
const { t } = useTranslation();
|
|
17
18
|
|
|
18
19
|
const parentCollection = navigationController.getCollectionFromIds(parentCollectionIds);
|
|
19
20
|
|
|
@@ -28,7 +29,7 @@ export function EditorEntityAction({
|
|
|
28
29
|
|
|
29
30
|
const editorButton = <Tooltip
|
|
30
31
|
asChild={true}
|
|
31
|
-
title={canEditCollection ? (isDirty ? "
|
|
32
|
+
title={canEditCollection ? (isDirty ? t("save_before_changing_schema") : t("edit_schema_for_this_form")) : t("no_permissions_to_edit_collection")}>
|
|
32
33
|
<IconButton
|
|
33
34
|
color={"primary"}
|
|
34
35
|
disabled={!canEditCollection || isDirty}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AddIcon, Button } from "@firecms/ui";
|
|
2
|
+
import { useTranslation } from "@firecms/core";
|
|
2
3
|
import { useCollectionEditorController } from "../useCollectionEditorController";
|
|
3
4
|
|
|
4
5
|
export function NewCollectionButton() {
|
|
6
|
+
const { t } = useTranslation();
|
|
5
7
|
const collectionEditorController = useCollectionEditorController();
|
|
6
8
|
return <div className={"bg-surface-50 dark:bg-surface-900 min-w-fit rounded"}>
|
|
7
9
|
<Button className={"min-w-fit"}
|
|
@@ -12,7 +14,7 @@ export function NewCollectionButton() {
|
|
|
12
14
|
sourceClick: "new_collection_button"
|
|
13
15
|
})}>
|
|
14
16
|
<AddIcon/>
|
|
15
|
-
|
|
17
|
+
{t("new_collection")}
|
|
16
18
|
</Button>
|
|
17
19
|
</div>
|
|
18
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginHomePageAdditionalCardsProps, useAuthController } from "@firecms/core";
|
|
1
|
+
import { PluginHomePageAdditionalCardsProps, useAuthController, useTranslation } from "@firecms/core";
|
|
2
2
|
import { AddIcon, Card, cls, Typography } from "@firecms/ui";
|
|
3
3
|
import { useCollectionEditorController } from "../useCollectionEditorController";
|
|
4
4
|
|
|
@@ -12,6 +12,8 @@ export function NewCollectionCard({
|
|
|
12
12
|
|
|
13
13
|
const authController = useAuthController();
|
|
14
14
|
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
|
|
15
17
|
const collectionEditorController = useCollectionEditorController();
|
|
16
18
|
const canCreateCollections = collectionEditorController.configPermissions
|
|
17
19
|
? collectionEditorController.configPermissions({
|
|
@@ -35,11 +37,12 @@ export function NewCollectionCard({
|
|
|
35
37
|
<AddIcon color="primary" size={"large"}/>
|
|
36
38
|
<Typography color="primary"
|
|
37
39
|
variant={"caption"}
|
|
38
|
-
className={"font-medium"}>{"
|
|
40
|
+
className={"font-medium"}>{t("add_new_collection").toUpperCase()}</Typography>
|
|
39
41
|
|
|
40
42
|
{!canCreateCollections &&
|
|
41
|
-
<Typography variant={"caption"}>
|
|
42
|
-
|
|
43
|
+
<Typography variant={"caption"}>
|
|
44
|
+
{t("no_permissions_create_collection")}
|
|
45
|
+
</Typography>
|
|
43
46
|
}
|
|
44
47
|
</div>
|
|
45
48
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityTableController, getDefaultPropertiesOrder, useAuthController } from "@firecms/core";
|
|
1
|
+
import { EntityTableController, getDefaultPropertiesOrder, useAuthController, useTranslation } from "@firecms/core";
|
|
2
2
|
import { AddIcon, Tooltip } from "@firecms/ui";
|
|
3
3
|
import { useCollectionEditorController } from "../useCollectionEditorController";
|
|
4
4
|
import { PersistedCollection } from "../types/persisted_collection";
|
|
@@ -17,6 +17,7 @@ export function PropertyAddColumnComponent({
|
|
|
17
17
|
|
|
18
18
|
const authController = useAuthController();
|
|
19
19
|
const collectionEditorController = useCollectionEditorController();
|
|
20
|
+
const { t } = useTranslation();
|
|
20
21
|
const canEditCollection = collectionEditorController.configPermissions
|
|
21
22
|
? collectionEditorController.configPermissions({
|
|
22
23
|
user: authController.user,
|
|
@@ -27,7 +28,7 @@ export function PropertyAddColumnComponent({
|
|
|
27
28
|
return (
|
|
28
29
|
<Tooltip
|
|
29
30
|
asChild={true}
|
|
30
|
-
title={canEditCollection ? "
|
|
31
|
+
title={canEditCollection ? t("add_new_property") : t("no_permission_add_properties")}>
|
|
31
32
|
<div
|
|
32
33
|
className={"p-0.5 w-20 h-full flex items-center justify-center cursor-pointer bg-surface-100 bg-opacity-40 bg-surface-100/40 hover:bg-surface-100 dark:bg-surface-950 dark:bg-opacity-40 dark:bg-surface-950/40 dark:hover:bg-surface-950"}
|
|
33
34
|
// className={onHover ? "bg-white dark:bg-surface-950" : undefined}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { EntityCollection, useNavigationController, useSnackbarController, AIIcon } from "@firecms/core";
|
|
2
|
+
import { EntityCollection, useNavigationController, useSnackbarController, AIIcon, useTranslation } from "@firecms/core";
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
5
|
CircularProgress,
|
|
@@ -48,6 +48,11 @@ export interface AICollectionGeneratorPopoverProps {
|
|
|
48
48
|
* Whether to show the label text
|
|
49
49
|
*/
|
|
50
50
|
showLabel?: boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Optional analytics callback
|
|
54
|
+
*/
|
|
55
|
+
onAnalyticsEvent?: (event: string, params?: object) => void;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
export function AICollectionGeneratorPopover({
|
|
@@ -56,13 +61,15 @@ export function AICollectionGeneratorPopover({
|
|
|
56
61
|
generateCollection,
|
|
57
62
|
trigger,
|
|
58
63
|
size = "small",
|
|
59
|
-
showLabel = true
|
|
64
|
+
showLabel = true,
|
|
65
|
+
onAnalyticsEvent
|
|
60
66
|
}: AICollectionGeneratorPopoverProps) {
|
|
61
67
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
62
68
|
const [prompt, setPrompt] = useState("");
|
|
63
69
|
const [loading, setLoading] = useState(false);
|
|
64
70
|
const [error, setError] = useState<string | null>(null);
|
|
65
71
|
|
|
72
|
+
const { t } = useTranslation();
|
|
66
73
|
const navigation = useNavigationController();
|
|
67
74
|
const snackbarController = useSnackbarController();
|
|
68
75
|
|
|
@@ -74,6 +81,9 @@ export function AICollectionGeneratorPopover({
|
|
|
74
81
|
setLoading(true);
|
|
75
82
|
setError(null);
|
|
76
83
|
|
|
84
|
+
const mode = existingCollection ? "modify" : "create";
|
|
85
|
+
onAnalyticsEvent?.("ai_collection_generate_start", { mode });
|
|
86
|
+
|
|
77
87
|
try {
|
|
78
88
|
const collectionsContext = existingCollections.map(c => ({
|
|
79
89
|
path: c.path,
|
|
@@ -100,6 +110,10 @@ export function AICollectionGeneratorPopover({
|
|
|
100
110
|
onGenerated(result.collection, result.operations);
|
|
101
111
|
setMenuOpen(false);
|
|
102
112
|
setPrompt("");
|
|
113
|
+
onAnalyticsEvent?.("ai_collection_generate_success", {
|
|
114
|
+
mode,
|
|
115
|
+
operationsCount: result.operations?.length
|
|
116
|
+
});
|
|
103
117
|
snackbarController.open({
|
|
104
118
|
type: "success",
|
|
105
119
|
message: existingCollection
|
|
@@ -112,6 +126,10 @@ export function AICollectionGeneratorPopover({
|
|
|
112
126
|
? e.message
|
|
113
127
|
: "Failed to generate collection. Please try again.";
|
|
114
128
|
setError(errorMessage);
|
|
129
|
+
onAnalyticsEvent?.("ai_collection_generate_error", {
|
|
130
|
+
mode,
|
|
131
|
+
error: errorMessage
|
|
132
|
+
});
|
|
115
133
|
snackbarController.open({
|
|
116
134
|
type: "error",
|
|
117
135
|
message: errorMessage
|
|
@@ -138,13 +156,13 @@ export function AICollectionGeneratorPopover({
|
|
|
138
156
|
: <AIIcon size="small" />
|
|
139
157
|
}
|
|
140
158
|
>
|
|
141
|
-
|
|
159
|
+
{t("ai_assist")}
|
|
142
160
|
</Button>
|
|
143
161
|
) : (
|
|
144
162
|
<IconButton
|
|
145
163
|
size={size}
|
|
146
164
|
disabled={loading}
|
|
147
|
-
aria-label="
|
|
165
|
+
aria-label={t("ai_assist")}
|
|
148
166
|
>
|
|
149
167
|
{loading
|
|
150
168
|
? <CircularProgress size="smallest" />
|
|
@@ -168,14 +186,14 @@ export function AICollectionGeneratorPopover({
|
|
|
168
186
|
<div className="flex items-center gap-2">
|
|
169
187
|
<AIIcon size="small" />
|
|
170
188
|
<Typography variant="subtitle2">
|
|
171
|
-
{existingCollection ? "
|
|
189
|
+
{existingCollection ? t("modify_collection_with_ai") : t("generate_collection_with_ai")}
|
|
172
190
|
</Typography>
|
|
173
191
|
</div>
|
|
174
192
|
|
|
175
193
|
<Typography variant="caption" color="secondary">
|
|
176
194
|
{existingCollection
|
|
177
|
-
? "
|
|
178
|
-
: "
|
|
195
|
+
? t("describe_changes_to_make")
|
|
196
|
+
: t("describe_collection_to_create")
|
|
179
197
|
}
|
|
180
198
|
</Typography>
|
|
181
199
|
|
|
@@ -188,8 +206,8 @@ export function AICollectionGeneratorPopover({
|
|
|
188
206
|
onChange={(e) => setPrompt(e.target.value)}
|
|
189
207
|
onKeyDown={handleKeyDown}
|
|
190
208
|
placeholder={existingCollection
|
|
191
|
-
? "
|
|
192
|
-
: "
|
|
209
|
+
? t("ai_placeholder_modify")
|
|
210
|
+
: t("ai_placeholder_create")
|
|
193
211
|
}
|
|
194
212
|
disabled={loading}
|
|
195
213
|
/>
|
|
@@ -207,7 +225,7 @@ export function AICollectionGeneratorPopover({
|
|
|
207
225
|
onClick={() => setMenuOpen(false)}
|
|
208
226
|
disabled={loading}
|
|
209
227
|
>
|
|
210
|
-
|
|
228
|
+
{t("cancel")}
|
|
211
229
|
</Button>
|
|
212
230
|
<Button
|
|
213
231
|
variant="filled"
|
|
@@ -216,7 +234,7 @@ export function AICollectionGeneratorPopover({
|
|
|
216
234
|
disabled={!prompt.trim() || loading}
|
|
217
235
|
startIcon={loading ? <CircularProgress size="smallest" /> : undefined}
|
|
218
236
|
>
|
|
219
|
-
{loading ? "
|
|
237
|
+
{loading ? t("generating") : t("generate_with_ai")}
|
|
220
238
|
</Button>
|
|
221
239
|
</div>
|
|
222
240
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState } from "react";
|
|
2
|
-
import { EntityCollection, FieldCaption, getFieldConfig, IconForView, Property, PropertyConfigBadge, resolveCollection, SearchIconsView, singular, toSnakeCase, unslugify, useAuthController, useCustomizationController } from "@firecms/core";
|
|
2
|
+
import { EntityCollection, FieldCaption, getFieldConfig, IconForView, Property, PropertyConfigBadge, resolveCollection, SearchIconsView, singular, toSnakeCase, unslugify, useAuthController, useCustomizationController, useTranslation } from "@firecms/core";
|
|
3
3
|
import {
|
|
4
4
|
BooleanSwitchWithLabel,
|
|
5
5
|
Chip,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Container,
|
|
9
9
|
DebouncedTextField,
|
|
10
10
|
Dialog,
|
|
11
|
+
HistoryIcon,
|
|
11
12
|
IconButton,
|
|
12
13
|
Select,
|
|
13
14
|
SelectItem,
|
|
@@ -60,6 +61,8 @@ export function CollectionDetailsForm({
|
|
|
60
61
|
const [iconDialogOpen, setIconDialogOpen] = useState(false);
|
|
61
62
|
const [orderPropertyDialogOpen, setOrderPropertyDialogOpen] = useState(false);
|
|
62
63
|
|
|
64
|
+
const { t } = useTranslation();
|
|
65
|
+
|
|
63
66
|
const authController = useAuthController();
|
|
64
67
|
const customizationController = useCustomizationController();
|
|
65
68
|
|
|
@@ -136,12 +139,12 @@ export function CollectionDetailsForm({
|
|
|
136
139
|
<div
|
|
137
140
|
className="flex flex-row gap-2 py-2 pt-3 items-center">
|
|
138
141
|
<Typography variant={!isNewCollection ? "h5" : "h4"} className={"flex-grow"}>
|
|
139
|
-
{isNewCollection ? "
|
|
142
|
+
{isNewCollection ? t("new_collection") : t("collection_with_name", { name: values?.name || "" })}
|
|
140
143
|
</Typography>
|
|
141
144
|
<DefaultDatabaseField databaseId={values.databaseId}
|
|
142
145
|
onDatabaseIdUpdate={updateDatabaseId} />
|
|
143
146
|
|
|
144
|
-
<Tooltip title={"
|
|
147
|
+
<Tooltip title={t("change_icon")}
|
|
145
148
|
asChild={true}>
|
|
146
149
|
<IconButton
|
|
147
150
|
shape={"square"}
|
|
@@ -153,7 +156,7 @@ export function CollectionDetailsForm({
|
|
|
153
156
|
|
|
154
157
|
{parentCollection && <Chip colorScheme={"tealDarker"}>
|
|
155
158
|
<Typography variant={"caption"}>
|
|
156
|
-
|
|
159
|
+
{t("is_subcollection_of")} <b>{parentCollection.name}</b>
|
|
157
160
|
</Typography>
|
|
158
161
|
</Chip>}
|
|
159
162
|
|
|
@@ -164,26 +167,26 @@ export function CollectionDetailsForm({
|
|
|
164
167
|
<TextField
|
|
165
168
|
value={values.name ?? ""}
|
|
166
169
|
onChange={(e: any) => updateName(e.target.value)}
|
|
167
|
-
label={"
|
|
170
|
+
label={t("name")}
|
|
168
171
|
autoFocus={true}
|
|
169
172
|
required
|
|
170
173
|
error={showErrors && Boolean(errors.name)} />
|
|
171
174
|
<FieldCaption error={touched.name && Boolean(errors.name)}>
|
|
172
|
-
{touched.name && Boolean(errors.name) ? errors.name : "
|
|
175
|
+
{touched.name && Boolean(errors.name) ? errors.name : t("collection_name_description")}
|
|
173
176
|
</FieldCaption>
|
|
174
177
|
</div>
|
|
175
178
|
|
|
176
179
|
<div className={cls("col-span-12 ")}>
|
|
177
180
|
<Field name={"path"}
|
|
178
181
|
as={DebouncedTextField}
|
|
179
|
-
label={"
|
|
182
|
+
label={t("path")}
|
|
180
183
|
required
|
|
181
184
|
error={showErrors && Boolean(errors.path)} />
|
|
182
185
|
|
|
183
186
|
<FieldCaption error={touched.path && Boolean(errors.path)}>
|
|
184
187
|
{touched.path && Boolean(errors.path)
|
|
185
188
|
? errors.path
|
|
186
|
-
: isSubcollection ? "
|
|
189
|
+
: isSubcollection ? t("relative_path_to_parent") : t("path_in_database")}
|
|
187
190
|
</FieldCaption>
|
|
188
191
|
|
|
189
192
|
</div>
|
|
@@ -246,7 +249,7 @@ export function CollectionDetailsForm({
|
|
|
246
249
|
<Select
|
|
247
250
|
key={`order-select-${numberProperties.length}`}
|
|
248
251
|
name="orderProperty"
|
|
249
|
-
label="
|
|
252
|
+
label={t("order_property")}
|
|
250
253
|
size={"large"}
|
|
251
254
|
fullWidth={true}
|
|
252
255
|
position={"item-aligned"}
|
|
@@ -258,10 +261,10 @@ export function CollectionDetailsForm({
|
|
|
258
261
|
}}
|
|
259
262
|
renderValue={(value) => {
|
|
260
263
|
if (orderPropertyMissing) {
|
|
261
|
-
return <span className="text-red-500">{value} (
|
|
264
|
+
return <span className="text-red-500">{value} ({t("not_found_suffix")})</span>;
|
|
262
265
|
}
|
|
263
266
|
const prop = numberProperties.find(p => p.key === value);
|
|
264
|
-
if (!prop) return "
|
|
267
|
+
if (!prop) return t("select_a_property");
|
|
265
268
|
const fieldConfig = getFieldConfig(prop.property, customizationController.propertyConfigs);
|
|
266
269
|
return (
|
|
267
270
|
<div className="flex items-center gap-2">
|
|
@@ -291,7 +294,7 @@ export function CollectionDetailsForm({
|
|
|
291
294
|
<div>
|
|
292
295
|
<div>{prop.label}</div>
|
|
293
296
|
<Typography variant="caption" color="secondary">
|
|
294
|
-
{fieldConfig?.name || "
|
|
297
|
+
{fieldConfig?.name || t("number")}
|
|
295
298
|
</Typography>
|
|
296
299
|
</div>
|
|
297
300
|
</div>
|
|
@@ -301,10 +304,10 @@ export function CollectionDetailsForm({
|
|
|
301
304
|
</Select>
|
|
302
305
|
<FieldCaption error={orderPropertyMissing}>
|
|
303
306
|
{orderPropertyMissing
|
|
304
|
-
?
|
|
307
|
+
? t("order_property_not_found", { property: values.orderProperty ?? "" })
|
|
305
308
|
: numberProperties.length === 0
|
|
306
|
-
? "
|
|
307
|
-
: "
|
|
309
|
+
? t("no_number_properties")
|
|
310
|
+
: t("order_property_description")
|
|
308
311
|
}
|
|
309
312
|
</FieldCaption>
|
|
310
313
|
</>
|
|
@@ -322,7 +325,7 @@ export function CollectionDetailsForm({
|
|
|
322
325
|
: "__order";
|
|
323
326
|
const dialogPropertyName = orderPropertyMissing && values.orderProperty
|
|
324
327
|
? unslugify(values.orderProperty)
|
|
325
|
-
: "
|
|
328
|
+
: t("order_label");
|
|
326
329
|
|
|
327
330
|
if (!showCreateButton) return null;
|
|
328
331
|
|
|
@@ -333,7 +336,7 @@ export function CollectionDetailsForm({
|
|
|
333
336
|
className="ml-3.5 text-sm text-primary hover:text-primary-dark mt-2"
|
|
334
337
|
onClick={() => setOrderPropertyDialogOpen(true)}
|
|
335
338
|
>
|
|
336
|
-
|
|
339
|
+
{t("create_property", { property: dialogPropertyKey })}
|
|
337
340
|
</button>
|
|
338
341
|
<PropertyFormDialog
|
|
339
342
|
open={orderPropertyDialogOpen}
|
|
@@ -375,16 +378,14 @@ export function CollectionDetailsForm({
|
|
|
375
378
|
position={"start"}
|
|
376
379
|
size={"large"}
|
|
377
380
|
allowIndeterminate={true}
|
|
378
|
-
label={values.history === null || values.history === undefined ? "
|
|
379
|
-
values.history ? "
|
|
380
|
-
)}
|
|
381
|
+
label={<span className="flex items-center gap-2"><HistoryIcon size={"smallest"} />{values.history === null || values.history === undefined ? t("doc_history_global") : (
|
|
382
|
+
values.history ? t("doc_history_enabled") : t("doc_history_not_enabled")
|
|
383
|
+
)}</span>}
|
|
381
384
|
onValueChange={(v) => setFieldValue("history", v)}
|
|
382
385
|
value={values.history === undefined ? null : values.history}
|
|
383
386
|
/>
|
|
384
387
|
<FieldCaption>
|
|
385
|
-
|
|
386
|
-
This is useful for auditing purposes. The data is stored in a subcollection of the document
|
|
387
|
-
in your database, called <b>__history</b>.
|
|
388
|
+
{t("doc_history_description")}
|
|
388
389
|
</FieldCaption>
|
|
389
390
|
</div>
|
|
390
391
|
|
|
@@ -423,7 +424,9 @@ function DefaultDatabaseField({
|
|
|
423
424
|
onDatabaseIdUpdate
|
|
424
425
|
}: { databaseId?: string, onDatabaseIdUpdate: (databaseId: string) => void }) {
|
|
425
426
|
|
|
426
|
-
|
|
427
|
+
const { t } = useTranslation();
|
|
428
|
+
|
|
429
|
+
return <Tooltip title={t("database_id")}
|
|
427
430
|
side={"top"}
|
|
428
431
|
align={"start"}>
|
|
429
432
|
<TextField size={"small"}
|
|
@@ -431,6 +434,6 @@ function DefaultDatabaseField({
|
|
|
431
434
|
inputClassName={"text-end"}
|
|
432
435
|
value={databaseId ?? ""}
|
|
433
436
|
onChange={(e: any) => onDatabaseIdUpdate(e.target.value)}
|
|
434
|
-
placeholder={"
|
|
437
|
+
placeholder={t("default_text")}></TextField>
|
|
435
438
|
</Tooltip>
|
|
436
439
|
}
|