Skip to content

Commit cf6ac78

Browse files
committed
adding status bar as a component.
1 parent d7a0c39 commit cf6ac78

File tree

7 files changed

+54
-4
lines changed

7 files changed

+54
-4
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export * from './pagination-model'
1+
export * from './pagination-model';
22
export * from './common-dictionary.model';
33
export * from './key-value.model';
44
export * from './common-dictionary-text.model';
5+
export * from './status-bar.model';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export class StatusBarModel {
2+
status: number;
3+
}

eform-client/src/app/common/modules/eform-shared/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export * from './eform-page-subheader/eform-page-subheader.component';
22
export * from './eform-pagination/eform-pagination.component';
33
export * from './eform-spinner/eform-spinner.component';
44
export * from './eform-page-size/eform-page-size.component';
5+
export * from './status-bar/status-bar.component';
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--<div class="progress-bar" role="progressbar" style="width: {{trashInspection.status-bar}}%"></div>-->
2+
<div class="progress" *ngIf="statusBar.status == 0" style="height: 2em">
3+
<div class="progress-bar grey" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 100%; padding-left: 5px; padding-right: 5px;">{{'Ready for server' | translate}}</div>
4+
</div>
5+
<div class="progress" *ngIf="statusBar.status == 33" style="height: 2em">
6+
<div class="progress-bar orange text" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 100%; padding-left: 5px; padding-right: 5px;">{{'Received by server' | translate}}</div>
7+
</div>
8+
<div class="progress" *ngIf="statusBar.status == 66" style="height: 2em">
9+
<div class="progress-bar yellow text-black-60" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 100%; padding-left: 5px; padding-right: 5px;">{{'Ready for device' | translate}}</div>
10+
</div>
11+
<div class="progress" *ngIf="statusBar.status == 70" style="height: 2em">
12+
<div class="progress-bar info-color" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 100%; padding-left: 5px; padding-right: 5px;">{{'Retrieved by device' | translate}}</div>
13+
</div>
14+
<div class="progress" *ngIf="statusBar.status == 77" style="height: 2em">
15+
<div class="progress-bar success-color" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 100%; padding-left: 5px; padding-right: 5px;">{{'Completed' | translate}}</div>
16+
</div>
17+
<div class="progress" *ngIf="statusBar.status == 110" style="height: 2em; padding-left: 2px;">
18+
<div class="progress-bar danger-color" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 100%; padding-left: 5px; padding-right: 5px;">{{'System error: Contact Microting' | translate}}</div>
19+
</div>

eform-client/src/app/common/modules/eform-shared/components/status-bar/status-bar.component.scss

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Component, OnInit, Input } from '@angular/core';
2+
import { StatusBarModel} from '../../../../models/common';
3+
4+
@Component({
5+
selector: 'status-bar',
6+
templateUrl: './status-bar.component.html',
7+
styleUrls: ['./status-bar.component.scss']
8+
})
9+
export class StatusBarComponent implements OnInit {
10+
statusBar: StatusBarModel = new StatusBarModel();
11+
constructor() { }
12+
@Input()
13+
get status() {
14+
return this.statusBar.status;
15+
}
16+
set status(status: number) {
17+
this.statusBar.status = status;
18+
}
19+
20+
ngOnInit() {
21+
}
22+
23+
}

eform-client/src/app/common/modules/eform-shared/eform-shared.module.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
EformPageSubheaderComponent,
99
EformPaginationComponent,
1010
EformSpinnerComponent,
11-
EformPageSizeComponent
11+
EformPageSizeComponent,
12+
StatusBarComponent
1213
} from './components';
1314

1415
@NgModule({
@@ -22,13 +23,15 @@ import {
2223
EformPageSubheaderComponent,
2324
EformPaginationComponent,
2425
EformSpinnerComponent,
25-
EformPageSizeComponent
26+
EformPageSizeComponent,
27+
StatusBarComponent
2628
],
2729
exports: [
2830
EformPageSubheaderComponent,
2931
EformPaginationComponent,
3032
EformSpinnerComponent,
31-
EformPageSizeComponent
33+
EformPageSizeComponent,
34+
StatusBarComponent
3235
]
3336
})
3437
export class EformSharedModule {

0 commit comments

Comments
 (0)