Skip to content

Commit c555410

Browse files
Merge pull request #125 from OS2iot/feature/Increase-size-of-gateway-map
Made map component fill 100% in height, height now pr use basis
2 parents 8fa5a7e + edeacad commit c555410

File tree

10 files changed

+30
-28
lines changed

10 files changed

+30
-28
lines changed

src/app/applications/iot-devices/iot-device-detail/iot-device-detail-generic/iot-device-detail-generic.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ <h3>{{ 'IOTDEVICE.DETAIL' | translate }}</h3>
6464
<div class="jumbotron jumbotron--m-left jumbotron--full-width">
6565
<h3>{{ 'IOTDEVICE.LOCATION' | translate }}</h3>
6666
<div *ngIf="device.location; else locationElseBlock">
67+
<div class="thirty-height">
6768
<app-map [coordinates]="getCoordinates()"></app-map>
69+
</div>
6870
<div class="row">
6971
<div class="col-6">
7072
<p><strong>{{ 'IOTDEVICE.LONGITUDE' | translate }}</strong>{{longitude | number:'2.1-6'}}</p>

src/app/applications/iot-devices/iot-device-edit/iot-device-edit.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
[ngClass]="{'is-invalid' : formFailedSubmit && errorFields.includes('comment'), 'is-valid' : formFailedSubmit && !errorFields.includes('comment')}">
6565
</div>
6666

67-
<div class="form-group mt-3 col-12" *ngIf="iotDevice">
67+
<div class="form-group mt-3 col-12 thirty-height" *ngIf="iotDevice">
6868
<app-map [coordinates]="getCoordinates()" (updateCoordinates)="updateCoordinates($event)"></app-map>
6969
</div>
7070

src/app/gateway/gateway-detail/gateway-detail.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ <h3>{{ 'GATEWAY.DETAILS' | translate }}</h3>
2020
<div class="jumbotron jumbotron--m-left jumbotron--full-width">
2121
<div *ngIf="gateway.location; else locationElseBlock">
2222
<h3>{{ 'GATEWAY.LOCATION' | translate }}</h3>
23-
<app-map [coordinates]="getCoordinates()"></app-map>
23+
<div class="thirty-height">
24+
<app-map [coordinates]="getCoordinates()"></app-map>
25+
</div>
2426
<div class="row">
2527
<div class="col-4">
2628
<p><strong>{{ 'GATEWAY.LONGITUDE' | translate }}</strong>

src/app/gateway/gateway-edit/gateway-edit.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
[ngClass]="{'is-invalid' : formFailedSubmit && errorFields.includes('id'), 'is-valid' : formFailedSubmit && !errorFields.includes('id')}">
3434
</div>
3535

36-
<div class="row" *ngIf="gateway.location">
36+
<div class="row thirty-height" *ngIf="gateway.location">
3737
<app-map [coordinates]="getCoordinates()" (updateCoordinates)="updateCoordinates($event)"></app-map>
3838
</div>
3939

@@ -77,4 +77,4 @@
7777
<button class="btn btn-primary ml-2" type="submit">{{ submitButton }}</button>
7878
</div>
7979
</form>
80-
<!-- test app-form-iot--gateway -->
80+
<!-- test app-form-iot--gateway -->

src/app/gateway/gateway-list/gateway-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
</mat-tab>
1818
<mat-tab label="{{'GATEWAY.MAP-TAB' | translate}}">
19-
<div class="jumbotron--table" *ngIf="showmap && gateways">
19+
<div class="jumbotron--table sixty-height" *ngIf="showmap && gateways">
2020
<app-map [coordinateList]="coordinateList">
2121
</app-map>
2222
</div>

src/app/gateway/gateway-list/gateway-list.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
font-size: inherit;
44
line-height: 3em;
55
height: 3em;
6-
}
6+
}

src/app/gateway/gateway-table/gateway-table.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class GatewayTableComponent implements AfterViewInit {
4343

4444
faExclamationTriangle = faExclamationTriangle;
4545
faCheckCircle = faCheckCircle;
46-
46+
refetchIntervalId: NodeJS.Timeout;
4747
batteryStatusColor = 'green';
4848
batteryStatusPercentage = 50;
4949
resultsLength = 0;
@@ -67,10 +67,14 @@ export class GatewayTableComponent implements AfterViewInit {
6767
this.organizationId = x;
6868
this.refresh();
6969
});
70-
70+
this.refetchIntervalId = setInterval(() => this.refresh(), 60 * 1000)
7171
this.refresh();
7272
}
7373

74+
ngOnDestroy() {
75+
clearInterval(this.refetchIntervalId)
76+
}
77+
7478
private refresh() {
7579
this.getGateways().subscribe((data) => {
7680
data.result.forEach((gw) => {
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<div class="map-container">
2-
<div class="map-frame">
3-
<div class="map" id="{{mapId}}"></div>
4-
</div>
5-
</div>
1+
<div class="map" id="{{mapId}}"></div>

src/assets/scss/components/_boxes.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,19 @@
3535
.box{
3636
width: 100%;
3737
@extend .p-3;
38-
38+
3939
&--info{
4040
background-color: $color-bg-info;
4141
border: $info-border;
4242
border-radius: $border-radius-primary;
4343
@extend .mb-5;
4444
}
45-
}
45+
}
46+
47+
.sixty-height{
48+
height: 60vh;
49+
}
50+
51+
.thirty-height{
52+
height: 30vh
53+
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
2-
3-
.map-container {
4-
height: 30vh;
5-
}
6-
7-
.map-frame {
8-
height: 100%;
9-
}
10-
11-
.map {
12-
height: 100%;
13-
}
1+
.map {
2+
height: 100%;
3+
}

0 commit comments

Comments
 (0)