From b49809203dca9831e0e6f6f9ba1a1d7f1832e1ea Mon Sep 17 00:00:00 2001 From: ilan7empest Date: Thu, 16 Nov 2023 17:57:03 +0800 Subject: [PATCH 1/4] Fix [Quick actions] Add breadcrumbs to Quick actions page --- .../ProjectDetailsHeader.js | 69 ++++++++------- .../ProjectOverview/ProjectOverview.js | 84 +++++++++---------- 2 files changed, 80 insertions(+), 73 deletions(-) diff --git a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js index 63bca4622..4dec376b4 100644 --- a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js +++ b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js @@ -35,38 +35,45 @@ const ProjectDetailsHeader = ({ projectData, projectName }) => {
{projectName}
-

{projectData.spec.description ?? ''}

+ {projectData && ( +

{projectData.spec.description}

+ )} - + {projectData && ( + + )} ) diff --git a/src/components/Project/ProjectOverview/ProjectOverview.js b/src/components/Project/ProjectOverview/ProjectOverview.js index 9782b85ee..29a0e91de 100644 --- a/src/components/Project/ProjectOverview/ProjectOverview.js +++ b/src/components/Project/ProjectOverview/ProjectOverview.js @@ -22,6 +22,7 @@ import { connect } from 'react-redux' import { isEmpty } from 'lodash' import { useNavigate, useParams } from 'react-router-dom' +import Breadcrumbs from '../../../common/Breadcrumbs/Breadcrumbs' import Loader from '../../../common/Loader/Loader' import NoData from '../../../common/NoData/NoData' import ProjectAction from '../ProjectAction/ProjectAction' @@ -56,10 +57,6 @@ const ProjectOverview = ({ fetchProject, project }) => { ) }, [fetchProject, navigate, params.projectName]) - if (project.loading) { - return - } - if (project.error) { return (
@@ -82,54 +79,57 @@ const ProjectOverview = ({ fetchProject, project }) => { ) } - if (isEmpty(project.data)) { - return - } - return (
+
+ +
- -
- {/* move to card */} - {Object.keys(cards).map(card => { - const { additionalLinks, actions, subTitle, title } = cards[card] - return ( -
-
-
-

{title}

-

{subTitle ?? ''}

+ {project.loading && } + {isEmpty(project.data) && !project.loading ? ( + + ) : ( +
+ {/* move to card */} + {Object.keys(cards).map(card => { + const { additionalLinks, actions, subTitle, title } = cards[card] + return ( +
+
+
+

{title}

+

{subTitle ?? ''}

+
+
+ +
-
- +
+
-
-
- -
-
-

Resources

-
- {additionalLinks && - additionalLinks.map(({ id, label, handleClick }) => ( - handlePathExecution(handleClick)} - > - {label} - - ))} +
+

Resources

+
+ {additionalLinks && + additionalLinks.map(({ id, label, handleClick }) => ( + handlePathExecution(handleClick)} + > + {label} + + ))} +
-
- ) - })} -
+ ) + })} +
+ )}
) } From c6a2300f014757e96651590c155ab5a69c27227c Mon Sep 17 00:00:00 2001 From: ilan7empest Date: Thu, 16 Nov 2023 17:59:23 +0800 Subject: [PATCH 2/4] Fix breadcrumb uppercase --- src/common/Breadcrumbs/breadcrumbs.util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/Breadcrumbs/breadcrumbs.util.js b/src/common/Breadcrumbs/breadcrumbs.util.js index 90c8f9fd1..b8f9339c5 100644 --- a/src/common/Breadcrumbs/breadcrumbs.util.js +++ b/src/common/Breadcrumbs/breadcrumbs.util.js @@ -41,7 +41,7 @@ export const generateProjectScreens = params => [ label: 'Quick actions', id: PROJECT_QUICK_ACTIONS_PAGE }, - { label: 'Feature Store', id: 'feature-store' }, + { label: 'Feature store', id: 'feature-store' }, { label: 'Datasets', id: 'datasets' }, { label: 'Artifacts', id: 'files' }, { label: 'Models', id: 'models' }, From 2d423b7099fa3f159018b5b8dfc3bf51357e306a Mon Sep 17 00:00:00 2001 From: ilan7empest Date: Thu, 16 Nov 2023 19:37:46 +0800 Subject: [PATCH 3/4] Fix by code review --- src/common/ProjectDetailsHeader/ProjectDetailsHeader.js | 7 ++++--- src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss | 1 + src/components/ProjectsPage/ProjectsView.js | 4 ---- src/components/ProjectsPage/projects.scss | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js index 4dec376b4..cf4634eae 100644 --- a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js +++ b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.js @@ -35,9 +35,10 @@ const ProjectDetailsHeader = ({ projectData, projectName }) => {
{projectName}
- {projectData && ( -

{projectData.spec.description}

- )} + +

+ {projectData && projectData.spec.description} +

{projectData && (
    diff --git a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss index 3390a7713..6a2ab650f 100644 --- a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss +++ b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss @@ -30,6 +30,7 @@ &__description { max-width: 75%; margin: 0; + word-break: break-word; } &__details { diff --git a/src/components/ProjectsPage/ProjectsView.js b/src/components/ProjectsPage/ProjectsView.js index 9732e20ca..2cde2c3ab 100644 --- a/src/components/ProjectsPage/ProjectsView.js +++ b/src/components/ProjectsPage/ProjectsView.js @@ -21,7 +21,6 @@ import React from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' -import Breadcrumbs from '../../common/Breadcrumbs/Breadcrumbs' import ContentMenu from '../../elements/ContentMenu/ContentMenu' import CreateProjectDialog from './CreateProjectDialog/CreateProjectDialog' import Loader from '../../common/Loader/Loader' @@ -99,9 +98,6 @@ const ProjectsView = ({ message={confirmData.message} /> )} -
    - -
    diff --git a/src/components/ProjectsPage/projects.scss b/src/components/ProjectsPage/projects.scss index e5d815a70..4b31679b0 100644 --- a/src/components/ProjectsPage/projects.scss +++ b/src/components/ProjectsPage/projects.scss @@ -25,7 +25,7 @@ display: flex; flex-flow: column nowrap; height: 100%; - padding: 0 12px 15px; + padding: 50px 12px 0; .projects-content-header { display: flex; From b305aafa686b95d659da06ea764012db4b44ca3e Mon Sep 17 00:00:00 2001 From: ilan7empest Date: Fri, 17 Nov 2023 02:40:39 +0800 Subject: [PATCH 4/4] fix by code review --- src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss index 6a2ab650f..755d3715b 100644 --- a/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss +++ b/src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss @@ -28,7 +28,7 @@ } &__description { - max-width: 75%; + max-width: 90%; margin: 0; word-break: break-word; }