Skip to content

Commit

Permalink
clean material module we import
Browse files Browse the repository at this point in the history
  • Loading branch information
fxmontigny committed Aug 1, 2023
1 parent 33d068e commit de4d4d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 35 deletions.
6 changes: 5 additions & 1 deletion front/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ export class AppComponent implements AfterViewInit {
* Control si on est en SSL ou non
*/
onControlSSL() {
if (location.protocol !== 'https:' && environment.forceSSL) {
if (
location.protocol !== 'https:' &&
location.hostname !== 'localhost' &&
environment.forceSSL
) {
location.replace(
`https:${location.href.substring(location.protocol.length)}`
)
Expand Down
11 changes: 0 additions & 11 deletions front/src/app/components/popup/popup.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { RouterModule } from '@angular/router'
import { PopupComponent } from './popup.component'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { MaterialModule } from 'src/app/libs/material.module'
import { PipesModule } from 'src/app/pipes/pipes.module'
import { NgSelectModule } from '@ng-select/ng-select'

/**
* Liste des composants à importer
Expand All @@ -21,12 +16,6 @@ const list = [
declarations: [...list],
imports: [
CommonModule,
RouterModule,
FormsModule,
ReactiveFormsModule,
MaterialModule,
PipesModule,
NgSelectModule,
],
exports: list,
})
Expand Down
23 changes: 1 addition & 22 deletions front/src/app/libs/material.module.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
import { NgModule } from '@angular/core'
import { MatInputModule } from '@angular/material/input'
import {
MatFormFieldModule,
MAT_FORM_FIELD_DEFAULT_OPTIONS,
} from '@angular/material/form-field'
import { MatButtonModule } from '@angular/material/button'
import { MatCardModule } from '@angular/material/card'
import {
MatSnackBarModule,
MAT_SNACK_BAR_DEFAULT_OPTIONS,
} from '@angular/material/snack-bar'
import { MatTableModule } from '@angular/material/table'
import { MatIconModule } from '@angular/material/icon'
import { MatDialogModule } from '@angular/material/dialog'
import { MatSelectModule } from '@angular/material/select'
import { MatSortModule } from '@angular/material/sort'
import { MatDatepickerModule } from '@angular/material/datepicker'
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'
import { DragDropModule } from '@angular/cdk/drag-drop'
import {
MatTooltipDefaultOptions,
MatTooltipModule,
MAT_TOOLTIP_DEFAULT_OPTIONS,
} from '@angular/material/tooltip'
import { MatMenuModule } from '@angular/material/menu'
import { MatButtonToggleModule } from '@angular/material/button-toggle'
import { MatCheckboxModule } from '@angular/material/checkbox'
import {
MatNativeDateModule,
Expand Down Expand Up @@ -67,21 +55,12 @@ export const MY_FORMATS = {
*/
@NgModule({
exports: [
MatButtonToggleModule,
MatInputModule,
MatFormFieldModule,
MatButtonModule,
MatCardModule,
MatSnackBarModule,
MatTableModule,
MatIconModule,
MatDialogModule,
MatSelectModule,
MatSortModule,
MatDatepickerModule,
MatNativeDateModule,
MatProgressSpinnerModule,
DragDropModule,
MatTooltipModule,
MatMenuModule,
MatCheckboxModule,
Expand All @@ -92,9 +71,9 @@ export const MY_FORMATS = {
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
useValue: { appearance: 'fill' },
},
{ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 2500 } },
{ provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
{ provide: MAT_TOOLTIP_DEFAULT_OPTIONS, useValue: myCustomTooltipDefaults },

{
provide: DateAdapter,
useClass: MomentDateAdapter,
Expand Down
2 changes: 1 addition & 1 deletion front/src/app/services/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class UserService {
* @returns
*/
me() {
return this.serverService.get('users/me').then((data) => data.data || null)
return this.serverService.getWithoutError('users/me').then((data) => data.data || null)
}

/**
Expand Down

0 comments on commit de4d4d0

Please sign in to comment.