Decouple policy instance components
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / policy / no-type-policy-editor / no-type-policy-editor.component.html
index 6fe3ca9..fdf174e 100644 (file)
@@ -1,21 +1,48 @@
-<mat-form-field style="width: 800px;"  appearance="fill">
-    <textarea id="policyJsonTextArea" formControlName="policyJsonTextArea" matInput cdkTextareaAutosize
-        cdkAutosizeMinRows="10" required [(value)]="this.policyJson" placeholder="Policy properties"
-        matTooltip="The properties of the policy instance, in JSON format" matTooltipPosition="before">
+<!--
+ -
+   ========================LICENSE_START=================================
+   O-RAN-SC
+   %%
+   Copyright (C) 2021: Nordix Foundation
+   %%
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+   ========================LICENSE_END===================================
+  /
+-->
+
+<h4>
+    Properties *
+</h4>
+<form [formGroup]="instanceForm">
+    <mat-form-field style="width: 800px;" appearance="fill">
+        <textarea id="policyJsonTextArea" formControlName="policyJsonTextArea" matInput cdkTextareaAutosize
+            cdkAutosizeMinRows="10" required [value]="this.policyJson" placeholder="Policy properties"
+            matTooltip="The properties of the policy instance, in JSON format" matTooltipPosition="before">
     </textarea>
-    <div *ngIf="policyJsonTextArea.invalid && (policyJsonTextArea.dirty || policyJsonTextArea.touched)">
-        <div *ngIf="policyJsonTextArea.errors.required">
-            <mat-error role="alert">
-                This field is required.
-            </mat-error>
+        <div *ngIf="policyJsonTextArea.invalid && (policyJsonTextArea.dirty || policyJsonTextArea.touched)">
+            <div *ngIf="policyJsonTextArea.errors.required">
+                <mat-error role="alert">
+                    This field is required.
+                </mat-error>
+            </div>
+            <div *ngIf="policyJsonTextArea.errors.invalidJson">
+                <mat-error role="alert">
+                    The policy properties must be a valid JSON.
+                </mat-error>
+            </div>
         </div>
-        <div *ngIf="policyJsonTextArea.errors.invalidJson">
-            <mat-error role="alert">
-                The policy properties must be a valid JSON.
-            </mat-error>
-        </div>
-    </div>
-    <button id="formatButton" (click)="formatJsonInput();" mat-raised-button [disabled]="!policyJsonTextArea.valid">
-        Format JSON
-    </button>
-</mat-form-field>
+        <button id="formatButton" (click)="formatJsonInput();" mat-raised-button [disabled]="!policyJsonTextArea.valid">
+            Format JSON
+        </button>
+    </mat-form-field>
+</form>
\ No newline at end of file