Skip to content

Commit

Permalink
chore: error message for case saving when no item is selected (should…
Browse files Browse the repository at this point in the history
…n't actually happen ever) #356
  • Loading branch information
bsilkyn committed May 15, 2024
1 parent 44fd23d commit 279bb5d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
8 changes: 7 additions & 1 deletion frontend/src/assets/lang/app/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,13 @@
},
"edit": "Edit",
"cancel": "Cancel",
"save": "Save",
"save": {
"save": "Save",
"error": {
"title": "Invalid Safe Operation",
"detail": "Trying to save while no item is selected"
}
},
"delete": "Delete",
"users": {
"title": "Users",
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/assets/lang/app/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,13 @@
},
"edit": "Bewerken",
"cancel": "Annuleer",
"save": "Sla op",
"save": {
"save": "Sla op",
"error": {
"title": "Ongeldige Opsla Operatie",
"detail": "Men kan niet opslaan wanneer geen item is geselecteerd"
}
},
"delete": "Verwijder",
"users": {
"title": "Gebruikers",
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/views/admin/UsersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ import { useStudents } from '@/composables/services/student.service.ts';
import { useAssistant } from '@/composables/services/assistant.service.ts';
import { useTeacher } from '@/composables/services/teacher.service.ts';
import { useFilter } from '@/composables/filters/filter.ts';
import { useMessagesStore } from '@/store/messages.store.ts';
import { roles, type Role, User } from '@/types/users/User.ts';
import { getUserFilters } from '@/types/filter/Filter.ts';
import { useRoute } from 'vue-router';
/* Composable injections */
const { t } = useI18n();
const { addErrorMessage } = useMessagesStore();
const { query } = useRoute();
const { pagination, users, getUsers, searchUsers, toggleAdmin } = useUser();
const { createStudent, deleteStudent } = useStudents();
Expand Down Expand Up @@ -121,7 +123,7 @@ const saveItem = async (): Promise<void> => {
// update locally
await dataTable.value.fetch();
} else {
// raise error TODO
addErrorMessage(t('admin.save.error.title'), t('admin.save.error.detail'));
}
popupEdit.value = false;
};
Expand Down Expand Up @@ -210,7 +212,7 @@ const saveItem = async (): Promise<void> => {
</div>
<div class="flex justify-content-end gap-2">
<Button type="button" :label="t('admin.cancel')" severity="secondary" @click="popupEdit = false"></Button>
<Button type="button" :label="t('admin.save')" @click="saveItem"></Button>
<Button type="button" :label="t('admin.save.save')" @click="saveItem"></Button>
</div>
</Dialog>
</template>
Expand Down

0 comments on commit 279bb5d

Please sign in to comment.