Skip to content

Commit

Permalink
Revert "solved design page getting disabled error"
Browse files Browse the repository at this point in the history
This reverts commit 109ad54.
  • Loading branch information
ppratikcr7 committed Apr 27, 2023
1 parent 9e5eb41 commit 6aaeb22
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,10 @@ export class ExperimentDesignStepperService {
this.store$.dispatch(actionUpdateFactorialConditionTableData({ tableData }));
}

setUpdatePayloadTableEditModeDetails(rowIndex: number | null, isNgDestroyCall: boolean): void {
setUpdatePayloadTableEditModeDetails(rowIndex: number | null): void {
this.store$.dispatch(
experimentDesignStepperAction.actionToggleSimpleExperimentPayloadTableEditMode({
simpleExperimentPayloadTableEditIndex: rowIndex,
isNgDestroyCall: isNgDestroyCall,
})
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const actionToggleSimpleExperimentPayloadTableEditMode = createAction(
'[Experiment-Design-Stepper] Update Simple Experiment Payload Table Edit Mode Details',
props<{
simpleExperimentPayloadTableEditIndex: number | null;
isNgDestroyCall: boolean;
}>()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,9 @@ const reducer = createReducer(
})),
on(
experimentDesignStepperAction.actionToggleSimpleExperimentPayloadTableEditMode,
(state, { simpleExperimentPayloadTableEditIndex, isNgDestroyCall }): ExperimentDesignStepperState => {
(state, { simpleExperimentPayloadTableEditIndex }): ExperimentDesignStepperState => {
// toggle edit mode
let editMode: boolean;
if (!isNgDestroyCall) {
editMode = !state.isSimpleExperimentPayloadTableEditMode;
}
const editMode = !state.isSimpleExperimentPayloadTableEditMode;

// if not in edit mode, use null for row-index
const editIndex = editMode ? simpleExperimentPayloadTableEditIndex : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export class PayloadsTableComponent implements OnInit, OnDestroy {
}

ngOnDestroy(): void {
this.experimentDesignStepperService.clearSimpleExperimentDesignStepperData();
this.experimentDesignStepperService.setUpdatePayloadTableEditModeDetails(null, true);
this.experimentDesignStepperService.setUpdatePayloadTableEditModeDetails(null);
this.subscriptions.unsubscribe();
}

Expand Down Expand Up @@ -119,7 +118,7 @@ export class PayloadsTableComponent implements OnInit, OnDestroy {
}

this.currentPayloadInput$.next(rowData.payload);
this.experimentDesignStepperService.setUpdatePayloadTableEditModeDetails(rowIndex, false);
this.experimentDesignStepperService.setUpdatePayloadTableEditModeDetails(rowIndex);
this.experimentDesignStepperService.setNewSimpleExperimentPayloadTableData(payloadTableData);
}

Expand Down

0 comments on commit 6aaeb22

Please sign in to comment.