From d8cdc5df59bea6f65fadca4df66d24c28b60daaf Mon Sep 17 00:00:00 2001 From: francesco Date: Sun, 19 Apr 2020 16:12:50 +0200 Subject: [PATCH] Dependencies fix Release 0.1.1 --- example/package.json | 76 ++++++++++---------- example/src/index.tsx | 2 +- example/yarn.lock | 118 +++++-------------------------- package.json | 16 ++--- src/CMSApp.tsx | 18 ++--- src/models.ts | 4 +- src/preview/ReferencePreview.tsx | 7 +- src/preview/index.tsx | 16 +++-- src/styles.ts | 3 - yarn.lock | 38 ++++++++-- 10 files changed, 128 insertions(+), 170 deletions(-) diff --git a/example/package.json b/example/package.json index 1022202..cbc3196 100644 --- a/example/package.json +++ b/example/package.json @@ -1,38 +1,42 @@ { - "name": "firecms-example", - "version": "0.1.0", - "private": true, - "dependencies": { - "react": "link:../node_modules/react", - "react-dom": "link:../node_modules/react-dom", - "react-scripts": "link:../node_modules/react-scripts", - "firecms": "link:.." - }, - "scripts": { - "start": "node ../node_modules/react-scripts/bin/react-scripts.js start", - "build": "node ../node_modules/react-scripts/bin/react-scripts.js build", - "test": "node ../node_modules/react-scripts/bin/react-scripts.js test", - "eject": "node ../node_modules/react-scripts/bin/react-scripts.js eject", - "deploy": "yarn run build && firebase deploy --only hosting" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@types/react": "^16.9.23", - "@types/react-dom": "^16.9.5", - "@types/react-router-dom": "^5.1.3" - } + "name": "firecms-example", + "version": "0.1.0", + "private": true, + "dependencies": { + "@material-ui/core": "link:../node_modules/@material-ui/core", + "@material-ui/icons": "link:../node_modules/@material-ui/icons", + "@material-ui/pickers": "link:../node_modules/firebase", + "firebase": "link:../node_modules/firebase", + "react": "link:../node_modules/react", + "react-dom": "link:../node_modules/react-dom", + "react-scripts": "link:../node_modules/react-scripts", + "firecms": "link:.." + }, + "scripts": { + "start": "node ../node_modules/react-scripts/bin/react-scripts.js start", + "build": "node ../node_modules/react-scripts/bin/react-scripts.js build", + "test": "node ../node_modules/react-scripts/bin/react-scripts.js test", + "eject": "node ../node_modules/react-scripts/bin/react-scripts.js eject", + "deploy": "yarn run build && firebase deploy --only hosting" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@types/react": "^16.9.23", + "@types/react-dom": "^16.9.5", + "@types/react-router-dom": "^5.1.3" + } } diff --git a/example/src/index.tsx b/example/src/index.tsx index 4f702d4..f1c8886 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -220,7 +220,7 @@ const blogSchema: EntitySchema = { ReactDOM.render( =1: +material-ui-chip-input@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/material-ui-chip-input/-/material-ui-chip-input-1.1.0.tgz#46550074da358fcfe075350181c315c9a405dc7d" integrity sha512-95JsxYtzBFUyvzLC0Ae8qo1h8heu9wcSgnGjF/Sy9QQ9pL/ufLVUyjS8uFULW4kEyeNZbZurux3KZKC3FLnoqg== @@ -9389,7 +9317,7 @@ react-select@>=3: react-input-autosize "^2.2.2" react-transition-group "^4.3.0" -react-transition-group@^4.0.0, react-transition-group@^4.3.0: +react-transition-group@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.3.0.tgz#fea832e386cf8796c58b61874a3319704f5ce683" integrity sha512-1qRV1ZuVSdxPlPf4O8t7inxUGpdyO5zG9IoNfJxSO0ImU2A1YWkEQvFPuIPZmMLkg5hYs7vv5mMOyfgSkvAwvw== @@ -9770,13 +9698,6 @@ rgba-regex@^1.0.0: resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= -rifm@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/rifm/-/rifm-0.7.0.tgz#debe951a9c83549ca6b33e5919f716044c2230be" - integrity sha512-DSOJTWHD67860I5ojetXdEQRIBvF6YcpNe53j0vn1vp9EUb9N80EiZTxgP+FkDKorWC8PZw052kTF4C1GOivCQ== - dependencies: - "@babel/runtime" "^7.3.1" - rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" @@ -10907,11 +10828,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript-eslint@^0.0.1-alpha.0: - version "0.0.1-alpha.0" - resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-0.0.1-alpha.0.tgz#285d68a4e96588295cd436278801bcb6a6b916c1" - integrity sha512-1hNKM37dAWML/2ltRXupOq2uqcdRQyDFphl+341NTPXFLLLiDhErXx8VtaSLh3xP7SyHZdcCgpt9boYYVb3fQg== - unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" diff --git a/package.json b/package.json index 0d0c692..6fa1532 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@camberi/firecms", - "version": "0.1.0", + "version": "0.1.1", "description": "Awesome Firestore based CMS", "author": "camberi", "license": "GPL-3.0", @@ -26,16 +26,12 @@ }, "dependencies": { "@date-io/date-fns": "^1.3.11", - "@material-ui/core": "^4.9.9", - "@material-ui/icons": "^4.9.1", - "@material-ui/lab": "latest", - "@material-ui/pickers": "^3.2.10", "date-fns": "^2.10.0", - "firebase": "^7.10.0", "formik": "^2.1.4", "material-ui-chip-input": "^1.1.0", "material-ui-dropzone": "^2.4.9", "material-ui-popup-state": "^1.5.4", + "@material-ui/lab": "latest", "object-hash": "^2.0.3", "react-router-dom": "^5.1.2", "react-select": ">=3", @@ -44,7 +40,11 @@ "peerDependencies": { "react": "^16.13.1", "react-dom": "^16.13.1", - "react-scripts": "^3.4.1" + "react-scripts": "^3.4.1", + "@material-ui/core": "^4.9.9", + "@material-ui/icons": "^4.9.1", + "@material-ui/pickers": "^3.2.10", + "firebase": "^7.10.0" }, "devDependencies": { "prop-types": "^15.7.2", @@ -94,7 +94,7 @@ "react-scripts": "^3.4.1", "react-select": ">=3", "typescript": "^3.8.3", - "typescript-eslint": "^0.0.1-alpha.0", + "@typescript-eslint/eslint-plugin": "^2.28.0", "yup": "^0.28.3" }, "files": [ diff --git a/src/CMSApp.tsx b/src/CMSApp.tsx index 1c87f5c..0deed02 100644 --- a/src/CMSApp.tsx +++ b/src/CMSApp.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from "react"; import { - AppBar, + AppBar, Box, Button, CssBaseline, Divider, @@ -290,7 +290,7 @@ export default function CMSApp({ function renderMainView() { if (error) { - return
{error}
; + return {error} ; } if (!firebaseConfigInitialized) { @@ -301,8 +301,8 @@ export default function CMSApp({ includeMedia !== undefined && includeMedia; const drawer = ( -
-
+ + {Object.entries(navigation).map(([key, view], index) => ( @@ -341,13 +341,13 @@ export default function CMSApp({ )} -
+ ); return ( -
+ @@ -363,7 +363,7 @@ export default function CMSApp({ {name} -
+
+
); diff --git a/src/models.ts b/src/models.ts index f0ffca6..6e1a648 100644 --- a/src/models.ts +++ b/src/models.ts @@ -159,7 +159,9 @@ interface BaseProperty { /** * When the entity is rendered as the target of a reference or as part of a - * map, should this property be included + * map, should this property be included. + * If includeAsMapPreview is not specified in any property of an entity, when + * the given entity is rendered, the first 3 properties are displayed. */ includeAsMapPreview?: boolean; diff --git a/src/preview/ReferencePreview.tsx b/src/preview/ReferencePreview.tsx index c2170f0..6a905db 100644 --- a/src/preview/ReferencePreview.tsx +++ b/src/preview/ReferencePreview.tsx @@ -12,7 +12,7 @@ export interface ReferencePreviewProps { schema: S; - renderPreviewComponent(value: any, property: Property):JSX.Element + renderPreviewComponent(value: any, property: Property): JSX.Element } export default function ReferencePreview( @@ -37,7 +37,10 @@ export default function ReferencePreview( if (!entity) return (); - const listProperties = Object.entries(schema.properties).filter(([_, property]) => property.includeInListView ); + let listProperties = Object.entries(schema.properties).filter(([_, property]) => property.includeAsMapPreview); + if (!listProperties) { + listProperties = Object.entries(schema.properties).slice(0, 3); + } return ( diff --git a/src/preview/index.tsx b/src/preview/index.tsx index 7b266b5..b1f1951 100644 --- a/src/preview/index.tsx +++ b/src/preview/index.tsx @@ -1,4 +1,5 @@ import { + Box, CardMedia, Chip, Container, @@ -71,7 +72,11 @@ export default function renderPreviewComponent(value: any, property: Property): function renderMap(property: MapProperty, values: any) { - const listProperties = Object.entries(property.properties).filter(([_, property]) => property.includeAsMapPreview); + + let listProperties = Object.entries(property.properties).filter(([_, property]) => property.includeAsMapPreview); + if (!listProperties) { + listProperties = Object.entries(property.properties).slice(0, 3); + } return ( @@ -86,7 +91,10 @@ function renderMap(property: MapProperty, values: any) { function renderArrayOfMaps(properties: Properties, values: any[]) { - const tableProperties = Object.entries(properties).filter(([_, property]) => property.includeAsMapPreview); + let tableProperties = Object.entries(properties).filter(([_, property]) => property.includeAsMapPreview); + if (!tableProperties) { + tableProperties = Object.entries(properties).slice(0, 3); + } return @@ -161,12 +169,12 @@ function renderUrlAudioComponent(value: any) { function renderUrlImageThumbnail(url: string) { return ( - + - + ); } diff --git a/src/styles.ts b/src/styles.ts index 7439bca..9445549 100644 --- a/src/styles.ts +++ b/src/styles.ts @@ -99,9 +99,6 @@ export const formStyles = makeStyles(theme => ({ }, }, - stepper: { - padding: theme.spacing(3, 0, 5) - }, buttons: { display: "flex", justifyContent: "flex-end" diff --git a/yarn.lock b/yarn.lock index fb39bf0..aafd6e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2257,6 +2257,16 @@ regexpp "^3.0.0" tsutils "^3.17.1" +"@typescript-eslint/eslint-plugin@^2.28.0": + version "2.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.28.0.tgz#4431bc6d3af41903e5255770703d4e55a0ccbdec" + integrity sha512-w0Ugcq2iatloEabQP56BRWJowliXUP5Wv6f9fKzjJmDW81hOTBxRoJ4LoEOxRpz9gcY51Libytd2ba3yLmSOfg== + dependencies: + "@typescript-eslint/experimental-utils" "2.28.0" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + tsutils "^3.17.1" + "@typescript-eslint/experimental-utils@2.27.0": version "2.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.27.0.tgz#801a952c10b58e486c9a0b36cf21e2aab1e9e01a" @@ -2267,6 +2277,16 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" +"@typescript-eslint/experimental-utils@2.28.0": + version "2.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.28.0.tgz#1fd0961cd8ef6522687b4c562647da6e71f8833d" + integrity sha512-4SL9OWjvFbHumM/Zh/ZeEjUFxrYKtdCi7At4GyKTbQlrj1HcphIDXlje4Uu4cY+qzszR5NdVin4CCm6AXCjd6w== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.28.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + "@typescript-eslint/parser@^2.10.0": version "2.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.27.0.tgz#d91664335b2c46584294e42eb4ff35838c427287" @@ -2290,6 +2310,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.28.0": + version "2.28.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.28.0.tgz#d34949099ff81092c36dc275b6a1ea580729ba00" + integrity sha512-HDr8MP9wfwkiuqzRVkuM3BeDrOC4cKbO5a6BymZBHUt5y/2pL0BXD6I/C/ceq2IZoHWhcASk+5/zo+dwgu9V8Q== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -12439,11 +12472,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript-eslint@^0.0.1-alpha.0: - version "0.0.1-alpha.0" - resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-0.0.1-alpha.0.tgz#285d68a4e96588295cd436278801bcb6a6b916c1" - integrity sha512-1hNKM37dAWML/2ltRXupOq2uqcdRQyDFphl+341NTPXFLLLiDhErXx8VtaSLh3xP7SyHZdcCgpt9boYYVb3fQg== - typescript@^3.8.3: version "3.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"