Skip to content

Commit bf6d186

Browse files
committed
Updated migration steps for new auth controller
1 parent f8b9214 commit bf6d186

File tree

4 files changed

+112
-93
lines changed

4 files changed

+112
-93
lines changed

CHANGELOG.md

+54-45
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,62 @@
11
## [3.0.0-beta.11] - 2024-11-28
22

33
- [BREAKING] Removed `userRoles` from AuthController. You can now access the `roles` prop in the user object directly
4-
- [BREAKING] Many FireCMS UI sizes have been adjusted for better consistency. This will affect you only if you are using custom components.
5-
- [BREAKING] The `authController` is now passed to the User Management controller, instead of the other way around. The `userManagementController` can be used as an auth controller, but with all the added logic for user management.
6-
- `smallest` or `tiny` have been renamed to `small`.
7-
- `small` has been renamed to `medium`.
8-
- `medium` has been renamed to `large`.
9-
- [BREAKING] For self-hosted versions, there has been a change in the API for the data management controllers. The
10-
`authController` is now passed to the User Management controller, instead of the other way around. The `userManagementController`
11-
can be used as an auth controller, but with all the added logic for user management.
12-
13-
Code before:
4+
- [BREAKING] Many FireCMS UI sizes have been adjusted for better consistency. This will affect you only if you are using
5+
custom components.
6+
- [BREAKING] The `authController` is now passed to the User Management controller, instead of the other way around. The
7+
`userManagementController` can be used as an auth controller, but with all the added logic for user management.
8+
- `smallest` or `tiny` have been renamed to `small`.
9+
- `small` has been renamed to `medium`.
10+
- `medium` has been renamed to `large`.
11+
- [BREAKING] For self-hosted versions, there has been a change in the API for the data management controllers. The
12+
`authController` is now passed to the User Management controller, instead of the other way around. The
13+
`userManagementController`
14+
can be used as an auth controller, but with all the added logic for user management.
15+
16+
❌ Code before:
17+
1418
```typescript
1519
/**
16-
* Controller in charge of user management
17-
*/
18-
const userManagement = useBuildUserManagement({
20+
* Controller in charge of user management
21+
*/
22+
const userManagement = useBuildUserManagement({
1923
dataSourceDelegate: firestoreDelegate
2024
});
2125

22-
/**
23-
* Controller for managing authentication
24-
*/
25-
const authController: FirebaseAuthController = useFirebaseAuthController({
26-
firebaseApp,
27-
signInOptions,
28-
loading: userManagement.loading,
29-
defineRolesFor: userManagement.defineRolesFor
30-
});
26+
/**
27+
* Controller for managing authentication
28+
*/
29+
const authController: FirebaseAuthController = useFirebaseAuthController({
30+
firebaseApp,
31+
signInOptions,
32+
loading: userManagement.loading,
33+
defineRolesFor: userManagement.defineRolesFor
34+
});
3135
```
3236

33-
Code after:
37+
Code after:
3438

3539
```typescript
3640
/**
37-
* Controller for managing authentication
38-
*/
39-
const authController: FirebaseAuthController = useFirebaseAuthController({
41+
* Controller for managing authentication
42+
*/
43+
const authController: FirebaseAuthController = useFirebaseAuthController({
4044
firebaseApp,
4145
signInOptions
4246
});
4347

44-
/**
45-
* Controller in charge of user management
46-
*/
47-
const userManagement = useBuildUserManagement({
48-
dataSourceDelegate: firestoreDelegate,
49-
authController
50-
});
48+
/**
49+
* Controller in charge of user management
50+
*/
51+
const userManagement = useBuildUserManagement({
52+
dataSourceDelegate: firestoreDelegate,
53+
authController
54+
});
5155
```
5256

5357
Then you want to replace all previous references to `authController` with `userManagement`.
54-
For example, if you were using `authController.signInWithEmailAndPassword`, you should now use `userManagement.signInWithEmailAndPassword`.
58+
For example, if you were using `authController.signInWithEmailAndPassword`, you should now use
59+
`userManagement.signInWithEmailAndPassword`.
5560

5661
```typescript
5762
const navigationController = useBuildNavigationController({
@@ -65,15 +70,15 @@ const navigationController = useBuildNavigationController({
6570
```
6671

6772
becomes:
68-
73+
6974
```typescript
7075
const navigationController = useBuildNavigationController({
71-
collections: collectionsBuilder,
72-
collectionPermissions: userManagement.collectionPermissions,
73-
views,
74-
adminViews: userManagementAdminViews,
75-
authController: userManagement,
76-
dataSourceDelegate: firestoreDelegate
76+
collections: collectionsBuilder,
77+
collectionPermissions: userManagement.collectionPermissions,
78+
views,
79+
adminViews: userManagementAdminViews,
80+
authController: userManagement,
81+
dataSourceDelegate: firestoreDelegate
7782
});
7883
```
7984

