From cc0fca850edc927df328831fac22d92883b28b49 Mon Sep 17 00:00:00 2001 From: VitaliiShpital Date: Fri, 22 May 2020 16:37:25 +0300 Subject: [PATCH] web/satellite: charges container on billing page reworked WHAT: charges container view was reworked to be more user-friendly WHY: billing UI/UX enhancements Change-Id: Ice663544a1e69742a5c5fcc7123eeaa38bfbf255 --- .../EstimatedCostsAndCredits.vue | 120 ++++-------------- .../UsageAndChargesItem.vue | 81 +++++++----- web/satellite/src/utils/constants/date.ts | 7 + .../src/utils/constants/emptyStatesImages.ts | 50 -------- .../images/account/billing/chargesExpand.svg | 3 + .../images/account/billing/chargesHide.svg | 3 + .../EstimatedCostsAndCredits.spec.ts | 34 ++++- .../UsageAndChargesItem.spec.ts | 6 +- .../EstimatedCostsAndCredits.spec.ts.snap | 58 ++++++--- .../UsageAndChargesItem.spec.ts.snap | 33 ++--- 10 files changed, 177 insertions(+), 218 deletions(-) create mode 100644 web/satellite/src/utils/constants/date.ts delete mode 100644 web/satellite/src/utils/constants/emptyStatesImages.ts create mode 100644 web/satellite/static/images/account/billing/chargesExpand.svg create mode 100644 web/satellite/static/images/account/billing/chargesHide.svg diff --git a/web/satellite/src/components/account/billing/estimatedCostsAndCredits/EstimatedCostsAndCredits.vue b/web/satellite/src/components/account/billing/estimatedCostsAndCredits/EstimatedCostsAndCredits.vue index a2ca5c299..1d0388ce8 100644 --- a/web/satellite/src/components/account/billing/estimatedCostsAndCredits/EstimatedCostsAndCredits.vue +++ b/web/satellite/src/components/account/billing/estimatedCostsAndCredits/EstimatedCostsAndCredits.vue @@ -3,32 +3,16 @@ @@ -39,18 +23,14 @@ import { Component, Vue } from 'vue-property-decorator'; import UsageAndChargesItem from '@/components/account/billing/estimatedCostsAndCredits/UsageAndChargesItem.vue'; import VButton from '@/components/common/VButton.vue'; -import ArrowRightIcon from '@/../static/images/common/BlueArrowRight.svg'; -import ArrowDownIcon from '@/../static/images/common/BlueExpand.svg'; - import { PAYMENTS_ACTIONS } from '@/store/modules/payments'; import { ProjectUsageAndCharges } from '@/types/payments'; +import { MONTHS_NAMES } from '@/utils/constants/date'; @Component({ components: { VButton, UsageAndChargesItem, - ArrowRightIcon, - ArrowDownIcon, }, }) export default class EstimatedCostsAndCredits extends Vue { @@ -67,11 +47,6 @@ export default class EstimatedCostsAndCredits extends Vue { } } - /** - * areProjectUsageAndChargesShown indicates if area with all projects is expanded. - */ - public areProjectUsageAndChargesShown: boolean = false; - /** * projectUsageAndCharges is an array of all stored ProjectUsageAndCharges. */ @@ -87,14 +62,12 @@ export default class EstimatedCostsAndCredits extends Vue { } /** - * toggleUsageChargesPopup is used to open/close area with list of project charges. + * chosenPeriod returns billing period chosen by user. */ - public toggleUsageChargesPopup(): void { - if (this.projectUsageAndCharges.length === 0) { - return; - } + public get chosenPeriod(): string { + const dateFromStore = this.$store.state.paymentsModule.startDate; - this.areProjectUsageAndChargesShown = !this.areProjectUsageAndChargesShown; + return `${MONTHS_NAMES[dateFromStore.getUTCMonth()]} ${dateFromStore.getUTCFullYear()}`; } } @@ -110,29 +83,26 @@ export default class EstimatedCostsAndCredits extends Vue { .current-month-area { margin-bottom: 32px; - padding: 40px; + padding: 40px 40px 0 40px; background-color: #fff; border-radius: 8px; font-family: 'font_regular', sans-serif; - &__title-area { - display: flex; - justify-content: space-between; - align-items: center; - padding-bottom: 40px; - border-bottom: 1px solid rgba(169, 181, 193, 0.3); + &__costs { + font-size: 36px; + line-height: 53px; + color: #384b65; + font-family: 'font_medium', sans-serif; + } - &__title, - &__costs { - font-size: 28px; - line-height: 42px; - font-family: 'font_bold', sans-serif; - color: #354049; - } + &__title { + font-size: 16px; + line-height: 24px; + color: #909090; } &__content { - margin-top: 20px; + margin-top: 35px; &__title { font-size: 16px; @@ -140,53 +110,19 @@ export default class EstimatedCostsAndCredits extends Vue { letter-spacing: 0.04em; text-transform: uppercase; color: #919191; + margin-bottom: 25px; } &__usage-charges { - position: relative; margin: 18px 0 0 0; background-color: #f5f6fa; border-radius: 12px; cursor: pointer; - - &__head { - display: flex; - justify-content: space-between; - align-items: center; - padding: 20px; - - &__name-area { - display: flex; - align-items: center; - - &__image-container { - max-width: 14px; - max-height: 14px; - width: 14px; - height: 14px; - display: flex; - align-items: center; - justify-content: center; - margin-right: 12px; - } - } - } - - &__content { - cursor: default; - max-height: 228px; - overflow-y: auto; - padding: 0 20px; - } } } } .item { - border-top: 1px solid rgba(169, 181, 193, 0.3); - } - - .summary { - user-select: text; + border-top: 1px solid #c7cdd2; } diff --git a/web/satellite/src/components/account/billing/estimatedCostsAndCredits/UsageAndChargesItem.vue b/web/satellite/src/components/account/billing/estimatedCostsAndCredits/UsageAndChargesItem.vue index 5e2fcac99..a612d4c95 100644 --- a/web/satellite/src/components/account/billing/estimatedCostsAndCredits/UsageAndChargesItem.vue +++ b/web/satellite/src/components/account/billing/estimatedCostsAndCredits/UsageAndChargesItem.vue @@ -3,17 +3,15 @@ @@ -52,13 +54,22 @@