From d4fb1680430a1a34a9784c67acfeebc2c48b15aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Mon, 30 Dec 2024 12:42:25 +0300 Subject: [PATCH] Add auth --- src/app/app.routes.ts | 23 ++++---- src/app/demo/components/auth/access.ts | 34 ++++++++++++ src/app/demo/components/auth/error.ts | 30 +++++++++++ src/app/demo/components/auth/login.ts | 72 ++++++++++++++++++++++++++ src/app/demo/components/auth/routes.ts | 10 ++++ 5 files changed, 157 insertions(+), 12 deletions(-) create mode 100644 src/app/demo/components/auth/access.ts create mode 100644 src/app/demo/components/auth/error.ts create mode 100644 src/app/demo/components/auth/login.ts create mode 100644 src/app/demo/components/auth/routes.ts diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 0464625..be3cd19 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -4,18 +4,17 @@ import {AppLayoutComponent} from './layout/app.layout.component'; export const routes: Routes = [ { path: '', component: AppLayoutComponent, - // children: - // [ - // { path: '', loadChildren: () => import('./demo/components/dashboard/dashboard.module').then(m => m.DashboardModule) }, - // { path: 'uikit', loadChildren: () => import('./demo/components/uikit/uikit.module').then(m => m.UIkitModule) }, - // { path: 'utilities', loadChildren: () => import('./demo/components/utilities/utilities.module').then(m => m.UtilitiesModule) }, - // { path: 'documentation', loadChildren: () => import('./demo/components/documentation/documentation.module').then(m => m.DocumentationModule) }, - // { path: 'blocks', loadChildren: () => import('./demo/components/primeblocks/primeblocks.module').then(m => m.PrimeBlocksModule) }, - // { path: 'pages', loadChildren: () => import('./demo/components/pages/pages.module').then(m => m.PagesModule) } - // ] + children: + [ + // { path: '', loadChildren: () => import('./demo/components/dashboard/dashboard.module').then(m => m.DashboardModule) }, + // { path: 'uikit', loadChildren: () => import('./demo/components/uikit/uikit.module').then(m => m.UIkitModule) }, + // { path: 'utilities', loadChildren: () => import('./demo/components/utilities/utilities.module').then(m => m.UtilitiesModule) }, + // { path: 'documentation', loadChildren: () => import('./demo/components/documentation/documentation.module').then(m => m.DocumentationModule) }, + // { path: 'blocks', loadChildren: () => import('./demo/components/primeblocks/primeblocks.module').then(m => m.PrimeBlocksModule) }, + // { path: 'pages', loadChildren: () => import('./demo/components/pages/pages.module').then(m => m.PagesModule) } + + ] }, - // { path: 'auth', loadChildren: () => import('./demo/components/auth/auth.module').then(m => m.AuthModule) }, - // { path: 'landing', loadChildren: () => import('./demo/components/landing/landing.module').then(m => m.LandingModule) }, - // { path: 'notfound', component: NotfoundComponent }, + { path: 'auth', loadChildren: () => import('./demo/components/auth/routes')}, { path: '**', redirectTo: '/notfound' }, ]; diff --git a/src/app/demo/components/auth/access.ts b/src/app/demo/components/auth/access.ts new file mode 100644 index 0000000..ba32339 --- /dev/null +++ b/src/app/demo/components/auth/access.ts @@ -0,0 +1,34 @@ +import { Component } from '@angular/core'; +import {ButtonModule} from 'primeng/button'; +import {RouterModule} from '@angular/router'; +import {RippleModule} from 'primeng/ripple'; + +@Component({ + selector: 'app-access', + standalone: true, + imports: [ + ButtonModule, + RouterModule, + RippleModule + ], + template: ` +
+
+ Sakai logo +
+
+
+
+ +
+

Access Denied

+ You do not have the necessary permisions. Please contact admins. + Access denied + +
+
+
+
+
` +}) +export class Access { } diff --git a/src/app/demo/components/auth/error.ts b/src/app/demo/components/auth/error.ts new file mode 100644 index 0000000..a5d203c --- /dev/null +++ b/src/app/demo/components/auth/error.ts @@ -0,0 +1,30 @@ +import { Component } from '@angular/core'; +import {ButtonModule} from 'primeng/button'; +import {RippleModule} from 'primeng/ripple'; +import {RouterModule} from '@angular/router'; + +@Component({ + selector: 'app-error', + imports: [ButtonModule, RippleModule, RouterModule], + standalone: true, + template: ` +
+
+ Sakai logo +
+
+
+
+ +
+

Error Occured

+ Requested resource is not available. + Error + +
+
+
+
+
` +}) +export class Error { } diff --git a/src/app/demo/components/auth/login.ts b/src/app/demo/components/auth/login.ts new file mode 100644 index 0000000..3cd554e --- /dev/null +++ b/src/app/demo/components/auth/login.ts @@ -0,0 +1,72 @@ +import {Component, inject} from '@angular/core'; +import { ButtonModule} from 'primeng/button'; +import { CheckboxModule} from 'primeng/checkbox'; +import { InputTextModule} from 'primeng/inputtext'; +import { PasswordModule} from 'primeng/password'; +import {FormsModule} from '@angular/forms'; +import {RouterModule} from '@angular/router'; +import { RippleModule} from 'primeng/ripple'; +import {LayoutService} from '../../../layout/service/app.layout.service'; + +@Component({ + selector: 'app-login', + standalone: true, + imports: [ + ButtonModule, + CheckboxModule, + InputTextModule, + PasswordModule, + FormsModule, + RouterModule, + RippleModule, + ], + template: ` +
+
+ Sakai logo +
+
+
+ Image +
Welcome, Isabel!
+ Sign in to continue +
+ +
+ + + + + + +
+
+ + +
+ Forgot password? +
+ +
+
+
+
+
+ `, + styles: [` + :host ::ng-deep .pi-eye, + :host ::ng-deep .pi-eye-slash { + transform:scale(1.6); + margin-right: 1rem; + color: var(--primary-color) !important; + } + `] +}) +export class Login { + + valCheck: string[] = ['remember']; + + password!: string; + + layoutService = inject(LayoutService); +} diff --git a/src/app/demo/components/auth/routes.ts b/src/app/demo/components/auth/routes.ts new file mode 100644 index 0000000..3b19fd9 --- /dev/null +++ b/src/app/demo/components/auth/routes.ts @@ -0,0 +1,10 @@ +import { Routes } from '@angular/router'; +import { Access } from './access'; +import { Login } from './login'; +import { Error } from './error'; + +export default [ + { path: 'access', component: Access}, + { path: 'error', component: Error}, + { path: 'login', component: Login}, +] as Routes;