Projekt

Obecné

Profil

« Předchozí | Další » 

Revize b5525aef

Přidáno uživatelem Jakub Hlaváč před více než 3 roky(ů)

Re #8850 - Ověření funkčnosti - implementované enpointy

+ new use case add position to unit
  • tweaking all calls to operations with units and sensors
    + adding sensor type enum from backend endpoint
    + some form validation :)
    - removing all endpoints from /senslog1

Zobrazit rozdíly:

src/app/dashboard/components/dashboard.component.html
1
<app-nav-bar></app-nav-bar>
1
<app-nav-bar (emitNewUnit)="addUnit($event)"></app-nav-bar>
2 2

  
3 3
<div class="container dashboard">
4
<!--  <div class="row">-->
5
<!--    <div class="col-md-6"></div>-->
6
<!--    <div class="col-md-6 text-right">-->
7
<!--      <p-button label="Add unit" icon="pi pi-cog" (onClick)="insertUnitPopup()"></p-button>-->
8
<!--    </div>-->
9
<!--  </div>-->
10
<p-accordion>
11
    <p-accordionTab *ngFor="let unit of units">
12
      <p-header [className]="'dashboard-unit-wrapper'">
13
        <div [className]="'row dashboard-unit'">
14
          <div class="col-md-8"><h3>{{ unit.unit.description}}</h3></div>
15
          <div class="col-md-4 text-right">
16
            <p-button label="Sensors graph" icon="pi pi-chart-line" [routerLink]="['/dashboard/unit', unit.unit.unitId]"></p-button>
17
            <p-splitButton *ngIf="loggedUser?.userInfo?.rightsId == 0 || loggedUser?.userInfo?.rightsId == 1" label="Add sensor" (onClick)="insertSensorPopup($event, unit.unit)" icon="pi pi-plus-circle" (onDropdownClick)="showItems($event, unit.unit)" [model]="items" styleClass="p-button-success"></p-splitButton>
4
  <p-accordion>
5
      <p-accordionTab *ngFor="let unit of units">
6
        <p-header [className]="'dashboard-unit-wrapper'">
7
          <div [className]="'row dashboard-unit'">
8
            <div class="col-md-8"><h3>{{ unit.unit.description}}</h3></div>
9
            <div class="col-md-4 text-right">
10
              <p-button label="Sensors graph" icon="pi pi-chart-line" [routerLink]="['/dashboard/unit', unit.unit.unitId]"></p-button>
11
              <p-splitButton *ngIf="loggedUser?.userInfo?.rightsId == 0 || loggedUser?.userInfo?.rightsId == 1" label="Add sensor" (onClick)="insertSensorPopup($event, unit.unit)"
12
                             icon="pi pi-plus-circle" (onDropdownClick)="showItems($event, unit.unit)" [model]="items" styleClass="p-button-success"></p-splitButton>
13
            </div>
18 14
          </div>
15
        </p-header>
16
        <div>
17
          <ng-container *ngFor="let sensor of unit.sensors">
18
            <app-sensors *ngIf="sensor" [sensor]="sensor" [unitId]="unit.unit.unitId" [phenomenons]="phenomenons" [loggedUser]="loggedUser" (emitSensorDeletion)="deleteSensor(unit.unit.unitId, $event)"></app-sensors>
19
          </ng-container>
19 20
        </div>
20
      </p-header>
21
      <div>
22
        <app-sensors *ngFor="let sensor of unit.sensors" [sensor]="sensor" [unitId]="unit.unit.unitId" [phenomenons]="phenomenons" [loggedUser]="loggedUser"></app-sensors>
23
      </div>
24
    </p-accordionTab>
25
</p-accordion>
21
      </p-accordionTab>
22
  </p-accordion>
26 23
</div>
27 24

  
28
<app-unit-popup *ngIf="editedUnit" [(isVisible)]="showEditUnitPopup" [unit]="editedUnit"></app-unit-popup>
29
<app-sensor-insert-popup *ngIf="editedUnit" [unit]="editedUnit" [(isVisible)]="showInsertSensorPopup" [phenomenons]="phenomenons"></app-sensor-insert-popup>
30

  
25
<app-unit-popup *ngIf="showEditUnitPopup" [(isVisible)]="showEditUnitPopup" [unit]="editedUnit"></app-unit-popup>
26
<app-sensor-insert-popup *ngIf="showInsertSensorPopup" [unit]="editedUnit" [(isVisible)]="showInsertSensorPopup" [phenomenons]="phenomenons" [sensorTypes]="sensorTypes" (emitNewSensor)="addSensors($event)"></app-sensor-insert-popup>
27
<app-position-insert-popup *ngIf="showInsertPositionPopup" [unitId]="editedUnit.unitId" [(isVisible)]="showInsertPositionPopup"></app-position-insert-popup>
31 28

  
32 29

  
33 30
<p-confirmDialog [style]="{width: '50vw'}" key="positionDialog" [position]="position" [baseZIndex]="10000" rejectButtonStyleClass="p-button-outlined"></p-confirmDialog>

Také k dispozici: Unified diff