Adding sorting for tables of EI
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / ei-coordinator / ei-coordinator.component.html
index 1b16b30..2eb0dd2 100644 (file)
@@ -19,54 +19,59 @@ limitations under the License.
 -->
 
 <div fxLayout="row">
-    <div class="nrcp-global-page-title">Enrichment Information Coordinator</div>
-    <div class="refresh-button">
-        <button mat-icon-button color="primary" aria-label="Button with a refresh icon" (click)="refreshTables()">
-            <mat-icon>refresh</mat-icon>
-        </button>
-    </div>
+  <div class="nrcp-global-page-title">Enrichment Information Coordinator</div>
+  <div class="refresh-button">
+    <button mat-icon-button color="primary" aria-label="Button with a refresh icon" (click)="refreshTables()">
+      <mat-icon>refresh</mat-icon>
+    </button>
+  </div>
 </div>
 
 <br>
 <h4>Producers</h4>
 
 <div class="table-container">
-  <mat-table #producersTable [dataSource]="producersDataSource"
-    matSort class="ei-coordinator-table mat-elevation-z8">
+  <mat-table #producersTable [dataSource]="producersDataSource" fixedLayout 
+    matSort (matSortChange)="sortProducers($event)"
+    class="ei-coordinator-table mat-elevation-z8">
     <ng-container matColumnDef="id">
-      <mat-header-cell *matHeaderCellDef>
+      <mat-header-cell *matHeaderCellDef mat-sort-header>
+        <div (click)="stopSort($event)">
         <form style="display: flex" [formGroup]="producersFormControl">
           <mat-form-field>
             <input matInput formControlName="ei_producer_id">
             <mat-placeholder>Producer ID</mat-placeholder>
           </mat-form-field>
         </form>
+      </div>
       </mat-header-cell>
       <mat-cell *matCellDef="let eiProducer"> {{eiProducer.ei_producer_id}} </mat-cell>
     </ng-container>
 
     <ng-container matColumnDef="types">
-      <mat-header-cell *matHeaderCellDef>
-        <br>
+      <mat-header-cell *matHeaderCellDef mat-sort-header>
+        <div (click)="stopSort($event)">
         <form style="display: flex" [formGroup]="producersFormControl">
           <mat-form-field>
             <input matInput formControlName="ei_producer_types">
             <mat-placeholder>Producer types</mat-placeholder>
           </mat-form-field>
         </form>
+        </div>
       </mat-header-cell>
       <mat-cell *matCellDef="let eiProducer"> {{this.getEIProducerTypes(eiProducer)}} </mat-cell>
     </ng-container>
 
     <ng-container matColumnDef="status">
-      <mat-header-cell *matHeaderCellDef>
-        <br>
+      <mat-header-cell *matHeaderCellDef mat-sort-header>
+        <div (click)="stopSort($event)">
         <form style="display: flex" [formGroup]="producersFormControl">
           <mat-form-field>
             <input matInput formControlName="status">
             <mat-placeholder>Producer status</mat-placeholder>
           </mat-form-field>
         </form>
+        </div>
       </mat-header-cell>
       <mat-cell *matCellDef="let eiProducer"> {{this.getEIProducerStatus(eiProducer)}} </mat-cell>
     </ng-container>
@@ -74,10 +79,6 @@ limitations under the License.
     <mat-header-row *matHeaderRowDef="['id', 'types', 'status']"></mat-header-row>
     <mat-row *matRowDef="let row; columns: ['id', 'types', 'status'];"></mat-row>
 
-     <!-- Row shown when there is no matching data. -->
-    <mat-row *matNoDataRow>
-      <mat-cell colspan="3">No data matching the filter "{{input.value}}"</mat-cell>
-    </mat-row>
   </mat-table>
 </div>
 
@@ -85,57 +86,62 @@ limitations under the License.
 <h4>Jobs</h4>
 
 <div class="table-container">
