From 1bfe4360a6acf9ec56df3c0f2ff60a57cb49cf6f Mon Sep 17 00:00:00 2001 From: "bruno.tavares" Date: Wed, 13 Sep 2023 14:53:21 +0100 Subject: [PATCH] Fix: Warning in console when creating a new test (#728) --- web/frontend/package.json | 7 +- .../src/components/Header/Profile/Profile.js | 49 +- .../Run/ErrorStatus/RunErrorStatus.js | 3 +- .../Run/PendingStatus/RunPendingStatus.js | 3 +- .../MoreButtonsMenu/MoreButtonsMenu.js | 17 +- .../Run/RunningStatus/RunRunningStatus.js | 12 +- .../User/CreateUserModal/CreateUserModal.js | 2 +- .../User/EditUserModal/EditUserModal.js | 2 +- .../CreateWorkspaceModal.js | 2 +- .../EditWorkspaceModal/EditWorkspaceModal.js | 2 +- web/frontend/src/index.js | 10 +- web/frontend/src/pages/Layout/layout.css | 2 +- web/frontend/yarn.lock | 3220 +++++++++-------- 13 files changed, 1796 insertions(+), 1535 deletions(-) diff --git a/web/frontend/package.json b/web/frontend/package.json index e32b273d..12bb203b 100644 --- a/web/frontend/package.json +++ b/web/frontend/package.json @@ -5,10 +5,11 @@ "dependencies": { "@ant-design/colors": "^6.0.0", "@ant-design/icons": "^4.6.2", + "@ant-design/pro-layout": "^7.16.11", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^12.1.5", "@testing-library/user-event": "^14.4.3", - "antd": "^4.19.5", + "antd": "^5.8.6", "axios": "^0.27.2", "axios-mock-adapter": "^1.21.2", "chart.js": "^3.7.1", @@ -25,9 +26,9 @@ "prettier": "^2.7.1", "prop-types": "^15.8.1", "qs": "^6.11.0", - "react": "^17.0.2", + "react": "^18.2.0", "react-chartjs-2": "^3.0.3", - "react-dom": "^17.0.2", + "react-dom": "^18.2.0", "react-error-boundary": "^4.0.10", "react-resizable": "^3.0.5", "react-router-dom": "6.4.2" diff --git a/web/frontend/src/components/Header/Profile/Profile.js b/web/frontend/src/components/Header/Profile/Profile.js index b6f5521f..9df0a191 100644 --- a/web/frontend/src/components/Header/Profile/Profile.js +++ b/web/frontend/src/components/Header/Profile/Profile.js @@ -3,7 +3,7 @@ import { LogoutOutlined, UserOutlined } from "@ant-design/icons"; -import { Dropdown, Menu, Select, Space } from "antd"; +import { Dropdown, Select, Space } from "antd"; import { useContext } from "react"; import { Link, useLocation, useNavigate } from "react-router-dom"; @@ -35,26 +35,31 @@ const Profile = () => { setCurrentWorkspace(workspace); }; - const menu = ( - - - {user.email} - - {user.role === userRoleModel.ADMIN ? ( - <> - }> - Workspaces - - }> - Users - - - ) : null} - }> - Logout - - - ); + const items = [ + { + key: "me", + label: user.email, + disabled: true + }, + { + key: "workspaces", + label: Workspaces, + icon: , + disabled: user.role !== userRoleModel.ADMIN + }, + { + key: "users", + label: Users, + icon: , + disabled: user.role !== userRoleModel.ADMIN + }, + { + key: "logout", + label: Logout, + icon: , + danger: true + } + ]; return ( @@ -70,7 +75,7 @@ const Profile = () => { ))} diff --git a/web/frontend/src/components/Run/ErrorStatus/RunErrorStatus.js b/web/frontend/src/components/Run/ErrorStatus/RunErrorStatus.js index 972def81..6d004a73 100644 --- a/web/frontend/src/components/Run/ErrorStatus/RunErrorStatus.js +++ b/web/frontend/src/components/Run/ErrorStatus/RunErrorStatus.js @@ -1,5 +1,6 @@ import { CloseCircleOutlined } from "@ant-design/icons"; -import { Button, PageHeader, Result, Space, Typography } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; +import { Button, Result, Space, Typography } from "antd"; import { useCallback, useEffect, useState } from "react"; import { Link, useNavigate } from "react-router-dom"; diff --git a/web/frontend/src/components/Run/PendingStatus/RunPendingStatus.js b/web/frontend/src/components/Run/PendingStatus/RunPendingStatus.js index f4fccdc6..b85d09d2 100644 --- a/web/frontend/src/components/Run/PendingStatus/RunPendingStatus.js +++ b/web/frontend/src/components/Run/PendingStatus/RunPendingStatus.js @@ -1,4 +1,5 @@ -import { Button, Col, PageHeader, Popconfirm, Row, Steps } from "antd"; +import { PageHeader } from "@ant-design/pro-layout"; +import { Button, Col, Popconfirm, Row, Steps } from "antd"; import { useCallback } from "react"; import { useNavigate } from "react-router-dom"; diff --git a/web/frontend/src/components/Run/RunningStatus/MoreButtonsMenu/MoreButtonsMenu.js b/web/frontend/src/components/Run/RunningStatus/MoreButtonsMenu/MoreButtonsMenu.js index 8024886f..c39c0ea3 100644 --- a/web/frontend/src/components/Run/RunningStatus/MoreButtonsMenu/MoreButtonsMenu.js +++ b/web/frontend/src/components/Run/RunningStatus/MoreButtonsMenu/MoreButtonsMenu.js @@ -1,12 +1,13 @@ import { MoreOutlined } from "@ant-design/icons"; -import { Button, Dropdown, Menu } from "antd"; +import { Button, Dropdown } from "antd"; import { runLogDownloadUrl } from "../../../../lib/routes"; const MoreButtonsMenu = ({ runId }) => { - const menu = ( - - + const items = [ + { + key: "runId", + label: ( { > Download logs - - - ); + ) + } + ]; return ( - +