@@ -84,7 +89,8 @@ const navigationController = useBuildNavigationController({
8489
- Reintroduced dark primary color variant for better theme options.
8590
- Minor web updates for improved aesthetics and functionality.
8691
- Fixed a bug where the Editor was not saving false values.
87-
- Replaced all instances of gray and slate colors with more unified surface and surface-accent colors for UI consistency.
92+
- Replaced all instances of gray and slate colors with more unified surface and surface-accent colors for UI
93+
consistency.
8894
- Added Avatar component fallback and integrated ESLint configuration into templates.
8995
- Enhanced error handling in forms and improved cloud error messages.
9096
- Refactored user management logic for better code organization.
@@ -94,8 +100,10 @@ const navigationController = useBuildNavigationController({
94100
- Fixed crash issues in repeat fields for subproperties and addressed various minor styling and functionality bugs.
95101
- Made improvements to heatmap responsiveness (HMR fixes).
96102
- Refactored text search functionalities for better efficiency and added relevant documentation.
97-
- Fixed issues with number input fields blocking scroll and replaced date picker with native HTML date input for consistency.
98-
- If you are using the `Select` component, you don't need to provide a `renderValue` function anymore. The component will handle it automatically.
103+
- Fixed issues with number input fields blocking scroll and replaced date picker with native HTML date input for
104+
consistency.
105+
- If you are using the `Select` component, you don't need to provide a `renderValue` function anymore. The component
106+
will handle it automatically.
99107

100108
## [3.0.0-beta.10] - 2024-07-10
101109

@@ -114,7 +122,8 @@ const navigationController = useBuildNavigationController({
114122
- Added API key generation and project selection capabilities.
115123
- Introduced a past-due warning message and improvements in collection and subcollection data handling.
116124
- Provided better error handling and layout consistency in the application.
117-
-
125+
-
126+
118127
## [3.0.0-beta.9] - 2024-07-10
119128

120129
- **NEW MARKDOWN EDITOR**: The markdown editor has been completely revamped. It now supports a live preview, and a much

website/blog/2024-12-04-firecms_open_source.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
slug: firecms_open_source_at_heart
33
title: FireCMS - Our Commitment to Open Source
44
author: Marian Moldovan
5-
image: /img/avatars/marian_avatar.jpeg
5+
image: /img/blog/firecms_open_source.jpg
66
author_url: https://www.linkedin.com/in/marianmoldovan/
77
author_image_url: https://avatars.githubusercontent.com/u/1479084?v=4
88
---

website/docs/CHANGELOG.md

+55-45
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,66 @@
22
id: changelog
33
title: Changelog
44
---
5+
56
## [3.0.0-beta.11] - 2024-11-28
67

78
- [BREAKING] Removed `userRoles` from AuthController. You can now access the `roles` prop in the user object directly
8-
- [BREAKING] Many FireCMS UI sizes have been adjusted for better consistency. This will affect you only if you are using custom components.
9-
- [BREAKING] The `authController` is now passed to the User Management controller, instead of the other way around. The `userManagementController` can be used as an auth controller, but with all the added logic for user management.
10-
- `smallest` or `tiny` have been renamed to `small`.
11-
- `small` has been renamed to `medium`.
12-
- `medium` has been renamed to `large`.
13-
- [BREAKING] For self-hosted versions, there has been a change in the API for the data management controllers. The
14-
`authController` is now passed to the User Management controller, instead of the other way around. The `userManagementController`
15-
can be used as an auth controller, but with all the added logic for user management.
16-
17-
Code before:
9+
- [BREAKING] Many FireCMS UI sizes have been adjusted for better consistency. This will affect you only if you are using
10+
custom components.
11+
- [BREAKING] The `authController` is now passed to the User Management controller, instead of the other way around. The
12+
`userManagementController` can be used as an auth controller, but with all the added logic for user management.
13+
- `smallest` or `tiny` have been renamed to `small`.
14+
- `small` has been renamed to `medium`.
15+
- `medium` has been renamed to `large`.
16+
- [BREAKING] For self-hosted versions, there has been a change in the API for the data management controllers. The
17+
`authController` is now passed to the User Management controller, instead of the other way around. The
18+
`userManagementController`
19+
can be used as an auth controller, but with all the added logic for user management.
20+
21+
❌ Code before:
22+
1823
```typescript
1924
/**
20-
* Controller in charge of user management
21-
*/
22-
const userManagement = useBuildUserManagement({
25+
* Controller in charge of user management
26+
*/
27+
const userManagement = useBuildUserManagement({
2328
dataSourceDelegate: firestoreDelegate
2429
});
2530

26-
/**
27-
* Controller for managing authentication
28-
*/
29-
const authController: FirebaseAuthController = useFirebaseAuthController({
30-
firebaseApp,
31-
signInOptions,
32-
loading: userManagement.loading,
33-
defineRolesFor: userManagement.defineRolesFor
34-
});
31+
/**
32+
* Controller for managing authentication
33+
*/
34+
const authController: FirebaseAuthController = useFirebaseAuthController({
35+
firebaseApp,
36+
signInOptions,
37+
loading: userManagement.loading,
38+
defineRolesFor: userManagement.defineRolesFor
39+
});
3540
```
3641

37-
Code after:
42+
Code after:
3843

3944
```typescript
4045
/**
41-
* Controller for managing authentication
42-
*/
43-
const authController: FirebaseAuthController = useFirebaseAuthController({
46+
* Controller for managing authentication
47+
*/
48+
const authController: FirebaseAuthController = useFirebaseAuthController({
4449
firebaseApp,
4550
signInOptions
4651
});
4752

48-
/**
49-
* Controller in charge of user management
50-
*/
51-
const userManagement = useBuildUserManagement({
52-
dataSourceDelegate: firestoreDelegate,
53-
authController
54-
});
53+
/**
54+
* Controller in charge of user management
55+
*/
56+
const userManagement = useBuildUserManagement({
57+
dataSourceDelegate: firestoreDelegate,
58+
authController
59+
});
5560
```
5661

5762
Then you want to replace all previous references to `authController` with `userManagement`.
58-
For example, if you were using `authController.signInWithEmailAndPassword`, you should now use `userManagement.signInWithEmailAndPassword`.
63+
For example, if you were using `authController.signInWithEmailAndPassword`, you should now use
64+
`userManagement.signInWithEmailAndPassword`.
5965

6066
```typescript
6167
const navigationController = useBuildNavigationController({
@@ -69,15 +75,15 @@ const navigationController = useBuildNavigationController({
6975
```
7076

7177
becomes:
72-
78+
7379
```typescript
7480
const navigationController = useBuildNavigationController({
75-
collections: collectionsBuilder,
76-
collectionPermissions: userManagement.collectionPermissions,
77-
views,
78-
adminViews: userManagementAdminViews,
79-
authController: userManagement,
80-
dataSourceDelegate: firestoreDelegate
81+
collections: collectionsBuilder,
82+
collectionPermissions: userManagement.collectionPermissions,
83+
views,
84+
adminViews: userManagementAdminViews,
85+
authController: userManagement,
86+
dataSourceDelegate: firestoreDelegate
8187
});
8288
```
8389

@@ -88,7 +94,8 @@ const navigationController = useBuildNavigationController({
8894
- Reintroduced dark primary color variant for better theme options.
8995
- Minor web updates for improved aesthetics and functionality.
9096
- Fixed a bug where the Editor was not saving false values.
91-
- Replaced all instances of gray and slate colors with more unified surface and surface-accent colors for UI consistency.
97+
- Replaced all instances of gray and slate colors with more unified surface and surface-accent colors for UI
98+
consistency.
9299
- Added Avatar component fallback and integrated ESLint configuration into templates.
93100
- Enhanced error handling in forms and improved cloud error messages.
94101
- Refactored user management logic for better code organization.
@@ -98,8 +105,10 @@ const navigationController = useBuildNavigationController({
98105
- Fixed crash issues in repeat fields for subproperties and addressed various minor styling and functionality bugs.
99106
- Made improvements to heatmap responsiveness (HMR fixes).
100107
- Refactored text search functionalities for better efficiency and added relevant documentation.
101-
- Fixed issues with number input fields blocking scroll and replaced date picker with native HTML date input for consistency.
102-
- If you are using the `Select` component, you don't need to provide a `renderValue` function anymore. The component will handle it automatically.
108+
- Fixed issues with number input fields blocking scroll and replaced date picker with native HTML date input for
109+
consistency.
110+
- If you are using the `Select` component, you don't need to provide a `renderValue` function anymore. The component
111+
will handle it automatically.
103112

104113
## [3.0.0-beta.10] - 2024-07-10
105114

@@ -118,7 +127,8 @@ const navigationController = useBuildNavigationController({
118127
- Added API key generation and project selection capabilities.
119128
- Introduced a past-due warning message and improvements in collection and subcollection data handling.
120129
- Provided better error handling and layout consistency in the application.
121-
-
130+
-
131+
122132
## [3.0.0-beta.9] - 2024-07-10
123133

124134
- **NEW MARKDOWN EDITOR**: The markdown editor has been completely revamped. It now supports a live preview, and a much

website/docs/pro/migrating_from_v3_beta.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For self-hosted versions, there has been a change in the API for the data manage
1818
`authController` is now passed to the User Management controller, instead of the other way around. The `userManagementController`
1919
can be used as an auth controller, but with all the added logic for user management.
2020

21-
Code before:
21+
Code before:
2222
```typescript
2323
/**
2424
* Controller in charge of user management
@@ -38,7 +38,7 @@ Code before:
3838
});
3939
```
4040

41-
Code after:
41+
Code after:
4242

4343
```typescript
4444
/**

0 commit comments

Comments
 (0)