Skip to content
Snippets Groups Projects
Verified Commit fc691181 authored by Vitali Tatarintev's avatar Vitali Tatarintev Committed by GitLab
Browse files

Merge branch '454823-use-full-state-name' into 'master'

Use name field in state selector so that it is used in leads

See merge request !149120



Merged-by: default avatarVitali Tatarintev <vtatarintev@gitlab.com>
Approved-by: default avatarRoy Liu <rliu@gitlab.com>
Approved-by: default avatarThomas Hutterer <thutterer@gitlab.com>
Approved-by: Savas Vedova's avatarSavas Vedova <svedova@gitlab.com>
Approved-by: default avatarVitali Tatarintev <vtatarintev@gitlab.com>
Co-authored-by: Doug Stull's avatarDoug Stull <dstull@gitlab.com>
parents 335bca0e 51a5ad24
No related branches found
No related tags found
1 merge request!149120Use name field in state selector so that it is used in leads
Pipeline #1250912662 passed
Pipeline: E2E Omnibus GitLab EE

#1251060508

    Pipeline: E2E CNG

    #1250953811

      Pipeline: GitLab

      #1250953775

        +29
        Showing
        with 12 additions and 23 deletions
        ......@@ -4,5 +4,5 @@ import 'ee/trials/track_trial_user_errors';
        import { initNamespaceSelector } from 'ee/trials/init_namespace_selector';
        trackSaasDuoProTrialGroup();
        initTrialCreateLeadForm('saasDuoProTrialSubmit', 'name');
        initTrialCreateLeadForm('saasDuoProTrialSubmit');
        initNamespaceSelector();
        ......@@ -19,7 +19,6 @@ export default {
        directives: {
        autofocusonshow,
        },
        inject: { stateValueField: { default: 'id' } },
        props: {
        country: {
        type: String,
        ......@@ -139,7 +138,7 @@ export default {
        v-autofocusonshow
        name="state"
        :options="stateOptionsWithDefault"
        :value-field="stateValueField"
        value-field="name"
        text-field="name"
        data-testid="state"
        :required="required"
        ......
        ......@@ -2,7 +2,7 @@ import Vue from 'vue';
        import TrialCreateLeadForm from 'ee/trials/components/trial_create_lead_form.vue';
        import apolloProvider from 'ee/subscriptions/buy_addons_shared/graphql';
        export const initTrialCreateLeadForm = (gtmSubmitEventLabel, stateValueField = 'id') => {
        export const initTrialCreateLeadForm = (gtmSubmitEventLabel) => {
        const el = document.querySelector('#js-trial-create-lead-form');
        if (!el) {
        ......@@ -35,7 +35,6 @@ export const initTrialCreateLeadForm = (gtmSubmitEventLabel, stateValueField = '
        },
        submitPath,
        gtmSubmitEventLabel,
        stateValueField,
        },
        render(createElement) {
        return createElement(TrialCreateLeadForm);
        ......
        ......@@ -90,7 +90,7 @@
        company_size: '1-99',
        phone_number: '+1 23 456-78-90',
        country: 'US',
        state: 'CA',
        state: 'California',
        website_url: 'gitlab.com',
        trial: trial_registration
        }.merge(glm_params)
        ......
        ......@@ -349,7 +349,7 @@ def external_upgrade_url(namespace, plan)
        "company_size" => form_data[:company_size].delete(' '),
        "phone_number" => form_data[:phone_number],
        "country" => form_data.dig(:country, :id),
        "state" => form_data.dig(:state, :id),
        "state" => form_data.dig(:state, :name),
        "namespace_id" => namespace.id,
        "comment" => '',
        "glm_content" => 'billing-group',
        ......@@ -534,7 +534,7 @@ def fill_in_and_submit_code_suggestions_hand_raise_lead
        "company_size" => form_data[:company_size].delete(' '),
        "phone_number" => form_data[:phone_number],
        "country" => form_data.dig(:country, :id),
        "state" => form_data.dig(:state, :id),
        "state" => form_data.dig(:state, :name),
        "namespace_id" => namespace.id,
        "comment" => '',
        "glm_content" => 'code-suggestions',
        ......
        ......@@ -146,7 +146,7 @@ def fill_in_and_submit_code_suggestions_hand_raise_lead
        "company_size" => form_data[:company_size].delete(' '),
        "phone_number" => form_data[:phone_number],
        "country" => form_data.dig(:country, :id),
        "state" => form_data.dig(:state, :id),
        "state" => form_data.dig(:state, :name),
        "namespace_id" => group.id,
        "comment" => '',
        "glm_content" => 'code-suggestions',
        ......
        ......@@ -41,7 +41,7 @@
        company_size: '1-99',
        phone_number: '+1234567890',
        country: 'US',
        state: 'FL',
        state: 'Florida',
        website_url: 'https://gitlab.com',
        trial_onboarding_flow: true,
        trial: false
        ......
        ......@@ -15,7 +15,7 @@ Vue.use(VueApollo);
        describe('CountryOrRegionSelector', () => {
        let wrapper;
        const createComponent = (props = {}, provides = {}) => {
        const createComponent = (props = {}) => {
        const mockResolvers = {
        Query: {
        countries() {
        ......@@ -29,9 +29,6 @@ describe('CountryOrRegionSelector', () => {
        return shallowMountExtended(CountryOrRegionSelector, {
        apolloProvider: createMockApollo([], mockResolvers),
        provide: {
        ...provides,
        },
        propsData: {
        country: COUNTRY_WITH_STATES,
        state: STATE,
        ......@@ -126,15 +123,9 @@ describe('CountryOrRegionSelector', () => {
        ]);
        });
        it('has the default value field populated when not set', () => {
        it('has the proper value field populated with name', () => {
        wrapper = createComponent();
        expect(findFormInput('state').attributes('value-field')).toBe('id');
        });
        it('has the proper value field populated when set', () => {
        wrapper = createComponent({}, { stateValueField: 'name' });
        expect(findFormInput('state').attributes('value-field')).toBe('name');
        });
        });
        ......
        ......@@ -103,7 +103,7 @@ def submit_company_information_form(
        skip_email_confirmation: true,
        gitlab_com_trial: true,
        provider: 'gitlab',
        state: trial_type == DUO_PRO_TRIAL ? form_data.dig(:state, :name) : form_data.dig(:state, :id)
        state: form_data.dig(:state, :name)
        }.merge(extra_params)
        if trial_type == DUO_PRO_TRIAL
        ......
        ......@@ -433,7 +433,7 @@ def company_params(user, glm: true, trial: false)
        last_name: 'User',
        phone_number: '+1234567890',
        country: 'US',
        state: 'FL',
        state: 'Florida',
        website_url: 'https://gitlab.com',
        trial_onboarding_flow: true,
        # these are the passed through params
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment