Skip to content

Commit

Permalink
Fix selects in dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
fgatti675 committed Dec 15, 2023
1 parent d0c73fe commit 3b2d4c2
Show file tree
Hide file tree
Showing 29 changed files with 679 additions and 1,379 deletions.
28 changes: 2 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ out-of-the-box experience for any project.
FireCMS is based on this great technologies:

- Typescript
- Firebase SDK 9
- Firebase SDK 10
- React + React Router 6
- Material UI 5
- Tailwind CSS
- Formik + Yup

### Quickstart
Expand Down Expand Up @@ -133,24 +133,6 @@ reordering.

You can replace the Firebase Storage implementation with your own.

## Included example

You can access the code for the demo project under
[`example`](https://github.com/FireCMSco/firecms/tree/master/example). It includes
every feature provided by this CMS.

Keep in mind you need to update the dependencies in that project if you want to
use it as it is, without linking it to the library source code. More details in
its README

## 🙌 Custom backend

FireCMS has a good separation of concerns. All the logic related to
Firebase/Firestore is abstracted away behind 3 interfaces: `DataSource`,
`StorageSource` and `AuthController`. This means you can extend or even
completely
replace those 3 implementations with your own.

## Contact and support

If you need general support, you can open a GitHub issue.
Expand All @@ -159,12 +141,6 @@ Do you need consulting setting up your Firestore-based CMS in no time? We are
happy to help!
`[email protected]`


## Contributing

Check the [Contributing Guidelines](CONTRIBUTING.md)
TLDR: Simply run `yarn` and `yarn dev`

## License

MIT © [FireCMS](https://github.com/FireCMSco)
38 changes: 19 additions & 19 deletions examples/example_pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"@firecms/data_import_export": "^3.0.0-alpha.37",
"@firecms/firebase_pro": "^3.0.0-alpha.37",
"@firecms/schema_inference": "^3.0.0-alpha.37",
"algoliasearch": "^4.17.1",
"firebase": "^10.5.2",
"algoliasearch": "^4.22.0",
"firebase": "^10.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.12.0",
"react-router-dom": "^6.12.0"
"react-router": "^6.21.0",
"react-router-dom": "^6.21.0"
},
"scripts": {
"dev": "vite --mode development",
Expand All @@ -42,25 +42,25 @@
]
},
"devDependencies": {
"@types/react": "^18.2.8",
"@types/react-dom": "18.2.14",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"@vitejs/plugin-react": "^4.0.0",
"autoprefixer": "^10.4.14",
"eslint": "^8.42.0",
"@types/react": "^18.2.45",
"@types/react-dom": "18.2.17",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"postcss": "^8.4.24",
"tailwindcss": "^3.3.2",
"typescript": "^5.2.2",
"vite": "^4.3.9",
"eslint-plugin-react-refresh": "^0.3.5",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"typescript": "^5.3.3",
"vite": "^4.5.1",
"vite-plugin-fonts": "^0.7.0",
"vite-plugin-svgr": "^3.2.0"
"vite-plugin-svgr": "^3.3.0"
}
}
2 changes: 2 additions & 0 deletions examples/example_pro/src/SampleApp/SampleApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ function SampleApp() {
return true;
if (path === "books")
return true;
if (path === "blog")
return true;
return false;
}
});
Expand Down
16 changes: 8 additions & 8 deletions examples/example_v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
},
"devDependencies": {
"@firecms/cli": "^3.0.0-alpha.37",
"@originjs/vite-plugin-federation": "^1.3.2",
"@types/react": "18.2.33",
"@types/react-dom": "18.2.14",
"@vitejs/plugin-react": "^4.1.0",
"@originjs/vite-plugin-federation": "^1.3.3",
"@types/react": "18.2.45",
"@types/react-dom": "18.2.17",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.5",
"typescript": "^5.3.0",
"vite": "^4.5.0"
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"typescript": "^5.3.3",
"vite": "^4.5.1"
}
}
18 changes: 9 additions & 9 deletions packages/collection_editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-react": "^4.1.0",
"eslint": "^8.52.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.55.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"react-router": "^6.17.0",
"react-router-dom": "^6.17.0",
"react-router": "^6.21.0",
"react-router-dom": "^6.21.0",
"ts-jest": "^29.1.1",
"typescript": "^5.3.0",
"vite": "^4.5.0",
"typescript": "^5.3.3",
"vite": "^4.5.1",
"vite-plugin-fonts": "^0.7.0"
},
"files": [
Expand Down
1 change: 1 addition & 0 deletions packages/collection_editor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ export type {
} from "./types/collection_inference";

export { MissingReferenceWidget } from "./ui/MissingReferenceWidget";

export * from "./ui/collection_editor/util";
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export function EntityCustomViewsSelectDialog({ open, onClose }: { open: boolean
{view.name} ({view.key})
</Button>;
})}
{(entityViews ?? []).length === 0 &&
<Typography variant={"body2"}>
No custom views defined
</Typography>
}
</DialogContent>
<DialogActions>
<Button onClick={() => onClose()}>Cancel</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,12 @@ function PropertyEditView({
<div className="flex mt-2 justify-between">
<div className={"w-full flex flex-col gap-2"}>
<Select
className={"w-full"}
// className={"w-full"}
error={Boolean(selectedWidgetError)}
value={selectedFieldConfigId ?? ""}
placeholder={"Select a property widget"}
open={selectOpen}
onOpenChange={setSelectOpen}
// open={selectOpen}
// onOpenChange={setSelectOpen}
position={"item-aligned"}
disabled={disabled}
renderValue={(value) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/create_firecms_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"devDependencies": {
"@types/node": "^20.8.9",
"ts-node": "^10.9.1",
"typescript": "^5.3.0"
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"files": [
"bin/",
Expand Down
14 changes: 7 additions & 7 deletions packages/data_import_export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@
"@jest/globals": "^29.7.0",
"@testing-library/jest-dom": "^5.17.0",
"@types/jest": "^29.5.6",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-react": "^4.1.0",
"@vitejs/plugin-react": "^4.2.1",
"babel-jest": "^29.7.0",
"eslint": "^8.52.0",
"eslint": "^8.55.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"typescript": "^5.3.0",
"vite": "^4.5.0",
"typescript": "^5.3.3",
"vite": "^4.5.1",
"vite-plugin-fonts": "^0.7.0"
},
"jest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export function ExportCollectionAction<M extends Record<string, any>, UserType e
collection: inputCollection
});

console.log("canExport", canExport)

const collection: ResolvedEntityCollection<M> = React.useMemo(() => resolveCollection({
collection: inputCollection,
path,
Expand Down
16 changes: 8 additions & 8 deletions packages/firebase_firecms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
"@firecms/data_enhancement": "^3.0.0-alpha.37",
"@firecms/data_import_export": "^3.0.0-alpha.37",
"@firecms/schema_inference": "^3.0.0-alpha.37",
"firebase": "^10.5.2",
"react-router": "^6.17.0",
"react-router-dom": "^6.17.0"
"firebase": "^10.7.1",
"react-router": "^6.21.0",
"react-router-dom": "^6.21.0"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.8.9",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"eslint": "^8.52.0",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"eslint": "^8.55.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^5.3.0"
"typescript": "^5.3.3"
},
"scripts": {
"dev": "vite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export function prepareCollectionForPersistence<M extends { [Key: string]: CMSTy
delete newCollection.additionalFields;
delete newCollection.callbacks;
delete newCollection.Actions;
delete newCollection.entityActions;
delete newCollection.selectionController;
delete newCollection.subcollections;
// @ts-ignore
Expand Down
6 changes: 3 additions & 3 deletions packages/firebase_firecms_pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
},
"dependencies": {
"@firecms/core": "^3.0.0-alpha.37",
"@firecms/firebase": "^3.0.0-alpha.37",
"@firecms/data_import_export": "^3.0.0-alpha.37",
"@firecms/firebase": "^3.0.0-alpha.37",
"@types/node": "^20.8.9",
"firebase": "^10.5.2",
"typescript": "^5.2.2"
"firebase": "^10.7.1",
"typescript": "^5.3.3"
},
"scripts": {
"dev": "vite",
Expand Down
18 changes: 9 additions & 9 deletions packages/firecms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@
"@firecms/data_import_export": "^3.0.0-alpha.37",
"@firecms/firebase": "^3.0.0-alpha.37",
"@firecms/schema_inference": "^3.0.0-alpha.37",
"firebase": "^10.5.2",
"react-router": "^6.17.0",
"react-router-dom": "^6.17.0"
"firebase": "^10.7.1",
"react-router": "^6.21.0",
"react-router-dom": "^6.21.0"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.8.9",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@typescript-eslint/parser": "^5.59.0",
"eslint": "^8.52.0",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.55.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^5.3.0"
"typescript": "^5.3.3"
},
"scripts": {
"dev": "vite",
Expand Down
6 changes: 3 additions & 3 deletions packages/firecms/src/FireCMS3App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export type FireCMS3ClientProps<ExtraAppbarProps = object> = {

basePath?: string;
baseCollectionPath?: string;
onAnalyticsEvent?: (event: CMSAnalyticsEvent, data?: object) => void;
onAnalyticsEvent?: (event: string, data?: object) => void;
};

function FullLoadingView(props: {
Expand Down Expand Up @@ -256,7 +256,8 @@ export function FireCMS3ClientWithController({
projectsApi: fireCMSBackend.projectsApi,
firebaseApp: clientFirebaseApp,
projectId,
onUserChanged: (user) => authController.setUser(user ?? null)
onUserChanged: (user) => authController.setUser(user ?? null),
onAnalyticsEvent: props.onAnalyticsEvent
});

const permissions: PermissionsBuilder<PersistedCollection, FireCMSUser> = useCallback(({
Expand Down Expand Up @@ -401,7 +402,6 @@ function FireCMS3AppAuthenticated({

const importExportPlugin = useImportExportPlugin({
exportAllowed: ({ collectionEntitiesCount }) => {
console.log("collectionEntitiesCount", collectionEntitiesCount);
return currentProjectController.canExport || collectionEntitiesCount <= DOCS_LIMIT;
},
notAllowedView: <SubscriptionPlanWidget showForPlans={["free"]}
Expand Down
2 changes: 1 addition & 1 deletion packages/firecms/src/FireCMS3AppProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type FireCMS3AppProps = {
/**
* Callback used to get analytics events from the CMS
*/
onAnalyticsEvent?: (event: CMSAnalyticsEvent, data?: object) => void;
onAnalyticsEvent?: (event: string, data?: object) => void;

/**
* Backend API host. Only used internally for testing.
Expand Down
Loading

0 comments on commit 3b2d4c2

Please sign in to comment.