Skip to content

Commit c63d544

Browse files
author
Allan Asp Christensen
authored
Merge pull request #23 from OS2iot/feature/styling-datatarget
Feature/styling datatarget
2 parents 311331f + 37f94f7 commit c63d544

File tree

10 files changed

+194
-343
lines changed

10 files changed

+194
-343
lines changed

src/app/applications/applications-routing.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { IoTDeviceDetailComponent } from './iot-devices/iot-device-detail/iot-de
88
import { IotDeviceEditComponent } from './iot-devices/iot-device-edit/iot-device-edit.component';
99
import { DatatargetEditComponent } from './datatarget/datatarget-edit/datatarget-edit.component';
1010
import { DatatargetListComponent } from './datatarget/datatarget-list/datatarget-list.component';
11-
import { DatatargetComponent } from './datatarget/datatarget/datatarget.component';
11+
import { DatatargetDetailComponent } from './datatarget/datatarget-detail/datatarget-detail.component';
1212

1313

1414
const applicationRoutes: Routes = [
@@ -32,7 +32,7 @@ const applicationRoutes: Routes = [
3232
{ path: '', component: DatatargetListComponent },
3333
{ path: 'datatarget-edit', component: DatatargetEditComponent },
3434
{ path: 'datatarget-edit/:datatargetId', component: DatatargetEditComponent },
35-
{ path: 'datatarget/:datatargetId', component: DatatargetComponent }
35+
{ path: 'datatarget/:datatargetId', component: DatatargetDetailComponent }
3636
]
3737

3838
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<ng-container *ngIf="datatarget">
2+
<app-top-bar-single [data]="datatarget" [backButton]="backButton" [buttons]="buttons"></app-top-bar-single>
3+
<div class=" jumbotron m-md-4 p-md-3">
4+
<div class="application-component">
5+
<h4>{{ 'DATATARGET.NAME' | translate }}</h4>
6+
<p class="mb-5">{{datatarget.name}}</p>
7+
<h4>{{ 'DATATARGET.URL' | translate }}</h4>
8+
<p class="mb-5">{{datatarget.url}}</p>
9+
<h4>{{ 'DATATARGET.TIMEOUT' | translate }}</h4>
10+
<p class="mb-5">{{datatarget.timeout}}</p>
11+
<h4>{{ 'DATATARGET.TYPE' | translate }}</h4>
12+
<p class="mb-5">{{datatarget.type}}</p>
13+
<h4>{{ 'DATATARGET.RELATIONS' | translate }}</h4>
14+
<div *ngIf="dataTargetRelations.length === 0">
15+
<p class="mb-5">{{'DATATARGET.NO-RELATIONS' | translate}}</p>
16+
</div>
17+
<div *ngFor="let relation of dataTargetRelations">
18+
<div class="row my-3">
19+
<div class="col-md-2">
20+
<h6>{{'DATATARGET.PAYLOADEDECODER' | translate}}</h6>
21+
</div>
22+
<div class="col-md-4">
23+
<ul>
24+
<li>
25+
{{relation.dataTarget.name}}
26+
</li>
27+
</ul>
28+
</div>
29+
<div class="col-md-2">
30+
<h6>{{'DATATARGET.IOTDEVICE' | translate}}</h6>
31+
</div>
32+
<div class="col-md-4">
33+
<div *ngFor="let device of relation.iotDevices">
34+
<ul>
35+
<li>{{device.name}}</li>
36+
</ul>
37+
</div>
38+
</div>
39+
<mat-divider></mat-divider>
40+
</div>
41+
</div>
42+
</div>
43+
</div>
44+
</ng-container>

src/app/applications/datatarget/datatarget/datatarget.component.scss renamed to src/app/applications/datatarget/datatarget-detail/datatarget-detail.component.scss

File renamed without changes.

src/app/applications/datatarget/datatarget/datatarget.component.spec.ts renamed to src/app/applications/datatarget/datatarget-detail/datatarget-detail.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22

3-
import { DatatargetComponent } from './datatarget.component';
3+
import { DatatargetDetailComponent } from './datatarget-detail.component';
44

55
describe('DatatargetComponent', () => {
6-
let component: DatatargetComponent;
7-
let fixture: ComponentFixture<DatatargetComponent>;
6+
let component: DatatargetDetailComponent;
7+
let fixture: ComponentFixture<DatatargetDetailComponent>;
88

99
beforeEach(async(() => {
1010
TestBed.configureTestingModule({
11-
declarations: [ DatatargetComponent ]
11+
declarations: [DatatargetDetailComponent]
1212
})
13-
.compileComponents();
13+
.compileComponents();
1414
}));
1515

1616
beforeEach(() => {
17-
fixture = TestBed.createComponent(DatatargetComponent);
17+
fixture = TestBed.createComponent(DatatargetDetailComponent);
1818
component = fixture.componentInstance;
1919
fixture.detectChanges();
2020
});

src/app/applications/datatarget/datatarget/datatarget.component.ts renamed to src/app/applications/datatarget/datatarget-detail/datatarget-detail.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import { Sort } from '@shared/models/sort.model';
1111
import { DatatargetService } from '../datatarget.service';
1212

1313
@Component({
14-
selector: 'app-datatarget',
15-
templateUrl: './datatarget.component.html',
16-
styleUrls: ['./datatarget.component.scss']
14+
selector: 'app-datatarget-detail',
15+
templateUrl: './datatarget-detail.component.html',
16+
styleUrls: ['./datatarget-detail.component.scss']
1717
})
18-
export class DatatargetComponent implements OnInit {
18+
export class DatatargetDetailComponent implements OnInit {
1919

2020
public datatargetSubscription: Subscription;
2121
public datatarget: DatatargetResponse;

src/app/applications/datatarget/datatarget.module.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { DatatargetTableComponent } from './datatarget-table/datatarget-table.co
44
import { DatatargetTableRowComponent } from './datatarget-tabel-row/datatarget-tabel-row.component';
55
import { DatatargetListComponent } from './datatarget-list/datatarget-list.component';
66
import { DatatargetEditComponent } from './datatarget-edit/datatarget-edit.component';
7-
import { DatatargetComponent } from './datatarget/datatarget.component';
7+
import { DatatargetDetailComponent } from './datatarget-detail/datatarget-detail.component';
88
import { TranslateModule } from '@ngx-translate/core';
99
import { RouterModule } from '@angular/router';
1010
import { NGMaterialModule } from '@shared/Modules/materiale.module';
@@ -17,20 +17,21 @@ import { TopBarModule } from '@shared/components/top-bar/top-bar.module';
1717
DatatargetTableRowComponent,
1818
DatatargetListComponent,
1919
DatatargetEditComponent,
20-
DatatargetComponent],
20+
DatatargetDetailComponent],
2121
imports: [
2222
CommonModule,
2323
TopBarModule,
2424
RouterModule,
2525
TranslateModule,
2626
FormModule,
27+
NGMaterialModule
2728
],
2829
exports: [
2930
DatatargetTableComponent,
3031
DatatargetTableRowComponent,
3132
DatatargetListComponent,
3233
DatatargetEditComponent,
33-
DatatargetComponent,
34+
DatatargetDetailComponent,
3435
NGMaterialModule
3536
]
3637
})

src/app/applications/datatarget/datatarget/datatarget.component.html

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)