Skip to content

Commit

Permalink
Small YETI fixes
Browse files Browse the repository at this point in the history
* translate cannot be applied on slots because of key extraction, but my fix was bad. We have to introduce some extra span element
* moment doesn't exist anymore -> date-fns
  • Loading branch information
Bruno Besson committed Mar 23, 2021
1 parent 757e264 commit 41be420
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/yeti/SubPanelBra.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="yeti-subpanel">
<sub-panel-title v-translate>Danger level</sub-panel-title>
<sub-panel-title><span v-translate>Danger level</span></sub-panel-title>
<div class="columns is-mobile">
<div class="column">
<div class="inputs-bra" :class="{ 'inputs-bra-different': bra.isDifferent }">
Expand Down
13 changes: 7 additions & 6 deletions src/components/yeti/SubPanelCourse.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="yeti-subpanel">
<sub-panel-title v-translate>Route</sub-panel-title>
<sub-panel-title><span v-translate>Route</span></sub-panel-title>
<div v-if="features.length">
<div class="columns is-mobile">
<div class="column">
Expand Down Expand Up @@ -39,7 +39,7 @@
<p class="yetiform-info is-italic is-marginless" v-translate>Lines chunks</p>
<features-list :features="features" :map="map" />
</div>
<sub-panel-title v-translate>Export</sub-panel-title>
<sub-panel-title><span v-translate>Export</span></sub-panel-title>
<div class="columns is-vcentered is-mobile">
<div class="column">
<ul class="form-export">
Expand Down Expand Up @@ -111,6 +111,8 @@
</template>

<script>
import { format } from 'date-fns';
import FeaturesList from '@/components/yeti/FeaturesList.vue';
import SubPanelTitle from '@/components/yeti/SubPanelTitle.vue';
import ol from '@/js/libs/ol';
Expand Down Expand Up @@ -206,22 +208,21 @@ export default {
}
},
downloadFeatures(format, extension, mimetype) {
downloadFeatures(olFormat, extension, mimetype) {
const features = this.features;
features[0].set('name', this.featuresTitle);
const filename = this.setFilename(extension);
const content = format.writeFeatures(features, {
const content = olFormat.writeFeatures(features, {
featureProjection: 'EPSG:3857',
});
utils.download(content, filename, mimetype + ';charset=utf-8');
},
setFilename(ext) {
let date = this.$moment.parseDate(new Date());
return date.format('YYYY-MM-DD_HH-mm-ss') + ext;
return format(new Date(), 'yyyy-MM-dd_HH-mm-ss') + ext;
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/yeti/SubPanelMethods.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="yeti-subpanel">
<sub-panel-title v-translate>Methods</sub-panel-title>
<sub-panel-title><span v-translate>Methods</span></sub-panel-title>
<div class="columns is-mobile yetitabs">
<div v-for="item of Object.keys(methods)" :key="item" class="column yetitab">
<div class="control yetitab-control" :class="{ 'yetitab-control--selected': method.type === item }">
Expand Down

0 comments on commit 41be420

Please sign in to comment.