Skip to content

Commit caa1c8d

Browse files
authored
refactor(angular): Align and update angular api with spec
2 parents 3485eed + 1d971ba commit caa1c8d

File tree

128 files changed

+9041
-5688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+9041
-5688
lines changed

eslint.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import tseslint from "typescript-eslint";
77
import pluginPrettier from "eslint-plugin-prettier";
88
import pluginReact from "eslint-plugin-react";
99
import pluginReactHooks from "eslint-plugin-react-hooks";
10+
import pluginAngular from "angular-eslint";
1011

1112
const config: any[] = [
1213
globalIgnores([
@@ -40,6 +41,11 @@ const config: any[] = [
4041
],
4142
},
4243
},
44+
{
45+
// Angular package specific rules
46+
files: ["packages/angular/src/**/*.{ts,tsx}"],
47+
processor: pluginAngular.processInlineTemplates,
48+
},
4349
{
4450
// React package specific rules
4551
files: ["packages/react/src/**/*.{ts,tsx}"],

examples/angular/src/app/app.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ import { provideFirebaseUI, provideFirebaseUIPolicies } from "@firebase-ui/angul
2626
import { initializeUI } from "@firebase-ui/core";
2727

2828
const firebaseConfig = {
29-
// your Firebase config here
29+
apiKey: "AIzaSyCvMftIUCD9lUQ3BzIrimfSfBbCUQYZf-I",
30+
authDomain: "fir-ui-rework.firebaseapp.com",
31+
projectId: "fir-ui-rework",
32+
storageBucket: "fir-ui-rework.firebasestorage.app",
33+
messagingSenderId: "200312857118",
34+
appId: "1:200312857118:web:94e3f69b0e0a4a863f040f",
3035
};
3136

3237
export const appConfig: ApplicationConfig = {

examples/angular/src/app/app.routes.server.ts

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,48 @@ export const serverRoutes: ServerRoute[] = [
2222
path: "",
2323
renderMode: RenderMode.Prerender,
2424
},
25-
/** Key auth screen demos - good for SSG as they showcase Firebase UI components */
25+
/** Static auth demos - good for SSG as they showcase Firebase UI components */
2626
{
27-
path: "screens/sign-in-auth-screen",
27+
path: "sign-in",
2828
renderMode: RenderMode.Prerender,
2929
},
3030
{
31-
path: "screens/oauth-screen",
31+
path: "oauth",
3232
renderMode: RenderMode.Prerender,
3333
},
34+
/** Interactive auth routes - better as CSR for user interaction */
3435
{
35-
path: "screens/sign-up-auth-screen",
36-
renderMode: RenderMode.Prerender,
36+
path: "sign-up",
37+
renderMode: RenderMode.Client,
3738
},
3839
{
39-
path: "screens/email-link-auth-screen",
40-
renderMode: RenderMode.Prerender,
40+
path: "forgot-password",
41+
renderMode: RenderMode.Client,
4142
},
43+
/** Dynamic auth routes - good for SSR as they may need server-side data */
4244
{
43-
path: "screens/phone-auth-screen",
44-
renderMode: RenderMode.Prerender,
45+
path: "email-link",
46+
renderMode: RenderMode.Server,
4547
},
46-
/** Interactive auth routes - better as CSR for user interaction */
4748
{
48-
path: "sign-in",
49-
renderMode: RenderMode.Client,
49+
path: "email-link-oauth",
50+
renderMode: RenderMode.Server,
5051
},
5152
{
52-
path: "register",
53-
renderMode: RenderMode.Client,
53+
path: "phone",
54+
renderMode: RenderMode.Server,
5455
},
5556
{
56-
path: "forgot-password",
57-
renderMode: RenderMode.Client,
57+
path: "phone-oauth",
58+
renderMode: RenderMode.Server,
59+
},
60+
{
61+
path: "sign-in-oauth",
62+
renderMode: RenderMode.Server,
63+
},
64+
{
65+
path: "sign-up-oauth",
66+
renderMode: RenderMode.Server,
5867
},
5968
/** All other routes will be rendered on the server (SSR) */
6069
{

examples/angular/src/app/app.routes.ts

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,72 +21,45 @@ export const routes: Routes = [
2121
path: "",
2222
loadComponent: () => import("./home").then((m) => m.HomeComponent),
2323
},
24-
// Direct auth routes (matching NextJS paths)
2524
{
26-
path: "sign-in",
27-
loadComponent: () => import("./auth/sign-in").then((m) => m.SignInComponent),
25+
path: "email-link",
26+
loadComponent: () => import("./auth/email-link").then((m) => m.EmailLinkComponent),
2827
},
2928
{
30-
path: "register",
31-
loadComponent: () => import("./auth/register").then((m) => m.RegisterComponent),
29+
path: "email-link-oauth",
30+
loadComponent: () => import("./auth/email-link-oauth").then((m) => m.EmailLinkOAuthComponent),
3231
},
3332
{
3433
path: "forgot-password",
3534
loadComponent: () => import("./auth/forgot-password").then((m) => m.ForgotPasswordComponent),
3635
},
37-
// Sign-in subdirectories
3836
{
39-
path: "sign-in/phone",
40-
loadComponent: () => import("./auth/phone").then((m) => m.PhoneComponent),
37+
path: "oauth",
38+
loadComponent: () => import("./auth/oauth").then((m) => m.OAuthComponent),
4139
},
4240
{
43-
path: "sign-in/email",
44-
loadComponent: () => import("./auth/email-link").then((m) => m.EmailLinkComponent),
41+
path: "phone",
42+
loadComponent: () => import("./auth/phone").then((m) => m.PhoneComponent),
4543
},
46-
// Screen routes
4744
{
48-
path: "screens/sign-in-auth-screen",
49-
loadComponent: () => import("./auth/sign-in-screen").then((m) => m.SignInScreenComponent),
45+
path: "phone-oauth",
46+
loadComponent: () => import("./auth/phone-oauth").then((m) => m.PhoneOAuthComponent),
5047
},
5148
{
52-
path: "screens/sign-in-auth-screen-w-handlers",
53-
loadComponent: () => import("./auth/sign-in-handlers").then((m) => m.SignInHandlersComponent),
49+
path: "sign-in",
50+
loadComponent: () => import("./auth/sign-in").then((m) => m.SignInComponent),
5451
},
5552
{
56-
path: "screens/sign-in-auth-screen-w-oauth",
53+
path: "sign-in-oauth",
5754
loadComponent: () => import("./auth/sign-in-oauth").then((m) => m.SignInOAuthComponent),
5855
},
5956
{
60-
path: "screens/email-link-auth-screen",
61-
loadComponent: () => import("./auth/email-link-screen").then((m) => m.EmailLinkScreenComponent),
62-
},
63-
{
64-
path: "screens/email-link-auth-screen-w-oauth",
65-
loadComponent: () => import("./auth/email-link-oauth").then((m) => m.EmailLinkOAuthComponent),
66-
},
67-
{
68-
path: "screens/phone-auth-screen",
69-
loadComponent: () => import("./auth/phone-screen").then((m) => m.PhoneScreenComponent),
70-
},
71-
{
72-
path: "screens/phone-auth-screen-w-oauth",
73-
loadComponent: () => import("./auth/phone-oauth").then((m) => m.PhoneOAuthComponent),
74-
},
75-
{
76-
path: "screens/sign-up-auth-screen",
57+
path: "sign-up",
7758
loadComponent: () => import("./auth/sign-up").then((m) => m.SignUpComponent),
7859
},
7960
{
80-
path: "screens/sign-up-auth-screen-w-oauth",
81-
loadComponent: () => import("./auth/register-oauth").then((m) => m.RegisterOAuthComponent),
82-
},
83-
{
84-
path: "screens/oauth-screen",
85-
loadComponent: () => import("./auth/oauth").then((m) => m.OAuthComponent),
86-
},
87-
{
88-
path: "screens/password-reset-screen",
89-
loadComponent: () => import("./auth/password-reset").then((m) => m.PasswordResetComponent),
61+
path: "sign-up-oauth",
62+
loadComponent: () => import("./auth/sign-up-oauth").then((m) => m.SignUpOAuthComponent),
9063
},
9164
{
9265
path: "**",

examples/angular/src/app/auth/email-link-screen/email-link-screen.component.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/angular/src/app/auth/email-link/email-link.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { EmailLinkAuthScreenComponent } from "@firebase-ui/angular";
2424
selector: "app-email-link",
2525
standalone: true,
2626
imports: [CommonModule, RouterModule, EmailLinkAuthScreenComponent],
27-
template: ` <fui-email-link-auth-screen></fui-email-link-auth-screen> `,
27+
template: `<fui-email-link-auth-screen></fui-email-link-auth-screen> `,
2828
styles: [],
2929
})
3030
export class EmailLinkComponent implements OnInit {

examples/angular/src/app/auth/forgot-password/forgot-password.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import { Component, type OnInit, inject } from "@angular/core";
1818
import { CommonModule } from "@angular/common";
1919
import { Router, RouterModule } from "@angular/router";
2020
import { Auth, type User, authState } from "@angular/fire/auth";
21-
import { PasswordResetScreenComponent } from "@firebase-ui/angular";
21+
import { ForgotPasswordAuthScreenComponent } from "@firebase-ui/angular";
2222

2323
@Component({
2424
selector: "app-forgot-password",
2525
standalone: true,
26-
imports: [CommonModule, RouterModule, PasswordResetScreenComponent],
27-
template: ` <fui-password-reset-screen signInRoute="/sign-in"></fui-password-reset-screen> `,
26+
imports: [CommonModule, RouterModule, ForgotPasswordAuthScreenComponent],
27+
template: `<fui-forgot-password-auth-screen (backToSignIn)="backToSignIn()"></fui-forgot-password-auth-screen> `,
2828
styles: [],
2929
})
3030
export class ForgotPasswordComponent implements OnInit {
@@ -39,4 +39,8 @@ export class ForgotPasswordComponent implements OnInit {
3939
}
4040
});
4141
}
42+
43+
backToSignIn() {
44+
this.router.navigate(["/sign-in"]);
45+
}
4246
}

examples/angular/src/app/auth/password-reset/password-reset.component.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/angular/src/app/auth/phone-oauth/phone-oauth.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { PhoneAuthScreenComponent, GoogleSignInButtonComponent } from "@firebase
2626
imports: [CommonModule, RouterModule, PhoneAuthScreenComponent, GoogleSignInButtonComponent],
2727
template: `
2828
<fui-phone-auth-screen>
29-
<fui-google-sign-in-button></fui-google-sign-in-button>
29+
<fui-google-sign-in-button />
3030
</fui-phone-auth-screen>
3131
`,
3232
styles: [],

examples/angular/src/app/auth/phone/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
* limitations under the License.
1515
*/
1616

17-
export * from "./phone.component";
17+
export * from "./phone-screen.component";

0 commit comments

Comments
 (0)