@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.
Files changed (67) hide show
  1. package/dist/index.es.js +7010 -3754
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.umd.js +7008 -3752
  4. package/dist/index.umd.js.map +1 -1
  5. package/dist/locales/de.d.ts +120 -0
  6. package/dist/locales/en.d.ts +120 -0
  7. package/dist/locales/es.d.ts +120 -0
  8. package/dist/locales/fr.d.ts +120 -0
  9. package/dist/locales/hi.d.ts +120 -0
  10. package/dist/locales/it.d.ts +120 -0
  11. package/dist/locales/pt.d.ts +120 -0
  12. package/dist/ui/collection_editor/AICollectionGeneratorPopover.d.ts +5 -1
  13. package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +4 -0
  14. package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -1
  15. package/package.json +12 -12
  16. package/src/ConfigControllerProvider.tsx +1 -0
  17. package/src/locales/de.ts +125 -0
  18. package/src/locales/en.ts +145 -0
  19. package/src/locales/es.ts +125 -0
  20. package/src/locales/fr.ts +125 -0
  21. package/src/locales/hi.ts +125 -0
  22. package/src/locales/it.ts +125 -0
  23. package/src/locales/pt.ts +125 -0
  24. package/src/ui/EditorCollectionAction.tsx +3 -3
  25. package/src/ui/EditorEntityAction.tsx +3 -2
  26. package/src/ui/NewCollectionButton.tsx +3 -1
  27. package/src/ui/NewCollectionCard.tsx +7 -4
  28. package/src/ui/PropertyAddColumnComponent.tsx +3 -2
  29. package/src/ui/collection_editor/AICollectionGeneratorPopover.tsx +29 -11
  30. package/src/ui/collection_editor/CollectionDetailsForm.tsx +28 -25
  31. package/src/ui/collection_editor/CollectionEditorDialog.tsx +55 -42
  32. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +23 -19
  33. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +12 -10
  34. package/src/ui/collection_editor/DisplaySettingsForm.tsx +19 -17
  35. package/src/ui/collection_editor/EntityActionsEditTab.tsx +11 -12
  36. package/src/ui/collection_editor/EntityActionsSelectDialog.tsx +5 -6
  37. package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +5 -5
  38. package/src/ui/collection_editor/EnumForm.tsx +6 -2
  39. package/src/ui/collection_editor/ExtendSettingsForm.tsx +8 -7
  40. package/src/ui/collection_editor/GeneralSettingsForm.tsx +42 -42
  41. package/src/ui/collection_editor/GetCodeDialog.tsx +13 -12
  42. package/src/ui/collection_editor/KanbanConfigSection.tsx +11 -9
  43. package/src/ui/collection_editor/LayoutModeSwitch.tsx +7 -4
  44. package/src/ui/collection_editor/PropertyEditView.tsx +75 -66
  45. package/src/ui/collection_editor/SubcollectionsEditTab.tsx +16 -19
  46. package/src/ui/collection_editor/ViewModeSwitch.tsx +8 -6
  47. package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +6 -3
  48. package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +5 -2
  49. package/src/ui/collection_editor/properties/BooleanPropertyField.tsx +3 -1
  50. package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +6 -4
  51. package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +20 -18
  52. package/src/ui/collection_editor/properties/EnumPropertyField.tsx +5 -4
  53. package/src/ui/collection_editor/properties/MapPropertyField.tsx +8 -7
  54. package/src/ui/collection_editor/properties/MarkdownPropertyField.tsx +22 -23
  55. package/src/ui/collection_editor/properties/NumberPropertyField.tsx +3 -1
  56. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +5 -4
  57. package/src/ui/collection_editor/properties/StoragePropertyField.tsx +46 -51
  58. package/src/ui/collection_editor/properties/StringPropertyField.tsx +3 -1
  59. package/src/ui/collection_editor/properties/UrlPropertyField.tsx +12 -10
  60. package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +23 -4
  61. package/src/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +8 -3
  62. package/src/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +5 -2
  63. package/src/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +7 -5
  64. package/src/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +10 -7
  65. package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +11 -9
  66. package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +4 -1
  67. 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 ? "Edit collection" : "You don't have permissions to edit this collection"}>
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 ? "You need to save the document before changing the schema" : "Edit schema for this form") : "You don't have permissions to edit this collection"}>
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
- New collection
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"}>{"Add new collection".toUpperCase()}</Typography>
40
+ className={"font-medium"}>{t("add_new_collection").toUpperCase()}</Typography>
39
41
 
40
42
  {!canCreateCollections &&
41
- <Typography variant={"caption"}>You don&apos;t have permissions to create
42
- collections</Typography>
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 ? "Add new property" : "You don't have permission to add new properties"}>
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
- AI Assist
159
+ {t("ai_assist")}
142
160
  </Button>
143
161
  ) : (
144
162
  <IconButton
145
163
  size={size}
146
164
  disabled={loading}
147
- aria-label="AI Assist"
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 ? "Modify Collection with AI" : "Generate Collection with AI"}
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
- ? "Describe the changes you want to make to this collection."
178
- : "Describe the collection you want to create."
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
- ? "e.g., Add a thumbnail image field with storage, make price required..."
192
- : "e.g., Create a products collection with name, price, description, and category..."
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
- Cancel
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 ? "Generating..." : "Generate"}
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 ? "New collection" : `${values?.name} collection`}
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={"Change icon"}
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
- This is a subcollection of <b>{parentCollection.name}</b>
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={"Name"}
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 : "Name of this collection, usually a plural name (e.g. Products)"}
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={"Path"}
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 ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database"}
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="Order Property"
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} (not found)</span>;
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 "Select a property";
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 || "Number"}
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
- ? `Property "${values.orderProperty}" does not exist or is not a number property. Please select a valid property or clear the selection.`
307
+ ? t("order_property_not_found", { property: values.orderProperty ?? "" })
305
308
  : numberProperties.length === 0
306
- ? "No number properties found. Add a number property to enable ordering."
307
- : "Select a number property to persist the order of items"
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
- : "Order";
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
- + Create "{dialogPropertyKey}" property
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 ? "Document history revisions enabled if enabled globally" : (
379
- values.history ? "Document history revisions ENABLED" : "Document history revisions NOT enabled"
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
- When enabled, each document in this collection will have a history of changes.
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
- return <Tooltip title={"Database ID"}
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={"(default)"}></TextField>
437
+ placeholder={t("default_text")}></TextField>
435
438
  </Tooltip>
436
439
  }