Skip to content

Commit dfaa307

Browse files
feedback changes for metadata on gateways.
1 parent 443bd73 commit dfaa307

File tree

7 files changed

+31
-52
lines changed

7 files changed

+31
-52
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ <h3>{{ 'GATEWAY.LOCATION' | translate }}</h3>
3333
<app-map [coordinates]="getCoordinates()"></app-map>
3434
</div>
3535
<div class="row">
36-
<div class="col-4">
37-
<p><strong>{{ 'GATEWAY.LONGITUDE' | translate }}</strong>
38-
{{gateway.location?.longitude | number:'2.1-9'}}</p>
39-
</div>
4036
<div class="col-4">
4137
<p><strong>{{ 'GATEWAY.LATITUDE' | translate }}</strong>
4238
{{gateway.location.latitude | number:'2.1-9'}}</p>
4339
</div>
40+
<div class="col-4">
41+
<p><strong>{{ 'GATEWAY.LONGITUDE' | translate }}</strong>
42+
{{gateway.location?.longitude | number:'2.1-9'}}</p>
43+
</div>
4444
<div class="col-4">
4545
<p><strong>{{ 'GATEWAY.ALTITUDE' | translate }}</strong>
4646
{{gateway.location.altitude | number:'2.1-9'}}</p>

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@
4040
<p>{{'DBLCLICKINFO' | translate}}</p>
4141

4242
<div class="row mb-5">
43-
<div class="form-group mt-3 col-6">
44-
<label class="form-label" for="longitude">{{ 'GATEWAY.LONGITUDE' | translate }}</label>
45-
<input type="number" class="form-control" id="longitude" name="longitude" [placeholder]="'00'" required
46-
[(ngModel)]="gateway.location.longitude" step=".000001" min="-180" max="180" maxlength="12"
47-
(keyup)="onCoordinateKey($event)"
48-
[ngClass]="{'is-invalid' : formFailedSubmit && errorFields.includes('longitude'), 'is-valid' : formFailedSubmit && !errorFields.includes('longitude')}">
49-
</div>
50-
5143
<div class="form-group mt-3 col-6">
5244
<label class="form-label" for="location.latitude">{{ 'GATEWAY.LATITUDE' | translate }}</label>
5345
<input type="number" class="form-control" id="location.latitude" name="location.latitude" [placeholder]="'00'"
@@ -56,6 +48,14 @@
5648
[ngClass]="{'is-invalid' : formFailedSubmit && errorFields.includes('latitude'), 'is-valid' : formFailedSubmit && !errorFields.includes('latitude')}">
5749
</div>
5850

