Refactor application structure to use WorkspaceService for state management
- Removed direct state management from components and centralized it in WorkspaceService. - Updated ApartmentsPage, TenantsPage, LeasesPage, and DashboardPage to utilize WorkspaceService for data handling. - Introduced SessionService to manage user session state and authentication. - Simplified component templates to reflect new service-based architecture. - Removed unused ConfigService and its tests. - Added lease.html template for lease document generation. - Created app.routes.spec.ts for route mapping tests.
This commit is contained in:
1 parent
be1f680a62
commit
82f339e209
33 files changed
+292
-929
No files matched your search
@@ -21,8 +21,8 @@
|
||||
<mat-radio-group
|
||||
class="theme-options"
|
||||
aria-label="Thème de l'application"
|
||||
[value]="themePreference()"
|
||||
(change)="themePreferenceChanged.emit($event.value)"
|
||||
[value]="theme.preference()"
|
||||
(change)="theme.setPreference($event.value)"
|
||||
>
|
||||
<mat-radio-button value="light"
|
||||
><span class="theme-option-copy"
|
||||
@@ -60,10 +60,10 @@
|
||||
</div>
|
||||
<div class="session-action">
|
||||
<div>
|
||||
<strong>{{ username() }}</strong
|
||||
><span>{{ email() }}</span>
|
||||
<strong>{{ session.username() }}</strong
|
||||
><span>{{ session.email() }}</span>
|
||||
</div>
|
||||
<button mat-stroked-button type="button" (click)="logoutRequested.emit()">Déconnexion</button>
|
||||
<button mat-stroked-button type="button" (click)="logout()">Déconnexion</button>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Component, input, output } from '@angular/core';
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { ThemePreference } from '../../services/theme.service';
|
||||
import { SessionService } from '../../services/session.service';
|
||||
import { ThemeService } from '../../services/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings-page',
|
||||
@@ -10,9 +11,8 @@ import { ThemePreference } from '../../services/theme.service';
|
||||
styleUrl: './settings-page.css',
|
||||
})
|
||||
export class SettingsPage {
|
||||
readonly username = input.required<string>();
|
||||
readonly email = input.required<string>();
|
||||
readonly themePreference = input.required<ThemePreference>();
|
||||
readonly themePreferenceChanged = output<ThemePreference>();
|
||||
readonly logoutRequested = output<void>();
|
||||
readonly session = inject(SessionService);
|
||||
readonly theme = inject(ThemeService);
|
||||
|
||||
logout(): void { window.location.href = '/logout'; }
|
||||
}
|
||||
Reference in new issue
Block a user