# HG changeset patch # User Sascha L. Teichmann # Date 1562589282 -7200 # Node ID 8e47d6f129984c45ddb72251711cb5c96a6bfd61 # Parent eb3896cca80a8617f4283295fcbe5c4a4b9e926e# Parent 387f239018c7fa82134e64f9a4783cee2f3ba860 Merged default into sld-colors branch. diff -r eb3896cca80a -r 8e47d6f12998 client/src/components/Pdftool.vue --- a/client/src/components/Pdftool.vue Fri Jul 05 15:15:59 2019 +0200 +++ b/client/src/components/Pdftool.vue Mon Jul 08 14:34:42 2019 +0200 @@ -108,12 +108,14 @@ import { displayError } from "@/lib/errors"; import { pdfgen, templateLoader } from "@/lib/mixins"; -var paperSizes = { +const paperSizes = { // in millimeter, landscape [width, height] a3: [420, 297], a4: [297, 210] }; +const DEFAULT_TEMPLATE = "Default"; + export default { mixins: [pdfgen, templateLoader], name: "pdftool", @@ -128,7 +130,7 @@ }, templates: [ { - name: "Default", + name: DEFAULT_TEMPLATE, properties: { format: "landscape", paperSize: "a4", @@ -150,7 +152,7 @@ }, { type: "northarrow", - position: "topright", + position: "topleft", offset: { x: 6, y: 4 }, size: 2 } @@ -210,20 +212,17 @@ // When a template is chosen from the dropdown, its propoerties are // applied to the rest of the form. applyTemplateToForm() { - if (this.form.template) { + if (this.form.template && this.form.template.name !== DEFAULT_TEMPLATE) { this.loadTemplates( `/templates/${this.form.template.type}/${this.form.template.name}` ) .then(response => { this.prepareImages(response.data.template_data.elements).then( values => { - this.templateData = response.data.template_data; values.forEach(v => { response.data.template_data.elements[v.index].url = v.url; }); - this.form.format = this.templateData.properties.format; - this.form.paperSize = this.templateData.properties.paperSize; - this.form.resolution = this.templateData.properties.resolution; + this.setTemplate(response.data.template_data); } ); }) @@ -234,8 +233,16 @@ message: `${status}: ${data.message || data}` }); }); + } else { + this.setTemplate(this.templates[0]); } }, + setTemplate(template) { + this.templateData = template; + this.form.format = this.templateData.properties.format; + this.form.paperSize = this.templateData.properties.paperSize; + this.form.resolution = this.templateData.properties.resolution; + }, download() { // disable button while working on it this.readyToGenerate = false; @@ -803,8 +810,8 @@ }) .then(response => { if (response.data.length) { - this.templates = response.data; - this.form.template = this.templates[0]; + this.templates = [...this.templates, ...response.data]; + this.form.template = this.templates[1]; this.applyTemplateToForm(); } else { this.form.template = this.templates[0]; diff -r eb3896cca80a -r 8e47d6f12998 client/src/components/importconfiguration/ScheduledImports.vue --- a/client/src/components/importconfiguration/ScheduledImports.vue Fri Jul 05 15:15:59 2019 +0200 +++ b/client/src/components/importconfiguration/ScheduledImports.vue Mon Jul 08 14:34:42 2019 +0200 @@ -763,7 +763,9 @@ this.retry = this.currentSchedule.trys === null || this.currentSchedule.trys === undefined || - this.currentSchedule === 0 ? false : true; + this.currentSchedule === 0 + ? false + : true; }, isWeekly(cron) { return /0 \d{1,2} \d{1,2} \* \* \d{1}/.test(cron);