-
Notifications
You must be signed in to change notification settings - Fork 42
[WIP] Create DualPaneMapper component and implement step 2 of mapping wizard #40
Conversation
1f633d5
to
33ca18c
Compare
@michaelkro can you post some screenshots for @serenamarie125 to review after you are getting close? Great job starting this! |
@priley86 yup, no problem! |
* Disable add mapping button until a valid mapping has been selected * Remove mapped items from source and target cluster lists after clicking button
* Extract DualPaneMapper as a standalone component * MappingWizardClustersStep will implement instances of DualPaneMapper and TreeView * MappingWizardClustersStep will manage clusters state
* Add mappings to TreeView * Only parent nodes are selectable * Parent nodes are expanded by default * Remove individual mappings * Remove all mappings
@priley86 @serenamarie125 here are some screenshots. I still have a couple todos (listed in main PR comment) |
2cd4786
to
7af7b24
Compare
* Create TreeViewContainer component to declutter MappingWizardClustersStep * Fix bug in removeMapping method (missing parentheses) * Add classNames and styles
* Optional component that is rendered in the DualPanelMapperList component if `hasCounter` is passed in as true. * Expects `selectedItems` and `totalItems` props
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; | |||
|
|||
const DualPaneMapperCount = ({ selectedItems, totalItems }) => ( | |||
<div className="dual-pane-mapper-count"> | |||
{selectedItems} of {totalItems} items selected | |||
{selectedItems} {__('of')} {totalItems} {__('items selected')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelkro Can you use sprintf
here in order to keep the whole sentence intact.
Something like this -
__(sprintf('%s of %s items selected', {selectedItems}, {totalItems}));
Whole sentences work better with translators.
{__('Remove Mapping')} | ||
</Button>{' '} | ||
<Button disabled={mappings.length === 0} onClick={removeAll}> | ||
{__('Remove all')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelkro Can you please useInitial capitalization ? "Remove All" with a capital A
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, no problem! :)
DualPaneMapperList The first implementation requires passing props down two levels, first through DualPaneMapperList, then into DualPaneMapperCounter, which is not ideal.
|
||
const DualPaneMapperCount = ({ selectedItems, totalItems }) => ( | ||
<div className="dual-pane-mapper-count"> | ||
{__(sprintf('%s of %s items selected', selectedItems, totalItems))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Just realized that it should have been -
sprintf(__('%s of %s items selected'), selectedItems, totalItems)
(my apologies)
Otherwise the string would not be extracted for translation.
Initial commit based on https://github.com/priley86/miq_v2v_ui_plugin/pull/40
Initial commit based on https://github.com/priley86/miq_v2v_ui_plugin/pull/40
Closing in favor of https://github.com/priley86/miq_v2v_ui_plugin/pull/44 |
[WIP]
Initial implementation and integration of
DualPaneMapper
CI failure is due to a
setState
call incomponentDidMount
. Just doing this to stub data for nowhttps://github.com/priley86/miq_v2v_ui_plugin/issues/26
Notes
DualPaneMapper.scss
was copied and pasted from here, with some minor customization.Todo:
x of y items selected
info at bottom of Source Clusters pane as shown in mocks