Skip to content

Commit

Permalink
#793: Reload division and season data after edit
Browse files Browse the repository at this point in the history
  • Loading branch information
laingsimon committed Mar 4, 2024
1 parent 49bc6c4 commit c8d57bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ describe('DivisionControls', () => {
updatedDivision = null;
});

async function divisionOrSeasonChanged(x?: boolean) {
changedDivisionOrSeason = x;
async function divisionOrSeasonChanged(preventReloadIfIdsAreTheSame?: boolean) {
changedDivisionOrSeason = preventReloadIfIdsAreTheSame;
}

async function renderComponent(props: IDivisionControlsProps, account: UserDto, seasons: SeasonDto[], divisions: DivisionDto[], route?: string, currentPath?: string) {
Expand Down Expand Up @@ -601,7 +601,7 @@ describe('DivisionControls', () => {
reportedError.verifyNoError();
const dialog = context.container.querySelector('.btn-group .modal-dialog');
expect(dialog).toBeFalsy();
expect(changedDivisionOrSeason).toEqual(true);
expect(changedDivisionOrSeason).toEqual(false);
expect(reloadSeasonsCalled).toEqual(true);
expect(updatedSeason).not.toBeNull();
});
Expand Down Expand Up @@ -665,7 +665,7 @@ describe('DivisionControls', () => {
reportedError.verifyNoError();
const dialog = context.container.querySelector('.btn-group .modal-dialog');
expect(dialog).toBeFalsy();
expect(changedDivisionOrSeason).toEqual(true);
expect(changedDivisionOrSeason).toEqual(false);
expect(reloadDivisionsCalled).toEqual(true);
expect(updatedDivision).not.toBeNull();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {IClientActionResultDto} from "../common/IClientActionResultDto";

export interface IDivisionControlsProps {
originalSeasonData: DivisionDataSeasonDto;
onDivisionOrSeasonChanged?(type?: boolean): Promise<any>;
onDivisionOrSeasonChanged?(preventReloadIfIdsAreTheSame?: boolean): Promise<any>;
originalDivisionData: DivisionDataDto;
overrideMode?: string;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ export function DivisionControls({originalSeasonData, onDivisionOrSeasonChanged,
onSave={async () => {
await reloadDivisions();
if (onDivisionOrSeasonChanged) {
await onDivisionOrSeasonChanged(true);
await onDivisionOrSeasonChanged(false);
}
setDivisionData(null);
}}
Expand All @@ -81,7 +81,7 @@ export function DivisionControls({originalSeasonData, onDivisionOrSeasonChanged,
onSave={async () => {
await reloadSeasons();
if (onDivisionOrSeasonChanged) {
await onDivisionOrSeasonChanged(true);
await onDivisionOrSeasonChanged(false);
}
setSeasonData(null);
}}
Expand Down

0 comments on commit c8d57bc

Please sign in to comment.