Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ export const routes: Routes = [
(mod) => mod.PrivacyPolicyComponent,
),
},
{
path: 'settings',
loadChildren: () =>
import('./features/settings/settings.routes').then(
(mod) => mod.settingsRoutes,
),
},
],
},
];
8 changes: 8 additions & 0 deletions src/app/core/components/breadcrumb/breadcrumb.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="breadcrumbs">
@for (url of parsedUrl(); track url; let l = $last) {
{{ url }}
@if (!l) {
/
}
}
</div>
Empty file.
22 changes: 22 additions & 0 deletions src/app/core/components/breadcrumb/breadcrumb.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BreadcrumbComponent } from './breadcrumb.component';

describe('BreadcrumbComponent', () => {
let component: BreadcrumbComponent;
let fixture: ComponentFixture<BreadcrumbComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [BreadcrumbComponent],
}).compileComponents();

fixture = TestBed.createComponent(BreadcrumbComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
16 changes: 16 additions & 0 deletions src/app/core/components/breadcrumb/breadcrumb.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component, computed, inject, signal } from '@angular/core';
import { Router } from '@angular/router';

@Component({
selector: 'osf-breadcrumb',
imports: [],
templateUrl: './breadcrumb.component.html',
styleUrl: './breadcrumb.component.scss',
})
export class BreadcrumbComponent {
#router = inject(Router);
protected readonly url = signal(this.#router.url);
protected readonly parsedUrl = computed(() => {
return this.url().split('/').filter(Boolean);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<osf-breadcrumb />
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SettingsHeaderComponent } from './settings-header.component';

describe('SettingsHeaderComponent', () => {
let component: SettingsHeaderComponent;
let fixture: ComponentFixture<SettingsHeaderComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SettingsHeaderComponent],
}).compileComponents();

fixture = TestBed.createComponent(SettingsHeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { BreadcrumbComponent } from '@core/components/breadcrumb/breadcrumb.component';

@Component({
selector: 'osf-settings-header',
imports: [BreadcrumbComponent],
templateUrl: './settings-header.component.html',
styleUrl: './settings-header.component.scss',
})
export class SettingsHeaderComponent {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>account-settings works!</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AccountSettingsComponent } from './account-settings.component';

describe('AccountSettingsComponent', () => {
let component: AccountSettingsComponent;
let fixture: ComponentFixture<AccountSettingsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AccountSettingsComponent],
}).compileComponents();

fixture = TestBed.createComponent(AccountSettingsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Component } from '@angular/core';

@Component({
selector: 'osf-account-settings',
imports: [],
templateUrl: './account-settings.component.html',
styleUrl: './account-settings.component.scss',
})
export class AccountSettingsComponent {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Routes } from '@angular/router';

export const accountSettingsRoute: Routes[] = [];
4 changes: 4 additions & 0 deletions src/app/features/settings/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './account-settings/account-settings.route';
export * from './account-settings/account-settings.component';

export * from './profile-settings/profile-settings.component';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>profile-settings works!</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ProfileSettingsComponent } from './profile-settings.component';

describe('ProfileSettingsComponent', () => {
let component: ProfileSettingsComponent;
let fixture: ComponentFixture<ProfileSettingsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ProfileSettingsComponent],
}).compileComponents();

fixture = TestBed.createComponent(ProfileSettingsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Component } from '@angular/core';

@Component({
selector: 'osf-profile-settings',
imports: [],
templateUrl: './profile-settings.component.html',
styleUrl: './profile-settings.component.scss',
})
export class ProfileSettingsComponent {}
3 changes: 3 additions & 0 deletions src/app/features/settings/settings-container.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<osf-settings-header />

<router-outlet />
Empty file.
22 changes: 22 additions & 0 deletions src/app/features/settings/settings-container.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SettingsContainerComponent } from './settings-container.component';

describe('SettingsContainerComponent', () => {
let component: SettingsContainerComponent;
let fixture: ComponentFixture<SettingsContainerComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SettingsContainerComponent],
}).compileComponents();

fixture = TestBed.createComponent(SettingsContainerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions src/app/features/settings/settings-container.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { SettingsHeaderComponent } from '@core/components/settings-header/settings-header.component';

@Component({
selector: 'osf-settings-container',
imports: [RouterOutlet, SettingsHeaderComponent],
templateUrl: './settings-container.component.html',
styleUrl: './settings-container.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SettingsContainerComponent {}
25 changes: 25 additions & 0 deletions src/app/features/settings/settings.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Routes } from '@angular/router';
import { SettingsContainerComponent } from '@osf/features/settings/settings-container.component';

export const settingsRoutes: Routes = [
{
path: '',
component: SettingsContainerComponent,
children: [
{
path: 'profile-settings',
loadComponent: () =>
import('./profile-settings/profile-settings.component').then(
(c) => c.ProfileSettingsComponent,
),
},
{
path: 'account-settings',
loadComponent: () =>
import('./account-settings/account-settings.component').then(
(c) => c.AccountSettingsComponent,
),
},
],
},
];