release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
3 changed files with 20 additions and 9 deletions
Showing only changes of commit 567e994b71 - Show all commits

View File

@ -34,7 +34,7 @@
icon="mdi-pencil"
@click="editType({ id: props.row.id, name: props.row.name })"
/>
<q-btn round icon="mdi-delete" @click="deleteType(props.row.name)" />
<q-btn round icon="mdi-delete" @click="deleteType(props.row.id)" />
</q-td>
</template>
</q-table>
@ -114,8 +114,8 @@ export default defineComponent({
edittype.value = false;
}
function deleteType(name: string) {
void store.dispatch('schedule/removeEventType', name);
function deleteType(id: number) {
void store.dispatch('schedule/removeEventType', id);
}
return {
columns,

View File

@ -68,7 +68,7 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { defineComponent, ref } from '@vue/composition-api';
import { defineComponent, ref, onBeforeMount } from '@vue/composition-api';
import { Store } from 'vuex';
import { StateInterface } from 'src/store';
import { date } from 'quasar';
@ -100,8 +100,14 @@ export default defineComponent({
const users = ref(state.users);
function refresh() {
root.$router.go(0);
refreshKey.value += 1;
}
onBeforeMount(() => {
store.dispatch('user/getUsers').catch(error => {
console.warn(error);
});
});
function isUserEnrolled(job: FG.Job) {
return (

View File

@ -66,8 +66,8 @@ const mutations: MutationTree<ScheduleInterface> = {
addEventType(state, eventType: EventType) {
state.eventTypes.unshift(eventType);
},
removeEventType(state, name: string) {
const index = state.eventTypes.findIndex(item => item.name == name);
removeEventType(state, id: number) {
const index = state.eventTypes.findIndex(item => item.id == id);
state.eventTypes.splice(index, 1);
},
setEventType(state, eventType: EventType) {
@ -83,8 +83,12 @@ const mutations: MutationTree<ScheduleInterface> = {
state.events = events;
},
updateEvent(state, event: FG.Event) {
let eventToChange = state.events.find(ev => ev.id == event.id);
eventToChange = event;
/*let eventToChange = state.events.find(ev => ev.id == event.id);
eventToChange = event; */
const index = state.events.findIndex(ev => ev.id == event.id);
if (index > -1) {
state.events[index] = event;
}
}
};
@ -157,7 +161,7 @@ const actions: ActionTree<ScheduleInterface, StateInterface> = {
console.warn(err);
});
},
removeEventType({ commit }, data: string) {
removeEventType({ commit }, data: number) {
axios
.delete(`/schedule/event-types/${data}`)
.then(() => {
@ -199,6 +203,7 @@ const actions: ActionTree<ScheduleInterface, StateInterface> = {
updateInformation.service
)
.then((response: AxiosResponse<FG.Event>) => {
response.data.start = new Date(response.data.start);
commit('updateEvent', response.data);
})
.catch(err => {