Mercurial > gemma
comparison client/src/components/importoverview/ImportOverview.vue @ 2789:c1e832f77726
import_overview: setting a sane default window in case of reload
When the overview is initially opened the default window is
start: begin of current hour
end: end of current hour
depending on interval size the window is widened to e.g. begin and
end of day.
When a reload is triggered, the reload puts "now" within the selected
window
when the window was 'hour' it uses
start: begin of current hour
end: end of current hour
which should behave consistent.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 25 Mar 2019 11:03:23 +0100 |
parents | 9a7d4caa1b77 |
children | 718ec88fbeed |
comparison
equal
deleted
inserted
replaced
2788:ff3b89ff07bd | 2789:c1e832f77726 |
---|---|
2 <div class="overview"> | 2 <div class="overview"> |
3 <UIBoxHeader | 3 <UIBoxHeader |
4 icon="clipboard-check" | 4 icon="clipboard-check" |
5 :title="importReviewLabel" | 5 :title="importReviewLabel" |
6 :closeCallback="$parent.close" | 6 :closeCallback="$parent.close" |
7 :actions="[{ callback: loadLogs, icon: 'redo' }]" | 7 :actions="[{ callback: loadUpdatedLogs, icon: 'redo' }]" |
8 /> | 8 /> |
9 <div class="position-relative"> | 9 <div class="position-relative"> |
10 <transition name="fade"> | 10 <transition name="fade"> |
11 <div class="loading" v-if="loading"> | 11 <div class="loading" v-if="loading"> |
12 <font-awesome-icon icon="spinner" spin /> | 12 <font-awesome-icon icon="spinner" spin /> |
231 this.$store.commit("imports/setEndDate", end); | 231 this.$store.commit("imports/setEndDate", end); |
232 this.loadLogs(); | 232 this.loadLogs(); |
233 }, | 233 }, |
234 filteredImports() { | 234 filteredImports() { |
235 return this.imports; | 235 return this.imports; |
236 }, | |
237 loadUpdatedLogs() { | |
238 const [start, end] = this.determineInterval(new Date()); | |
239 this.$store.commit("imports/setStartDate", start); | |
240 this.$store.commit("imports/setEndDate", end); | |
241 this.loadLogs(); | |
236 }, | 242 }, |
237 loadLogs() { | 243 loadLogs() { |
238 this.loading = true; | 244 this.loading = true; |
239 this.$store | 245 this.$store |
240 .dispatch("imports/getImports", { | 246 .dispatch("imports/getImports", { |