fix: 8543 added disabled flag support in icon button table widget (#8950)

* fix: 8543 added disabled flag support in icon button table widget

* updated test case
This commit is contained in:
Yash Vibhandik 2021-11-11 16:09:21 +05:30 committed by GitHub
parent f6b8900246
commit 4b2c1fc316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View File

@ -95,6 +95,14 @@ describe("Table Widget property pane feature validation", function() {
force: true, force: true,
}); });
cy.get(".t--widget-tablewidget .tbody .bp3-icon-add").should("exist"); cy.get(".t--widget-tablewidget .tbody .bp3-icon-add").should("exist");
// disabled icon btn
cy.CheckWidgetProperties(commonlocators.disableCheckbox);
cy.getTableDataSelector("0", "4").then((selector) => {
cy.get(selector + " button.bp3-disabled").should("exist");
});
cy.UncheckWidgetProperties(commonlocators.disableCheckbox);
//Delete Column //Delete Column
cy.get(".t--property-pane-back-btn").click({ cy.get(".t--property-pane-back-btn").click({
force: true, force: true,

View File

@ -187,6 +187,7 @@ interface RenderIconButtonProps {
boxShadowColor: string; boxShadowColor: string;
onCommandClick: (dynamicTrigger: string, onComplete: () => void) => void; onCommandClick: (dynamicTrigger: string, onComplete: () => void) => void;
isCellVisible: boolean; isCellVisible: boolean;
disabled: boolean;
} }
export const renderIconButton = ( export const renderIconButton = (
props: RenderIconButtonProps, props: RenderIconButtonProps,
@ -211,6 +212,7 @@ export const renderIconButton = (
boxShadowColor={props.boxShadowColor} boxShadowColor={props.boxShadowColor}
buttonColor={props.buttonColor} buttonColor={props.buttonColor}
buttonVariant={props.buttonVariant} buttonVariant={props.buttonVariant}
disabled={props.disabled}
iconName={props.iconName} iconName={props.iconName}
isSelected={props.isSelected} isSelected={props.isSelected}
key={index} key={index}
@ -231,6 +233,7 @@ function IconButton(props: {
borderRadius: ButtonBorderRadius; borderRadius: ButtonBorderRadius;
boxShadow: ButtonBoxShadow; boxShadow: ButtonBoxShadow;
boxShadowColor: string; boxShadowColor: string;
disabled: boolean;
}): JSX.Element { }): JSX.Element {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const onComplete = () => { const onComplete = () => {
@ -257,6 +260,7 @@ function IconButton(props: {
boxShadowColor={props.boxShadowColor} boxShadowColor={props.boxShadowColor}
buttonColor={props.buttonColor} buttonColor={props.buttonColor}
buttonVariant={props.buttonVariant} buttonVariant={props.buttonVariant}
disabled={props.disabled}
icon={props.iconName} icon={props.iconName}
loading={loading} loading={loading}
onClick={handleClick} onClick={handleClick}

View File

@ -245,6 +245,7 @@ class TableWidget extends BaseWidget<TableWidgetProps, WidgetState> {
boxShadow: cellProperties.boxShadow || "NONE", boxShadow: cellProperties.boxShadow || "NONE",
boxShadowColor: cellProperties.boxShadowColor || "", boxShadowColor: cellProperties.boxShadowColor || "",
isCellVisible: cellProperties.isCellVisible ?? true, isCellVisible: cellProperties.isCellVisible ?? true,
disabled: !!cellProperties.isDisabled,
}; };
return renderIconButton(iconButtonProps, isHidden, cellProperties); return renderIconButton(iconButtonProps, isHidden, cellProperties);
} else { } else {