Add removing option for repositories
Signed-off-by: trivernis <trivernis@protonmail.com>pull/4/head
parent
ace63ac461
commit
bb2f564b58
@ -0,0 +1,10 @@
|
||||
<h1 mat-dialog-title>
|
||||
{{title}}
|
||||
</h1>
|
||||
<div mat-dialog-content>
|
||||
{{message}}
|
||||
</div>
|
||||
<div mat-dialog-actions class="confirm-dialog-actions">
|
||||
<button mat-stroked-button [color]="this.denyColor" (click)="closeDialog(false)">{{denyAction}}</button>
|
||||
<button mat-flat-button [color]="this.confirmColor" (click)="closeDialog(true)">{{confirmAction}}</button>
|
||||
</div>
|
@ -0,0 +1,8 @@
|
||||
.confirm-dialog-actions {
|
||||
display: block;
|
||||
|
||||
button {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ConfirmDialogComponent } from './confirm-dialog.component';
|
||||
|
||||
describe('ConfirmDialogComponent', () => {
|
||||
let component: ConfirmDialogComponent;
|
||||
let fixture: ComponentFixture<ConfirmDialogComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ConfirmDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConfirmDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,35 @@
|
||||
import {Component, Inject, OnInit} from '@angular/core';
|
||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||
import {ThemePalette} from "@angular/material/core";
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirm-dialog',
|
||||
templateUrl: './confirm-dialog.component.html',
|
||||
styleUrls: ['./confirm-dialog.component.scss']
|
||||
})
|
||||
export class ConfirmDialogComponent {
|
||||
|
||||
title = "";
|
||||
message = "";
|
||||
confirmAction = "";
|
||||
confirmColor: ThemePalette = "primary";
|
||||
denyAction = "Cancel";
|
||||
denyColor: ThemePalette = "accent";
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ConfirmDialogComponent>,
|
||||
@Inject(
|
||||
MAT_DIALOG_DATA) data: { title: string, message: string, confirmAction: string, denyAction?: string, confirmColor?: ThemePalette, denyColor?: ThemePalette }
|
||||
) {
|
||||
this.title = data.title;
|
||||
this.message = data.message;
|
||||
this.confirmAction = data.confirmAction;
|
||||
this.denyAction = data.denyAction ?? this.denyAction;
|
||||
this.confirmColor = data.confirmColor ?? this.confirmColor;
|
||||
this.denyColor = data.denyColor ?? this.denyColor;
|
||||
}
|
||||
|
||||
public closeDialog(result: boolean) {
|
||||
this.dialogRef.close(result);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue