Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "6kB"
"maximumError": "8kB"
}
],
"outputHashing": "all"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ <h2 mat-dialog-title>{{ data.componentName }} - Deletion Form</h2>
<span>Mandatory</span>
</div>

<mat-radio-group [(ngModel)]="deploymentStatus" class="deployment-status-group">
<mat-radio-group [(ngModel)]="deploymentStatus" required class="deployment-status-group" #deploymentStatusInput="ngModel">
<mat-radio-button [value]="true">It is deployed in QA/Prod</mat-radio-button>
<mat-radio-button [value]="false">It is in DEV or not deployed</mat-radio-button>

<mat-error *ngIf="deploymentStatusInput.touched && deploymentStatusInput.errors?.['required']">
This field is mandatory
</mat-error>
</mat-radio-group>

<div *ngIf="deploymentStatus" class="change-request-section">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ app-request-deletion-dialog {
--mat-radio-label-text-color: var(--appshell-color-dark-green-main)!important;
--mat-radio-label-text-size: 14px;
}

&.ng-invalid.ng-touched mat-radio-button {
--mdc-radio-unselected-icon-color: #E10A0A!important;
}

mat-error {
line-height: var(--mat-form-field-subscript-text-line-height);
font-size: var(--mat-form-field-subscript-text-size);
letter-spacing: var(--mat-form-field-subscript-text-tracking);
font-weight: var(--mat-form-field-subscript-text-weight);
}
}

.change-request-section {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { Component, Inject, QueryList, ViewChildren, ViewEncapsulation } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatButtonModule } from '@angular/material/button';
import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatRadioModule } from '@angular/material/radio';
import { FormsModule } from '@angular/forms';
import { FormsModule, NgModel } from '@angular/forms';
import { RequestDeletionDialogData, RequestDeletionDialogResult } from '../../models/request-deletion-dialog-data';
import { AppShellIconComponent } from '@opendevstack/ngx-appshell';

Expand All @@ -29,6 +29,8 @@ import { AppShellIconComponent } from '@opendevstack/ngx-appshell';
})
export class RequestDeletionDialogComponent {

@ViewChildren(NgModel) controls!: QueryList<NgModel>;

deploymentStatus: boolean | undefined = undefined;
changeNumber: string = '';
reason: string = '';
Expand All @@ -41,6 +43,7 @@ export class RequestDeletionDialogComponent {
) {}

onAccept(): void {
this.controls.forEach(c => c.control.markAsTouched());
if (this.deploymentStatus === undefined) {
return;
}
Expand Down
Loading