Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: fix nge update after importing or deleting multiple trains #10285

Merged
merged 1 commit into from
Jan 15, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ const ScenarioContent = ({
<ImportTrainSchedule
timetableId={scenario.timetable_id}
upsertTrainSchedules={upsertTrainSchedules}
dtoImport={dtoImport}
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import { useAppDispatch } from 'store';
const ImportTrainSchedule = ({
timetableId,
upsertTrainSchedules,
dtoImport,
}: {
timetableId: number;
upsertTrainSchedules: (trainSchedules: TrainScheduleResult[]) => void;
dtoImport: () => void;
}) => {
const dispatch = useAppDispatch();
const { t } = useTranslation(['rollingstock']);
Expand Down Expand Up @@ -57,6 +59,7 @@ const ImportTrainSchedule = ({
trainsJsonData={trainsJsonData}
trainsXmlData={trainsXmlData}
upsertTrainSchedules={upsertTrainSchedules}
dtoImport={dtoImport}
/>
</main>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type ImportTrainScheduleTrainsListProps = {
trainsJsonData: TrainScheduleBase[];
trainsXmlData: ImportedTrainSchedule[];
upsertTrainSchedules: (trainSchedules: TrainScheduleResult[]) => void;
dtoImport: () => void;
};

const ImportTrainScheduleTrainsList = ({
Expand All @@ -48,6 +49,7 @@ const ImportTrainScheduleTrainsList = ({
trainsJsonData,
trainsXmlData,
upsertTrainSchedules,
dtoImport,
}: ImportTrainScheduleTrainsListProps) => {
const { t } = useTranslation(['operationalStudies/importTrainSchedule']);
const rollingStockDict = useMemo(
Expand Down Expand Up @@ -91,6 +93,7 @@ const ImportTrainScheduleTrainsList = ({

const trainSchedules = await postTrainSchedule({ id: timetableId, body: payloads }).unwrap();
upsertTrainSchedules(trainSchedules);
dtoImport();
dispatch(
setSuccess({
title: t('success'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const Timetable = ({
const removeAndUnselectTrains = (trainIds: number[]) => {
removeTrains(trainIds);
setSelectedTrainIds([]);
dtoImport();
};

const toggleConflictsListExpanded = () => {
Expand Down
Loading