Skip to content

Commit 68177e5

Browse files
authored
Merge pull request #4 from laravelcm/move-to-module
Move single components to module
2 parents 3708ed8 + cdfcc55 commit 68177e5

34 files changed

+226
-300
lines changed

package-lock.json

Lines changed: 0 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"@tailwindcss/typography": "^0.5.6",
3535
"ngx-pagination": "^6.0.2",
3636
"ngx-permissions": "^13.0.1",
37-
"ngx-skeleton-loader": "^6.0.0",
3837
"rxjs": "~7.5.0",
3938
"tslib": "^2.3.0",
4039
"zone.js": "~0.11.4"

src/app/modules/authentication/pages/forgot-password/forgot-password.component.ts

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3-
import { Meta, Title } from '@angular/platform-browser';
43
import { Store } from '@ngrx/store';
54
import { Observable } from 'rxjs';
65

7-
import { environment } from 'environments/environment';
86
import { forgotPasswordAction } from '../../store/auth.actions';
97
import {
108
selectError,
@@ -15,7 +13,7 @@ import {
1513
@Component({
1614
templateUrl: './forgot-password.component.html',
1715
})
18-
export class ForgotPasswordComponent implements OnInit {
16+
export class ForgotPasswordComponent {
1917
public form: FormGroup = this.fb.group({
2018
email: ['', [Validators.required, Validators.email]],
2119
});
@@ -26,28 +24,7 @@ export class ForgotPasswordComponent implements OnInit {
2624

2725
public loading$: Observable<boolean> = this.store.select(selectLoading);
2826

29-
constructor(
30-
private fb: FormBuilder,
31-
private store: Store,
32-
private meta: Meta,
33-
private title: Title
34-
) {}
35-
36-
ngOnInit(): void {
37-
this.title.setTitle($localize`Mot de passe oublié | Admin CPanel`);
38-
this.meta.updateTag({
39-
property: 'og:url',
40-
content: environment.baseUrl + '/forgot-password',
41-
});
42-
this.meta.updateTag({
43-
property: 'og:title',
44-
content: $localize`Mot de passe oublié | Admin CPanel`,
45-
});
46-
this.meta.updateTag({
47-
property: 'og:description',
48-
content: $localize`Réinitialisez votre mot de passe`,
49-
});
50-
}
27+
constructor(private fb: FormBuilder, private store: Store) {}
5128

5229
public submit() {
5330
if (this.form.valid) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
import { ErrorComponent } from './error.component';
5+
import { SuccessComponent } from './success.component';
6+
7+
const COMPONENTS = [ErrorComponent, SuccessComponent];
8+
9+
@NgModule({
10+
declarations: COMPONENTS,
11+
imports: [CommonModule],
12+
exports: COMPONENTS,
13+
})
14+
export class AlertModule {}

src/app/shared/components/alert/error.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ import { Component, Input } from '@angular/core';
3434
})
3535
export class ErrorComponent {
3636
@Input() class!: string;
37-
3837
@Input() message!: string;
39-
4038
@Input() errors: string[] = [];
4139
}

src/app/shared/components/alert/success.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ import { Component, Input } from '@angular/core';
2727
})
2828
export class SuccessComponent {
2929
@Input() class!: string;
30-
3130
@Input() message!: string;
3231
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
import { ButtonPrimaryComponent } from './primary.component';
5+
import { ButtonLinkComponent } from './link.component';
6+
import { ButtonDefaultComponent } from './default.component';
7+
import { RouterModule } from '@angular/router';
8+
9+
const COMPONENTS = [
10+
ButtonPrimaryComponent,
11+
ButtonLinkComponent,
12+
ButtonDefaultComponent,
13+
];
14+
15+
@NgModule({
16+
declarations: COMPONENTS,
17+
imports: [CommonModule, RouterModule],
18+
exports: COMPONENTS,
19+
})
20+
export class ButtonModule {}

src/app/shared/components/buttons/default.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ import { Observable } from 'rxjs';
3333
})
3434
export class ButtonDefaultComponent {
3535
@Input() type: string = 'button';
36-
3736
@Input() loading$!: Observable<boolean>;
38-
3937
@Input() class!: string;
4038
}

src/app/shared/components/buttons/link.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import { Component, Input } from '@angular/core';
66
<a
77
[routerLink]="link"
88
[ngClass]="class"
9-
class="inline-flex items-center rounded-md border border-transparent bg-primary-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:bg-gray-700 dark:hover:bg-gray-800 dark:text-slate-300 dark:hover:text-white dark:focus:ring-offset-gray-800">
9+
class="inline-flex items-center rounded-md border border-transparent bg-primary-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2">
1010
<ng-content></ng-content>
1111
</a>
1212
`,
1313
})
1414
export class ButtonLinkComponent {
1515
@Input() link!: any;
16-
1716
@Input() class!: string;
1817
}

src/app/shared/components/buttons/primary.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ import { Observable } from 'rxjs';
3535
})
3636
export class ButtonPrimaryComponent {
3737
@Input() type: string = 'button';
38-
3938
@Input() loading$!: Observable<boolean>;
40-
4139
@Input() class!: string;
4240
}

0 commit comments

Comments
 (0)