@firecms/collection_editor 3.1.0-canary.1df3b2c → 3.1.0-canary.75005e4

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 +6984 -3759
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.umd.js +6982 -3757
  4. package/dist/index.umd.js.map +1 -1
  5. package/dist/locales/de.d.ts +118 -0
  6. package/dist/locales/en.d.ts +118 -0
  7. package/dist/locales/es.d.ts +118 -0
  8. package/dist/locales/fr.d.ts +118 -0
  9. package/dist/locales/hi.d.ts +118 -0
  10. package/dist/locales/it.d.ts +118 -0
  11. package/dist/locales/pt.d.ts +118 -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 +123 -0
  18. package/src/locales/en.ts +143 -0
  19. package/src/locales/es.ts +123 -0
  20. package/src/locales/fr.ts +123 -0
  21. package/src/locales/hi.ts +123 -0
  22. package/src/locales/it.ts +123 -0
  23. package/src/locales/pt.ts +123 -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 +7 -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,5 +1,5 @@
1
1
  import React, { useState } from "react";
2
- import { AIIcon, EntityCollection, prettifyIdentifier, } from "@firecms/core";
2
+ import { AIIcon, EntityCollection, prettifyIdentifier, useTranslation } from "@firecms/core";
3
3
  import { Button, Card, Chip, cls, CodeIcon, Container, Icon, Tooltip, Typography, } from "@firecms/ui";
4
4
  import { CollectionJsonImportDialog } from "./CollectionJsonImportDialog";
5
5
 
@@ -18,16 +18,19 @@ export function CollectionEditorWelcomeView({
18
18
  parentCollection,
19
19
  onContinue,
20
20
  existingCollectionPaths,
21
- generateCollection
21
+ generateCollection,
22
+ onAnalyticsEvent
22
23
  }: {
23
24
  path: string;
24
25
  parentCollection?: EntityCollection;
25
26
  onContinue: (importData?: object[], propertiesOrder?: string[]) => void;
26
27
  existingCollectionPaths?: string[];
27
28
  generateCollection?: CollectionGenerationCallback;
29
+ onAnalyticsEvent?: (event: string, params?: object) => void;
28
30
  }) {
29
31
 
30
32
  const { pathSuggestions } = useCollectionEditorController();
33
+ const { t } = useTranslation();
31
34
 
32
35
  const filteredSuggestions = (pathSuggestions ?? []).filter(s => !(existingCollectionPaths ?? []).find(c => c.trim().toLowerCase() === s.trim().toLowerCase()));
33
36
 
@@ -47,13 +50,13 @@ export function CollectionEditorWelcomeView({
47
50
  <div
48
51
  className="flex flex-row py-2 pt-3 items-center">
49
52
  <Typography variant={"h4"} className={"flex-grow"}>
50
- New collection
53
+ {t("new_collection")}
51
54
  </Typography>
52
55
  </div>
53
56
 
54
57
  {parentCollection && <Chip colorScheme={"tealDarker"}>
55
58
  <Typography variant={"caption"}>
56
- This is a subcollection of <b>{parentCollection.name}</b>
59
+ {t("this_is_subcollection_of")} <b>{parentCollection.name}</b>
57
60
  </Typography>
58
61
  </Chip>}
59
62
 
@@ -61,7 +64,7 @@ export function CollectionEditorWelcomeView({
61
64
 
62
65
  <Typography variant={"caption"}
63
66
  color={"secondary"}>
64
- Use one of the existing paths in your database:
67
+ {t("use_existing_paths_database")}
65
68
  </Typography>
66
69
  <div className={"flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7"}>
67
70
 
@@ -90,7 +93,7 @@ export function CollectionEditorWelcomeView({
90
93
  <Typography variant={"caption"}
91
94
  color={"secondary"}
92
95
  className={"mb-2"}>
93
- Describe your collection to AI:
96
+ {t("describe_collection_ai")}
94
97
  </Typography>
95
98
 
96
99
  <AICollectionGeneratorPopover
@@ -99,12 +102,13 @@ export function CollectionEditorWelcomeView({
99
102
  onContinue();
100
103
  }}
101
104
  generateCollection={generateCollection}
105
+ onAnalyticsEvent={onAnalyticsEvent}
102
106
  trigger={
103
107
  <Button
104
108
  variant="outlined"
105
109
  startIcon={<AIIcon size="small" />}
106
110
  >
107
- Generate with AI
111
+ {t("generate_with_ai")}
108
112
  </Button>
109
113
  }
110
114
  />
@@ -115,7 +119,7 @@ export function CollectionEditorWelcomeView({
115
119
  <Typography variant={"caption"}
116
120
  color={"secondary"}
117
121
  className={"mb-2"}>
118
- Create from JSON configuration:
122
+ {t("create_from_json_config")}
119
123
  </Typography>
120
124
 
121
125
  <Button
@@ -123,7 +127,7 @@ export function CollectionEditorWelcomeView({
123
127
  onClick={() => setJsonImportOpen(true)}
124
128
  startIcon={<CodeIcon size="small" />}
125
129
  >
126
- Paste JSON Configuration
130
+ {t("paste_json_config")}
127
131
  </Button>
128
132
 
129
133
  <CollectionJsonImportDialog
@@ -146,7 +150,7 @@ export function CollectionEditorWelcomeView({
146
150
  <Typography variant={"caption"}
147
151
  color={"secondary"}
148
152
  className={"mb-2"}>
149
- Create a collection from a file (csv, json, xls, xslx...)
153
+ {t("create_collection_from_file_formats")}
150
154
  </Typography>
151
155
 
152
156
  <ImportFileUpload onDataAdded={(data, propertiesOrder) => onContinue(data, propertiesOrder)} />
@@ -156,34 +160,34 @@ export function CollectionEditorWelcomeView({
156
160
  <div className={"my-2"}>
157
161
  <Typography variant={"caption"}
158
162
  color={"secondary"}>
159
- Select a template:
163
+ {t("select_template")}
160
164
  </Typography>
161
165
 
162
166
  <div className={"flex gap-2"}>
163
- <TemplateButton title={"Products"}
164
- subtitle={"A collection of products with images, prices and stock"}
167
+ <TemplateButton title={t("products")}
168
+ subtitle={t("collection_products_subtitle")}
165
169
  icon={<Icon size={"small"}
166
170
  iconKey={productsCollectionTemplate.icon! as string} />}
167
171
  onClick={() => {
168
172
  setValues(productsCollectionTemplate);
169
173
  onContinue();
170
174
  }} />
171
- <TemplateButton title={"Users"}
172
- subtitle={"A collection of users with emails, names and roles"}
175
+ <TemplateButton title={t("users")}
176
+ subtitle={t("collection_users_subtitle")}
173
177
  icon={<Icon size={"small"} iconKey={usersCollectionTemplate.icon! as string} />}
174
178
  onClick={() => {
175
179
  setValues(usersCollectionTemplate);
176
180
  onContinue();
177
181
  }} />
178
- <TemplateButton title={"Blog posts"}
179
- subtitle={"A collection of blog posts with images, authors and complex content"}
182
+ <TemplateButton title={t("blog_posts")}
183
+ subtitle={t("collection_blog_posts_subtitle")}
180
184
  icon={<Icon size={"small"} iconKey={blogCollectionTemplate.icon! as string} />}
181
185
  onClick={() => {
182
186
  setValues(blogCollectionTemplate);
183
187
  onContinue();
184
188
  }} />
185
- <TemplateButton title={"Pages"}
186
- subtitle={"A collection of pages with images, authors and complex content"}
189
+ <TemplateButton title={t("pages")}
190
+ subtitle={t("collection_pages_subtitle")}
187
191
  icon={<Icon size={"small"} iconKey={pagesCollectionTemplate.icon! as string} />}
188
192
  onClick={() => {
189
193
  setValues(pagesCollectionTemplate);
@@ -13,7 +13,8 @@ import {
13
13
  PropertyOrBuilder,
14
14
  useLargeLayout,
15
15
  User,
16
- useSnackbarController
16
+ useSnackbarController,
17
+ useTranslation
17
18
  } from "@firecms/core";
18
19
  import {
19
20
  AddIcon,
@@ -79,6 +80,7 @@ export function CollectionPropertiesEditorForm({
79
80
 
80
81
  const largeLayout = useLargeLayout();
81
82
  const asDialog = !largeLayout
83
+ const { t } = useTranslation();
82
84
 
83
85
  // index of the selected property within the namespace
84
86
  const [selectedPropertyIndex, setSelectedPropertyIndex] = useState<number | undefined>();
@@ -431,7 +433,7 @@ export function CollectionPropertiesEditorForm({
431
433
  <Typography variant={"body2"}
432
434
  className={"ml-2"}
433
435
  color={"secondary"}>
434
- Created by {owner.displayName}
436
+ {t("created_by", { name: owner.displayName ?? "" })}
435
437
  </Typography>}
436
438
  </div>
437
439
 
@@ -440,7 +442,7 @@ export function CollectionPropertiesEditorForm({
440
442
  </div>}
441
443
 
442
444
  <div className="ml-1 mt-2 flex flex-row gap-2">
443
- <Tooltip title={"Get the code for this collection"}
445
+ <Tooltip title={t("get_code_for_collection")}
444
446
  asChild={true}>
445
447
  <IconButton
446
448
  variant={"filled"}
@@ -449,7 +451,7 @@ export function CollectionPropertiesEditorForm({
449
451
  <CodeIcon />
450
452
  </IconButton>
451
453
  </Tooltip>
452
- {inferPropertiesFromData && <Tooltip title={"Add new properties based on data"}
454
+ {inferPropertiesFromData && <Tooltip title={t("add_properties_from_data")}
453
455
  asChild={true}>
454
456
  <IconButton
455
457
  variant={"filled"}
@@ -458,7 +460,7 @@ export function CollectionPropertiesEditorForm({
458
460
  {inferringProperties ? <CircularProgress size={"small"} /> : <FindInPageIcon />}
459
461
  </IconButton>
460
462
  </Tooltip>}
461
- <Tooltip title={"Add new property"}
463
+ <Tooltip title={t("add_new_property")}
462
464
  asChild={true}>
463
465
  <Button
464
466
  onClick={() => setNewPropertyDialogOpen(true)}>
@@ -487,7 +489,7 @@ export function CollectionPropertiesEditorForm({
487
489
  size={"large"}
488
490
  onClick={() => setNewPropertyDialogOpen(true)}
489
491
  startIcon={<AddIcon />}>
490
- Add new property
492
+ {t("add_new_property")}
491
493
  </Button>
492
494
  </div>
493
495
 
@@ -524,20 +526,20 @@ export function CollectionPropertiesEditorForm({
524
526
  <div className={"w-full flex flex-col items-center justify-center h-full gap-4"}>
525
527
  <Typography variant={"label"} className="">
526
528
  {emptyCollection
527
- ? "Now you can add your first property"
528
- : "Select a property to edit it"}
529
+ ? t("add_first_property")
530
+ : t("select_property_to_edit")}
529
531
  </Typography>
530
532
  <Button
531
533
  onClick={() => setNewPropertyDialogOpen(true)}
532
534
  >
533
535
  <AddIcon />
534
- Add new property
536
+ {t("add_new_property")}
535
537
  </Button>
536
538
  </div>}
537
539
 
538
540
  {selectedProperty && isPropertyBuilder(selectedProperty) &&
539
541
  <Typography variant={"label"} className="flex items-center justify-center">
540
- {"This property is defined as a property builder in code"}
542
+ {t("property_defined_as_builder")}
541
543
  </Typography>}
542
544
  </div>
543
545
  </div>}
@@ -8,7 +8,8 @@ import {
8
8
  resolveCollection,
9
9
  unslugify,
10
10
  useAuthController,
11
- useCustomizationController
11
+ useCustomizationController,
12
+ useTranslation
12
13
  } from "@firecms/core";
13
14
  import {
14
15
  BooleanSwitchWithLabel,
@@ -44,6 +45,7 @@ export function DisplaySettingsForm({
44
45
 
45
46
  const authController = useAuthController();
46
47
  const customizationController = useCustomizationController();
48
+ const { t } = useTranslation();
47
49
 
48
50
  // Resolve collection to get properties for order property select
49
51
  const resolvedCollection = useMemo(() => resolveCollection({
@@ -90,7 +92,7 @@ export function DisplaySettingsForm({
90
92
 
91
93
  <div>
92
94
  <Typography variant={"h5"} className={"flex-grow"}>
93
- Display settings
95
+ {t("display_settings")}
94
96
  </Typography>
95
97
  </div>
96
98
 
@@ -119,10 +121,10 @@ export function DisplaySettingsForm({
119
121
 
120
122
  return (
121
123
  <>
124
+ <Typography variant={"label"} color={"secondary"} className={"ml-3.5"}>{t("order_property")}</Typography>
122
125
  <Select
123
126
  key={`order-select-${numberProperties.length}`}
124
127
  name="orderProperty"
125
- label="Order Property"
126
128
  size={"large"}
127
129
  fullWidth={true}
128
130
  position={"item-aligned"}
@@ -134,10 +136,10 @@ export function DisplaySettingsForm({
134
136
  }}
135
137
  renderValue={(value) => {
136
138
  if (orderPropertyMissing) {
137
- return <span className="text-red-500">{value} (not found)</span>;
139
+ return <span className="text-red-500">{value} ({t("not_found_suffix")})</span>;
138
140
  }
139
141
  const prop = numberProperties.find(p => p.key === value);
140
- if (!prop) return "Select a property";
142
+ if (!prop) return t("select_a_property");
141
143
  const fieldConfig = getFieldConfig(prop.property, customizationController.propertyConfigs);
142
144
  return (
143
145
  <div className="flex items-center gap-2">
@@ -167,7 +169,7 @@ export function DisplaySettingsForm({
167
169
  <div>
168
170
  <div>{prop.label}</div>
169
171
  <Typography variant="caption" color="secondary">
170
- {fieldConfig?.name || "Number"}
172
+ {fieldConfig?.name || t("number")}
171
173
  </Typography>
172
174
  </div>
173
175
  </div>
@@ -177,10 +179,10 @@ export function DisplaySettingsForm({
177
179
  </Select>
178
180
  <FieldCaption error={orderPropertyMissing}>
179
181
  {orderPropertyMissing
180
- ? `Property "${values.orderProperty}" does not exist or is not a number property. Please select a valid property or clear the selection.`
182
+ ? t("order_property_not_found", { property: values.orderProperty ?? "" })
181
183
  : numberProperties.length === 0
182
- ? "No number properties found. Add a number property to enable ordering."
183
- : "Select a number property to persist the order of items"
184
+ ? t("no_number_properties")
185
+ : t("order_property_description")
184
186
  }
185
187
  </FieldCaption>
186
188
  </>
@@ -207,7 +209,7 @@ export function DisplaySettingsForm({
207
209
  className="ml-3.5 text-sm text-primary hover:text-primary-dark mt-2"
208
210
  onClick={() => setOrderPropertyDialogOpen(true)}
209
211
  >
210
- + Create "{dialogPropertyKey}" property
212
+ {t("create_property", { property: dialogPropertyKey })}
211
213
  </button>
212
214
  <PropertyFormDialog
213
215
  open={orderPropertyDialogOpen}
@@ -250,7 +252,7 @@ export function DisplaySettingsForm({
250
252
  name="defaultSize"
251
253
  size={"large"}
252
254
  fullWidth={true}
253
- label="Default row size"
255
+ label={t("default_row_size")}
254
256
  position={"item-aligned"}
255
257
  onChange={handleChange}
256
258
  value={values.defaultSize ?? ""}
@@ -289,9 +291,9 @@ export function DisplaySettingsForm({
289
291
  <CloseIcon size={"small"} />
290
292
  </IconButton>}
291
293
  value={values.sideDialogWidth ?? ""}
292
- label={"Side dialog width"} />
294
+ label={t("side_dialog_width")} />
293
295
  <FieldCaption>
294
- Optionally define the width (in pixels) of entities side dialog. Default is 768px
296
+ {t("side_dialog_width_description")}
295
297
  </FieldCaption>
296
298
  </div>
297
299
 
@@ -300,12 +302,12 @@ export function DisplaySettingsForm({
300
302
  <BooleanSwitchWithLabel
301
303
  position={"start"}
302
304
  size={"large"}
303
- label={values.inlineEditing === undefined || values.inlineEditing ? "Data can be edited directly in the table view" : "Data can be edited only in the form view"}
305
+ label={values.inlineEditing === undefined || values.inlineEditing ? t("inline_editing_enabled") : t("inline_editing_disabled")}
304
306
  onValueChange={(v) => setFieldValue("inlineEditing", v)}
305
307
  value={values.inlineEditing === undefined ? true : values.inlineEditing}
306
308
  />
307
309
  <FieldCaption>
308
- Allow editing data directly in the table view, without opening the form view.
310
+ {t("inline_editing_description")}
309
311
  </FieldCaption>
310
312
  </div>
311
313
 
@@ -314,12 +316,12 @@ export function DisplaySettingsForm({
314
316
  <BooleanSwitchWithLabel
315
317
  position={"start"}
316
318
  size={"large"}
317
- label={values.includeJsonView === undefined || values.includeJsonView ? "Include JSON view" : "Do not include JSON view"}
319
+ label={values.includeJsonView === undefined || values.includeJsonView ? t("include_json_view") : t("no_json_view")}
318
320
  onValueChange={(v) => setFieldValue("includeJsonView", v)}
319
321
  value={values.includeJsonView === undefined ? true : values.includeJsonView}
320
322
  />
321
323
  <FieldCaption>
322
- Include the JSON representation of the document.
324
+ {t("json_view_description")}
323
325
  </FieldCaption>
324
326
  </div>
325
327
 
@@ -4,7 +4,8 @@ import {
4
4
  EntityAction,
5
5
  EntityCollection,
6
6
  resolveEntityAction,
7
- useCustomizationController
7
+ useCustomizationController,
8
+ useTranslation
8
9
  } from "@firecms/core";
9
10
  import {
10
11
  AddIcon,
@@ -34,6 +35,7 @@ export function EntityActionsEditTab({
34
35
  }) {
35
36
 
36
37
  const { entityActions: contextEntityActions } = useCustomizationController();
38
+ const { t } = useTranslation();
37
39
 
38
40
  const [addEntityActionDialogOpen, setAddEntityActionDialogOpen] = React.useState<boolean>(false);
39
41
  const [actionToDelete, setActionToDelete] = React.useState<string | undefined>();
@@ -53,7 +55,7 @@ export function EntityActionsEditTab({
53
55
  <div className={"flex flex-col gap-16"}>
54
56
  <div className={"flex-grow flex flex-col gap-4 items-start"}>
55
57
  <Typography variant={"h6"}>
56
- Custom actions
58
+ {t("custom_actions")}
57
59
  </Typography>
58
60
 
59
61
  {totalEntityActions === 0 &&
@@ -62,8 +64,8 @@ export function EntityActionsEditTab({
62
64
  href={"https://firecms.co/docs/custom_actions"}
63
65
  component={"a"}
64
66
  rel="noopener noreferrer"
65
- target="_blank">More info</Button>}>
66
- Define your own custom actions by uploading them with the CLI.
67
+ target="_blank">{t("more_info")}</Button>}>
68
+ {t("define_custom_actions_cli")}
67
69
  </Alert>
68
70
  }
69
71
 
@@ -81,7 +83,7 @@ export function EntityActionsEditTab({
81
83
  </TableCell>
82
84
  <TableCell
83
85
  align="right">
84
- <Tooltip title={"Remove"}
86
+ <Tooltip title={t("remove")}
85
87
  asChild={true}>
86
88
  <IconButton size="small"
87
89
  onClick={(e) => {
@@ -104,8 +106,7 @@ export function EntityActionsEditTab({
104
106
  {action.name}
105
107
  </Typography>
106
108
  <Typography variant={"caption"} className={"flex-grow"}>
107
- This action is defined in code with
108
- key <code>{action.key}</code>
109
+ {t("action_defined_in_code")} <code>{action.key}</code>
109
110
  </Typography>
110
111
  </TableCell>
111
112
  </TableRow>
@@ -118,7 +119,7 @@ export function EntityActionsEditTab({
118
119
  setAddEntityActionDialogOpen(true);
119
120
  }}
120
121
  startIcon={<AddIcon />}>
121
- Add custom entity action
122
+ {t("add_custom_entity_action")}
122
123
  </Button>
123
124
  </Paper>
124
125
 
@@ -150,10 +151,8 @@ export function EntityActionsEditTab({
150
151
  setActionToDelete(undefined);
151
152
  }}
152
153
  onCancel={() => setActionToDelete(undefined)}
153
- title={<>Remove this action?</>}
154
- body={<>This will <b>not
155
- delete any data</b>, only
156
- the action in the CMS</>} />}
154
+ title={<>{t("remove_this_action")}</>}
155
+ body={<>{t("remove_action_warning")}</>} />}
157
156
 
158
157
  <EntityActionsSelectDialog
159
158
  open={addEntityActionDialogOpen}
@@ -1,4 +1,4 @@
1
- import { useCustomizationController } from "@firecms/core";
1
+ import { useCustomizationController, useTranslation } from "@firecms/core";
2
2
  import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography } from "@firecms/ui";
3
3
  import React from "react";
4
4
 
@@ -9,11 +9,12 @@ export function EntityActionsSelectDialog({
9
9
  const {
10
10
  entityActions
11
11
  } = useCustomizationController();
12
+ const { t } = useTranslation();
12
13
 
13
14
  return <Dialog
14
15
  maxWidth={"md"}
15
16
  open={open}>
16
- <DialogTitle>Select custom action</DialogTitle>
17
+ <DialogTitle>{t("select_custom_action")}</DialogTitle>
17
18
  <DialogContent className={"flex flex-col gap-4"}>
18
19
  {entityActions?.map((action) => {
19
20
  return <Button
@@ -27,14 +28,12 @@ export function EntityActionsSelectDialog({
27
28
  })}
28
29
  {(entityActions ?? []).length === 0 &&
29
30
  <Typography variant={"body2"}>
30
- No custom actions defined. Define your custom actions in the customization settings, before using
31
- this
32
- dialog.
31
+ {t("no_custom_actions_defined")}
33
32
  </Typography>
34
33
  }
35
34
  </DialogContent>
36
35
  <DialogActions>
37
- <Button onClick={() => onClose()}>Cancel</Button>
36
+ <Button onClick={() => onClose()}>{t("cancel")}</Button>
38
37
  </DialogActions>
39
38
  </Dialog>
40
39
  }
@@ -1,4 +1,4 @@
1
- import { useCustomizationController } from "@firecms/core";
1
+ import { useCustomizationController, useTranslation } from "@firecms/core";
2
2
  import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography } from "@firecms/ui";
3
3
  import React from "react";
4
4
 
@@ -9,11 +9,12 @@ export function EntityCustomViewsSelectDialog({
9
9
  const {
10
10
  entityViews,
11
11
  } = useCustomizationController();
12
+ const { t } = useTranslation();
12
13
 
13
14
  return <Dialog
14
15
  maxWidth={"md"}
15
16
  open={open}>
16
- <DialogTitle>Select custom view</DialogTitle>
17
+ <DialogTitle>{t("select_custom_view")}</DialogTitle>
17
18
  <DialogContent className={"flex flex-col gap-4"}>
18
19
  {entityViews?.map((view) => {
19
20
  return <Button
@@ -27,13 +28,12 @@ export function EntityCustomViewsSelectDialog({
27
28
  })}
28
29
  {(entityViews ?? []).length === 0 &&
29
30
  <Typography variant={"body2"}>
30
- No custom views defined. Define your custom views in the customization settings, before using this
31
- dialog.
31
+ {t("no_custom_views_defined")}
32
32
  </Typography>
33
33
  }
34
34
  </DialogContent>
35
35
  <DialogActions>
36
- <Button onClick={() => onClose()}>Cancel</Button>
36
+ <Button onClick={() => onClose()}>{t("cancel")}</Button>
37
37
  </DialogActions>
38
38
  </Dialog>
39
39
  }
@@ -1,7 +1,8 @@
1
1
  import React, { useEffect } from "react";
2
2
  import equal from "react-fast-compare"
3
3
 
4
- import { ArrayContainer, ArrayEntryParams, EnumValueConfig, EnumValues, FieldCaption, } from "@firecms/core";
4
+ import { ArrayContainer, ArrayEntryParams, EnumValueConfig, EnumValues, FieldCaption, useTranslation
5
+ } from "@firecms/core";
5
6
  import {
6
7
  FindInPageIcon,
7
8
  Badge,
@@ -44,6 +45,8 @@ export function EnumForm({
44
45
  allowDataInference,
45
46
  getData
46
47
  }: EnumFormProps) {
48
+ const { t } = useTranslation();
49
+
47
50
 
48
51
  const formex = useCreateFormex<{
49
52
  enumValues: EnumValueConfig[]
@@ -347,6 +350,7 @@ function EnumEntryDialog({
347
350
  enumValuesPath: string;
348
351
  onClose: () => void;
349
352
  }) {
353
+ const { t } = useTranslation();
350
354
 
351
355
  const {
352
356
  errors,
@@ -363,7 +367,7 @@ function EnumEntryDialog({
363
367
  open={open}
364
368
  onOpenChange={(open) => !open ? onClose() : undefined}
365
369
  >
366
- <DialogTitle hidden>Enum form dialog</DialogTitle>
370
+ <DialogTitle hidden>{t("enum_form_dialog")}</DialogTitle>
367
371
  <DialogContent>
368
372
  {index !== undefined &&
369
373
  <div className="flex flex-col gap-4">
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
2
  import {
3
3
  EntityCollection,
4
- User
4
+ User,
5
+ useTranslation
5
6
  } from "@firecms/core";
6
7
  import {
7
8
  Button,
@@ -44,16 +45,18 @@ export function ExtendSettingsForm({
44
45
  submitCount
45
46
  } = useFormex<EntityCollection>();
46
47
 
48
+ const { t } = useTranslation();
49
+
47
50
  return (
48
51
  <div className={"overflow-auto my-auto"}>
49
52
  <Container maxWidth={"4xl"} className={"flex flex-col gap-8 p-8 m-auto"}>
50
53
 
51
54
  <div>
52
55
  <Typography variant={"h5"} className={"flex-grow"}>
53
- Extend
56
+ {t("extend_title")}
54
57
  </Typography>
55
58
  <Typography variant={"body2"} color={"secondary"}>
56
- Add subcollections, custom views, and entity actions to this collection.
59
+ {t("extend_description")}
57
60
  </Typography>
58
61
  </div>
59
62
 
@@ -75,12 +78,10 @@ export function ExtendSettingsForm({
75
78
  {isMergedCollection && onResetToCode && (
76
79
  <div className={cls("flex flex-col gap-4 mt-8 border-t pt-8", defaultBorderMixin)}>
77
80
  <Typography variant={"body2"} color={"secondary"}>
78
- This collection is defined in code.
79
- The changes done in this editor will override the properties defined in code.
80
- You can delete the overridden values to revert to the state defined in code.
81
+ {t("collection_defined_in_code")}
81
82
  </Typography>
82
83
  <Button color={"neutral"} onClick={onResetToCode}>
83
- Reset to code
84
+ {t("reset_to_code")}
84
85
  </Button>
85
86
  </div>
86
87
  )}