Skip to content

Commit

Permalink
QB: Rename Summary buttons to Add summary
Browse files Browse the repository at this point in the history
  • Loading branch information
heralden committed Feb 15, 2022
1 parent 9d4306d commit 5a67eb6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
12 changes: 6 additions & 6 deletions cypress/integration/query_builder_test/logic_constraint_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Query view test", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.get("select").should("have.value", "Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get(".query-view-column").within(() => {
Expand All @@ -22,7 +22,7 @@ describe("Query view test", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Gene");
cy.get("select").should("have.value", "Gene");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get(".query-view-column").within(() => {
Expand All @@ -40,7 +40,7 @@ describe("Query view test", function() {
it("can change the constraint to outer join", function(){
cy.get('.model-browser-root').within(() => {
cy.selectFromDropdown("Gene");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get(".query-view-column").within(() => {
Expand All @@ -52,7 +52,7 @@ describe("Query view test", function() {
it("can edit constraint logic", function(){
cy.get('.model-browser-root').within(() => {
cy.selectFromDropdown("Gene");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});
cy.get('.model-browser').within(() => {
cy.get(".qb-class").filter(':contains("Protein")').siblings(".label-button").click();
Expand All @@ -74,7 +74,7 @@ describe("Query view test", function() {
it("can add NULL as a constraint in search results", function(){
cy.get('.model-browser-root').within(() => {
cy.selectFromDropdown("Gene");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get(".query-view-column").within(() => {
Expand All @@ -92,4 +92,4 @@ describe("Query view test", function() {
})
})
});

10 changes: 5 additions & 5 deletions cypress/integration/query_builder_test/model_browser_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ describe("Model browser test", function() {
it("can select data type and summary attributes with model browser", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});
});

it("can select specific attributes", function(){
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Gene");
cy.get("select").should("have.value", "Gene");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get(".model-browser").within(() => {
Expand All @@ -37,7 +37,7 @@ describe("Model browser test", function() {
cy.get(".model-browser-column").within(() => {
cy.selectFromDropdown("Protein");
cy.get("select").should("have.value", "Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
cy.get('[title="Remove all selected attributes"]').click();
});
});
Expand All @@ -47,7 +47,7 @@ describe("Model browser test", function() {
cy.get(".model-browser-column > h4").should("include.text","Model Browser");
cy.contains("Data Model").click();
cy.contains("Gene").click();
cy.contains("Summary").click();
cy.contains("Add summary").click();

cy.get(".query-view-column").within(() => {
cy.get(".qb-label").should("include.text","Gene");
Expand All @@ -64,4 +64,4 @@ describe("Model browser test", function() {
cy.get(".model-browser-column > h4").should("include.text","Model Browser");
});
});

18 changes: 9 additions & 9 deletions cypress/integration/query_builder_test/query_view_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Query view test", function() {
// cy.viewport(1000, 600);
// cy.get(".model-browser-root").within(() => {
// cy.selectFromDropdown("Protein");
// cy.contains("Summary").click();
// cy.contains("Add summary").click();
// });

// cy.get("div.panel-body").first().as("queryEditorTab").within(()=>{
Expand All @@ -21,7 +21,7 @@ describe("Query view test", function() {
it("can save, clear, and load query", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get("div.panel-body").first().as("queryEditorTab").within(()=>{
Expand All @@ -45,7 +45,7 @@ describe("Query view test", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.get("select").should("have.value", "Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get("div.panel-body").first().as("queryEditorTab").within(() => {
Expand All @@ -59,7 +59,7 @@ describe("Query view test", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.get("select").should("have.value", "Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get('.query-view-column').within(() => {
Expand All @@ -75,7 +75,7 @@ describe("Query view test", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.get("select").should("have.value", "Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get(".panel-body").eq(1).as("previewTab").within(() => {
Expand All @@ -90,7 +90,7 @@ describe("Query view test", function() {
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.get("select").should("have.value", "Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get('.query-view-column').within(() => {
Expand All @@ -105,7 +105,7 @@ describe("Query view test", function() {
it('can rename a saved query', function(){
cy.get('.model-browser-root').within(() => {
cy.selectFromDropdown("Gene");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get('.query-view-column').within(()=>{
Expand All @@ -127,7 +127,7 @@ describe("Query view test", function() {
it('can delete a saved query', function(){
cy.get('.model-browser-root').within(() => {
cy.selectFromDropdown("Gene");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get(".panel-body").first().as("queryEditorTab").within(() => {
Expand Down Expand Up @@ -160,4 +160,4 @@ describe("Query view test", function() {
});
});
});

4 changes: 2 additions & 2 deletions cypress/integration/user_account/user_account_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe("User Account Test", function() {
cy.visit("/biotestmine/querybuilder");
cy.get(".model-browser-root").within(() => {
cy.selectFromDropdown("Protein");
cy.contains("Summary").click();
cy.contains("Add summary").click();
});

cy.get("div.panel-body").first().as("queryEditorTab").within(()=>{
Expand Down Expand Up @@ -148,4 +148,4 @@ describe("User Account Test", function() {
cy.wait("@logout");
cy.get(".mine-intro").should("exist");
})
});
});
9 changes: 5 additions & 4 deletions src/cljs/bluegenes/pages/querybuilder/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@
[:span.label-button
{:on-click (fn [e]
(ocall e :stopPropagation)
(dispatch [:qb/enhance-query-add-summary-views path sub]))}
"Summary"])]
(dispatch [:qb/enhance-query-add-summary-views path sub]))
:title (str "Add summary fields of " str-path " to query view")}
"Add summary"])]
(when open?
(let [class (im-path/class model (join "." trail))]
(into [:ul]
Expand Down Expand Up @@ -333,8 +334,8 @@
(when @root-class
[:button.label-button
{:on-click #(dispatch [:qb/enhance-query-add-summary-views [(name @root-class)]])
:title (str "Summarise " @root-class " by adding its common attributes")}
"Summary"])]
:title (str "Add summary fields of " (name @root-class) " to query view")}
"Add summary"])]
(if @root-class
[model-browser
(assoc @current-model :type-constraints @type-constraints)
Expand Down

0 comments on commit 5a67eb6

Please sign in to comment.