diff --git a/.gitignore b/.gitignore index 0892794..7f6aaf5 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ dist-ssr *.local # Editor directories and files +.vscode .vscode/* !.vscode/extensions.json .idea diff --git a/front-end/src/App.vue b/front-end/src/App.vue index 71e935b..fb6222d 100644 --- a/front-end/src/App.vue +++ b/front-end/src/App.vue @@ -17,13 +17,13 @@ const date = ref(new Date()); const email = ref(""); const failedLogin = ref(false); const isLogged = ref(pb.authStore.isValid); -const org = ref(""); +const organisation = ref(""); const organisations = ref([]); const password = ref(""); const projects = ref([]); const toast = useToast(); -watch(org, async () => { +watch(organisation, async () => { await getProjects(); }); @@ -59,7 +59,7 @@ async function logout() { } async function getProjects() { - const filter = pb.filter("organisation = {:organisation}", { organisation: org.value }); + const filter = pb.filter("organisation = {:organisation}", { organisation: organisation.value }); const records = await pb.collection("projects").getFullList(500, { filter, @@ -72,8 +72,8 @@ async function getProjects() { async function getOrganisations() { const records = await pb.collection("organisations").getFullList(); organisations.value = [...records]; - if (org.value === "" && records.length > 0) { - org.value = records[0].id; + if (organisation.value === "" && records.length > 0) { + organisation.value = records[0].id; } } @@ -88,13 +88,13 @@ function setDate(newDate: Date) { diff --git a/front-end/src/components/EntryTable.vue b/front-end/src/components/EntryTable.vue index 9b8f33e..f6896ab 100644 --- a/front-end/src/components/EntryTable.vue +++ b/front-end/src/components/EntryTable.vue @@ -30,17 +30,17 @@ const props = defineProps<{ projects: Project[]; }>(); -const orgWatch = toRef(() => props.org); -const dateWatch = toRef(() => props.date); -const entries = ref([]); const editingRows = ref([]); +const entries = ref([]); const newEntrySelection = ref(""); +const watchDate = toRef(() => props.date); +const watchOrganisation = toRef(() => props.org); -watch(dateWatch, () => { +watch(watchDate, () => { getEntries().then(); }); -watch(orgWatch, () => { +watch(watchOrganisation, () => { getEntries().then(); }); @@ -69,15 +69,15 @@ const summaries = computed(() => { } const result: { key: string; start: Date; end: Date }[] = []; - let cumsum = 0; + let cumulative_sum = 0; for (const key in minutes) { const start = new Date(props.date.getTime()); start.setHours(8, 0, 0); - start.setMinutes(start.getMinutes() + cumsum); - cumsum += minutes[key]; + start.setMinutes(start.getMinutes() + cumulative_sum); + cumulative_sum += minutes[key]; const end = new Date(props.date.getTime()); end.setHours(8, 0, 0); - end.setMinutes(end.getMinutes() + cumsum); + end.setMinutes(end.getMinutes() + cumulative_sum); result.push({ key, start, end }); }