From 5926e293aec3895f7f4b41915d371e64020204e0 Mon Sep 17 00:00:00 2001 From: david-loe <56305409+david-loe@users.noreply.github.com> Date: Thu, 22 Aug 2024 15:52:43 +0200 Subject: [PATCH] fix date regex --- common/scripts.ts | 1 - frontend/src/components/expenseReport/ExpenseReportPage.vue | 3 --- frontend/src/components/settings/SettingsPage.vue | 2 +- frontend/src/components/settings/elements/CSVImport.vue | 6 ++---- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/common/scripts.ts b/common/scripts.ts index 54c76835..5378c5a9 100644 --- a/common/scripts.ts +++ b/common/scripts.ts @@ -416,7 +416,6 @@ export function csvToObjects( escape = '"' ) { const lines = csvToArray(csv, separator, escape) - console.log(lines) let result = [] if (lines.length > 1) { const headers = lines[0] diff --git a/frontend/src/components/expenseReport/ExpenseReportPage.vue b/frontend/src/components/expenseReport/ExpenseReportPage.vue index 164c35ba..c111e39f 100644 --- a/frontend/src/components/expenseReport/ExpenseReportPage.vue +++ b/frontend/src/components/expenseReport/ExpenseReportPage.vue @@ -389,9 +389,6 @@ export default defineComponent({ const mails = await this.getExaminerMails() this.mailToLink = mailToLink(mails) this.msTeamsToLink = msTeamsToLink(mails) - console.log(this.expenseReport.editor._id !== this.$root.user._id) - console.log(this.$root.user._id) - console.log(this.expenseReport.editor._id) if (this.$refs.tooltip) { this.tooltip = new Tooltip(this.$refs.tooltip as Element) } diff --git a/frontend/src/components/settings/SettingsPage.vue b/frontend/src/components/settings/SettingsPage.vue index 993a58e4..fca23cb5 100644 --- a/frontend/src/components/settings/SettingsPage.vue +++ b/frontend/src/components/settings/SettingsPage.vue @@ -29,7 +29,7 @@ { path: 'settings.projects', key: 'identifier', array: $root.projects }, { path: 'settings.organisation', key: 'name', array: $root.organisations }, {path: 'loseAccessAt', fn: (val:string) => { - const match = val.match(/^(?[1-3]?\d)\.(?1?\d).(?\d\d\d\d)$/) + const match = val.match(/^(?[0-3]?\d)\.(?[0-1]?\d).(?\d\d\d\d)$/) if(match){ return match.groups!.y + '-' + match.groups!.m.padStart(2, '0') + '-' + match.groups!.d.padStart(2, '0') } diff --git a/frontend/src/components/settings/elements/CSVImport.vue b/frontend/src/components/settings/elements/CSVImport.vue index 414a1b26..babf345a 100644 --- a/frontend/src/components/settings/elements/CSVImport.vue +++ b/frontend/src/components/settings/elements/CSVImport.vue @@ -65,15 +65,13 @@ export default defineComponent({ }, async submit(data: any[]) { const result = await this.$root.setter(this.endpoint, data) - if (result.error) { - console.log(result.error) - } else { + if (result.ok) { this.$emit('imported') } }, downloadTemplate() { //Uint8Array for UTF-8 BOM - const file = new File([new Uint8Array([0xef, 0xbb, 0xbf]), this.genTemplate()], 'template.csv', { type: 'text/csv' }) + const file = new File([new Uint8Array([0xef, 0xbb, 0xbf]), this.genTemplate()], 'CSV Import.csv', { type: 'text/csv' }) download(file) }, genTemplate(seperator = ';', pathSeperator = '.') {