Create policy module
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / policy / policy-control.component.html
1 <!--
2   ========================LICENSE_START=================================
3   O-RAN-SC
4   %%
5   Copyright (C) 2019 Nordix Foundation
6   %%
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ========================LICENSE_END===================================
19   -->
20
21   <div fxLayout="row">
22     <div class="nrcp-global-page-title">Policy Control</div>
23     <div class="refresh-button">
24         <button mat-icon-button color="primary" (click)="refreshTables()">
25             <mat-icon>refresh</mat-icon>
26         </button>
27     </div>
28 </div>
29
30 <table mat-table [dataSource]="policyTypesDataSource" matSort multiTemplateDataRows
31     class="policy-type-table mat-elevation-z8">
32
33     <ng-container matColumnDef="name">
34         <mat-header-cell *matHeaderCellDef>Policy Type</mat-header-cell>
35         <mat-cell *matCellDef="let policyTypeSchema">
36             <mat-icon matTooltip="Properties">{{isInstancesShown(policyTypeSchema)  ? 'expand_less' : 'expand_more'}}
37             </mat-icon>
38             {{this.getDisplayName(policyTypeSchema)}}
39         </mat-cell>
40     </ng-container>
41
42     <ng-container matColumnDef="description">
43         <mat-header-cell *matHeaderCellDef> Description </mat-header-cell>
44         <mat-cell *matCellDef="let policyTypeSchema"> {{policyTypeSchema.schemaObject.description}}
45         </mat-cell>
46     </ng-container>
47
48     <ng-container matColumnDef="action">
49         <mat-header-cell class="action-cell" *matHeaderCellDef>Action </mat-header-cell>
50         <mat-cell class="action-cell" *matCellDef="let policyTypeSchema" (click)="$event.stopPropagation()">
51             <button mat-icon-button (click)="createPolicyInstance(policyTypeSchema)">
52                 <mat-icon matTooltip="Create instance">add_box</mat-icon>
53             </button>
54         </mat-cell>
55     </ng-container>
56
57     <!-- =================== Policy instances for one type ======================== -->
58     <ng-container matColumnDef="instanceTableContainer">
59         <mat-cell *matCellDef="let policyTypeSchema">
60             <nrcp-policy-instance [policyTypeSchema]=policyTypeSchema [expanded]=this.getExpandedObserver(policyTypeSchema)>
61             </nrcp-policy-instance>
62         </mat-cell>
63     </ng-container>
64     <!-- ======= -->
65
66     <ng-container matColumnDef="noRecordsFound">
67         <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
68     </ng-container>
69
70     <mat-header-row *matHeaderRowDef="['name', 'description', 'action']"></mat-header-row>
71     <mat-row *matRowDef="let policyTypeSchema; columns: ['name', 'description', 'action']"
72         (click)="toggleListInstances(policyTypeSchema)">
73     </mat-row>
74
75     <mat-row *matRowDef="let policyTypeSchema; columns: ['instanceTableContainer'];"
76         [@detailExpand]="isInstancesShown(policyTypeSchema) ? 'expanded' : 'collapsed'" style="overflow: hidden">
77     </mat-row>
78
79     <mat-footer-row *matFooterRowDef="['noRecordsFound']"
80         [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}">
81     </mat-footer-row>
82
83 </table>