Uploaded image for project: 'Hybrid Application Console'
  1. Hybrid Application Console
  2. HAC-417

in-form OSDTrial / OSD / choice is ignored, pre-form button takes precedence!

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • None
    • Infrastructure
    • False
    • False
    • HAC Infra - Sprint 213

      Looks like choices you make inside the form (and wizard?) between OSDTrial / OSD are ignored!

      1. Click [Create trial cluster] button.  This takes you to /openshift/create/osdtrial/aws (or /gcp)
      2. Inside form, switch to "Annual: Fixed capacity subscription from Red Hat"
      3. Fill & submit form.  The actual backend request sends product "id": "osd"

      Similarly:

      1. Click [Create cluster] button.  This takes you to /openshift/create/osd/aws (or /gcp)
      2. Inside form, switch to "Free trial (upgradeable)"
      3. Fill & submit form.  The actual backend request sends product "id": "osd"
         
        I'm not 100% certain users see this, because in prod I no longer qualify for OSDTrial, and in staging the buttons go to wizard — I can only reproduce in staging by going to /create/ {osdtrial,osd}

        /aws URLs directly.

      I do also see this issue in wizard!
      However let's focus on form as more urgent and one I better understand.

      Another variant:

      1. Click [Create trial cluster] button.  This takes you to /openshift/create/osdtrial/aws (or /gcp)
      2. Inside form, switch to "On-demand: Flexible usage billed through the Red Hat Marketplace"
      3. Fill & submit form.  The actual backend request sends billing_model "marketplace" with product "id": "osdtrial" — results in error CLUSTERS-MGMT-400: 'marketplace' billing_model is not allowed for OSD Trial clusters

      This happens because https://gitlab.cee.redhat.com/service/uhc-portal/-/blob/4a2921c619df59b9608ef8a0f2d85fa164081d52/src/components/clusters/CreateOSDPage/index.js#L130 does

        onSubmit: submitOSDRequest(dispatch, ownProps),
      

      and createClusterRequest() prioritizes passed-in props:

        // in non-wizard, cloudProviderID is supplied as a parameter. in the wizard, it's in the form.
        const actualCloudProviderID = cloudProviderID || formData.cloud_provider;
        const actualProduct = product || formData.product;
      

      The cloudProviderId and product props come from router reflecting which button user used to open form:

                  <TermsGuardedRoute path="/create/osdtrial/aws" gobackPath="/create/osdtrial" render={() => <CreateOSDPage cloudProviderID="aws" product={normalizedProducts.OSDTrial} />} history={history} />
                  <TermsGuardedRoute path="/create/osdtrial/gcp" gobackPath="/create/osdtrial" render={() => <CreateOSDPage cloudProviderID="gcp" product={normalizedProducts.OSDTrial} />} history={history} />
                  <Route path="/create/osdtrial" render={() => <GatedCreationWizard product={normalizedProducts.OSDTrial} />} />
                  <Route path="/create/osd" render={() => <GatedCreationWizard product={normalizedProducts.OSD} />} />
      

      (remember that in prod GatedCreationWizard still shows the form)
      But unlike provider, the passed-in product prop is NOT final choice, it was merely supposed to be used to initialize the radio button. We should still use formData.product!

              bpaskinc@redhat.com Beni Paskin-Cherniavsky (Inactive)
              bpaskinc@redhat.com Beni Paskin-Cherniavsky (Inactive)
              Archiver:
              rhn-support-sthamilt Stacey Hamilton
              Tongtong Zhou Tongtong Zhou

                Created:
                Updated:
                Resolved:
                Archived: