Skip to content

Commit

Permalink
fix: add set title for coordinateur pages (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gavanier authored Nov 27, 2023
1 parent 26be9e8 commit b1085f4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
npm-debug.log
yarn-error.log

# Project data
/src/assets/data/lieux-inclusion-numerique.json

# IDEs and editors
.idea/
.project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { DATA_COORDINATEURS_CONFIGURATION, POSITION_CONFIGURATION, ZOOM_LEVEL_CONFIGURATION } from '../../../../root';
import {
BRAND_CONFIGURATION,
DATA_COORDINATEURS_CONFIGURATION,
POSITION_CONFIGURATION,
ZOOM_LEVEL_CONFIGURATION
} from '../../../../root';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
Expand All @@ -27,6 +32,14 @@ export class CoordinateursWebComponentLayout implements OnInit {
DATA_COORDINATEURS_CONFIGURATION.coordinateurs = coordinateursSource;
}

@Input() set brandName(name: string) {
BRAND_CONFIGURATION.name = name;
}

@Input() set brandSousTitre(sousTitre: string) {
BRAND_CONFIGURATION.sousTitre = sousTitre;
}

public constructor(private readonly router: Router) {}

public ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';
import {
ASSETS_CONFIGURATION,
ASSETS_TOKEN,
BRAND_CONFIGURATION,
BRAND_TOKEN,
INITIAL_POSITION_TOKEN,
POSITION_CONFIGURATION,
setTitleAction,
setTitleActionProvider,
ZOOM_LEVEL_CONFIGURATION,
ZOOM_LEVEL_TOKEN
} from '../../../../root';
Expand All @@ -12,11 +14,12 @@ import { AddressHttp, AddressPresenter, AddressRepository, SEARCHABLE_TOKEN } fr
import { MarkersPresenter } from '../../../core/presenters';
import { ConseillersHttp, CoordinateursHttp } from '../../data';
import { ConseillersRepository, CoordinateursRepository } from '../../reporitories';
import { Title } from '@angular/platform-browser';

export const coordinateursProviders = [
{
provide: ASSETS_TOKEN,
useValue: ASSETS_CONFIGURATION
provide: BRAND_TOKEN,
useValue: BRAND_CONFIGURATION
},
{
provide: INITIAL_POSITION_TOKEN,
Expand Down Expand Up @@ -62,5 +65,6 @@ export const coordinateursProviders = [
provide: HTTP_INTERCEPTORS,
useClass: CacheInterceptor,
multi: true
}
},
setTitleActionProvider(setTitleAction, [BRAND_TOKEN, Title])
];
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import { NgModule } from '@angular/core';
import { ASSETS_APPLICATION_CONFIGURATION, ASSETS_TOKEN } from '../../../../root';
import { CoordinateursCommonModule } from '../common/coordinateurs.common.module';
import { CoordinateursFeatureRoutingModule } from './coordinateurs.feature-routing.module';

@NgModule({
imports: [CoordinateursCommonModule, CoordinateursFeatureRoutingModule],
providers: [
{
provide: ASSETS_TOKEN,
useValue: ASSETS_APPLICATION_CONFIGURATION
}
]
imports: [CoordinateursCommonModule, CoordinateursFeatureRoutingModule]
})
export class CoordinateursFeatureModule {}
3 changes: 0 additions & 3 deletions src/root/modules/application/application.module.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { NgModule } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { MatomoModule } from 'ngx-matomo';
import { setTitleAction } from '../../actions';
import { ApplicationRootLayout } from '../../layouts/application-root/application-root-layout.component';
import {
ASSETS_APPLICATION_CONFIGURATION,
ASSETS_TOKEN,
BRAND_APPLICATION_CONFIGURATION,
BRAND_TOKEN
} from '../../configuration';
import { setTitleActionProvider } from '../../providers';
import { MediationNumeriqueCommonModule } from '../common/mediation-numerique.common.module';
import { ApplicationRoutingModule } from './application-routing.module';

Expand Down

0 comments on commit b1085f4

Please sign in to comment.