Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions canvas_modules/common-canvas/.eslintrc.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2023 Elyra Authors
* Copyright 2017-2025 Elyra Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,12 +17,16 @@

const codeCoverageDir = "reports/coverage";
const autoprefixer = require("autoprefixer");
const { config } = require("grunt");

module.exports = function(grunt) {
grunt.initConfig({
eslint: {
node: {
src: ["Gruntfile.js", "__mocks__/**/*.js", "__tests__/**/*.js", "constants/**/*.js", "utils/**/*.js"]
target: [
"Gruntfile.cjs","__mocks__/**/*.js", "__tests__/**/*.js", "constants/**/*.js", "utils/**/*.js"
],
options: {
overrideConfigFile: "eslint.config.mjs"
},
browser: {
files: {
Expand Down Expand Up @@ -69,7 +73,7 @@ module.exports = function(grunt) {
postcss: {
options: {
processors: [
autoprefixer() // add vendor prefixes
autoprefixer // add vendor prefixes
]
},
dist: {
Expand Down
2 changes: 1 addition & 1 deletion canvas_modules/common-canvas/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
*/


module.exports = "test-file-stub";
export default "test-file-stub";
2 changes: 1 addition & 1 deletion canvas_modules/common-canvas/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// This file allows jest tests to run. It should contain any exported variables
// from *.scss files which are used in the code

module.exports = {
export default {
smallFlyoutWidth: "318px", // This variable is taken from global.scss
mediumFlyoutWidth: "625px" // This variable is taken from global.scss
};
2 changes: 1 addition & 1 deletion canvas_modules/common-canvas/__mocks__/svgMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

module.exports = "<svg />";
export default "<svg />";
30 changes: 0 additions & 30 deletions canvas_modules/common-canvas/__tests__/.eslintrc.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@
* limitations under the License.
*/

const { fireEvent } = require("@testing-library/react");
import { fireEvent } from "@testing-library/react";

// Retrieve the dropdown items from a non-filterable dropdown control
function getDropdownItems(container, parameterId) {
export function getDropdownItems(container, parameterId) {
let dropdownWrapper = container.querySelector(`div[data-id='properties-${parameterId}']`);
const dropdownButton = dropdownWrapper.querySelector("button");
fireEvent.click(dropdownButton);
dropdownWrapper = container.querySelector(`div[data-id='properties-${parameterId}']`);
const dropdownList = dropdownWrapper.querySelectorAll("li.cds--list-box__menu-item");
return dropdownList;
}

module.exports = {
getDropdownItems: getDropdownItems
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@
* limitations under the License.
*/
// This is an invalid formatted operation
function op() {
export function op() {
return "invalidOp";
}

function invalid(paramInfo, param2Info, value, controller) {
export function invalid(paramInfo, param2Info, value, controller) {
return true;
}

// Public Methods ------------------------------------------------------------->

module.exports.op = op;
module.exports.invalid = invalid;
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,14 @@
* limitations under the License.
*/

function op() {
export function op() {
return "customMax";
}

function evaluate(paramInfo, param2Info, value, controller) {
export function evaluate(paramInfo, param2Info, value, controller) {
const supportedControls = ["numberfield"];
if (supportedControls.indexOf(paramInfo.control.controlType) >= 0) {
return paramInfo.value < value;
}
return true;
}

// Public Methods ------------------------------------------------------------->

module.exports.op = op;
module.exports.evaluate = evaluate;
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@
* limitations under the License.
*/

function op() {
export function op() {
return "equals";
}

function evaluate() {
export function evaluate() {
return "testing";
}

// Public Methods ------------------------------------------------------------->

module.exports.op = op;
module.exports.evaluate = evaluate;
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function controllerHandler(propertyController) {
renderedController = propertyController;
}

function flyoutEditorForm(paramDef, propertiesConfigOverrides, callbacksOverrides, propertiesInfoOverrides) {
export function flyoutEditorForm(paramDef, propertiesConfigOverrides, callbacksOverrides, propertiesInfoOverrides) {
const applyPropertyChanges = sinon.spy();
const closePropertiesDialog = sinon.spy();
let callbacks = {
Expand Down Expand Up @@ -76,7 +76,7 @@ function flyoutEditorForm(paramDef, propertiesConfigOverrides, callbacksOverride
return { wrapper: wrapper, controller: renderedController, callbacks: callbacks };
}

function flyoutEditorFormRerender(paramDef, propertiesConfigOverrides, callbacksOverrides, propertiesInfoOverrides) {
export function flyoutEditorFormRerender(paramDef, propertiesConfigOverrides, callbacksOverrides, propertiesInfoOverrides) {
const applyPropertyChanges = sinon.spy();
const closePropertiesDialog = sinon.spy();
let callbacks = {
Expand Down Expand Up @@ -111,15 +111,15 @@ function flyoutEditorFormRerender(paramDef, propertiesConfigOverrides, callbacks
return { propertiesInfo: propertiesInfo, propertiesConfig: propertiesConfig, callbacks: callbacks, customControls: customControls, customConditionOps: customConditionOps };
}

function setControls(controller, controls) {
export function setControls(controller, controls) {
const parsedControls = [];
for (const control of controls) {
UiConditionsParser.parseControl(parsedControls, control);
}
controller.saveControls(parsedControls);
}

function genLongString(length) {
export function genLongString(length) {
let str = "";
while (length > str.length) {
str += Math.random().toString(36)
Expand All @@ -128,7 +128,7 @@ function genLongString(length) {
return str;
}

function openSummaryPanel(wrapper, panelId) {
export function openSummaryPanel(wrapper, panelId) {
const { container } = wrapper;
const summaryPanel = container.querySelector(`div[data-id='properties-${panelId}']`);
expect(summaryPanel).to.exist;
Expand All @@ -137,7 +137,7 @@ function openSummaryPanel(wrapper, panelId) {
}


function getParameterFromParamDef(parameterId, paramDef) {
export function getParameterFromParamDef(parameterId, paramDef) {
const parameters = paramDef.parameters;
let parameterFound = null;
parameters.forEach((parameter) => {
Expand All @@ -147,12 +147,3 @@ function getParameterFromParamDef(parameterId, paramDef) {
});
return parameterFound;
}

module.exports = {
flyoutEditorForm: flyoutEditorForm,
flyoutEditorFormRerender: flyoutEditorFormRerender,
setControls: setControls,
genLongString: genLongString,
openSummaryPanel: openSummaryPanel,
getParameterFromParamDef: getParameterFromParamDef
};
Loading
Loading