Commit 398ddd20 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch 'vs/ci-purchase-follow-ups' into 'master'

Switch to GlCollapse component

See merge request gitlab-org/gitlab!64982
parents 3c4021d2 cf06f7c2
<script> <script>
import { GlIcon } from '@gitlab/ui'; import { GlIcon, GlCollapse, GlCollapseToggleDirective } from '@gitlab/ui';
import STATE_QUERY from 'ee/subscriptions/graphql/queries/state.query.graphql'; import stateQuery from 'ee/subscriptions/graphql/queries/state.query.graphql';
import { TAX_RATE, NEW_GROUP } from 'ee/subscriptions/new/constants'; import { TAX_RATE, NEW_GROUP } from 'ee/subscriptions/new/constants';
import formattingMixins from 'ee/subscriptions/new/formatting_mixins'; import formattingMixins from 'ee/subscriptions/new/formatting_mixins';
import { sprintf, s__ } from '~/locale'; import { sprintf, s__ } from '~/locale';
...@@ -10,6 +10,10 @@ export default { ...@@ -10,6 +10,10 @@ export default {
components: { components: {
SummaryDetails, SummaryDetails,
GlIcon, GlIcon,
GlCollapse,
},
directives: {
GlCollapseToggle: GlCollapseToggleDirective,
}, },
mixins: [formattingMixins], mixins: [formattingMixins],
props: { props: {
...@@ -20,7 +24,7 @@ export default { ...@@ -20,7 +24,7 @@ export default {
}, },
apollo: { apollo: {
state: { state: {
query: STATE_QUERY, query: stateQuery,
manual: true, manual: true,
result({ data }) { result({ data }) {
this.subscription = data.subscription; this.subscription = data.subscription;
...@@ -37,7 +41,7 @@ export default { ...@@ -37,7 +41,7 @@ export default {
subscription: {}, subscription: {},
namespaces: [], namespaces: [],
isSetupForCompany: false, isSetupForCompany: false,
collapsed: true, isBottomSummaryVisible: false,
fullName: null, fullName: null,
customer: {}, customer: {},
selectedPlanId: null, selectedPlanId: null,
...@@ -100,11 +104,6 @@ export default { ...@@ -100,11 +104,6 @@ export default {
); );
}, },
}, },
methods: {
toggleCollapse() {
this.collapsed = !this.collapsed;
},
},
i18n: { i18n: {
title: s__("Checkout|%{name}'s GitLab subscription"), title: s__("Checkout|%{name}'s GitLab subscription"),
}, },
...@@ -117,27 +116,28 @@ export default { ...@@ -117,27 +116,28 @@ export default {
class="order-summary gl-display-flex gl-flex-direction-column gl-flex-grow-1 gl-mt-2 mt-lg-5" class="order-summary gl-display-flex gl-flex-direction-column gl-flex-grow-1 gl-mt-2 mt-lg-5"
> >
<div class="d-lg-none"> <div class="d-lg-none">
<div @click="toggleCollapse"> <div v-gl-collapse-toggle.summary-details>
<h4 class="d-flex justify-content-between gl-font-lg" :class="{ 'gl-mb-7': !collapsed }"> <h4 class="d-flex justify-content-between gl-font-lg">
<div class="d-flex"> <div class="d-flex">
<gl-icon v-if="collapsed" name="chevron-right" :size="18" use-deprecated-sizes /> <gl-icon v-if="isBottomSummaryVisible" name="chevron-down" />
<gl-icon v-else name="chevron-down" :size="18" use-deprecated-sizes /> <gl-icon v-else name="chevron-right" />
<div>{{ titleWithName }}</div> <div>{{ titleWithName }}</div>
</div> </div>
<div class="gl-ml-3">{{ formatAmount(totalAmount, usersPresent) }}</div> <div class="gl-ml-3">{{ formatAmount(totalAmount, usersPresent) }}</div>
</h4> </h4>
</div> </div>
<summary-details <gl-collapse id="summary-details" v-model="isBottomSummaryVisible">
v-show="!collapsed" <summary-details
:vat="vat" :vat="vat"
:total-ex-vat="totalExVat" :total-ex-vat="totalExVat"
:users-present="usersPresent" :users-present="usersPresent"
:selected-plan-text="selectedPlan.name" :selected-plan-text="selectedPlan.name"
:selected-plan-price="selectedPlanPrice" :selected-plan-price="selectedPlanPrice"
:total-amount="totalAmount" :total-amount="totalAmount"
:number-of-users="subscription.quantity" :number-of-users="subscription.quantity"
:tax-rate="$options.taxRate" :tax-rate="$options.taxRate"
/> />
</gl-collapse>
</div> </div>
<div class="d-none d-lg-block"> <div class="d-none d-lg-block">
<div class="append-bottom-20"> <div class="append-bottom-20">
......
...@@ -39,12 +39,14 @@ export default { ...@@ -39,12 +39,14 @@ export default {
default: null, default: null,
}, },
}, },
data() {
return {
startDate: new Date(),
};
},
computed: { computed: {
startDate() {
return new Date(Date.now());
},
endDate() { endDate() {
return new Date(this.startDate).setFullYear(this.startDate.getFullYear() + 1); return this.startDate.setFullYear(this.startDate.getFullYear() + 1);
}, },
}, },
i18n: { i18n: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment