Move `:trial_started` disabled message to helper
Description
There's some coupling within a message used in a shared component to the outer context. Let's see if we can move that message to the co-located context. The proposal is in the Context
below
Context
The following discussion from !83156 (merged) should be addressed:
-
@pslaughter started a discussion: suggestion (non-blocking): This message has coupled to it the context of being the
:trial_started
link, but the only check we have here is if the link is!enabled
. This means, if any other link happened to be!enabled
we'd show a message about ultimate trials🤔 WDYT of moving this message to the
onboarding_actions_data
helper? We could even have a default message we use here.Here's a patch for what I'm suggesting:
diff --git a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue index 1912477758b..5e099f960c5 100644 --- a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue +++ b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue @@ -21,7 +21,7 @@ export default { }, i18n: { trialOnly: s__('LearnGitlab|Trial only'), - contactAdmin: s__('LearnGitlab|Contact your administrator to start a free Ultimate trial.'), + contactAdmin: s__('LearnGitlab|Contact your administrator to perform this action.'), viewAdminList: s__('LearnGitlab|View administrator list'), watchHow: __('Watch how'), }, @@ -113,7 +113,7 @@ export default { triggers="hover focus" data-testid="contact-admin-popover" > - <p>{{ $options.i18n.contactAdmin }}</p> + <p>{{ value.disabled_message || $options.i18n.contactAdmin }}</p> <gl-link :href="value.url" class="font-size-inherit" diff --git a/ee/app/helpers/ee/learn_gitlab_helper.rb b/ee/app/helpers/ee/learn_gitlab_helper.rb index 65cbf293342..f0c0377165b 100644 --- a/ee/app/helpers/ee/learn_gitlab_helper.rb +++ b/ee/app/helpers/ee/learn_gitlab_helper.rb @@ -40,6 +40,7 @@ def onboarding_actions_data(project) if ::Gitlab::CurrentSettings.should_check_namespace_plan? && !can_start_trial?(project) action_urls[:trial_started][:enabled] = false + action_urls[:trial_started][:disabled_message] = s_('LearnGitlab|Contact your administrator to start a free Ultimate trial.') end action_urls
This looks like it still works:
I can create a follow-up for this
😄