From dd70557640db594940b7b4220608904f4a91e488 Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Mon, 2 Dec 2024 17:00:37 +0900 Subject: [PATCH] Changed supported NodeJS/OS version and fixed code --- .github/workflows/ci.yml | 6 +- .github/workflows/docker_helper.sh | 2 +- .github/workflows/nodejs_helper.sh | 2 +- .github/workflows/nodejstypevars.sh | 13 +- package.json | 64 +- .../__snapshots__/r3aboutdialog-test.jsx.snap | 40 +- .../r3accountdialog-test.jsx.snap | 62 +- .../__snapshots__/r3appbar-test.jsx.snap | 26 +- .../__snapshots__/r3container-test.jsx.snap | 224 +++--- .../r3createpathdialog-test.jsx.snap | 62 +- .../r3createservicedialog-test.jsx.snap | 91 ++- .../r3createservicetenantdialog-test.jsx.snap | 62 +- .../__snapshots__/r3formbuttons-test.jsx.snap | 8 +- .../r3localtenantdialog-test.jsx.snap | 136 ++-- .../__snapshots__/r3maintree-test.jsx.snap | 669 ++++++------------ .../__snapshots__/r3msgbox-test.jsx.snap | 12 +- .../r3pathinfodialog-test.jsx.snap | 49 +- .../__snapshots__/r3policy-test.jsx.snap | 99 ++- .../r3popupmsgdialog-test.jsx.snap | 40 +- .../__snapshots__/r3resource-test.jsx.snap | 191 +++-- .../__snapshots__/r3role-test.jsx.snap | 224 +++--- .../__snapshots__/r3service-test.jsx.snap | 101 ++- .../r3signincreddialog-test.jsx.snap | 60 +- .../__snapshots__/r3toolbar-test.jsx.snap | 51 +- 24 files changed, 1042 insertions(+), 1252 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d1cf20..b4a9296 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: fail-fast: false matrix: - node-version: [18, 20] + node-version: [18, 20, 22] steps: # @@ -137,8 +137,8 @@ jobs: # : If you want to use the created Docker image as the default image, specify "default". # imageinfo: - - alpine:3.19,alpine:3.19,alpine,default - - ubuntu:22.04,ubuntu:22.04,ubuntu + - alpine:3.20,alpine:3.20,alpine,default + - ubuntu:24.04,ubuntu:24.04,ubuntu # # Run building and pushing helper diff --git a/.github/workflows/docker_helper.sh b/.github/workflows/docker_helper.sh index c7e0d0a..1a18e18 100755 --- a/.github/workflows/docker_helper.sh +++ b/.github/workflows/docker_helper.sh @@ -661,7 +661,7 @@ fi if echo "${CI_DOCKER_IMAGE_OSTYPE}" | grep -q -i -e "ubuntu" -e "debian"; then SETUP_PC_SCRIPT_NAME="script.deb.sh" SETUP_PC_SCRIPT_EXEC="bash" -elif echo "${CI_DOCKER_IMAGE_OSTYPE}" | grep -q -i -e "rocky" -e "centos" -e "fedora"; then +elif echo "${CI_DOCKER_IMAGE_OSTYPE}" | grep -q -i -e "rocky" -e "fedora"; then SETUP_PC_SCRIPT_NAME="script.rpm.sh" SETUP_PC_SCRIPT_EXEC="bash" elif echo "${CI_DOCKER_IMAGE_OSTYPE}" | grep -q -i -e "alpine"; then diff --git a/.github/workflows/nodejs_helper.sh b/.github/workflows/nodejs_helper.sh index e4ac89a..8309906 100755 --- a/.github/workflows/nodejs_helper.sh +++ b/.github/workflows/nodejs_helper.sh @@ -736,7 +736,7 @@ PRNSUCCESS "Start to check options and environments" CPPCHECK_TARGET="." CPPCHECK_BASE_OPT="--quiet --error-exitcode=1 --inline-suppr -j 4 --std=c++03 --xml --enable=warning,style,information,missingInclude" CPPCHECK_ENABLE_VALUES="warning style information missingInclude" -CPPCHECK_IGNORE_VALUES="unmatchedSuppression" +CPPCHECK_IGNORE_VALUES="unmatchedSuppression missingIncludeSystem normalCheckLevelMaxBranches" CPPCHECK_BUILD_DIR="/tmp/cppcheck" SHELLCHECK_TARGET_DIRS="." diff --git a/.github/workflows/nodejstypevars.sh b/.github/workflows/nodejstypevars.sh index 917bf55..deee9f1 100644 --- a/.github/workflows/nodejstypevars.sh +++ b/.github/workflows/nodejstypevars.sh @@ -62,25 +62,20 @@ if [ -z "${CI_NODEJS_MAJOR_VERSION}" ]; then # Unknown NodeJS Major version : Nothing to do # : -elif [ "${CI_NODEJS_MAJOR_VERSION}" = "14" ]; then - INSTALL_PKG_LIST="git" - INSTALLER_BIN="apt-get" - INSTALL_QUIET_ARG="-qq" - IS_PUBLISHER=0 -elif [ "${CI_NODEJS_MAJOR_VERSION}" = "16" ]; then +elif [ "${CI_NODEJS_MAJOR_VERSION}" = "18" ]; then INSTALL_PKG_LIST="git" INSTALLER_BIN="apt-get" INSTALL_QUIET_ARG="-qq" IS_PUBLISHER=0 -elif [ "${CI_NODEJS_MAJOR_VERSION}" = "18" ]; then +elif [ "${CI_NODEJS_MAJOR_VERSION}" = "20" ]; then INSTALL_PKG_LIST="git" INSTALLER_BIN="apt-get" INSTALL_QUIET_ARG="-qq" IS_PUBLISHER=1 -elif [ "${CI_NODEJS_MAJOR_VERSION}" = "20" ]; then +elif [ "${CI_NODEJS_MAJOR_VERSION}" = "22" ]; then INSTALL_PKG_LIST="git" INSTALLER_BIN="apt-get" INSTALL_QUIET_ARG="-qq" @@ -131,7 +126,7 @@ RUN_POST_PUBLISH=1 # CPPCHECK_TARGET "." # CPPCHECK_BASE_OPT "--quiet --error-exitcode=1 --inline-suppr -j 4 --std=c++03 --xml" # CPPCHECK_ENABLE_VALUES "warning style information missingInclude" -# CPPCHECK_IGNORE_VALUES "unmatchedSuppression" +# CPPCHECK_IGNORE_VALUES "unmatchedSuppression missingIncludeSystem normalCheckLevelMaxBranches" # CPPCHECK_BUILD_DIR "/tmp/cppcheck" # # SHELLCHECK_TARGET_DIRS "." diff --git a/package.json b/package.json index e521d1b..ba4eade 100644 --- a/package.json +++ b/package.json @@ -2,27 +2,27 @@ "name": "k2hr3-app", "version": "1.0.34", "dependencies": { - "@emotion/react": "^11.11.4", - "@emotion/styled": "^11.11.5", - "@mui/icons-material": "^5.15.15", - "@mui/material": "^5.15.15", - "ajv": "^8.12.0", - "body-parser": "^1.20.2", - "config": "^3.3.11", - "cookie-parser": "^1.4.6", - "debug": "^4.3.4", - "ejs": "^3.1.9", - "express": "^4.19.2", - "express-session": "^1.18.0", - "jose": "^5.2.4", + "@emotion/react": "^11.13.5", + "@emotion/styled": "^11.13.5", + "@mui/icons-material": "^6.1.9", + "@mui/material": "^6.1.9", + "ajv": "^8.17.1", + "body-parser": "^1.20.3", + "config": "^3.3.12", + "cookie-parser": "^1.4.7", + "debug": "^4.3.7", + "ejs": "^3.1.10", + "express": "^4.21.1", + "express-session": "^1.18.1", + "jose": "^5.9.6", "morgan": "^1.10.0", - "openid-client": "^5.6.5", + "openid-client": "^6.1.6", "passport": "^0.7.0", "prop-types": "^15.8.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", "react-transition-group": "^4.4.5", - "rotating-file-stream": "^3.2.1", + "rotating-file-stream": "^3.2.5", "serve-favicon": "^2.5.0", "whatwg-fetch": "^3.6.20" }, @@ -42,26 +42,26 @@ "views": "views" }, "devDependencies": { - "@babel/core": "^7.24.4", - "@babel/eslint-parser": "^7.24.1", + "@babel/core": "^7.26.0", + "@babel/eslint-parser": "^7.25.9", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.24.1", + "@babel/plugin-proposal-decorators": "^7.25.9", "@babel/plugin-proposal-private-property-in-object": "^7.21.11", - "@babel/preset-env": "^7.24.4", - "@babel/preset-react": "^7.24.1", + "@babel/preset-env": "^7.26.0", + "@babel/preset-react": "^7.25.9", "babel-jest": "^29.7.0", - "babel-loader": "^9.1.3", - "css-loader": "^7.0.0", - "eslint": "^8.57.0", - "eslint-plugin-react": "^7.34.1", + "babel-loader": "^9.2.1", + "css-loader": "^7.1.2", + "eslint": "^8.57.1", + "eslint-plugin-react": "^7.37.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "license-checker": "^25.0.1", "react-test-context-provider": "^2.2.0", - "react-test-renderer": "^18.2.0", - "style-loader": "^3.3.4", - "webpack": "^5.91.0", + "react-test-renderer": "^18.3.1", + "style-loader": "^4.0.0", + "webpack": "^5.96.1", "webpack-cli": "^5.1.4" }, "browser": { @@ -93,9 +93,9 @@ "test": "npm run test:all", "test:all": "echo 'All Test - ESLint and JEST' && npm run test:lint && npm run test:jest", "test:lint": "echo 'Run ESlint(NOTE: maybe install eslint in global)' && eslint app.js webpack.config.js bin/www routes/*.js routes/*/*.js src/*/*.js src/*.jsx src/*/*.jsx tests/*/*.js tests/*/*.jsx && echo 'ESlint - Success' && echo ''", - "test:jest": "echo 'Run JEST' && jest --env=jsdom && echo 'JEST - Success' && echo ''", - "test:update": "echo 'Update JEST snapshot' && jest --env=jsdom --updateSnapshot && echo 'Update JEST snapshot - Success' && echo ''", - "test:watch": "echo 'Start JEST watch' && jest --env=jsdom --watch && echo 'Start JEST watch - Success' && echo ''", + "test:jest": "echo 'Run JEST' && jest --env=jsdom --silent && echo 'JEST - Success' && echo ''", + "test:update": "echo 'Update JEST snapshot' && jest --env=jsdom --updateSnapshot --silent && echo 'Update JEST snapshot - Success' && echo ''", + "test:watch": "echo 'Start JEST watch' && jest --env=jsdom --watch --silent && echo 'Start JEST watch - Success' && echo ''", "deploy": "echo 'Deploy github pages for demo' && demo/demo_deploy.sh && echo 'Deploy github pages for demo - Success' && echo ''" }, "repository": { diff --git a/tests/__tests__/__snapshots__/r3aboutdialog-test.jsx.snap b/tests/__tests__/__snapshots__/r3aboutdialog-test.jsx.snap index 89af856..e7c8840 100644 --- a/tests/__tests__/__snapshots__/r3aboutdialog-test.jsx.snap +++ b/tests/__tests__/__snapshots__/r3aboutdialog-test.jsx.snap @@ -3,7 +3,7 @@ exports[`R3AboutDialog test snapshot for R3AboutDialog 1`] = ` < aria-label="about dialog" - className="MuiDialog-root css-1h8td7x-MuiDialog-root" + className="MuiDialog-root css-1pivxxs-MuiDialog-root" closeAfterTransition={true} components={ { @@ -33,6 +33,11 @@ exports[`R3AboutDialog test snapshot for R3AboutDialog 1`] = ` "__emotion_styles": [ "label:MuiDialog-backdrop;", [Function], + { + "name": "1mbdz04", + "next": undefined, + "styles": "z-index:-1;", + }, [Function], [Function], ], @@ -72,41 +77,52 @@ exports[`R3AboutDialog test snapshot for R3AboutDialog 1`] = ` } >

About K2HR3

License: MIT
K2HR3 is K2hdkc based Resource and Roles and policy Rules, gathers commonmanagement information for the cloud.K2HR3 can dynamically manage information as "who", "what", "operate".These are stored as roles, resources, policies in K2hdkc, and the clientsystem can dynamically read and modify these information.
@@ -116,11 +132,11 @@ exports[`R3AboutDialog test snapshot for R3AboutDialog 1`] = `
diff --git a/tests/__tests__/__snapshots__/r3appbar-test.jsx.snap b/tests/__tests__/__snapshots__/r3appbar-test.jsx.snap index 638f4c0..92bd6d3 100644 --- a/tests/__tests__/__snapshots__/r3appbar-test.jsx.snap +++ b/tests/__tests__/__snapshots__/r3appbar-test.jsx.snap @@ -2,16 +2,21 @@ exports[`R3AppBar test snapshot for R3AppBar 1`] = `
K2HR3
@@ -57,7 +60,7 @@ exports[`R3AppBar test snapshot for R3AppBar 1`] = ` aria-haspopup="true" aria-label="signin menu" aria-labelledby={null} - className="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit MuiIconButton-sizeLarge css-1fn7xgs-MuiButtonBase-root-MuiIconButton-root" + className="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit MuiIconButton-sizeLarge css-mnh26k-MuiButtonBase-root-MuiIconButton-root" data-mui-internal-clone-element={true} disabled={false} label="signin-menu" @@ -81,7 +84,7 @@ exports[`R3AppBar test snapshot for R3AppBar 1`] = ` > -
diff --git a/tests/__tests__/__snapshots__/r3container-test.jsx.snap b/tests/__tests__/__snapshots__/r3container-test.jsx.snap index 2b5f229..85c358d 100644 --- a/tests/__tests__/__snapshots__/r3container-test.jsx.snap +++ b/tests/__tests__/__snapshots__/r3container-test.jsx.snap @@ -3,16 +3,21 @@ exports[`R3Container test snapshot for R3Container 1`] = ` [
K2HR3
@@ -58,7 +61,7 @@ exports[`R3Container test snapshot for R3Container 1`] = ` aria-haspopup="true" aria-label="signin menu" aria-labelledby={null} - className="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit MuiIconButton-sizeLarge css-1fn7xgs-MuiButtonBase-root-MuiIconButton-root" + className="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorInherit MuiIconButton-sizeLarge css-mnh26k-MuiButtonBase-root-MuiIconButton-root" data-mui-internal-clone-element={true} disabled={false} label="signin-menu" @@ -82,7 +85,7 @@ exports[`R3Container test snapshot for R3Container 1`] = ` > -
, @@ -107,35 +107,42 @@ exports[`R3Container test snapshot for R3Container 1`] = ` className="MuiBox-root css-0" >
TENANT
No tenant list
-
SERVICE
- -
+
-
ROLE
- -
+
-
RESOURCE
- -
+
-
POLICY
- -
+
@@ -388,15 +332,20 @@ exports[`R3Container test snapshot for R3Container 1`] = ` className="MuiBox-root css-0" >
Unselected -
First select the tenant, then select ROLE / RESOURCE / POLICY, then browse and edit.
diff --git a/tests/__tests__/__snapshots__/r3createpathdialog-test.jsx.snap b/tests/__tests__/__snapshots__/r3createpathdialog-test.jsx.snap index 60f1266..90c68e0 100644 --- a/tests/__tests__/__snapshots__/r3createpathdialog-test.jsx.snap +++ b/tests/__tests__/__snapshots__/r3createpathdialog-test.jsx.snap @@ -3,7 +3,7 @@ exports[`R3CreatePathDialog test snapshot for R3CreatePathDialog 1`] = ` < aria-label="create path dialog" - className="MuiDialog-root css-1h8td7x-MuiDialog-root" + className="MuiDialog-root css-1pivxxs-MuiDialog-root" closeAfterTransition={true} components={ { @@ -33,6 +33,11 @@ exports[`R3CreatePathDialog test snapshot for R3CreatePathDialog 1`] = ` "__emotion_styles": [ "label:MuiDialog-backdrop;", [Function], + { + "name": "1mbdz04", + "next": undefined, + "styles": "z-index:-1;", + }, [Function], [Function], ], @@ -72,75 +77,90 @@ exports[`R3CreatePathDialog test snapshot for R3CreatePathDialog 1`] = ` } >

Create a new path

TENANT GROUP0:TENANT0 TYPE role PARENT PATH /JEST_ROLE_PARENT_PATH CREATE PATH
Specify users including yourself at creating a new tenant.
-
SERVICE
- -
+
-
child_service
- -
+
-
ROLE
- -
+
-
dummyservicerole
- -
+
@@ -336,39 +280,27 @@ exports[`R3MainTree test snapshot for R3MainTree 1`] = `
-
RESOURCE
- -
+
-
dummyserviceresource
- -
+
@@ -442,39 +356,27 @@ exports[`R3MainTree test snapshot for R3MainTree 1`] = `
-
POLICY
- -
+
-
dummyservicepolicy
- -
+
@@ -558,30 +442,17 @@ exports[`R3MainTree test snapshot for R3MainTree 1`] = `
-
ROLE
- -
+
-
dummyrole
- -
+
-
dummysubrole
- -
+
@@ -750,30 +589,17 @@ exports[`R3MainTree test snapshot for R3MainTree 1`] = `
-
RESOURCE
- -
+
-
dummyresource
- -
+
-
dummysubresource
- -
+
@@ -942,30 +736,17 @@ exports[`R3MainTree test snapshot for R3MainTree 1`] = `
-
POLICY
- -
+
-
dummypolicy
- -
+
-
dummysubpolicy
- -
+
diff --git a/tests/__tests__/__snapshots__/r3msgbox-test.jsx.snap b/tests/__tests__/__snapshots__/r3msgbox-test.jsx.snap index dac069c..f01618e 100644 --- a/tests/__tests__/__snapshots__/r3msgbox-test.jsx.snap +++ b/tests/__tests__/__snapshots__/r3msgbox-test.jsx.snap @@ -2,11 +2,16 @@ exports[`R3MsgBox test snapshot for R3MsgBox 1`] = `
Dummy error message
diff --git a/tests/__tests__/__snapshots__/r3pathinfodialog-test.jsx.snap b/tests/__tests__/__snapshots__/r3pathinfodialog-test.jsx.snap index a650e79..c1f3f3e 100644 --- a/tests/__tests__/__snapshots__/r3pathinfodialog-test.jsx.snap +++ b/tests/__tests__/__snapshots__/r3pathinfodialog-test.jsx.snap @@ -3,7 +3,7 @@ exports[`R3PathInfoDialog test snapshot for R3PathInfoDialog 1`] = ` < aria-label="path information dialog" - className="MuiDialog-root css-1h8td7x-MuiDialog-root" + className="MuiDialog-root css-1pivxxs-MuiDialog-root" closeAfterTransition={true} components={ { @@ -33,6 +33,11 @@ exports[`R3PathInfoDialog test snapshot for R3PathInfoDialog 1`] = ` "__emotion_styles": [ "label:MuiDialog-backdrop;", [Function], + { + "name": "1mbdz04", + "next": undefined, + "styles": "z-index:-1;", + }, [Function], [Function], ], @@ -72,65 +77,79 @@ exports[`R3PathInfoDialog test snapshot for R3PathInfoDialog 1`] = ` } >

Selected Path Information

TENANT GROUP0:TENANT0 TYPE role PATH yrn:yahoo:::37146:role:JEST_OWNER_SERVICE
-
ALIASES
@@ -310,16 +304,16 @@ exports[`R3Policy test snapshot for R3Policy 1`] = ` className="MuiBox-root css-1wchkkw" >
-
-
-
-
ALIASES
@@ -574,16 +563,16 @@ exports[`R3Resource test snapshot for R3Resource 1`] = ` className="MuiBox-root css-1wchkkw" >
-
-
-
IP ADDRESSES

IP ADDRESS

AUX

@@ -320,16 +317,16 @@ exports[`R3Role test snapshot for R3Role 1`] = ` className="MuiBox-root css-1wchkkw" >
-
-
-
POLICIES
@@ -601,16 +590,16 @@ exports[`R3Role test snapshot for R3Role 1`] = ` className="MuiBox-root css-1wchkkw" >
-
-
ALIASES
@@ -744,16 +728,16 @@ exports[`R3Role test snapshot for R3Role 1`] = ` className="MuiBox-root css-1wchkkw" >
-
-
-
-