51+
<div class="form-group mt-3 col-6">
52+
<label class="form-label" for="longitude">{{ 'GATEWAY.LONGITUDE' | translate }}</label>
53+
<input type="number" class="form-control" id="longitude" name="longitude" [placeholder]="'00'" required
54+
[(ngModel)]="gateway.location.longitude" step=".000001" min="-180" max="180" maxlength="12"
55+
(keyup)="onCoordinateKey($event)"
56+
[ngClass]="{'is-invalid' : formFailedSubmit && errorFields.includes('longitude'), 'is-valid' : formFailedSubmit && !errorFields.includes('longitude')}">
57+
</div>
58+
5959
<div class="form-group mt-3 col-6">
6060
<label class="form-label" for="altitude">{{ 'GATEWAY.ALTITUDE' | translate }}</label>
6161
<input type="number" class="form-control" id="altitude" name="altitude" [placeholder]="00" required

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

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -76,42 +76,12 @@ const columnDefinitions: TableColumn[] = [
7676
toggleable: true,
7777
default: false,
7878
},
79-
{
80-
id: "gatewayResponsibleEmail",
81-
display: "LORA-GATEWAY-TABLE.RESPONSIBLE-EMAIL",
82-
toggleable: true,
83-
default: false,
84-
},
85-
{
86-
id: "gatewayResponsiblePhoneNumber",
87-
display: "LORA-GATEWAY-TABLE.RESPONSIBLE-PHONE-NUMBER",
88-
toggleable: true,
89-
default: false,
90-
},
91-
{
92-
id: "operationalResponsibleName",
93-
display: "LORA-GATEWAY-TABLE.OPERATIONAL-NAME",
94-
toggleable: true,
95-
default: false,
96-
},
97-
{
98-
id: "operationalResponsibleEmail",
99-
display: "LORA-GATEWAY-TABLE.OPERATIONAL-EMAIL",
100-
toggleable: true,
101-
default: false,
102-
},
10379
{
10480
id: "tags",
10581
display: "LORA-GATEWAY-TABLE.TAGS",
10682
toggleable: true,
10783
default: false,
10884
},
109-
{
110-
id: "location",
111-
display: "LORA-GATEWAY-TABLE.LOCATION",
112-
toggleable: true,
113-
default: false,
114-
},
11585
{
11686
id: "createdAt",
11787
display: "LORA-GATEWAY-TABLE.CREATED-AT",

src/app/gateway/gateway.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class Gateway extends EditPermission {
1919
operationalResponsibleName?: string;
2020
operationalResponsibleEmail?: string;
2121

22-
tagsString = "{}";
22+
tagsString: string;
2323
tags?: JSON;
2424
rxPacketsReceived: number;
2525
txPacketsEmitted: number;

src/app/shared/components/map/map.component.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,17 @@ export class MapComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy
121121
const gatewayLayerGroup = [];
122122

123123
this.coordinateList.forEach(coord => {
124-
if (!coord.markerInfo.isDevice) {
125-
gatewayLayerGroup.push(
126-
this.addMarker(coord.latitude, coord.longitude, coord.draggable, coord.markerInfo)
127-
);
128-
this.markers = L.layerGroup(gatewayLayerGroup).addTo(this.map);
124+
if (this.isFromApplication) {
125+
if (!coord.markerInfo.isDevice) {
126+
gatewayLayerGroup.push(
127+
this.addMarker(coord.latitude, coord.longitude, coord.draggable, coord.markerInfo)
128+
);
129+
this.markers = L.layerGroup(gatewayLayerGroup).addTo(this.map);
130+
} else {
131+
clusterGroup.addLayer(
132+
this.addMarker(coord.latitude, coord.longitude, coord.draggable, coord.markerInfo)
133+
);
134+
}
129135
} else {
130136
clusterGroup.addLayer(
131137
this.addMarker(coord.latitude, coord.longitude, coord.draggable, coord.markerInfo)

src/app/shared/services/chirpstack-gateway.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ export class ChirpstackGatewayService {
2828
.getOrganizationInfo()
2929
.find(org => org.id === response.gateway.organizationId)?.name;
3030

31+
// We want to show helper text if tags is empty. To show empty text, the tagsString has to be undefined.
32+
response.gateway.tagsString =
33+
Object.keys(response.gateway.tags).length === 0 ? undefined : JSON.stringify(response.gateway.tags);
34+
3135
// Move createdat and updatedat to next level ease the use.
32-
response.gateway.tagsString = JSON.stringify(response.gateway.tags);
3336
response.gateway.createdByName = this.userMinimalService.getUserNameFrom(response.gateway.createdBy);
3437

3538
response.gateway.updatedByName = this.userMinimalService.getUserNameFrom(response.gateway.updatedBy);

src/assets/i18n/da.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@
384384
"RESPONSIBLE-NAME": "Gateway-ansvarlig",
385385
"RESPONSIBLE-EMAIL": "Kontaktmail",
386386
"RESPONSIBLE-PHONE-NUMBER": "Kontakttelefon",
387-
"OPERATIONAL-NAME": "Driftansvarlig",
387+
"OPERATIONAL-NAME": "Driftsansvarlig",
388388
"OPERATIONAL-EMAIL": "Kontaktmail - drift",
389389
"TAGS": "Tags",
390390
"CREATED-AT": "Oprettelsesdato"
@@ -828,7 +828,7 @@
828828
"GATEWAYID": "Gateway id (EUI)",
829829
"GATEWAYID-PLACEHOLDER": "0000000000000000",
830830
"METADATA": "Gateway tags",
831-
"METADATA-PLACEHOLDER": "Angiv JSON her",
831+
"METADATA-PLACEHOLDER": "Angiv JSON her: {\"tagName\": \"tagValue\"}",
832832
"ALTITUDE": "Højde",
833833
"ALTITUDE-PLACEHOLDER": "00",
834834
"LONGITUDE": "Længdegrad",
@@ -845,7 +845,7 @@
845845
"GATEWAY-RESPONSIBLE-CONTACT-PLACEHOLDER": "Angiv mailadresse på gateway-ansvarlig",
846846
"GATEWAY-RESPONSIBLE-CONTACT-NUMBER": "Kontakttelefon",
847847
"GATEWAY-RESPONSIBLE-CONTACT-NUMBER-PLACEHOLDER": "Angiv telefonnummer på gateway-ansvarlig",
848-
"OPERATION-RESPONSIBLE": "Driftansvarlig",
848+
"OPERATION-RESPONSIBLE": "Driftsansvarlig",
849849
"OPERATION-RESPONSIBLE-PLACEHOLDER": "Angiv ansvarlig for den fysiske drift af gateway",
850850
"OPERATION-RESPONSIBLE-CONTACT": "Kontaktmail - drift",
851851
"OPERATION-RESPONSIBLE-CONTACT-PLACEHOLDER": "Angiv mailadresse på driftsansvarlig"

0 commit comments

Comments
 (0)