diff --git a/src/components/Card/Card.jsx b/src/components/Card/Card.jsx index 6c8d93af77..c203f25ae4 100644 --- a/src/components/Card/Card.jsx +++ b/src/components/Card/Card.jsx @@ -41,9 +41,6 @@ const CardWrapper = ({ onMouseUp, onTouchEnd, onTouchStart, - onMouseOver, - onFocus, - onBlur, tabIndex, testID, ...others @@ -60,9 +57,6 @@ const CardWrapper = ({ onTouchEnd={onTouchEnd} onTouchStart={onTouchStart} onScroll={onScroll} - onMouseOver={onMouseOver} - onFocus={onFocus} - onBlur={onBlur} tabIndex={tabIndex} className={classnames(className, `${iotPrefix}--card--wrapper`)} {...validOthers} @@ -123,12 +117,6 @@ CardWrapper.propTypes = { onTouchEnd: PropTypes.func, onTouchStart: PropTypes.func, onScroll: PropTypes.func, - /** Allows custom mouse over event handlers, such as changing the style */ - onMouseOver: PropTypes.func, - /** Allows custom keyboard event handlers, such as changing the style */ - onFocus: PropTypes.func, - /** Allows custom keyboard event handlers, such as changing the style */ - onBlur: PropTypes.func, /** Optionally sets a keyboard tab index for the container */ tabIndex: PropTypes.number, }; @@ -141,9 +129,6 @@ CardWrapper.defaultProps = { onTouchEnd: undefined, onTouchStart: undefined, onScroll: undefined, - onMouseOver: undefined, - onFocus: undefined, - onBlur: undefined, tabIndex: undefined, }; CardContent.propTypes = { diff --git a/src/components/CardEditor/CardEditor.jsx b/src/components/CardEditor/CardEditor.jsx index 19f545a94a..9f5c0e0cb8 100644 --- a/src/components/CardEditor/CardEditor.jsx +++ b/src/components/CardEditor/CardEditor.jsx @@ -37,11 +37,11 @@ const defaultProps = { supportedTypes: ['BAR', 'TIMESERIES', 'VALUE', 'IMAGE', 'TABLE'], }; +const baseClassName = `${iotPrefix}--card-editor`; + const CardEditor = ({ cardJson, onShowGallery, onChange, onAddCard, supportedTypes, i18n }) => { const mergedI18N = { ...defaultProps.i18n, ...i18n }; - const baseClassName = `${iotPrefix}--card-editor`; - // show the gallery if no card is being edited const showGallery = cardJson === null || cardJson === undefined; diff --git a/src/components/CardEditor/CardEditor.story.jsx b/src/components/CardEditor/CardEditor.story.jsx index 07ca7adbad..3f21926f81 100644 --- a/src/components/CardEditor/CardEditor.story.jsx +++ b/src/components/CardEditor/CardEditor.story.jsx @@ -24,7 +24,7 @@ const CardEditorInteractive = () => {
setData(null)} onAddCard={type => { setData({ ...defaultCard, id: `card-${counter + 1}`, type }); @@ -42,7 +42,7 @@ storiesOf('Watson IoT Experimental/CardEditor', module) .add('default', () => (
{ onAddCard={actions.onAddCard} /> ); - const addTableCardBtn = screen.getByTestId('card-gallery-list-TABLE-add'); + const addTableCardBtn = screen.getByTitle('Data table'); userEvent.click(addTableCardBtn); expect(actions.onAddCard).toHaveBeenCalledTimes(1); }); @@ -35,7 +35,7 @@ describe('CardEditor', () => { it('fires onChange when user edits title in form', () => { render( { it('fires onChange when user edits description in form', () => { render( { it('fires onShowGallery when user clicks button', () => { render( { it('opens and closes JSON code modal through button clicks', () => { render( +
+ +
-
- Gallery -
-
+ Content + + + + + show menu options + +
-
-
- - - - - - -
-
+ Content + + +
@@ -385,294 +373,282 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
+
+ +
-
- Gallery -
-
+ Content + + + + + show menu options + +
-
-
- - - - - - -
-
+ Content + + +
diff --git a/src/components/ComboBox/__snapshots__/ComboBox.story.storyshot b/src/components/ComboBox/__snapshots__/ComboBox.story.storyshot index 47a35efbb9..e078873b5f 100644 --- a/src/components/ComboBox/__snapshots__/ComboBox.story.storyshot +++ b/src/components/ComboBox/__snapshots__/ComboBox.story.storyshot @@ -29,7 +29,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
Combobox title @@ -64,7 +64,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper aria-activedescendant={null} aria-autocomplete="list" aria-controls={null} - aria-labelledby="downshift-0-label" + aria-labelledby="downshift-2-label" autoComplete="off" className="bx--text-input bx--text-input--empty" data-testid="combo-box" @@ -169,7 +169,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
Combobox title @@ -204,7 +204,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper aria-activedescendant={null} aria-autocomplete="list" aria-controls={null} - aria-labelledby="downshift-4-label" + aria-labelledby="downshift-6-label" autoComplete="off" className="bx--text-input bx--text-input--empty" data-testid="combo-box" @@ -309,7 +309,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
Combobox title @@ -344,7 +344,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper aria-activedescendant={null} aria-autocomplete="list" aria-controls={null} - aria-labelledby="downshift-3-label" + aria-labelledby="downshift-5-label" autoComplete="off" className="bx--text-input bx--text-input--empty" data-testid="combo-box" @@ -453,7 +453,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
Combobox title @@ -488,7 +488,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper aria-activedescendant={null} aria-autocomplete="list" aria-controls={null} - aria-labelledby="downshift-1-label" + aria-labelledby="downshift-3-label" autoComplete="off" className="bx--text-input bx--text-input--empty" data-testid="combo-box" @@ -585,7 +585,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
Combobox title @@ -620,7 +620,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper aria-activedescendant={null} aria-autocomplete="list" aria-controls={null} - aria-labelledby="downshift-2-label" + aria-labelledby="downshift-4-label" autoComplete="off" className="bx--text-input" data-testid="combo-box" diff --git a/src/components/DashboardEditor/DashboardEditor.jsx b/src/components/DashboardEditor/DashboardEditor.jsx index 064b890851..d695aa4d1b 100644 --- a/src/components/DashboardEditor/DashboardEditor.jsx +++ b/src/components/DashboardEditor/DashboardEditor.jsx @@ -110,7 +110,6 @@ const DashboardEditor = ({ // show the gallery if no card is being edited const [dashboardJson, setDashboardJson] = useState(initialValue); const [selectedCardId, setSelectedCardId] = useState(); - const [borderHoveredCardId, setBorderHoveredCardId] = useState(null); const addCard = type => { const cardData = getDefaultCard(type); @@ -158,7 +157,7 @@ const DashboardEditor = ({ {notification}
{}} onLayoutChange={(newLayout, newLayouts) => setDashboardJson({ @@ -169,7 +168,6 @@ const DashboardEditor = ({ > {dashboardJson.cards.map(cardData => { const isSelected = selectedCardId === cardData.id; - const isBorderHovered = borderHoveredCardId === cardData.id; const onSelectCard = () => setSelectedCardId(cardData.id); const onDuplicateCard = id => duplicateCard(id); const onRemoveCard = id => removeCard(id); @@ -179,21 +177,11 @@ const DashboardEditor = ({ renderCardPreview( cardData, isSelected, - isBorderHovered, - setBorderHoveredCardId, onSelectCard, onDuplicateCard, onRemoveCard ) ?? - getCardPreview( - cardData, - isSelected, - isBorderHovered, - setBorderHoveredCardId, - onSelectCard, - onDuplicateCard, - onRemoveCard - ) + getCardPreview(cardData, isSelected, onSelectCard, onDuplicateCard, onRemoveCard) ); })} diff --git a/src/components/DashboardEditor/__snapshots__/DashboardEditor.story.storyshot b/src/components/DashboardEditor/__snapshots__/DashboardEditor.story.storyshot index cf031ce405..3a65e6a1a9 100644 --- a/src/components/DashboardEditor/__snapshots__/DashboardEditor.story.storyshot +++ b/src/components/DashboardEditor/__snapshots__/DashboardEditor.story.storyshot @@ -285,7 +285,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper } >