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
+
+
-
+ Content
+
+
+
-
-

-
+ Card title
+
-
-
-
-

-
-
-
-
-
-
-
-
+ Description (Optional)
+
-
-
-
-
-
-

-
+ Size
+
-
+
+
+
+
+
+
@@ -385,294 +373,282 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT Exper
+
-
- Gallery
-
-
+ Content
+
+
-
+ Content
+
+
+
-
-

-
+ Card title
+
-
-
-
-

-
+ Description (Optional)
+
-
-
-
-
-
-
-
-
-
-
-
-
-

-
+ Size
+
-
+
+
+
+
+
+
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
}
>
(
export const getCardPreview = (
cardData,
isSelected,
- isBorderHovered,
- setBorderHoveredCardId,
onSelectCard,
onDuplicateCard,
onRemoveCard
) => {
const commonProps = {
- ...(isSelected || isBorderHovered
+ ...(isSelected
? {
className: classNames({
[`${baseClassName}--preview__selected-card`]: isSelected,
- [`${baseClassName}--preview__border-hovered-card`]: isBorderHovered,
}),
}
: {}),
- availableActions: { edit: true, clone: true, delete: true },
+ availableActions: { clone: true, delete: true },
onCardAction: (id, actionId) => {
- if (actionId === CARD_ACTIONS.EDIT_CARD) {
- onSelectCard();
- }
if (actionId === CARD_ACTIONS.CLONE_CARD) {
onDuplicateCard(id);
}
@@ -343,26 +337,6 @@ export const getCardPreview = (
onRemoveCard(id);
}
},
- onMouseOver: e => {
- if (
- // if the card is already selected, the full card wrapper can be captured in the event
- e.target?.getAttribute('class')?.includes('iot--card ') ||
- // if the card is not selected, use the relatedTarget, AKA where the event originated
- // from which is the outer editor preview or the grid-layout
- e.relatedTarget?.getAttribute('class')?.includes('iot--dashboard-editor--preview') ||
- e.relatedTarget?.getAttribute('class')?.includes('react-grid-layout')
- ) {
- setBorderHoveredCardId(cardData.id);
- } else {
- setBorderHoveredCardId(null);
- }
- },
- onFocus: () => {
- setBorderHoveredCardId(cardData.id);
- },
- onBlur: () => {
- setBorderHoveredCardId(null);
- },
tabIndex: 0,
onClick: () => onSelectCard(),
};
diff --git a/src/components/Table/TableViewDropdown/__snapshots__/TableViewDropdown.story.storyshot b/src/components/Table/TableViewDropdown/__snapshots__/TableViewDropdown.story.storyshot
index bd49358625..9a1440856c 100644
--- a/src/components/Table/TableViewDropdown/__snapshots__/TableViewDropdown.story.storyshot
+++ b/src/components/Table/TableViewDropdown/__snapshots__/TableViewDropdown.story.storyshot
@@ -38,10 +38,10 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
aria-disabled={false}
aria-expanded={false}
aria-haspopup="listbox"
- aria-labelledby="downshift-18-label downshift-18-toggle-button"
+ aria-labelledby="downshift-20-label downshift-20-toggle-button"
className="bx--list-box__field"
disabled={false}
- id="downshift-18-toggle-button"
+ id="downshift-20-toggle-button"
onClick={[Function]}
onKeyDown={[Function]}
type="button"
@@ -108,9 +108,9 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table