-    <mat-table #jobsTable [dataSource]="jobsDataSource"
-        matSort class="ei-coordinator-table mat-elevation-z8">
-        <ng-container matColumnDef="id">
-            <mat-header-cell *matHeaderCellDef>
-                <br>
-                <form style="display: flex" [formGroup]="jobsFormControl">
-                    <mat-form-field>
-                        <input matInput formControlName="id">
-                        <mat-placeholder>Job ID</mat-placeholder>
-                    </mat-form-field>
-                </form>
-            </mat-header-cell>
-            <mat-cell *matCellDef="let eiJob"> {{this.getDisplayName(eiJob)}} </mat-cell>
-        </ng-container>
-        <ng-container matColumnDef="typeId">
-            <mat-header-cell *matHeaderCellDef>
-                <br>
-                <form style="display: flex" [formGroup]="jobsFormControl">
-                    <mat-form-field>
-                        <input matInput formControlName="typeId">
-                        <mat-placeholder>Type ID</mat-placeholder>
-                    </mat-form-field>
-                </form>
-            </mat-header-cell>
-            <mat-cell *matCellDef="let eiJob">{{this.getEITypeId(eiJob)}} </mat-cell>
-            </ng-container>
-        <ng-container matColumnDef="owner">
-            <mat-header-cell *matHeaderCellDef>
-                <br>
-                <form style="display: flex" [formGroup]="jobsFormControl">
-                    <mat-form-field>
-                        <input matInput formControlName="owner">
-                        <mat-placeholder>Owner</mat-placeholder>
-                    </mat-form-field>
-                </form>
-            </mat-header-cell>
-            <mat-cell *matCellDef="let eiJob">{{eiJob.owner}} </mat-cell>
-        </ng-container>
-        <ng-container matColumnDef="targetUri">
-            <mat-header-cell *matHeaderCellDef>
-                <br>
-                <form style="display: flex" [formGroup]="jobsFormControl">
-                    <mat-form-field>
-                        <input matInput formControlName="targetUri">
-                        <mat-placeholder>Target URI</mat-placeholder>
-                    </mat-form-field>
-                </form>
-            </mat-header-cell>
-            <mat-cell *matCellDef="let eiJob"> {{this.getTargetUri(eiJob)}}  </mat-cell>
-        </ng-container>
-        <mat-header-row *matHeaderRowDef="['id', 'typeId', 'owner', 'targetUri']"></mat-header-row>
-        <mat-row *matRowDef="let row; columns: ['id', 'typeId', 'owner', 'targetUri'];"></mat-row>
-    </mat-table>
+  <mat-table [dataSource]="jobsDataSource" fixedLayout 
+    matSort (matSortChange)="sortJobs($event)"
+    class="ei-coordinator-table mat-elevation-z8">
+    <ng-container matColumnDef="id">
+      <mat-header-cell *matHeaderCellDef mat-sort-header>
+        <div (click)="stopSort($event)">
+          <form style="display: flex" [formGroup]="jobsFormControl">
+            <mat-form-field>
+              <input matInput formControlName="id">
+              <mat-placeholder>Job ID</mat-placeholder>
+            </mat-form-field>
+          </form>
+        </div>
+      </mat-header-cell>
+      <mat-cell *matCellDef="let eiJob"> {{this.getDisplayName(eiJob)}} </mat-cell>
+    </ng-container>
+    <ng-container matColumnDef="typeId">
+      <mat-header-cell *matHeaderCellDef mat-sort-header>
+        <div (click)="stopSort($event)">
+          <form style="display: flex" [formGroup]="jobsFormControl">
+            <mat-form-field>
+              <input matInput formControlName="typeId">
+              <mat-placeholder>Type ID</mat-placeholder>
+            </mat-form-field>
+          </form>
+        </div>
+      </mat-header-cell>
+      <mat-cell *matCellDef="let eiJob">{{this.getEITypeId(eiJob)}} </mat-cell>
+    </ng-container>
+    <ng-container matColumnDef="owner">
+      <mat-header-cell *matHeaderCellDef mat-sort-header>
+        <div (click)="stopSort($event)">
+          <form style="display: flex" [formGroup]="jobsFormControl">
+            <mat-form-field>
+              <input matInput formControlName="owner">
+              <mat-placeholder>Owner</mat-placeholder>
+            </mat-form-field>
+          </form>
+        </div>
+      </mat-header-cell>
+      <mat-cell *matCellDef="let eiJob">{{eiJob.owner}} </mat-cell>
+    </ng-container>
+    <ng-container matColumnDef="targetUri">
+      <mat-header-cell *matHeaderCellDef mat-sort-header>
+        <div (click)="stopSort($event)">
+          <form style="display: flex" [formGroup]="jobsFormControl">
+            <mat-form-field>
+              <input matInput formControlName="targetUri">
+              <mat-placeholder>Target URI</mat-placeholder>
+            </mat-form-field>
+          </form>
+        </div>
+      </mat-header-cell>
+      <mat-cell *matCellDef="let eiJob"> {{this.getTargetUri(eiJob)}} </mat-cell>
+    </ng-container>
+    <mat-header-row *matHeaderRowDef="['id', 'typeId', 'owner', 'targetUri']"></mat-header-row>
+    <mat-row *matRowDef="let row; columns: ['id', 'typeId', 'owner', 'targetUri'];"></mat-row>
+  </mat-table>
 </div>
\ No newline at end of file