Commit fa3c9e90 authored by Paul Herbert's avatar Paul Herbert

2100 - Breeze ICO updates. Improved error visuals

parent 8ae7ee4f
...@@ -19,10 +19,8 @@ ...@@ -19,10 +19,8 @@
<input formControlName="addressCountControl" type="text" class="form-control" placeholder="Number to generate..." style="border-radius: 0px; width: 163px"> <input formControlName="addressCountControl" type="text" class="form-control" placeholder="Number to generate..." style="border-radius: 0px; width: 163px">
<button *ngIf="!addressCountControl.invalid && addressCount" [disabled]="addressCountControl.invalid || !addressCount" (click)="generateAddresses()" <button *ngIf="!addressCountControl.invalid && addressCount" [disabled]="addressCountControl.invalid || !addressCount" (click)="generateAddresses()"
class="btn btn-darkgray btn-sm" type="button" style="margin-left: 5px">Go</button> class="btn btn-darkgray btn-sm" type="button" style="margin-left: 5px">Go</button>
<img style="width:16px; height:16px; margin-left:6px; margin-top:8px" *ngIf="showAddressesTick" src="../../../assets/images/Tick_Mark-16.png" <app-feedback style="margin-left:5px; width:115px" [loading]="generateAddressesLoadingState.loading" [success]="showAddressesTick"
/> [errored]="generateAddressesLoadingState.errored" [erroredText]="'Failed'" [showSuccessTick]="true"></app-feedback>
<app-feedback *ngIf="!generateAddressesLoadingState.success" style="margin-left:5px; width:115px" [loading]="generateAddressesLoadingState.loading"
[errored]="generateAddressesLoadingState.errored" [erroredText]="'Failed'"></app-feedback>
</div> </div>
</div> </div>
...@@ -33,10 +31,8 @@ ...@@ -33,10 +31,8 @@
formControlName="datePickerControl"></ngb-datepicker> formControlName="datePickerControl"></ngb-datepicker>
<button [disabled]="!resyncDate" style="margin-left: 5px; align-self:flex-start; height:34px" (click)="resync()" class="btn btn-darkgray btn-sm" <button [disabled]="!resyncDate" style="margin-left: 5px; align-self:flex-start; height:34px" (click)="resync()" class="btn btn-darkgray btn-sm"
type="button">Go</button> type="button">Go</button>
<img style="width:16px; height:16px; margin-left:6px; margin-top:8px" *ngIf="showResyncTick" src="../../../assets/images/Tick_Mark-16.png" <app-feedback style="margin-left:5px; width:65px" [loading]="resyncLoadingState.loading" [showSuccessTick]="true" [errored]="resyncLoadingState.errored"
/> [erroredText]="'Failed'" [success]="showResyncTick"></app-feedback>
<app-feedback *ngIf="!resyncLoadingState.success" style="margin-left:5px; width:65px" [loading]="resyncLoadingState.loading"
[errored]="resyncLoadingState.errored" [erroredText]="'Failed'"></app-feedback>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -17,7 +17,7 @@ export class AdvancedComponent implements OnInit, OnDestroy { ...@@ -17,7 +17,7 @@ export class AdvancedComponent implements OnInit, OnDestroy {
private extPubKeySubs = new SerialDisposable(); private extPubKeySubs = new SerialDisposable();
private generateAddressesSubs = new SerialDisposable(); private generateAddressesSubs = new SerialDisposable();
private resyncSubs = new SerialDisposable(); private resyncSubs = new SerialDisposable();
private addresses = new Array<string>(); private addresses: string[] = [];
private resyncActioned = false; private resyncActioned = false;
constructor(private advancedService: AdvancedService, private formBuilder: FormBuilder) { constructor(private advancedService: AdvancedService, private formBuilder: FormBuilder) {
......
<div> <div>
<div class="progress" *ngIf="loading"> <div class="progress" *ngIf="loading">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="100" <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="100" aria-valuemin="0"
aria-valuemin="0" aria-valuemax="100" style="width: 100%"> aria-valuemax="100" style="width: 100%">
<label style="font-size:10px">Working...</label> <label style="font-size:10px">Working...</label>
</div> </div>
</div> </div>
<div class="alert alert-danger" role="alert" *ngIf="errored"> <div *ngIf="errored">
<label>{{erroredText}}</label> <img style="width:16px; height:16px; margin-left:3px" src="../../../../assets/images/if_Error_16.png" />
</div>
<div *ngIf="success">
<img style="width:16px; height:16px; margin-left:3px" src="../../../../assets/images/Tick_Mark-16.png" />
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -9,6 +9,8 @@ export class FeedbackComponent { ...@@ -9,6 +9,8 @@ export class FeedbackComponent {
private _loading = false; private _loading = false;
private _errored = false; private _errored = false;
private _erroredText = "Failed"; private _erroredText = "Failed";
private _success = false;
private _showSuccessTick = false;
@Input() @Input()
public set loading(value: boolean) { public set loading(value: boolean) {
...@@ -33,4 +35,20 @@ export class FeedbackComponent { ...@@ -33,4 +35,20 @@ export class FeedbackComponent {
public get erroredText(): string { public get erroredText(): string {
return this._erroredText; return this._erroredText;
} }
@Input()
public set success(value: boolean) {
this._success = value;
}
public get success(): boolean {
return this._success;
}
@Input()
public set showSuccessTick(value: boolean) {
this._showSuccessTick = value;
}
public get showSuccessTick(): boolean {
return this._showSuccessTick;
}
} }
...@@ -6,10 +6,10 @@ export class SerialDisposable { ...@@ -6,10 +6,10 @@ export class SerialDisposable {
this.dispose(); this.dispose();
this.subscription = value; this.subscription = value;
} }
public dispose() { dispose() {
if (this.subscription) { if (this.subscription) {
this.subscription.unsubscribe(); this.subscription.unsubscribe();
this.subscription = null; this.subscription = null;
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment