diff --git a/.husky/.gitignore b/.husky/.gitignore deleted file mode 100644 index 31354ec138..0000000000 --- a/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 169fc556e7..0000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npm run lint:js -# npm test diff --git a/cypress/e2e/iva/job-browser-grid.cy.js b/cypress/e2e/iva/job-browser-grid.cy.js index 897e742a5e..d7450c509e 100644 --- a/cypress/e2e/iva/job-browser-grid.cy.js +++ b/cypress/e2e/iva/job-browser-grid.cy.js @@ -31,88 +31,38 @@ context("Job Browser Grid", () => { // TOOLBAR context("Job Toolbar", () => { - const toolbarComponent = ""; - beforeEach(() => { cy.get(browserGrid) .find(`div[data-cy="toolbar"]`) .as("toolbar"); }); - //1. Render the toolbar - context("render", () => { - // 1.1. It should render a div with the toolbar - it("should render toolbar", () => { - cy.get(browserGrid) - .find(`div[data-cy="toolbar-wrapper"]`) - .should("be.visible"); - }); - // 1.1. If configured, it should render a New button - it("should render New button", () => { - cy.get(browserGrid) - .find(`button[data-action="create"]`) - .should("be.visible"); - }); + it("should render toolbar", () => { + cy.get(browserGrid) + .find(`div[data-cy="toolbar-wrapper"]`) + .should("be.visible"); }); - }); - // MODAL CREATE - context("Modal Create", () => { - beforeEach(() => { - // eslint-disable-next-line cypress/unsafe-to-chain-command + it("should render Refresh button", () => { cy.get(browserGrid) - .find(`button[data-action="create"]`) - .should("be.disabled"); + .find(`button[data-cy="job-refresh"]`) + .should("be.visible"); + }); + + it("should render Export button", () => { cy.get(browserGrid) - .find(`div[data-cy="modal-create"]`) - .as("modal-create"); + .find(`button[data-cy="toolbar-btn-export"]`) + .should("be.visible"); + }); + + it("should render Settings button", () => { + cy.get(browserGrid) + .find(`button[data-cy="toolbar-btn-settings"]`) + .should("be.visible"); }); - // 1. Open modal and render create - // it("should render create modal", () => { - // // eslint-disable-next-line cypress/unsafe-to-chain-command - // cy.get("@modal-create") - // .find("div.modal-dialog") - // .should("be.visible"); - // }); - // 2. Render title - // it("should render create title", () => { - // // eslint-disable-next-line cypress/unsafe-to-chain-command - // cy.get("@modal-create") - // .find("h4.modal-title") - // .should("contain.text", "Job Create"); - // }); - // 3. Render button clear - // it("should render button clear", () => { - // // eslint-disable-next-line cypress/unsafe-to-chain-command - // cy.get("@modal-create") - // .contains('button', 'Clear') - // .should("be.visible"); - // }); - // 4. Render button create - // it("should render button create", () => { - // // eslint-disable-next-line cypress/unsafe-to-chain-command - // cy.get("@modal-create") - // .contains('button', 'Create') - // .should("be.visible"); - // }); - // 5. Render tabs - // it("should render form tabs", () => { - // // eslint-disable-next-line cypress/unsafe-to-chain-command - // cy.get("@modal-create") - // .find("ul.nav.nav-tabs > li") - // .should("have.length.at.least", 1); - // }); - // 6. Render File ID - // it("should have form field ID", () => { - // // eslint-disable-next-line cypress/unsafe-to-chain-command - // cy.get("@modal-create") - // .find(`data-form div.form-horizontal div.row.form-group label.control-label`) - // .should("contain.text", "Job ID"); - // }); }); context("Modal Setting", () => { - it("should move modal setting", () => { cy.get("button[data-action='settings']") .click(); @@ -204,27 +154,27 @@ context("Job Browser Grid", () => { }); }); - context("Row", () => { - it("should display row #3 as selected", () => { - // eslint-disable-next-line cypress/unsafe-to-chain-command - cy.get("tbody tr") - .eq(3) - .click() - .should("have.class","success"); - }); + context("Row", () => { + it("should display row #3 as selected", () => { + // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.get("tbody tr") + .eq(3) + .click() + .should("have.class","success"); + }); - it("should download job Json", () => { - cy.get("tbody tr:first > td") - .eq(-2) - .within(() => { - cy.get("button") - .click(); - cy.get("ul[class='dropdown-menu dropdown-menu-right']") - .contains("a","Download JSON") - .click(); - }); + it("should download job Json", () => { + cy.get("tbody tr:first > td") + .eq(-2) + .within(() => { + cy.get("button") + .click(); + cy.get("ul[class='dropdown-menu dropdown-menu-right']") + .contains("a","Download JSON") + .click(); }); }); + }); context("extension", () => { it("should display 'Extra Column' column", () => { diff --git a/package.json b/package.json index 8bb72077ee..afa96b8068 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "serve:build": "vite preview", "clean": "rm -rf build", "build": "npm run clean && rollup -c && npm run package", - "prepare": "husky install", "test:open": "cypress open", "test:prepare": "./prepare-test.sh", "test:run": "cypress run --spec cypress/e2e/commons/data-form.cy.js,cypress/e2e/iva/**/*.cy.js", @@ -43,7 +42,6 @@ "@polymer/polymer": "2.6.1", "@svgdotjs/svg.js": "^3.0.16", "@vaadin/router": "^1.7.2", - "@webcomponents/webcomponentsjs": "^1.1.0", "animate.css": "^3.5.2", "backbone": "~1.3.3", "bootstrap": "3.3.6", @@ -107,7 +105,6 @@ "grunt": "^1.4.0", "grunt-shell": "^3.0.1", "highlight.js": "^10.6.0", - "husky": "^6.0.0", "lint-staged": "^11.0.0", "regenerator-runtime": "^0.13.3", "rollup": "^2.56.3", diff --git a/src/sites/api/index.html b/src/sites/api/index.html index 9a19d331a9..e4c4dc8fa9 100644 --- a/src/sites/api/index.html +++ b/src/sites/api/index.html @@ -55,9 +55,6 @@ - - diff --git a/src/sites/iva/index.html b/src/sites/iva/index.html index 0ba84271fa..e46364a22d 100644 --- a/src/sites/iva/index.html +++ b/src/sites/iva/index.html @@ -83,10 +83,6 @@ - - - - diff --git a/src/webcomponents/commons/opencb-grid-toolbar.js b/src/webcomponents/commons/opencb-grid-toolbar.js index eaef8b6ccc..64e97fb872 100644 --- a/src/webcomponents/commons/opencb-grid-toolbar.js +++ b/src/webcomponents/commons/opencb-grid-toolbar.js @@ -156,12 +156,12 @@ export default class OpencbGridToolbar extends LitElement { As a workaround, the tooltip will be displayed from a wrapper --> ${isCreateDisabled ? html ` - ` : html ` - @@ -181,7 +181,7 @@ export default class OpencbGridToolbar extends LitElement { ${this._settings?.showSettings ? html`
-
diff --git a/src/webcomponents/job/job-grid.js b/src/webcomponents/job/job-grid.js index cc1709fc1f..02c05dfd63 100644 --- a/src/webcomponents/job/job-grid.js +++ b/src/webcomponents/job/job-grid.js @@ -90,7 +90,7 @@ export default class JobGrid extends LitElement { } propertyObserver() { - // With each property change we must updated config and create the columns again. No extra checks are needed. + // With each property change we must update config and create the columns again. No extra checks are needed. this._config = { ...this.getDefaultConfig(), ...this.config, @@ -107,21 +107,21 @@ export default class JobGrid extends LitElement { toolId: this.toolId, resource: "JOB", columns: this._getDefaultColumns(), - create: { - display: { - modalTitle: "Job Create", - modalDraggable: true, - disabled: true, - disabledTooltip: "This operation will be implemented soon. Thanks for your patience.", - modalCyDataName: "modal-create", - }, - render: () => html ` - - ` - }, // Uncomment in case we need to change defaults + // create: { + // display: { + // modalTitle: "Job Create", + // modalDraggable: true, + // disabled: true, + // disabledTooltip: "This operation will be implemented soon. Thanks for your patience.", + // modalCyDataName: "modal-create", + // }, + // render: () => html ` + // + // ` + // }, // export: { // display: { // modalTitle: "Job Export", @@ -421,26 +421,46 @@ export default class JobGrid extends LitElement { if (UtilsNew.isNotEmpty(params)) { html = "
"; for (const key of Object.keys(params)) { - let nestedObject = ""; - if (typeof params[key] === "object") { - for (const subKey of Object.keys(params[key])) { - nestedObject += ` -
- ${subKey}: ${params[key][subKey]} + html += `
`; + // 1. Normal parameter + if (typeof params[key] !== "object") { + if (params[key].length > 100) { + html += ` + ${key}: ${params[key].substring(0, 100) + "..." || "true"} + `; + } else { + html += ` + ${key}: ${params[key] || "true"} + `; + } + } else { + // 2. This parameter is an Object, we need to loop its internal subparams. + let nestedObject = ""; + // 2.1 It can contain some subparams, or ... + if (UtilsNew.isNotEmpty(params[key])) { + for (const subKey of Object.keys(params[key])) { + nestedObject += ` +
+ ${subKey}: ${params[key][subKey]} +
+ `; + } + html += ` +
+ ${key}: +
+
+ ${nestedObject}
`; + } else { + // 2.2 ... it can be an empty object. + html += ` + ${key}:none + `; } } - html += ` -
- ${nestedObject ? ` -
${key}:
-
- ${nestedObject} -
` : - `${key}: ${params[key]}`} -
- `; + html += "
"; } html += "
"; } @@ -641,7 +661,7 @@ export default class JobGrid extends LitElement { return [ { render: () => html` - `,