Skip to content

Commit

Permalink
✨ Fix go to outside from settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
damianpumar committed Jun 18, 2024
1 parent 0379aec commit 29952ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions argilla-frontend/pages/dataset/_id/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export default {
components: {
InternalPage,
},
beforeRouteLeave(to, from, next) {
this.goToOutside(next);
},
setup() {
return useDatasetSettingViewModel();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const useDatasetSettingViewModel = () => {
];
});

const onGoToDataset = () => {
const goToDataset = () => {
if (routes.previousRouteMatchWith(datasetId)) return routes.goBack();

routes.goToFeedbackTaskAnnotationPage(datasetId);
Expand All @@ -112,23 +112,23 @@ export const useDatasetSettingViewModel = () => {
if (datasetSetting.isVectorsModified) return goToTab("vector");
};

const goToDataset = () => {
const goToOutside = (next) => {
if (datasetSetting.isModified) {
return notification.notify({
message: t("changes_no_submit"),
buttonText: t("button.ignore_and_continue"),
permanent: true,
type: "warning",
onClick() {
onGoToDataset();
next();
},
onClose() {
goToTabWithModification();
},
});
}

onGoToDataset();
next();
};

onBeforeMount(() => {
Expand All @@ -155,6 +155,7 @@ export const useDatasetSettingViewModel = () => {
isAdminOrOwnerRole,
datasetId,
datasetSetting,
goToOutside,
goToDataset,
};
};

0 comments on commit 29952ad

Please sign in to comment.