-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
198 additions
and
7 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
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
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,33 @@ | ||
<div mat-dialog-title>Choose reason for rejecting bid</div> | ||
<button class="small-close-button pull-right" (click)="dialogClose()"> | ||
<mat-icon fontSet="partIcon" fontIcon="part-circle-remove"></mat-icon> | ||
</button> | ||
|
||
<div mat-dialog-content class="dialog-content"> | ||
|
||
<p class="lead"> | ||
Please indicate a reason for rejecting this bid. | ||
</p> | ||
|
||
<div class="row" fxLayout fxLayoutAlign="center center"> | ||
<mat-form-field class="full-width" fxFlex="50%"> | ||
<mat-select value="{{data?.selectedMessage}}" placeholder="Reason For Rejection"> | ||
<mat-option *ngFor="let rMsg of rejectMessages" [value]="rMsg.value"> | ||
{{rMsg.viewValue}} | ||
</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
|
||
</div><!-- .dialog-content --> | ||
|
||
<mat-dialog-actions fxLayoutAlign="space-between center"> | ||
<button mat-button mat-dialog-close (click)="dialogClose()"> | ||
<mat-icon fontSet="partIcon" fontIcon="part-cross"></mat-icon> | ||
Cancel | ||
</button> | ||
<button [disabled]="!data?.selectedMessage" mat-raised-button color="primary" [mat-dialog-close]="data?.selectedMessage"> | ||
<mat-icon fontSet="partIcon" fontIcon="part-check"></mat-icon> | ||
Reject Bid | ||
</button> | ||
</mat-dialog-actions> |
Empty file.
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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; | ||
import { CoreModule } from '../../core/core.module'; | ||
import { SharedModule } from '../../wallet/shared/shared.module'; | ||
import { CoreUiModule } from '../../core-ui/core-ui.module'; | ||
import { RejectBidComponent } from './reject-bid.component'; | ||
|
||
describe('RejectBidComponent', () => { | ||
let component: RejectBidComponent; | ||
let fixture: ComponentFixture<RejectBidComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ RejectBidComponent ], | ||
imports: [ | ||
BrowserAnimationsModule, | ||
SharedModule, | ||
CoreModule.forRoot(), | ||
CoreUiModule.forRoot(), | ||
], | ||
providers: [ | ||
{ provide: MatDialogRef }, | ||
{ provide: MAT_DIALOG_DATA } | ||
] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(RejectBidComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,51 @@ | ||
import { Component, Output, OnInit, Inject } from '@angular/core'; | ||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; | ||
import { rejectMessages } from '../../core/util/utils'; | ||
|
||
@Component({ | ||
selector: 'app-reject-bid', | ||
templateUrl: './reject-bid.component.html', | ||
styleUrls: ['./reject-bid.component.scss'] | ||
}) | ||
export class RejectBidComponent implements OnInit { | ||
|
||
rejectMessages: RejectionMessages[] = []; | ||
|
||
constructor( | ||
private dialogRef: MatDialogRef<RejectBidComponent>, | ||
@Inject(MAT_DIALOG_DATA) public data: DialogData, | ||
) { | ||
this.createMessages(); | ||
} | ||
|
||
ngOnInit() { | ||
} | ||
|
||
createMessages () { | ||
const keys = Object.keys(rejectMessages); | ||
for (let k = 0; k < keys.length; k++) { | ||
this.rejectMessages.push({ | ||
value: keys[k], | ||
viewValue: rejectMessages[keys[k]] | ||
}) | ||
} | ||
} | ||
|
||
confirm(): void { | ||
this.dialogRef.close(this.data.selectedMessage); | ||
} | ||
|
||
dialogClose(): void { | ||
this.dialogRef.close('CANCEL'); | ||
} | ||
} | ||
|
||
export interface RejectionMessages { | ||
value: string; | ||
viewValue: string; | ||
} | ||
|
||
export interface DialogData { | ||
selectedMessage: string; | ||
} | ||
|