@firecms/collection_editor 3.0.0-tw4.6 → 3.0.1
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.d.ts +1 -1
- package/dist/index.es.js +890 -881
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +890 -881
- package/dist/index.umd.js.map +1 -1
- package/dist/types/config_controller.d.ts +9 -0
- package/package.json +8 -8
- package/src/index.ts +1 -1
- package/src/types/config_controller.tsx +11 -0
- package/src/ui/PropertyAddColumnComponent.tsx +1 -1
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +1 -2
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +0 -6
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +1 -1
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +1 -1
- package/src/ui/collection_editor/PropertyFieldPreview.tsx +1 -1
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +1 -5
- package/src/ui/collection_editor/properties/StoragePropertyField.tsx +23 -2
- package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { CMSType, NavigationGroupMapping, Property } from "@firecms/core";
|
|
2
2
|
import { PersistedCollection } from "./persisted_collection";
|
|
3
|
+
export interface CollectionsSetupInfo {
|
|
4
|
+
status: "ongoing" | "complete";
|
|
5
|
+
error: string | null;
|
|
6
|
+
}
|
|
3
7
|
/**
|
|
4
8
|
* Use this controller to access the configuration that is stored externally,
|
|
5
9
|
* and not defined in code.
|
|
@@ -7,6 +11,11 @@ import { PersistedCollection } from "./persisted_collection";
|
|
|
7
11
|
export interface CollectionsConfigController {
|
|
8
12
|
loading: boolean;
|
|
9
13
|
collections?: PersistedCollection[];
|
|
14
|
+
/**
|
|
15
|
+
* Status information about the automatic collections setup process.
|
|
16
|
+
* Stored in the project config document at `collectionsSetup`.
|
|
17
|
+
*/
|
|
18
|
+
collectionsSetup?: CollectionsSetupInfo;
|
|
10
19
|
getCollection: (id: string) => PersistedCollection;
|
|
11
20
|
saveCollection: <M extends {
|
|
12
21
|
[Key: string]: CMSType;
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/collection_editor",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.1",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"source": "src/index.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@firecms/data_export": "^3.0.
|
|
11
|
-
"@firecms/data_import": "^3.0.
|
|
12
|
-
"@firecms/data_import_export": "^3.0.
|
|
13
|
-
"@firecms/formex": "^3.0.
|
|
14
|
-
"@firecms/schema_inference": "^3.0.
|
|
15
|
-
"@firecms/ui": "^3.0.
|
|
10
|
+
"@firecms/data_export": "^3.0.1",
|
|
11
|
+
"@firecms/data_import": "^3.0.1",
|
|
12
|
+
"@firecms/data_import_export": "^3.0.1",
|
|
13
|
+
"@firecms/formex": "^3.0.1",
|
|
14
|
+
"@firecms/schema_inference": "^3.0.1",
|
|
15
|
+
"@firecms/ui": "^3.0.1",
|
|
16
16
|
"json5": "^2.2.3",
|
|
17
17
|
"prism-react-renderer": "^2.4.1"
|
|
18
18
|
},
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "72d951d01d15ef5a7efcde6c63839f65964d2f7a"
|
|
73
73
|
}
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
export * from "./utils/collections";
|
|
16
16
|
|
|
17
17
|
export type {
|
|
18
|
-
CollectionsConfigController, DeleteCollectionParams, SaveCollectionParams, UpdateCollectionParams
|
|
18
|
+
CollectionsConfigController, DeleteCollectionParams, SaveCollectionParams, UpdateCollectionParams, CollectionsSetupInfo
|
|
19
19
|
} from "./types/config_controller";
|
|
20
20
|
export type {
|
|
21
21
|
CollectionEditorController
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { CMSType, NavigationGroupMapping, Property } from "@firecms/core";
|
|
2
2
|
import { PersistedCollection } from "./persisted_collection";
|
|
3
3
|
|
|
4
|
+
export interface CollectionsSetupInfo {
|
|
5
|
+
status: "ongoing" | "complete";
|
|
6
|
+
error: string | null;
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
/**
|
|
5
10
|
* Use this controller to access the configuration that is stored externally,
|
|
6
11
|
* and not defined in code.
|
|
@@ -11,6 +16,12 @@ export interface CollectionsConfigController {
|
|
|
11
16
|
|
|
12
17
|
collections?: PersistedCollection[];
|
|
13
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Status information about the automatic collections setup process.
|
|
21
|
+
* Stored in the project config document at `collectionsSetup`.
|
|
22
|
+
*/
|
|
23
|
+
collectionsSetup?: CollectionsSetupInfo;
|
|
24
|
+
|
|
14
25
|
getCollection: (id: string) => PersistedCollection;
|
|
15
26
|
|
|
16
27
|
saveCollection: <M extends { [Key: string]: CMSType }>(params: SaveCollectionParams<M>) => Promise<void>;
|
|
@@ -29,7 +29,7 @@ export function PropertyAddColumnComponent({
|
|
|
29
29
|
asChild={true}
|
|
30
30
|
title={canEditCollection ? "Add new property" : "You don't have permission to add new properties"}>
|
|
31
31
|
<div
|
|
32
|
-
className={"p-0.5 w-20 h-full flex items-center justify-center cursor-pointer bg-surface-100 bg-opacity-40
|
|
32
|
+
className={"p-0.5 w-20 h-full flex items-center justify-center cursor-pointer bg-surface-100 bg-opacity-40 hover:bg-surface-100 dark:bg-surface-950 dark:bg-opacity-40 dark:hover:bg-surface-950"}
|
|
33
33
|
// className={onHover ? "bg-white dark:bg-surface-950" : undefined}
|
|
34
34
|
onClick={() => {
|
|
35
35
|
collectionEditorController.editProperty({
|
|
@@ -165,7 +165,6 @@ export function CollectionDetailsForm({
|
|
|
165
165
|
<Field name={"path"}
|
|
166
166
|
as={DebouncedTextField}
|
|
167
167
|
label={"Path"}
|
|
168
|
-
disabled={!isNewCollection}
|
|
169
168
|
required
|
|
170
169
|
error={showErrors && Boolean(errors.path)}/>
|
|
171
170
|
|
|
@@ -241,7 +240,7 @@ export function CollectionDetailsForm({
|
|
|
241
240
|
expanded={advancedPanelExpanded}
|
|
242
241
|
onExpandedChange={setAdvancedPanelExpanded}
|
|
243
242
|
title={
|
|
244
|
-
<div className="flex flex-row text-surface-500
|
|
243
|
+
<div className="flex flex-row text-surface-500">
|
|
245
244
|
<SettingsIcon/>
|
|
246
245
|
<Typography variant={"subtitle2"}
|
|
247
246
|
className="ml-2">
|
|
@@ -693,32 +693,26 @@ function CollectionEditorInternal<M extends Record<string, any>>({
|
|
|
693
693
|
{isNewCollection && includeTemplates && currentView === "import_data_mapping" &&
|
|
694
694
|
<Button variant={"text"}
|
|
695
695
|
type="button"
|
|
696
|
-
color={"primary"}
|
|
697
696
|
onClick={() => {
|
|
698
697
|
importConfig.setInUse(false);
|
|
699
698
|
return setCurrentView("welcome");
|
|
700
699
|
}}>
|
|
701
|
-
<ArrowBackIcon/>
|
|
702
700
|
Back
|
|
703
701
|
</Button>}
|
|
704
702
|
|
|
705
703
|
{isNewCollection && includeTemplates && currentView === "import_data_preview" &&
|
|
706
704
|
<Button variant={"text"}
|
|
707
705
|
type="button"
|
|
708
|
-
color={"primary"}
|
|
709
706
|
onClick={() => {
|
|
710
707
|
setCurrentView("import_data_mapping");
|
|
711
708
|
}}>
|
|
712
|
-
<ArrowBackIcon/>
|
|
713
709
|
Back
|
|
714
710
|
</Button>}
|
|
715
711
|
|
|
716
712
|
{isNewCollection && includeTemplates && currentView === "details" &&
|
|
717
713
|
<Button variant={"text"}
|
|
718
|
-
color={"neutral"}
|
|
719
714
|
type="button"
|
|
720
715
|
onClick={() => setCurrentView("welcome")}>
|
|
721
|
-
<ArrowBackIcon/>
|
|
722
716
|
Back
|
|
723
717
|
</Button>}
|
|
724
718
|
|
|
@@ -156,7 +156,7 @@ export function TemplateButton({
|
|
|
156
156
|
onClick={onClick}
|
|
157
157
|
className={cls(
|
|
158
158
|
"my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
|
|
159
|
-
"text-
|
|
159
|
+
"text-surface-700 dark:text-surface-accent-300",
|
|
160
160
|
"hover:border-primary-dark hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary",
|
|
161
161
|
"border-surface-400 dark:border-surface-600 "
|
|
162
162
|
)}
|
|
@@ -303,7 +303,7 @@ export function CollectionPropertiesEditorForm({
|
|
|
303
303
|
};
|
|
304
304
|
|
|
305
305
|
const body = (
|
|
306
|
-
<div className={"grid grid-cols-12 gap-2 h-full bg-
|
|
306
|
+
<div className={"grid grid-cols-12 gap-2 h-full bg-white dark:bg-surface-950"}>
|
|
307
307
|
<div className={cls(
|
|
308
308
|
"bg-surface-50 dark:bg-surface-900",
|
|
309
309
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
@@ -42,7 +42,7 @@ export function PropertyFieldPreview({
|
|
|
42
42
|
const disabled = !editableProperty(property);
|
|
43
43
|
|
|
44
44
|
const borderColorClass = hasError
|
|
45
|
-
? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100
|
|
45
|
+
? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0"
|
|
46
46
|
: (selected ? "border-primary" : "border-transparent");
|
|
47
47
|
|
|
48
48
|
return <ErrorBoundary>
|
|
@@ -41,7 +41,7 @@ export function ReferencePropertyField({
|
|
|
41
41
|
<Field name={pathPath}
|
|
42
42
|
pathPath={pathPath}
|
|
43
43
|
type="select"
|
|
44
|
-
disabled={
|
|
44
|
+
disabled={disabled}
|
|
45
45
|
value={pathValue}
|
|
46
46
|
error={pathError}
|
|
47
47
|
handleChange={handleChange}
|
|
@@ -155,10 +155,6 @@ export function CollectionsSelect({
|
|
|
155
155
|
|
|
156
156
|
</Select>
|
|
157
157
|
|
|
158
|
-
<FieldCaption>
|
|
159
|
-
You can only edit the reference collection upon field
|
|
160
|
-
creation.
|
|
161
|
-
</FieldCaption>
|
|
162
158
|
</>
|
|
163
159
|
);
|
|
164
160
|
}
|
|
@@ -48,6 +48,7 @@ export function StoragePropertyField({
|
|
|
48
48
|
const maxSize = `${baseStoragePath}.maxSize`;
|
|
49
49
|
const storagePath = `${baseStoragePath}.storagePath`;
|
|
50
50
|
const storeUrl = `${baseStoragePath}.storeUrl`;
|
|
51
|
+
const includeBucketUrl = `${baseStoragePath}.includeBucketUrl`;
|
|
51
52
|
|
|
52
53
|
// Image resize config paths
|
|
53
54
|
const imageResize = `${baseStoragePath}.imageResize`;
|
|
@@ -87,7 +88,7 @@ export function StoragePropertyField({
|
|
|
87
88
|
|
|
88
89
|
<ExpandablePanel
|
|
89
90
|
title={
|
|
90
|
-
<div className="flex flex-row text-surface-500
|
|
91
|
+
<div className="flex flex-row text-surface-500">
|
|
91
92
|
<CloudUploadIcon/>
|
|
92
93
|
<Typography variant={"subtitle2"}
|
|
93
94
|
className="ml-4">
|
|
@@ -169,6 +170,26 @@ export function StoragePropertyField({
|
|
|
169
170
|
</ul>
|
|
170
171
|
</Typography>
|
|
171
172
|
|
|
173
|
+
<Field name={includeBucketUrl}
|
|
174
|
+
type="checkbox">
|
|
175
|
+
{({
|
|
176
|
+
field,
|
|
177
|
+
form
|
|
178
|
+
}: FormexFieldProps) => {
|
|
179
|
+
return <SwitchControl
|
|
180
|
+
label={"Include bucket URL (gs://...) in saved value"}
|
|
181
|
+
disabled={existing || disabled}
|
|
182
|
+
form={form}
|
|
183
|
+
field={field}/>;
|
|
184
|
+
}}
|
|
185
|
+
</Field>
|
|
186
|
+
|
|
187
|
+
<Typography variant={"caption"} className={"ml-3.5 mt-1 mb-2"}>
|
|
188
|
+
Turn this setting on if you want to save a fully-qualified storage URL
|
|
189
|
+
(e.g. <code>gs://my-bucket/path/to/file</code>) instead of just the storage path.
|
|
190
|
+
You can only change this prop upon creation.
|
|
191
|
+
</Typography>
|
|
192
|
+
|
|
172
193
|
<Field name={storeUrl}
|
|
173
194
|
type="checkbox">
|
|
174
195
|
{({
|
|
@@ -179,7 +200,7 @@ export function StoragePropertyField({
|
|
|
179
200
|
label={"Save URL instead of storage path"}
|
|
180
201
|
disabled={existing || disabled}
|
|
181
202
|
form={form}
|
|
182
|
-
field={field}
|
|
203
|
+
field={field}/>;
|
|
183
204
|
}}
|
|
184
205
|
</Field>
|
|
185
206
|
|
|
@@ -12,7 +12,7 @@ export function ValidationPanel({
|
|
|
12
12
|
asField={true}
|
|
13
13
|
innerClassName="p-4"
|
|
14
14
|
title={
|
|
15
|
-
<div className="flex flex-row text-surface-500
|
|
15
|
+
<div className="flex flex-row text-surface-500">
|
|
16
16
|
<RuleIcon/>
|
|
17
17
|
<Typography variant={"subtitle2"}
|
|
18
18
|
className="ml-4">
|