Commit 31f07bce authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'vs/fix-actual-plan-name' into 'master'

Fix displaying the actual plan name on the billings page

See merge request gitlab-org/gitlab!67572
parents 2231f183 6acefc49
...@@ -59,6 +59,9 @@ export default { ...@@ -59,6 +59,9 @@ export default {
availableTrialAction: { availableTrialAction: {
default: null, default: null,
}, },
trialPlanName: {
default: '',
},
}, },
computed: { computed: {
...mapState([ ...mapState([
...@@ -192,7 +195,7 @@ export default { ...@@ -192,7 +195,7 @@ export default {
v-if="availableTrialAction" v-if="availableTrialAction"
:namespace-id="namespaceId" :namespace-id="namespaceId"
:action="availableTrialAction" :action="availableTrialAction"
:plan-name="planName" :plan-name="trialPlanName"
class="gl-mr-3" class="gl-mr-3"
/> />
<gl-button <gl-button
......
...@@ -25,6 +25,7 @@ export default (containerId = 'js-billing-plans') => { ...@@ -25,6 +25,7 @@ export default (containerId = 'js-billing-plans') => {
freePersonalNamespace, freePersonalNamespace,
refreshSeatsHref, refreshSeatsHref,
action, action,
trialPlanName,
} = containerEl.dataset; } = containerEl.dataset;
return new Vue({ return new Vue({
...@@ -42,6 +43,7 @@ export default (containerId = 'js-billing-plans') => { ...@@ -42,6 +43,7 @@ export default (containerId = 'js-billing-plans') => {
freePersonalNamespace: parseBoolean(freePersonalNamespace), freePersonalNamespace: parseBoolean(freePersonalNamespace),
refreshSeatsHref, refreshSeatsHref,
availableTrialAction: action, availableTrialAction: action,
trialPlanName,
}, },
render(createElement) { render(createElement) {
return createElement(SubscriptionApp); return createElement(SubscriptionApp);
......
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import ExtendReactivateTrialButton from 'ee/trials/extend_reactivate_trial/components/extend_reactivate_trial_button.vue'; import ExtendReactivateTrialButton from 'ee/trials/extend_reactivate_trial/components/extend_reactivate_trial_button.vue';
export const initExtendReactivateTrialButton = (el) => { export const initExtendReactivateTrialButton = (el) => {
const { namespaceId, action, planName } = el.dataset; const { namespaceId, action, trialPlanName } = el.dataset;
return new Vue({ return new Vue({
el, el,
...@@ -10,7 +10,7 @@ export const initExtendReactivateTrialButton = (el) => { ...@@ -10,7 +10,7 @@ export const initExtendReactivateTrialButton = (el) => {
return createElement(ExtendReactivateTrialButton, { return createElement(ExtendReactivateTrialButton, {
props: { props: {
namespaceId: Number(namespaceId), namespaceId: Number(namespaceId),
planName, planName: trialPlanName,
action, action,
}, },
}); });
......
...@@ -69,7 +69,7 @@ module EE ...@@ -69,7 +69,7 @@ module EE
{ {
namespace_id: namespace.id, namespace_id: namespace.id,
plan_name: ::Plan::ULTIMATE.titleize, trial_plan_name: ::Plan::ULTIMATE.titleize,
action: action action: action
} }
end end
......
...@@ -234,7 +234,7 @@ RSpec.describe EE::TrialHelper do ...@@ -234,7 +234,7 @@ RSpec.describe EE::TrialHelper do
allow(namespace).to receive(:trial_extended_or_reactivated?).and_return(false) allow(namespace).to receive(:trial_extended_or_reactivated?).and_return(false)
end end
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: nil })} it { is_expected.to eq({ namespace_id: 1, trial_plan_name: 'Ultimate', action: nil })}
end end
context 'when trial can be reactivated' do context 'when trial can be reactivated' do
...@@ -245,7 +245,7 @@ RSpec.describe EE::TrialHelper do ...@@ -245,7 +245,7 @@ RSpec.describe EE::TrialHelper do
allow(namespace).to receive(:free_plan?).and_return(true) allow(namespace).to receive(:free_plan?).and_return(true)
end end
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: nil }) } it { is_expected.to eq({ namespace_id: 1, trial_plan_name: 'Ultimate', action: nil }) }
end end
end end
...@@ -254,7 +254,7 @@ RSpec.describe EE::TrialHelper do ...@@ -254,7 +254,7 @@ RSpec.describe EE::TrialHelper do
allow(namespace).to receive(:can_extend_trial?).and_return(true) allow(namespace).to receive(:can_extend_trial?).and_return(true)
end end
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: 'extend' }) } it { is_expected.to eq({ namespace_id: 1, trial_plan_name: 'Ultimate', action: 'extend' }) }
end end
context 'when trial can be reactivated' do context 'when trial can be reactivated' do
...@@ -262,7 +262,7 @@ RSpec.describe EE::TrialHelper do ...@@ -262,7 +262,7 @@ RSpec.describe EE::TrialHelper do
allow(namespace).to receive(:can_reactivate_trial?).and_return(true) allow(namespace).to receive(:can_reactivate_trial?).and_return(true)
end end
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: 'reactivate' }) } it { is_expected.to eq({ namespace_id: 1, trial_plan_name: 'Ultimate', action: 'reactivate' }) }
end end
end end
end end
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