Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.11] Embed New Backend form into a modal #2413

Merged
merged 12 commits into from
Apr 29, 2021
Merged

Conversation

josemigallas
Copy link
Contributor

@josemigallas josemigallas commented Apr 14, 2021

What this PR does / why we need it:

Replaces the link to the Backend's new page with a button that displays a modal containing the form. Once a backend is created it will be selected in the dropdown.

Screenshot 2021-04-14 at 13 17 13

modal

Which issue(s) this PR fixes

Subtask of [3scale][2.11][HI-prio] Improve Select in 'Add Backend to Product' form
THREESCALE-6882: Embed New Backend form into a modal

@josemigallas josemigallas added ruby Pull requests that update Ruby code javascript Pull requests that update Javascript code labels Apr 14, 2021
@josemigallas josemigallas requested review from a team April 14, 2021 11:18
@josemigallas josemigallas self-assigned this Apr 14, 2021
@thomasmaas
Copy link
Member

Is the idea to use this modal everywhere where a user can create a new backend or just here where creating the backend is like a side step in the process of adding a backend to a product?

@cntlsn
Copy link
Contributor

cntlsn commented Apr 14, 2021

Is the idea to use this modal everywhere where a user can create a new backend or just here where creating the backend is like a side step in the process of adding a backend to a product?

@thomasmaas the idea here is to help a user in the process of selecting a Backend by giving them the option to create a new one without leaving the context. So yes, we will still have a dedicated page featuring the Backend creation form for when a user chooses the traditional creation path (eg. from the Dashboard or the Backends index page)

cntlsn
cntlsn previously approved these changes Apr 14, 2021
Copy link
Contributor

@cntlsn cntlsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX looks good to me!

thomasmaas
thomasmaas previously approved these changes Apr 15, 2021
@thomasmaas
Copy link
Member

@josemigallas any chance you could add data-testid="newBackendCreateBackend-buttonSubmit" to the button html so we can measure usage?

@josemigallas
Copy link
Contributor Author

josemigallas commented Apr 16, 2021

@josemigallas any chance you could add data-testid="newBackendCreateBackend-buttonSubmit" to the button html so we can measure usage?

Do you mean change the current button's data-testid to that specific one? Is there a naming rule behind this?
https://github.com/3scale/porta/blob/2e520e658b0e29b815991f260b01842085761267/app/javascript/src/BackendApis/components/BackendSelect.jsx#L44
or
https://github.com/3scale/porta/blob/97643c0ba781c4265c0e5e74c05769138a0f269e/app/javascript/src/BackendApis/components/NewBackendForm.jsx#L60

@thomasmaas
Copy link
Member

For the naming scheme I refer to @cntlsn and @damianpm. In Pendo you can scope it down to a page but even then I'd say 'submit' is not unique enough.

@cntlsn
Copy link
Contributor

cntlsn commented Apr 16, 2021

@thomasmaas thank you for spotting this!

@josemigallas the naming rule for those ids can be found in this issue THREESCALE-6729

I think we should actually track two buttons in this page:

  • the 'Create a Backend' button with icon
data-testid=”newBackendCreateBackend-buttonLink”
  • the 'Create Backend' button in the modal form
data-testid=”newBackendCreateBackend-buttonSubmit”

Question: will displaying the modal dialog change the URL of the page?

@josemigallas
Copy link
Contributor Author

Question: will displaying the modal dialog change the URL of the page?

No it won't. One thing to point out is that the same form is going to be used in its own page, meaning the same data-testid is going to be present in both the modal and the "Create Backend" page. Is this problematic?

@thomasmaas
Copy link
Member

thomasmaas commented Apr 16, 2021

It's not. In pendo we can still get the specific numbers for both usages by scoping the click on that button to different page urls. And in case of this modal the scoping page url would be the 'add backend to product' page url.

thomasmaas
thomasmaas previously approved these changes Apr 19, 2021
Copy link
Contributor

@damianpm damianpm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (js side)

@josemigallas josemigallas merged commit 039d591 into master Apr 29, 2021
@josemigallas josemigallas deleted the 2.11/new_backend_modal branch April 29, 2021 15:33

const VALIDATION_CONSTRAINTS = {
name: { length: { minimum: 1 } },
privateEndpoint: { url: { schemes: ['http', 'https', 'ws', 'wss'] } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2021-09-06 at 10 41 17

I can't reproduce the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code ruby Pull requests that update Ruby code
Projects
None yet
5 participants