Skip to content

Commit

Permalink
#2205 Upgrade @carbon/react to 1.71.0 (#2243)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmgokhale authored Nov 21, 2024
1 parent 3bebb81 commit 940e0ae
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ describe("oneofselect paramDef works correctly", () => {

// combobox should have aria-label
const comboboxWrapper = container.querySelector("div[data-id='properties-ctrl-oneofselect_custom_value']");
const comboboxAriaLabel = comboboxWrapper.querySelector(".cds--list-box__menu").getAttribute("aria-label");
expect(comboboxAriaLabel).to.equal("oneofselect custom value allowed");
const comboboxAriaLabelledby = comboboxWrapper.querySelector(".cds--list-box__menu").getAttribute("aria-labelledby");
expect(comboboxWrapper.querySelector(`label[id='${comboboxAriaLabelledby}']`).textContent).to.equal("oneofselect custom value allowed(required)");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("tearsheet tests", () => {
it("should have title and description set", () => {
controller.setActiveTearsheet("tearsheet1");
wrapper.update();
expect(wrapper.find("div.properties-tearsheet-panel .properties-tearsheet-header h3").text()).to.equal("Python");
expect(wrapper.find("div.properties-tearsheet-panel .properties-tearsheet-header h2").text()).to.equal("Python");
expect(wrapper.find("div.properties-tearsheet-panel .properties-tearsheet-header p").text()).to.equal("Your change is automatically saved.");
});
it("should be hidden but not removed from DOM on the tearsheet close button", () => {
Expand All @@ -68,7 +68,7 @@ describe("tearsheet tests", () => {
wrapper.find("div[data-id='properties-ctrl-code_rows'] button.maximize").simulate("click");
wrapper.update();
expect(wrapper.find("div.properties-tearsheet-panel.is-visible")).to.have.length(1);
expect(wrapper.find("div.properties-tearsheet-panel .properties-tearsheet-header h3").text()).to.equal("Python 2");
expect(wrapper.find("div.properties-tearsheet-panel .properties-tearsheet-header h2").text()).to.equal("Python 2");
expect(wrapper.find("div.properties-tearsheet-panel div[data-id='properties-ctrl-code_rows']")).to.have.length(1);
});
});
Expand All @@ -88,7 +88,7 @@ describe("Tearsheet renders correctly", () => {
const tearsheet = wrapper.find("div.properties-tearsheet-panel");
expect(tearsheet).to.have.length(1);
expect(tearsheet.find("div.properties-tearsheet-header")).to.have.length(1);
expect(tearsheet.find("div.properties-tearsheet-header > h3").text()).to.equal("test title");
expect(tearsheet.find("div.properties-tearsheet-header > h2").text()).to.equal("test title");
expect(tearsheet.find("div.properties-tearsheet-body")).to.have.length(1);
expect(tearsheet.find("div.properties-tearsheet-body").text()).to.equal("test content");
expect(tearsheet.find("div.properties-tearsheet-body.with-buttons")).to.have.length(0);
Expand Down
2 changes: 1 addition & 1 deletion canvas_modules/common-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.25.3",
"@babel/preset-react": "7.24.7",
"@carbon/react": "1.62.0-rc.0",
"@carbon/react": "1.71.0",
"@rollup/plugin-babel": "5.3.0",
"@rollup/plugin-commonjs": "21.0.1",
"@rollup/plugin-json": "4.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class CommonProperties extends React.Component {
}

componentDidCatch(error, info) {
console.error(error);
this.setState({
hasError: true,
error: error,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class DropDown extends React.Component {
}

handleComboOnChange(evt) {
let value = evt.selectedItem && evt.selectedItem.value ? evt.selectedItem.value : "";
let value = evt.selectedItem && evt.selectedItem.value ? evt.selectedItem.value : evt.selectedItem;
if (this.props.control.controlType === ControlType.SELECTCOLUMN) {
value = PropertyUtils.fieldStringToValue(value, this.props.control, this.props.controller);
}
Expand Down Expand Up @@ -290,6 +290,7 @@ class DropDown extends React.Component {
disabled={this.props.state === STATES.DISABLED || this.disableEmptyListDropdown}
type="default"
items={dropDown.options}
itemToString={(item) => (item ? item.label : "")}
itemToElement={this.renderItem}
renderSelectedItem={this.renderItem}
onChange={this.handleChange}
Expand Down
2 changes: 1 addition & 1 deletion canvas_modules/harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@babel/preset-react": "7.24.1",
"@carbon/charts": "1.15.3",
"@carbon/charts-react": "1.15.3",
"@carbon/react": "1.62.0-rc.0",
"@carbon/react": "1.71.0",
"@elyra/canvas": "file:../common-canvas",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
"ajv": "8.12.0",
Expand Down

0 comments on commit 940e0ae

Please sign in to comment.