From f2718734f663bf0c098f4872c8919f657ce6142a Mon Sep 17 00:00:00 2001 From: NickolaiYurchenko Date: Mon, 15 Mar 2021 19:57:17 +0200 Subject: [PATCH] web/storagenode: bug fixes WHAT: - fix for wrong total held calcutation on refresh - payout history year restrictions depends on selected satellite fixed - payout history total changed if distributed amount > 0 - dark mode info icon colors changed - option menu closing issue fixed Change-Id: Ia289d51f081b782ae601722b7c05c3307f56541d --- .../src/app/components/OptionsDropdown.vue | 17 +++++++++-------- .../src/app/components/SNOHeader.vue | 4 ++-- .../app/components/payments/EstimationArea.vue | 14 +++++++++++++- .../payments/PayoutHistoryPeriodCalendar.vue | 5 +++-- .../payments/PayoutHistoryTableItem.vue | 2 +- web/storagenode/static/styles/_variables.scss | 4 ++++ .../__snapshots__/EstimationArea.spec.ts.snap | 10 +++++----- .../PayoutHistoryTableItem.spec.ts.snap | 4 ++-- 8 files changed, 39 insertions(+), 21 deletions(-) diff --git a/web/storagenode/src/app/components/OptionsDropdown.vue b/web/storagenode/src/app/components/OptionsDropdown.vue index 8a836ca53..9573a31d1 100644 --- a/web/storagenode/src/app/components/OptionsDropdown.vue +++ b/web/storagenode/src/app/components/OptionsDropdown.vue @@ -3,11 +3,11 @@ @@ -31,7 +31,7 @@ export default class OptionsDropdown extends Vue { /** * Uses for switching mode. */ - public darkMode: boolean = false; + public isDarkMode: boolean = false; /** * Lifecycle hook after initial render. @@ -52,7 +52,7 @@ export default class OptionsDropdown extends Vue { htmlElement.setAttribute('theme', theme); const isDarkMode = theme === SNO_THEME.DARK; - this.darkMode = isDarkMode; + this.isDarkMode = isDarkMode; this.$store.dispatch(APPSTATE_ACTIONS.SET_DARK_MODE, isDarkMode); } @@ -63,12 +63,12 @@ export default class OptionsDropdown extends Vue { this.$emit('closeDropdown'); } - @Watch('darkMode') + @Watch('isDarkMode') private changeMode(): void { - this.$store.dispatch(APPSTATE_ACTIONS.SET_DARK_MODE, this.darkMode); + this.$store.dispatch(APPSTATE_ACTIONS.SET_DARK_MODE, this.isDarkMode); const htmlElement = document.documentElement; - if (this.darkMode) { + if (this.isDarkMode) { localStorage.setItem('theme', SNO_THEME.DARK); htmlElement.setAttribute('theme', SNO_THEME.DARK); @@ -96,6 +96,7 @@ export default class OptionsDropdown extends Vue { font-family: 'font_regular', sans-serif; font-size: 14px; color: var(--regular-text-color); + cursor: pointer; &__mode { display: flex; diff --git a/web/storagenode/src/app/components/SNOHeader.vue b/web/storagenode/src/app/components/SNOHeader.vue index 553af254a..455799a15 100644 --- a/web/storagenode/src/app/components/SNOHeader.vue +++ b/web/storagenode/src/app/components/SNOHeader.vue @@ -181,7 +181,7 @@ export default class SNOHeader extends Vue { } try { - await this.$store.dispatch(PAYOUT_ACTIONS.GET_ESTIMATION, this.$store.state.node.selectedSatellite.id); + await this.$store.dispatch(PAYOUT_ACTIONS.GET_ESTIMATION, selectedSatelliteId); } catch (error) { console.error(error); } @@ -190,7 +190,7 @@ export default class SNOHeader extends Vue { try { await this.$store.dispatch(PAYOUT_ACTIONS.GET_PAYOUT_INFO, selectedSatelliteId); - await this.$store.dispatch(PAYOUT_ACTIONS.GET_TOTAL); + await this.$store.dispatch(PAYOUT_ACTIONS.GET_TOTAL, selectedSatelliteId); } catch (error) { console.error(error.message); } diff --git a/web/storagenode/src/app/components/payments/EstimationArea.vue b/web/storagenode/src/app/components/payments/EstimationArea.vue index a9c815673..4cedb3f5c 100644 --- a/web/storagenode/src/app/components/payments/EstimationArea.vue +++ b/web/storagenode/src/app/components/payments/EstimationArea.vue @@ -4,7 +4,7 @@