Skip to content

Commit 869c31a

Browse files
committed
Merge branch 'master' of github.com:microting/eform-angular-frontend
2 parents 3c229c4 + 70ef93b commit 869c31a

File tree

25 files changed

+158
-31
lines changed

25 files changed

+158
-31
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export class DateFormatterModel {
2+
date: Date;
3+
time: Date;
4+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
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';
6+
export * from './date-formatter.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+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div *ngIf="format == 'date'">
2+
{{dateFormatter.date | date : 'dd.MM.y'}}
3+
</div>
4+
<div *ngIf="format == 'time'">
5+
{{dateFormatter.date | date : 'HH:mm:ss'}}
6+
</div>
7+
<div *ngIf="format == 'datetime'">
8+
{{dateFormatter.date | date : 'dd.MM.y HH:mm:ss'}}
9+
</div>

eform-client/src/app/common/modules/eform-shared/components/date-formatter/date-formatter.component.scss

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Component, OnInit, Input } from '@angular/core';
2+
import { DateFormatterModel} from '../../../../models/common';
3+
import {formatDate} from '@angular/common';
4+
5+
@Component({
6+
selector: 'date-formatter',
7+
templateUrl: './date-formatter.component.html',
8+
styleUrls: ['./date-formatter.component.scss']
9+
})
10+
export class DateFormatterComponent implements OnInit {
11+
dateFormatter: DateFormatterModel = new DateFormatterModel();
12+
format: string;
13+
constructor() { }
14+
15+
@Input()
16+
get date() {
17+
return this.dateFormatter.date;
18+
}
19+
set date(format) {
20+
this.dateFormatter.date = format;
21+
}
22+
@Input()
23+
get Format() {
24+
return this.format;
25+
}
26+
set Format(format) {
27+
this.format = format;
28+
}
29+
ngOnInit() {
30+
}
31+
32+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ 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';
6+
export * from './date-formatter/date-formatter.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+
}

0 commit comments

Comments
 (0)