diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4357b3c..c1efc42 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ * :racehorse: `:racehorse:` when improving performance * :non-potable_water: `:non-potable_water:` when plugging memory leaks * :memo: `:memo:` when writing docs - * :penguin: `: :` when fixing something on Linux + * :penguin: `:penguin:` when fixing something on Linux * :apple: `:apple:` when fixing something on macOS * :checkered_flag: `:checkered_flag:` when fixing something on Windows * :bug: `:bug:` when fixing a bug diff --git a/electron/package.json b/electron/package.json index fa6120b..919801b 100644 --- a/electron/package.json +++ b/electron/package.json @@ -1,6 +1,6 @@ { "name": "ec-verwaltungs-app", - "version": "1.1.1", + "version": "1.1.2", "description": "EC-Verwaltungs Application", "keywords": [], "homepage": "https://ec-nordbund.de", diff --git a/package.json b/package.json index 99426da..a3bee4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ec-verwaltungs-app", - "version": "1.1.1", + "version": "1.1.2", "description": "EC-Verwaltungs Application", "keywords": [], "homepage": "https://ec-nordbund.de", diff --git a/src/plugins/formConfig/index.ts b/src/plugins/formConfig/index.ts index e7f9a25..f05d301 100644 --- a/src/plugins/formConfig/index.ts +++ b/src/plugins/formConfig/index.ts @@ -1,10 +1,10 @@ import { - rule, - required, - maxLength, + exactLength, inArray, - exactLength -} from '@/plugins/rules' + maxLength, + required, + rule + } from '@/plugins/rules'; interface IConfig { label?: string @@ -178,7 +178,7 @@ export const akConfig: IConfig = { } export const ecKreisConfig: IConfig = { - name: 'ecKreisID', + name: 'ecKreis', label: 'Wähle einen EC-Kreis', componentName: 'ec-select-ecKreis', clearable: true @@ -313,4 +313,4 @@ export const maxTNConfig: IConfig = { step: 1, 'thumb-label': true, required: true -} \ No newline at end of file +} diff --git a/src/plugins/updateChecker.ts b/src/plugins/updateChecker.ts index 87dd7a4..196367a 100644 --- a/src/plugins/updateChecker.ts +++ b/src/plugins/updateChecker.ts @@ -1,61 +1,44 @@ -import version, { - isPrerelease -} from '@/plugins/version/version' - -import electron, { - isElectron, - isProduction -} from '@/plugins/electron' +import electron, { isElectron, isProduction } from '@/plugins/electron'; +import version, { isPrerelease } from '@/plugins/version/version'; // Wenn isElectron + isProduction Chack für Upates -if (isElectron && isProduction) { - ;(async () => { - // get fetcher - const fetch = eval("require('node-fetch')") - - // querx - const res = await fetch( - 'https://api.github.com/repos/ecnordbund/ec-verwaltungs-app/releases' - ) - - // get Result - const resultJSON: Array<{ - prerelease: boolean - tag_name: string - published_at: string - assets: Array<{ - name: string - browser_download_url: string - }> - }> = await res.json() - - const latest = resultJSON.filter( - v => v.prerelease === isPrerelease - )[0] - - if (latest.tag_name === `v${version}`) { - return +;(async () => { + // get fetcher + const fetch = eval("require('node-fetch')") + + // querx + const res = await fetch('https://ec-api.de/version') + + // get Result + const resultJSON: { + version: string + } = await res.json() + + if (version !== resultJSON.version) { + let url = '' + + switch (eval("require('os').platform()")) { + case 'win32': + url = `https://github.com/EC-Nordbund/ec-verwaltungs-app/releases/download/v${ + resultJSON.version + }/EC-Verwaltungs-App-${ + resultJSON.version + }.Setup.exe` + break + case 'darwin': + url = `https://github.com/EC-Nordbund/ec-verwaltungs-app/releases/download/v${ + resultJSON.version + }/EC-Verwaltungs-App-${resultJSON.version}.dmg` + break + default: + url = `https://github.com/EC-Nordbund/ec-verwaltungs-app/releases/download/v${ + resultJSON.version + }/ec-verwaltungs-app_${ + resultJSON.version + }_amd64.deb` + break } - const url = latest.assets - .map(v => { - const endungsArray = v.name.split('.') - const endung = endungsArray[endungsArray.length - 1] - return { - url: v.browser_download_url, - endung - } - }) - .filter( - v => - v.endung === - ({ - win32: 'exe', - darwin: 'dmg', - linux: 'deb' - })[(window).process.platform] - )[0].url - // show msgBox electron.remote.dialog.showMessageBox( { @@ -73,5 +56,5 @@ Wir empfehlen dir das Update sofort zu installieren! (Dauer: wenige Minuten)`, } } ) - })() -} + } +})() diff --git a/src/views/anmeldungen/details.vue b/src/views/anmeldungen/details.vue index 27e9272..acfc97e 100644 --- a/src/views/anmeldungen/details.vue +++ b/src/views/anmeldungen/details.vue @@ -209,7 +209,6 @@ import { getClient } from '@/plugins/apollo' import event from '@/plugins/eventbus' import {jsZip, Docxtemplater} from '@/plugins/docx' -import {exec} from 'child_process' const loadGQL = gql` query($authToken: String!, $anmeldeID: String!) { @@ -475,7 +474,6 @@ export default class anmeldungsDetails extends reloaderBase { const zipData = new jsZip(fileContent) const briefTemplate = new Docxtemplater() briefTemplate.loadZip(zipData) - console.log(this.data.anmeldung) briefTemplate.setData(this.manageData(this.data.anmeldung)) briefTemplate.render() const fertigerBrief = briefTemplate.getZip().generate({type: 'nodebuffer'}); @@ -483,7 +481,6 @@ export default class anmeldungsDetails extends reloaderBase { const tmpPath = electron.remote.app.getPath('temp').split('\\').join('/') const tmpFile = tmpPath + '/' + Math.random().toString(36).substring(7) + '.docx' fs.writeFileSync(tmpFile, fertigerBrief) - console.log(tmpFile) eval(`require('child_process').exec('start ${tmpFile}')`) } else { alert('Kein Brief ausgewählt.') diff --git a/src/views/personen/details.vue b/src/views/personen/details.vue index 30a183b..ca88e39 100644 --- a/src/views/personen/details.vue +++ b/src/views/personen/details.vue @@ -1,12 +1,19 @@