Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

[#368] Add Advanced Options Step to Plan Wizard #413

Merged
merged 1 commit into from
Jul 24, 2018

Conversation

michaelkro
Copy link
Contributor

@michaelkro michaelkro commented Jun 14, 2018

fixes #368

TODO

  • Fetch playbooks via API
  • Handle loading state when fetching playbooks
  • Handle error state if fetching playbooks fails
  • Modify plan POST to include playbooks data
  • Add link to where user can create a ansible playbook catalog item (new UX request)
    Notes:
    1. The creation form does not have its own URL, so it's not possible to link directly to it.
    2. The best we can do is to link to Services -> Catalogs, and so, it may be difficult for a new CF user to figure out what to do next.
    3. Won't do
  • Confirmation dialog for playbook(s) selected with no VMs
  • Clear checkboxes if user clears a playbook
  • Clear all form data if the user moves back to Step 2.
    Reasoning: If the user goes back to Step 2 and adds/removes a vm(s), things might get weird. The form data will persist, however, if the user moves forward to the Scheduling step and then comes back

Questions

  1. Do we want to display anything in particular if fetching playbooks returns nothing?
  2. What do we want to display if fetching playbooks fails?
  3. Is there any way to differentiate migration specific playbooks from the rest?

Notes

  • Stub actions/reducer for fetching playbooks

  • Copy and modify VMsStep table

  • Copy and modify BootstrapSelect

  • Modify and reuse BootstrapSelect for Advanced Options use case

  • Rename Options Step to Schedule Step

  • If the Advanced Options Step is revisited, i.e., the user navigates forward or backwards from the step and then back again, all form data will be cleared.

    Reasoning: Data regarding VM selection lives in the table's component state, and thus, is wiped when leaving the step (forward or backward). To persist, this state should be lifted to redux store.

    Update: Form data persists when moving forward to the Scheduling Step. i.e., when navigating back to the Advanced Options Step, playbook(s) and VM selections will have been preserved. If the user navigates backwards, from the Advanced Options Step to the VMs Step, all form data will be cleared. i.e., if the user goes back to the VM selection step, and then forward again to the Advanced Options Step, the dropdowns and table will have been returned to their initial states

  • Should be merged alongside Support for v2v pre/post Ansible playbook service. manageiq#17627. For now, plan creation will fail in this branch
    Update: Corresponding back end PRs have been merged

Screens

No Playbooks Selected

fullscreen_6_15_18__7_18_am

Top Dropdown Open

fullscreen_6_15_18__7_26_am

One Playbook Selected

advanced-options-3

Selected VMs Totals

advanced-optiones-4

All Checkboxes Enabled

advanced-options-5

Confirm Dialog

fullscreen_6_21_18__1_44_pm

Redux Form State

fullscreen_6_14_18__12_32_pm

POST Body

devtools_-_localhost_8080_migration

https://bugzilla.redhat.com/show_bug.cgi?id=1564250

@michaelkro michaelkro force-pushed the playbooks branch 3 times, most recently from 42b4cf8 to 65fb429 Compare June 14, 2018 17:18
@michaelkro michaelkro changed the title [WIP] Add Advanced Options Step to Plan Wizard [WIP] [Issue #368] Add Advanced Options Step to Plan Wizard Jun 14, 2018
@michaelkro michaelkro force-pushed the playbooks branch 2 times, most recently from c7ffb58 to ce0fb93 Compare June 14, 2018 18:28
@priley86 priley86 requested a review from vconzola June 14, 2018 20:32
@vconzola
Copy link

@michaelkro this is great work. To answer your questions...

  1. No, we just leave none selected as the only option in the dropdown.
  2. I'm thinking we display an in-line error. I believe notifications are displayed only as the result of a user action, but let me double check with Mgmt UX team. Then I can mock something up.

VM selection table should be shown with both columns disabled if no playbooks are selected.

@michaelkro michaelkro force-pushed the playbooks branch 2 times, most recently from fccdb09 to b58e993 Compare June 19, 2018 11:37
@priley86
Copy link
Member

priley86 commented Jun 19, 2018

@agrare @AparnaKarve can you possibly provide some API feedback for us w.r.t. to @michaelkro's questions above? We will need to query the available pre/post migration playbooks to drive the dropdowns in the plan wizard and then provide the selected pre/post somewhere in the service template POST.

Additionally, we will need to ensure that the tasks now indicate pre/post playbook status when visualizing on the details page. We should be able to drive the Overview cards (aggregates) by inspecting the individual tasks. The full UX is here in this issue:
https://docs.google.com/presentation/d/19CpXErM4mDsbLkx6ahQMpDn_i63eqb805GwM4M3Kl1Q/edit#slide=id.g3c2c648750_0_38

Can you give us an update on these APIs?

@agrare
Copy link
Member

agrare commented Jun 19, 2018

@priley86 I think we need to meet to discuss how we plan on doing this because neither @fdupont-redhat nor I know how this will look in the backend.

@michaelkro michaelkro force-pushed the playbooks branch 10 times, most recently from 8dba11b to c8c6502 Compare June 21, 2018 17:21
Copy link

@vconzola vconzola left a comment

Choose a reason for hiding this comment

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

@michaelkro This looks great. I'll provide some text for the message if loading playbooks fails. If that's keeping you from closing #368 please open a separate issue for the error message.

@michaelkro
Copy link
Contributor Author

@vconzola unfortunately, we can't close this until we hook it up to the back end, otherwise it'll break the Plan Wizard

I'm almost done putting the final UI touches though. If we have time, I'll demo what I have in standup this afternoon

@AparnaKarve
Copy link
Contributor

Tested this on an appliance and it's looking really great so far.

Thanks @michaelkro ! Nice job!!

title: __('No VMs Selected'),
body: __(
"You've selected a pre-migration or post-migration playbook service but no VMs on which to run the playbook service. Are you sure you want to continue?"
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure that the entire gettext text appears in a single.
And then mark that line with // prettier-ignore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops!

* Add VM/Playbook selection table
  * Custom reactabular formatters to enable dual selection columns
  * Extract some common helpers shared with VMStep table
* Make modifications to BootstrapSelect for this use case
* Confirm modal for case when a user selects a playbook, but does not
  select any VMs on which to run service
* Form data is reset if user navigates back from Advanced Options Step
  to the VM Selection Step
* Add schema validator for ServiceTemplateAnsiblePlaybook
@AparnaKarve AparnaKarve merged commit 1adefd3 into ManageIQ:master Jul 24, 2018
michaelkro added a commit to michaelkro/manageiq-v2v that referenced this pull request Jul 26, 2018
michaelkro added a commit to michaelkro/manageiq-v2v that referenced this pull request Jul 26, 2018
michaelkro added a commit to michaelkro/manageiq-v2v that referenced this pull request Jul 26, 2018
michaelkro added a commit to michaelkro/manageiq-v2v that referenced this pull request Jul 26, 2018
michaelkro added a commit to michaelkro/manageiq-v2v that referenced this pull request Jul 27, 2018
@simaishi
Copy link
Contributor

Backported to Gaprindashvili via #518

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Pre & Post Playbook Support to Migration Plans - Plan Wizard Changes
7 participants