-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #370 from cobbler/feature/add-profile-page
Cobbler-Frontend: Add user preferences
- Loading branch information
Showing
7 changed files
with
156 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
projects/cobbler-frontend/src/app/user/preferences/preferences.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<h1>User Preferences</h1> | ||
|
||
<mat-accordion multi="true"> | ||
<mat-expansion-panel [expanded]="true"> | ||
<mat-expansion-panel-header> | ||
<mat-panel-title>User Information</mat-panel-title> | ||
</mat-expansion-panel-header> | ||
<p>User information is not retrievable with Cobbler 3.3.x.</p> | ||
</mat-expansion-panel> | ||
<mat-expansion-panel [expanded]="true"> | ||
<mat-expansion-panel-header> | ||
<mat-panel-title>User Preferences</mat-panel-title> | ||
</mat-expansion-panel-header> | ||
<form class="preferences-form"> | ||
<mat-slide-toggle class="pad-bottom" [disabled]="true" | ||
>Dark Mode</mat-slide-toggle | ||
> | ||
<mat-form-field class="full-width"> | ||
<mat-label>Language</mat-label> | ||
<mat-select value="english" [disabled]="true"> | ||
<mat-option value="english">English</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
<mat-form-field class="full-width"> | ||
<mat-label>Date Format</mat-label> | ||
<!-- TODO: Switch to autocomplete once more then one format is supported --> | ||
<input matInput value="DD/MM/YYYY" readonly /> | ||
</mat-form-field> | ||
<mat-form-field class="full-width"> | ||
<mat-label>Number Format (floating point separator)</mat-label> | ||
<mat-select value="comma" [disabled]="true"> | ||
<mat-option value="comma">Comma</mat-option> | ||
<mat-option value="dot">Dot</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</form> | ||
</mat-expansion-panel> | ||
</mat-accordion> |
13 changes: 13 additions & 0 deletions
13
projects/cobbler-frontend/src/app/user/preferences/preferences.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.preferences-form { | ||
min-width: 150px; | ||
max-width: 800px; | ||
width: 100%; | ||
} | ||
|
||
.full-width { | ||
width: 100%; | ||
} | ||
|
||
.pad-bottom { | ||
padding-bottom: 1em; | ||
} |
23 changes: 23 additions & 0 deletions
23
projects/cobbler-frontend/src/app/user/preferences/preferences.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
|
||
import { PreferencesComponent } from './preferences.component'; | ||
|
||
describe('PreferencesComponent', () => { | ||
let component: PreferencesComponent; | ||
let fixture: ComponentFixture<PreferencesComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [PreferencesComponent, NoopAnimationsModule], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(PreferencesComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
projects/cobbler-frontend/src/app/user/preferences/preferences.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component } from '@angular/core'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { MatOptionModule } from '@angular/material/core'; | ||
import { MatExpansionModule } from '@angular/material/expansion'; | ||
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { MatInputModule } from '@angular/material/input'; | ||
import { MatSelectModule } from '@angular/material/select'; | ||
import { MatSlideToggleModule } from '@angular/material/slide-toggle'; | ||
|
||
@Component({ | ||
selector: 'cobbler-preferences', | ||
standalone: true, | ||
imports: [ | ||
MatExpansionModule, | ||
FormsModule, | ||
MatInputModule, | ||
MatFormFieldModule, | ||
MatSelectModule, | ||
MatOptionModule, | ||
MatSlideToggleModule, | ||
], | ||
templateUrl: './preferences.component.html', | ||
styleUrl: './preferences.component.scss', | ||
}) | ||
export class PreferencesComponent {} |