From b91f72f08a1e9c082f2998374f1b24c2a0c0c658 Mon Sep 17 00:00:00 2001 From: Vitalii Date: Mon, 8 May 2023 17:31:08 +0300 Subject: [PATCH] web/satellite: added limit cards on project dashboard Added storage, bandwidth, segment, free tier and coupon cards to project dashboard. Issue: https://github.com/storj/storj/issues/5827 Change-Id: Iaf974273a34c8ed3faf1974876fa685074d5ae61 --- .../upgradeAccountFlow/UpgradeInfoStep.vue | 4 +- .../components/project/EditProjectDetails.vue | 4 +- .../project/dashboard/LimitCard.vue | 158 +++++++++ .../project/dashboard/LimitsArea.vue | 328 ++++++++++++++++++ .../project/dashboard/ProjectDashboard.vue | 9 +- .../static/images/project/checkmark.svg | 3 + web/satellite/static/images/project/cloud.svg | 3 + .../static/images/project/download.svg | 3 + .../static/images/project/segment.svg | 3 + 9 files changed, 509 insertions(+), 6 deletions(-) create mode 100644 web/satellite/src/components/project/dashboard/LimitCard.vue create mode 100644 web/satellite/src/components/project/dashboard/LimitsArea.vue create mode 100644 web/satellite/static/images/project/checkmark.svg create mode 100644 web/satellite/static/images/project/cloud.svg create mode 100644 web/satellite/static/images/project/download.svg create mode 100644 web/satellite/static/images/project/segment.svg diff --git a/web/satellite/src/components/modals/upgradeAccountFlow/UpgradeInfoStep.vue b/web/satellite/src/components/modals/upgradeAccountFlow/UpgradeInfoStep.vue index 12fec0e81..4eb7f535c 100644 --- a/web/satellite/src/components/modals/upgradeAccountFlow/UpgradeInfoStep.vue +++ b/web/satellite/src/components/modals/upgradeAccountFlow/UpgradeInfoStep.vue @@ -19,8 +19,8 @@
- - + +
diff --git a/web/satellite/src/components/project/EditProjectDetails.vue b/web/satellite/src/components/project/EditProjectDetails.vue index 391175cb4..79c156cd1 100644 --- a/web/satellite/src/components/project/EditProjectDetails.vue +++ b/web/satellite/src/components/project/EditProjectDetails.vue @@ -535,7 +535,7 @@ async function onSaveStorageLimitButtonClick(): Promise { toggleStorageLimitEditing(); analytics.eventTriggered(AnalyticsEvent.PROJECT_STORAGE_LIMIT_UPDATED); - await notify.success('Project storage limit updated successfully!'); + notify.success('Project storage limit updated successfully!'); } /** @@ -560,7 +560,7 @@ async function onSaveBandwidthLimitButtonClick(): Promise { toggleBandwidthLimitEditing(); analytics.eventTriggered(AnalyticsEvent.PROJECT_BANDWIDTH_LIMIT_UPDATED); - await notify.success('Project bandwidth limit updated successfully!'); + notify.success('Project bandwidth limit updated successfully!'); } /** diff --git a/web/satellite/src/components/project/dashboard/LimitCard.vue b/web/satellite/src/components/project/dashboard/LimitCard.vue new file mode 100644 index 000000000..f0819f774 --- /dev/null +++ b/web/satellite/src/components/project/dashboard/LimitCard.vue @@ -0,0 +1,158 @@ +// Copyright (C) 2023 Storj Labs, Inc. +// See LICENSE for copying information. + + + + + + diff --git a/web/satellite/src/components/project/dashboard/LimitsArea.vue b/web/satellite/src/components/project/dashboard/LimitsArea.vue new file mode 100644 index 000000000..5083c324c --- /dev/null +++ b/web/satellite/src/components/project/dashboard/LimitsArea.vue @@ -0,0 +1,328 @@ +// Copyright (C) 2023 Storj Labs, Inc. +// See LICENSE for copying information. + + + + + + diff --git a/web/satellite/src/components/project/dashboard/ProjectDashboard.vue b/web/satellite/src/components/project/dashboard/ProjectDashboard.vue index 56f1b7a4c..4a7e2cee6 100644 --- a/web/satellite/src/components/project/dashboard/ProjectDashboard.vue +++ b/web/satellite/src/components/project/dashboard/ProjectDashboard.vue @@ -103,6 +103,7 @@ +
=> { appStore.toggleHasJustLoggedIn(); } - await projectsStore.getDailyProjectData({ since: past, before: now }); - await billingStore.getProjectUsageAndChargesCurrentRollup(); + await Promise.all([ + projectsStore.getDailyProjectData({ since: past, before: now }), + billingStore.getProjectUsageAndChargesCurrentRollup(), + billingStore.getCoupon(), + ]); } catch (error) { await notify.error(error.message, AnalyticsErrorEventSource.PROJECT_DASHBOARD_PAGE); } finally { diff --git a/web/satellite/static/images/project/checkmark.svg b/web/satellite/static/images/project/checkmark.svg new file mode 100644 index 000000000..90cd591c9 --- /dev/null +++ b/web/satellite/static/images/project/checkmark.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/project/cloud.svg b/web/satellite/static/images/project/cloud.svg new file mode 100644 index 000000000..518f178c6 --- /dev/null +++ b/web/satellite/static/images/project/cloud.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/project/download.svg b/web/satellite/static/images/project/download.svg new file mode 100644 index 000000000..8bf9e6d22 --- /dev/null +++ b/web/satellite/static/images/project/download.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/project/segment.svg b/web/satellite/static/images/project/segment.svg new file mode 100644 index 000000000..87c31f518 --- /dev/null +++ b/web/satellite/static/images/project/segment.svg @@ -0,0 +1,3 @@ + + +