Skip to content

Commit

Permalink
#1165 Add tearsheet group type (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusGuerrero authored Oct 5, 2022
1 parent ab67cd0 commit 19e6f06
Show file tree
Hide file tree
Showing 37 changed files with 822 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe("Correct form should be created", () => {
"label": {
"text": "boolean_param"
},
"light": false,
"labelVisible": false,
"controlType": "checkbox",
"valueDef": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,27 @@ describe("tearsheet tests", () => {
afterEach(() => {
wrapper.unmount();
});
it("should be hidden initially", () => {
expect(wrapper.find("div.tearsheet-panel")).to.have.length(0);
it("should be have only one tearsheet rendered", () => {
expect(wrapper.find("div.properties-tearsheet-panel")).to.have.length(1);
});
it("should be visible from the controller method", () => {
controller.setActiveTearsheet("tearsheet1");
wrapper.update();
expect(wrapper.find("div.properties-tearsheet-panel")).to.have.length(1);
expect(wrapper.find("div.properties-tearsheet-panel.is-visible")).to.have.length(1);
});
it("should have title and description set", () => {
controller.setActiveTearsheet("tearsheet1");
wrapper.update();
expect(wrapper.find("div.properties-tearsheet-panel .bx--modal-header h3").text()).to.equal("Python");
expect(wrapper.find("div.properties-tearsheet-panel .bx--modal-header p").text()).to.equal("Your change is automatically saved.");
});
it("should be hidden from DON on the tearsheet close button", () => {
it("should be hidden but not removed from DOM on the tearsheet close button", () => {
controller.setActiveTearsheet("tearsheet1");
wrapper.update();
wrapper.find("div.properties-tearsheet-panel button.bx--modal-close").simulate("click");
wrapper.update();
setTimeout(() => {
expect(wrapper.find("div.tearsheet-panel")).to.have.length(0);
expect(controller.getActiveTearsheet()).to.equal(null);
}, 1000);
expect(wrapper.find("div.properties-tearsheet-panel.is-visible")).to.have.length(0);
expect(wrapper.find("div.properties-tearsheet-panel")).to.have.length(1);
expect(controller.getActiveTearsheet()).to.equal(null);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
"description": {
"text": "Try pressing Increment or Descrement buttons"
},
"light": false,
"labelVisible": true,
"controlType": "readonly",
"valueDef": {
Expand Down Expand Up @@ -341,6 +342,7 @@
"description": {
"text": "Press 'Update Datamodel' to add a new field"
},
"light": false,
"labelVisible": true,
"controlType": "selectcolumns",
"valueDef": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
"description": {
"text": "Rename columns in the active dataset"
},
"light": false,
"labelVisible": true,
"controlType": "structuretable",
"valueDef": {
Expand All @@ -253,6 +254,7 @@
"label": {
"text": "Input name"
},
"light": false,
"labelVisible": true,
"controlType": "selectcolumn",
"valueDef": {
Expand All @@ -269,6 +271,7 @@
"label": {
"text": "Output name"
},
"light": false,
"labelVisible": true,
"controlType": "textfield",
"valueDef": {
Expand All @@ -287,6 +290,7 @@
"label": {
"text": "New Label"
},
"light": false,
"labelVisible": true,
"controlType": "textfield",
"valueDef": {
Expand Down Expand Up @@ -314,6 +318,7 @@
"label": {
"text": "Output name"
},
"light": false,
"labelVisible": true,
"controlType": "textfield",
"valueDef": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
"text": "Only the first row for each value of the columns added below will be included in the data table. Duplicate rows with the same value will be discarded.",
"placement": "on_panel"
},
"light": false,
"labelVisible": true,
"controlType": "selectcolumns",
"valueDef": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
"description": {
"text": "Rename columns in the active dataset"
},
"light": false,
"labelVisible": true,
"controlType": "structuretable",
"valueDef": {
Expand All @@ -233,6 +234,7 @@
"label": {
"text": "Input name"
},
"light": false,
"labelVisible": true,
"controlType": "selectcolumn",
"valueDef": {
Expand All @@ -249,6 +251,7 @@
"label": {
"text": "Output name"
},
"light": false,
"labelVisible": true,
"controlType": "textfield",
"valueDef": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
"label": {
"text": "Sort by"
},
"light": false,
"labelVisible": true,
"controlType": "structuretable",
"valueDef": {
Expand All @@ -228,6 +229,7 @@
"label": {
"text": "Field"
},
"light": false,
"labelVisible": true,
"controlType": "selectcolumn",
"valueDef": {
Expand All @@ -245,6 +247,7 @@
"label": {
"text": "Order"
},
"light": false,
"labelVisible": true,
"controlType": "toggletext",
"valueDef": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"label": {
"text": "int_param"
},
"light": false,
"labelVisible": true,
"controlType": "numberfield",
"valueDef": {
Expand All @@ -115,6 +116,7 @@
"label": {
"text": "exp_param"
},
"light": false,
"labelVisible": true,
"controlType": "expression",
"valueDef": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
"label": {
"text": "Target label: resource"
},
"light": false,
"labelVisible": true,
"controlType": "selectcolumn",
"valueDef": {
Expand All @@ -213,6 +214,7 @@
"label": {
"text": "inputs"
},
"light": false,
"labelVisible": true,
"controlType": "selectcolumns",
"valueDef": {
Expand Down Expand Up @@ -253,6 +255,7 @@
"description": {
"text": "Enum description: default"
},
"light": false,
"labelVisible": true,
"controlType": "radioset",
"valueDef": {
Expand Down Expand Up @@ -301,6 +304,7 @@
"description": {
"text": "Int description: default"
},
"light": false,
"labelVisible": true,
"controlType": "numberfield",
"valueDef": {
Expand Down Expand Up @@ -337,6 +341,7 @@
"label": {
"text": "double_param"
},
"light": false,
"labelVisible": true,
"controlType": "numberfield",
"valueDef": {
Expand Down Expand Up @@ -369,6 +374,7 @@
"label": {
"text": "boolean_param"
},
"light": false,
"labelVisible": false,
"controlType": "checkbox",
"valueDef": {
Expand Down Expand Up @@ -404,6 +410,7 @@
"description": {
"text": "String desciption: default"
},
"light": false,
"labelVisible": true,
"controlType": "textfield",
"valueDef": {
Expand Down
Loading

0 comments on commit 19e6f06

Please sign in to comment.