Commit 6acefc49 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Fix displaying the actual plan name on the billings page

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