@firecms/collection_editor 3.0.0-canary.42 → 3.0.0-canary.43

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.
@@ -43,6 +43,4 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
43
43
  * @param collectionInference
44
44
  */
45
45
  export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, UserType extends User = User>({ collectionConfigController, configPermissions, reservedGroups, extraView, getPathSuggestions, getUser, collectionInference, getData, onAnalyticsEvent }: CollectionConfigControllerProps<EC, UserType>): FireCMSPlugin<any, any, PersistedCollection>;
46
- export declare function IntroWidget({ introMode }: {
47
- introMode?: "new_project" | "existing_project";
48
- }): import("react/jsx-runtime").JSX.Element | null;
46
+ export declare function IntroWidget({}: {}): import("react/jsx-runtime").JSX.Element | null;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@firecms/collection_editor",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.42",
4
+ "version": "3.0.0-canary.43",
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_import_export": "^3.0.0-canary.42",
11
- "@firecms/formex": "^3.0.0-canary.42",
12
- "@firecms/schema_inference": "^3.0.0-canary.42",
13
- "@firecms/ui": "^3.0.0-canary.42",
10
+ "@firecms/data_import_export": "^3.0.0-canary.43",
11
+ "@firecms/formex": "^3.0.0-canary.43",
12
+ "@firecms/schema_inference": "^3.0.0-canary.43",
13
+ "@firecms/ui": "^3.0.0-canary.43",
14
14
  "json5": "^2.2.3",
15
15
  "prism-react-renderer": "^2.3.1"
16
16
  },
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@jest/globals": "^29.7.0",
57
- "@types/react": "^18.2.67",
58
- "@types/react-dom": "^18.2.22",
59
- "@typescript-eslint/eslint-plugin": "^7.3.1",
60
- "@typescript-eslint/parser": "^7.3.1",
57
+ "@types/react": "^18.2.79",
58
+ "@types/react-dom": "^18.2.25",
59
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
60
+ "@typescript-eslint/parser": "^7.7.0",
61
61
  "@vitejs/plugin-react": "^4.2.1",
62
62
  "eslint": "^8.57.0",
63
63
  "eslint-config-standard": "^17.1.0",
@@ -67,11 +67,11 @@
67
67
  "eslint-plugin-react": "^7.34.1",
68
68
  "eslint-plugin-react-hooks": "^4.6.0",
69
69
  "jest": "^29.7.0",
70
- "react-router": "^6.22.0",
71
- "react-router-dom": "^6.22.0",
70
+ "react-router": "^6.22.3",
71
+ "react-router-dom": "^6.22.3",
72
72
  "ts-jest": "^29.1.2",
73
- "typescript": "^5.4.2",
74
- "vite": "^5.2.3",
73
+ "typescript": "^5.4.5",
74
+ "vite": "^5.2.9",
75
75
  "vite-plugin-fonts": "^0.7.0"
76
76
  },
77
77
  "files": [
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "d6a2f28e93d3c532dd6efacfccffb91383d5330e"
84
+ "gitHead": "fedcb0d43c504245dd76b702e4ab4479fa8592df"
85
85
  }
@@ -1,4 +1,4 @@
1
- import { convertDataToEntity, getPropertiesMapping, ImportConfig } from "@firecms/data_import_export";
1
+ import { convertDataToEntity, ImportConfig } from "@firecms/data_import_export";
2
2
  import { CircularProgressCenter, EntityCollectionTable, Properties, useSelectionController } from "@firecms/core";
3
3
  import { useEffect, useState } from "react";
4
4
  import { Typography } from "@firecms/ui";
@@ -16,8 +16,8 @@ export function CollectionEditorImportDataPreview({
16
16
  const [loading, setLoading] = useState<boolean>(false);
17
17
 
18
18
  async function loadEntities() {
19
- const propertiesMapping = getPropertiesMapping(importConfig.originProperties, properties);
20
- const mappedData = importConfig.importData.map(d => convertDataToEntity(d, importConfig.idColumn, importConfig.headersMapping, properties, propertiesMapping, "TEMP_PATH"));
19
+ // const propertiesMapping = getPropertiesMapping(importConfig.originProperties, properties, importConfig.headersMapping);
20
+ const mappedData = importConfig.importData.map(d => convertDataToEntity(d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
21
21
  importConfig.setEntities(mappedData);
22
22
  }
23
23
 
@@ -145,12 +145,8 @@ export function CollectionEditorImportMapping({
145
145
 
146
146
  <Typography variant="h6" className={"my-4 ml-3.5"}>Data property mapping</Typography>
147
147
 
148
- <DataNewPropertiesMapping headersMapping={importConfig.headersMapping}
149
- headingsOrder={importConfig.headingsOrder}
150
- idColumn={importConfig.idColumn}
151
- originProperties={importConfig.originProperties}
148
+ <DataNewPropertiesMapping importConfig={importConfig}
152
149
  destinationProperties={values.properties as Properties}
153
- onIdPropertyChanged={(value) => importConfig.setIdColumn(value ?? undefined)}
154
150
  buildPropertyView={({
155
151
  property,
156
152
  propertyKey,
@@ -110,9 +110,7 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
110
110
  };
111
111
  }
112
112
 
113
- export function IntroWidget({ introMode }: {
114
- introMode?: "new_project" | "existing_project";
115
- }) {
113
+ export function IntroWidget({}: {}) {
116
114
 
117
115
  const navigation = useNavigationController();
118
116
  if (!navigation.topLevelNavigation)
@@ -127,7 +125,7 @@ export function IntroWidget({ introMode }: {
127
125
  }).createCollections
128
126
  : true;
129
127
 
130
- if ((navigation.collections ?? []).length > 0) {
128
+ if (!navigation.initialised || navigation.collections === undefined || (navigation.collections ?? []).length > 0) {
131
129
  return null;
132
130
  }
133
131