Move hand raise lead routes definition to the backend
What does this MR do and why?
Currently hand raise lead route is hardcoded in the js file.
Rails provides this route definition via routing file defined here.
Hardcoding it in the js files can lead to confusion and upkeep that could be avoided if we used the SSOT that has been provided by rails via definition of the route in the routing file.
How to set up and validate locally
- Setup gdk to simulate SaaS - https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance and restart GDK
- Make sure new navigation sidebar is enabled:
- Open network tab in browser console.
- Create new group. Visit Settings -> Billing.
- Click
Talk to an expert today
. Submit contact sales form. - Make sure there is request to
/-/subscriptions/hand_raise_leads
:
- Start new trial for that group. Locally can be achieved via:
bin/rails c
GitlabSubscription.find_or_create_by(namespace_id: Group.last).update(trial_starts_on: Date.yesterday, trial: true, trial_ends_on: 1.year.from_now, hosted_plan: Plan.find_by(name: 'ultimate_trial'))
- Reload page. Click
Contact sales
. Submit contact sales form. - Make sure there is request to
/-/subscriptions/hand_raise_leads
. - Click trial widget ->
Contact sales
. Submit contact sales form:
- Make sure there is request to
/-/subscriptions/hand_raise_leads
. - Switch to old navigation.
- Click trial widget ->
Contact sales
. Submit contact sales form: - Make sure there is request to
/-/subscriptions/hand_raise_leads
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #416386 (closed)
Edited by Serhii Yarynovskyi