@firecms/collection_editor 3.0.0 → 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 +884 -875
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +884 -875
- 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/collection_editor/CollectionDetailsForm.tsx +0 -1
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +0 -6
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +1 -5
- package/src/ui/collection_editor/properties/StoragePropertyField.tsx +22 -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>;
|
|
@@ -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
|
|
|
@@ -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`;
|
|
@@ -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
|
|