-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support creating folders if failed test path
- Loading branch information
Showing
7 changed files
with
113 additions
and
29 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
14 changes: 14 additions & 0 deletions
14
src/app/core/components/confirm-dialog/confirm-dialog.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,14 @@ | ||
<header header> | ||
<h3>{{ _data().title }}</h3> | ||
</header> | ||
|
||
<div content> | ||
@if (_data().message) { | ||
<p>{{ _data().message }}</p> | ||
} | ||
</div> | ||
|
||
<footer footer> | ||
<button spk-button class="" (click)="close('cancel')">{{ _data().cancelText }}</button> | ||
<button spk-button class="raised primary" (click)="close('confirm')">{{ _data().confirmText }}</button> | ||
</footer> |
3 changes: 3 additions & 0 deletions
3
src/app/core/components/confirm-dialog/confirm-dialog.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,3 @@ | ||
:host { | ||
display: block; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/app/core/components/confirm-dialog/confirm-dialog.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,39 @@ | ||
import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core'; | ||
|
||
export type ConfirmDialogData = { | ||
title: string; | ||
message?: string; | ||
confirmText?: string; | ||
cancelText?: string; | ||
}; | ||
|
||
const DEFAULT_DATA: ConfirmDialogData = { | ||
title: 'Are you sure?', | ||
confirmText: 'Confirm', | ||
cancelText: 'Cancel', | ||
}; | ||
|
||
@Component({ | ||
selector: 'app-confirm-dialog', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './confirm-dialog.component.html', | ||
styleUrl: './confirm-dialog.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class ConfirmDialogComponent { | ||
data = input<ConfirmDialogData>(); | ||
|
||
_data = computed(() => { | ||
return { | ||
...DEFAULT_DATA, | ||
...this.data(), | ||
}; | ||
}); | ||
|
||
closed = output<boolean>(); | ||
|
||
close(type: 'confirm' | 'cancel' = 'confirm') { | ||
this.closed.emit(type === 'confirm'); | ||
} | ||
} |