Skip to content

Commit

Permalink
fix(views): add go-back-button to user-subs view
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Nov 15, 2021
1 parent 877fd12 commit e0ec91a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/views/user-subscriptions/UserSubscriptions.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.user-subscriptions {
&__header {
margin-top: var(--spacing-unit);
display: flex;
justify-content: space-between;
gap: var(--spacing-unit);
Expand Down
25 changes: 21 additions & 4 deletions src/views/user-subscriptions/UserSubscriptions.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<div class="user-subscriptions">
<ViewHeader>
<template #left>
<GoBackButton />
</template>
</ViewHeader>
<div class="user-subscriptions__header">
<div class="user-subscriptions__header__left">
<h1>
Expand Down Expand Up @@ -51,15 +56,19 @@ import { useOrganizations } from "@/state/organizations.js";
import { useSubscriptions } from "@/state/subscriptions.js";
// Components
import ViewHeader from "@/components/generic/view-header/ViewHeader.vue";
import GoBackButton from "@/components/specific/app/go-back-button/GoBackButton.vue";
import BillingsTable from "@/components/specific/subscriptions/billings-table/BillingsTable.vue";
import InvoicesTable from "@/components/specific/subscriptions/invoices-table/InvoicesTable.vue";
import SubscribeCard from "@/components/specific/subscriptions/subscribe-card/SubscribeCard.vue";
export default {
components: {
BillingsTable,
GoBackButton,
InvoicesTable,
SubscribeCard
SubscribeCard,
ViewHeader
},
setup() {
const { userOrganizations } = useOrganizations();
Expand All @@ -85,9 +94,17 @@ export default {
);
let allPayments = await Promise.all(
subscriptions.value.map(sub => {
return loadSubscriptionPayments(selectedOrga.value, sub.cloud, sub);
})
subscriptions.value
// TODO: this is to avoid errors when fetching payments of a deleted space.
// Should be removed when a solution is found.
.filter(sub => sub.cloud)
.map(sub => {
return loadSubscriptionPayments(
selectedOrga.value,
sub.cloud,
sub
);
})
);
const tomorrow = new Date();
Expand Down

0 comments on commit e0ec91a

Please sign in to comment.