Skip to content

Commit

Permalink
perf: Update dynamic form layout and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
w940853815 committed Nov 20, 2024
1 parent c702ed7 commit 5ea9d03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<input matInput [formControlName]="'jms_'+fieldKey" />
<mat-hint>{{ formConfig[fieldKey].help_text }}</mat-hint>
</mat-form-field>
<div *ngSwitchCase="'labeled_choice'" class="radio-group">
<div *ngSwitchCase="'labeled_choice'" class="radio-group full-width">
<label class="zone-label">{{ formConfig[fieldKey].label }}</label>
<mat-radio-group style="display: block; padding: 12px 10px 10px 10px;" [formControlName]="'jms_'+fieldKey">
<mat-radio-group style="display: block; padding: 5px 0;" [formControlName]="'jms_'+fieldKey">
<mat-radio-button *ngFor="let choice of formConfig[fieldKey].choices"
[value]="choice.value">
{{ choice.label }}
Expand All @@ -17,10 +17,9 @@
</div>
</div>
<mat-form-field *ngIf="command" class="full-width">
<mat-label>{{ 'Command'| translate }}</mat-label>
<label class="zone-label">{{ 'Command'| translate }}</label>
<textarea rows="5" matInput [formControlName]="'sendCommand'" [value]="command.args"></textarea>
</mat-form-field>

<div style="float: right; padding-top: 20px">
<button mat-raised-button color="primary" type="submit" [disabled]="dynamicForm.invalid">{{"Confirm"| translate}}</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.full-width {
width: 100%;
margin-bottom: 20px;
}

.radio-group {
margin-bottom: 20px;
}
mat-hint {
font-size: 10px;
}
.zone-label {
color: rgba(0, 0, 0, 0.54);
cursor: pointer;
}

0 comments on commit 5ea9d03

Please sign in to comment.