-
-
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.
Cobbler-Frontend: Add edit functionality
- Loading branch information
Showing
39 changed files
with
1,681 additions
and
688 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
projects/cobbler-frontend/src/app/actions/mkloaders/mkloaders.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
2 changes: 1 addition & 1 deletion
2
projects/cobbler-frontend/src/app/actions/replicate/replicate.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
12 changes: 12 additions & 0 deletions
12
...c/app/common/dialog-box-confirm-cancel-edit/dialog-box-confirm-cancel-edit.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,12 @@ | ||
<h1 mat-dialog-title>Cancel Edit?</h1> | ||
<div mat-dialog-content class="content"> | ||
<p> | ||
Are you sure you want to cancel the edit for the item "{{ | ||
data.name | ||
}}"? All changes will be lost! | ||
</p> | ||
</div> | ||
<div mat-dialog-actions> | ||
<button mat-button [mat-dialog-close]="true">Yes</button> | ||
<button mat-button [mat-dialog-close]="false">No</button> | ||
</div> |
Empty file.
35 changes: 35 additions & 0 deletions
35
...pp/common/dialog-box-confirm-cancel-edit/dialog-box-confirm-cancel-edit.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,35 @@ | ||
import { DialogModule } from '@angular/cdk/dialog'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
|
||
import { DialogBoxConfirmCancelEditComponent } from './dialog-box-confirm-cancel-edit.component'; | ||
|
||
describe('DialogBoxConfirmCancelEditComponent', () => { | ||
let component: DialogBoxConfirmCancelEditComponent; | ||
let fixture: ComponentFixture<DialogBoxConfirmCancelEditComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ | ||
DialogBoxConfirmCancelEditComponent, | ||
DialogModule, | ||
NoopAnimationsModule, | ||
], | ||
providers: [ | ||
{ | ||
provide: MAT_DIALOG_DATA, | ||
useValue: { name: '' }, | ||
}, | ||
], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DialogBoxConfirmCancelEditComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...src/app/common/dialog-box-confirm-cancel-edit/dialog-box-confirm-cancel-edit.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,18 @@ | ||
import { Component, Inject } from '@angular/core'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; | ||
|
||
export interface DialogConfirmCancelData { | ||
name: string; | ||
} | ||
|
||
@Component({ | ||
selector: 'cobbler-dialog-box-confirm-cancel-edit', | ||
standalone: true, | ||
imports: [MatButtonModule, MatDialogModule], | ||
templateUrl: './dialog-box-confirm-cancel-edit.component.html', | ||
styleUrl: './dialog-box-confirm-cancel-edit.component.scss', | ||
}) | ||
export class DialogBoxConfirmCancelEditComponent { | ||
constructor(@Inject(MAT_DIALOG_DATA) public data: DialogConfirmCancelData) {} | ||
} |
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
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
15 changes: 15 additions & 0 deletions
15
...bler-frontend/src/app/common/dialog-key-value-input/dialog-key-value-input.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,15 @@ | ||
<h2 mat-dialog-title>Add new Option:</h2> | ||
<mat-dialog-content> | ||
<mat-form-field> | ||
<mat-label>New Key</mat-label> | ||
<input matInput cdkFocusInitial [(ngModel)]="this.data.key" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>New Value</mat-label> | ||
<input matInput [(ngModel)]="this.data.value" /> | ||
</mat-form-field> | ||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<button mat-button (click)="onNoClick()">No Thanks</button> | ||
<button mat-button [mat-dialog-close]="onYesClick()">Ok</button> | ||
</mat-dialog-actions> |
Empty file.
34 changes: 34 additions & 0 deletions
34
...r-frontend/src/app/common/dialog-key-value-input/dialog-key-value-input.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,34 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
|
||
import { DialogKeyValueInputComponent } from './dialog-key-value-input.component'; | ||
|
||
describe('DialogKeyValueInputComponent', () => { | ||
let component: DialogKeyValueInputComponent; | ||
let fixture: ComponentFixture<DialogKeyValueInputComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ | ||
DialogKeyValueInputComponent, | ||
MatDialogModule, | ||
NoopAnimationsModule, | ||
], | ||
providers: [ | ||
{ | ||
provide: MatDialogRef, | ||
useValue: {}, | ||
}, | ||
], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DialogKeyValueInputComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
37 changes: 37 additions & 0 deletions
37
...obbler-frontend/src/app/common/dialog-key-value-input/dialog-key-value-input.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,37 @@ | ||
import { Component, inject } from '@angular/core'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; | ||
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { MatInputModule } from '@angular/material/input'; | ||
|
||
export interface DialogKeyValueInputReturnData { | ||
key: string; | ||
value: string; | ||
} | ||
|
||
@Component({ | ||
selector: 'cobbler-dialog-key-value-input', | ||
standalone: true, | ||
imports: [ | ||
FormsModule, | ||
MatButtonModule, | ||
MatDialogModule, | ||
MatFormFieldModule, | ||
MatInputModule, | ||
], | ||
templateUrl: './dialog-key-value-input.component.html', | ||
styleUrl: './dialog-key-value-input.component.scss', | ||
}) | ||
export class DialogKeyValueInputComponent { | ||
data: DialogKeyValueInputReturnData = { key: '', value: '' }; | ||
readonly dialogRef = inject(MatDialogRef<DialogKeyValueInputComponent>); | ||
|
||
onNoClick(): void { | ||
this.dialogRef.close(); | ||
} | ||
|
||
onYesClick(): DialogKeyValueInputReturnData { | ||
return this.data; | ||
} | ||
} |
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
Oops, something went wrong.