Skip to content

Commit

Permalink
ALCS-2446 Set single date as default if date is not checked
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarreta committed Dec 18, 2024
1 parent ae6842a commit 14a39e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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">Single - Select date label </mat-radio-button>
<mat-radio-button [value]="DateType.SINGLE" [checked]="isSingleDateDeafult">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,6 +39,7 @@ export class DecisionConditionTypesDialogComponent {
isLoading = false;
isEdit = false;
showWarning = false;
isSingleDateDeafult = false;

service: ApplicationDecisionConditionTypesService | NoticeofIntentDecisionConditionTypesService | undefined;
conditionService: ApplicationDecisionConditionService | NoticeOfIntentDecisionConditionService | undefined;
Expand Down Expand Up @@ -110,6 +111,10 @@ export class DecisionConditionTypesDialogComponent {
this.conditionTypeForm.get('code')?.disable();
}

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

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

0 comments on commit 14a39e6

Please sign in to comment.