Skip to content

Commit

Permalink
ALCS-2446 Set default at the form
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarreta committed Dec 18, 2024
1 parent 3cbebcb commit 6e1e56b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h4>{{ isEdit ? 'Edit' : 'Create' }} Decision Condition Type</h4>
*ngIf="conditionTypeForm.get('isDateChecked')?.value"
class="condition-date-types"
>
<mat-radio-button [value]="DateType.SINGLE" [checked]="isSingleDateDefault">Single - Select date label </mat-radio-button>
<mat-radio-button [value]="DateType.SINGLE">Single - Select date label </mat-radio-button>
<div class="condition-fields-container" *ngIf="conditionTypeForm.value.dateType === DateType.SINGLE">
<mat-button-toggle-group
id="singleDateLabelId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export class DecisionConditionTypesDialogComponent {
isLoading = false;
isEdit = false;
showWarning = false;
isSingleDateDefault = false;

service: ApplicationDecisionConditionTypesService | NoticeofIntentDecisionConditionTypesService | undefined;
conditionService: ApplicationDecisionConditionService | NoticeOfIntentDecisionConditionService | undefined;
Expand Down Expand Up @@ -92,7 +91,7 @@ export class DecisionConditionTypesDialogComponent {
[this.conditionAsyncValidator(ValidationFields.Dates)],
),
isDateRequired: new FormControl(this.data?.content?.isDateRequired ? this.data.content.isDateRequired : false),
dateType: new FormControl(this.data?.content?.dateType),
dateType: new FormControl(this.data?.content?.dateType ?? DateType.SINGLE),
singleDateLabel: new FormControl(
this.data?.content?.singleDateLabel ? this.data.content.singleDateLabel : DateLabel.DUE_DATE,
),
Expand All @@ -111,10 +110,6 @@ export class DecisionConditionTypesDialogComponent {
this.conditionTypeForm.get('code')?.disable();
}

if (!this.data?.content?.isDateChecked && !this.data?.content?.dateType) {
this.isSingleDateDefault = true;
}

this.conditionTypeForm.get('isComponentToConditionChecked')?.disable();
this.conditionTypeForm.get('isDescriptionChecked')?.disable();
this.isLoading = false;
Expand Down

0 comments on commit 6e1e56b

Please sign in to comment.