From 774ce5ee85037392f687143d74e9ce6039ca9286 Mon Sep 17 00:00:00 2001
From: Aleksandr Gorodetskii
<41908792+AleksandrGorodetskii@users.noreply.github.com>
Date: Tue, 10 Dec 2024 18:56:24 +0300
Subject: [PATCH] NEW-GUI Pipelines cards and pipelines page - reorganize and
style adjustments (#3781) (#3818)
---
.../pages/home/components/pipeline-card.tsx | 36 ++++-----
.../pages/home/components/pipelines-list.tsx | 75 ++++++++++---------
.../sites/ngs-portal/src/pages/home/home.tsx | 2 +-
.../ngs-portal/src/pages/pipelines/index.tsx | 6 +-
4 files changed, 64 insertions(+), 55 deletions(-)
diff --git a/portals-ui/sites/ngs-portal/src/pages/home/components/pipeline-card.tsx b/portals-ui/sites/ngs-portal/src/pages/home/components/pipeline-card.tsx
index 9e271294df..6d53db763e 100644
--- a/portals-ui/sites/ngs-portal/src/pages/home/components/pipeline-card.tsx
+++ b/portals-ui/sites/ngs-portal/src/pages/home/components/pipeline-card.tsx
@@ -16,6 +16,7 @@ type Props = CommonProps & {
pipeline: Pipeline;
highlightedText?: string;
mode?: 'standard' | 'extended';
+ showDescription?: boolean;
};
type MappedTag = {
@@ -79,6 +80,7 @@ export const PipelineCard = ({
className,
style,
mode = 'standard',
+ showDescription = false,
}: Props) => {
const { uuiModals } = useUuiContext();
const { id, name, owner, data = {}, description } = pipeline;
@@ -105,7 +107,22 @@ export const PipelineCard = ({
className,
)}
style={style}>
-
+
+
+
{name}
+
+ {showDescription && !!description && (
+
{description}
+ )}
+
}
+ color="neutral"
+ size="18"
+ cx="w-fit"
+ />
{filteredTag.length > 0 && (
{filteredTag.map((tag) => (
@@ -119,23 +136,6 @@ export const PipelineCard = ({
))}
)}
-
-
- {name}
-
- }
- color="neutral"
- size="18"
- cx="shrink-0"
- />
-
- {description && (
-
{description}
- )}
{mode === 'extended' && (
diff --git a/portals-ui/sites/ngs-portal/src/pages/home/components/pipelines-list.tsx b/portals-ui/sites/ngs-portal/src/pages/home/components/pipelines-list.tsx
index 085740d1f3..5a6822fcaa 100644
--- a/portals-ui/sites/ngs-portal/src/pages/home/components/pipelines-list.tsx
+++ b/portals-ui/sites/ngs-portal/src/pages/home/components/pipelines-list.tsx
@@ -8,43 +8,48 @@ import NavigationDependencyOutlineIcon from '@epam/assets/icons/navigation-depen
type Props = {
pipelines: Pipeline[] | undefined;
mode?: 'standard' | 'extended';
+ showDescription?: boolean;
};
-export const PipelinesList = memo(({ pipelines, mode = 'standard' }: Props) => {
- const renderItem = (item: Pipeline, search: string, i: number) => {
+export const PipelinesList = memo(
+ ({ pipelines, mode = 'standard', showDescription }: Props) => {
+ const renderItem = (item: Pipeline, search: string, i: number) => {
+ return (
+
+ );
+ };
+
return (
-
+
+
+
+ Pipelines
+
+ }
+ items={pipelines}
+ renderItem={renderItem}
+ sliced
+ virtualized
+ search
+ itemKey="id"
+ searchClassName={mode === 'extended' ? 'py-1' : undefined}
+ viewAll={
+ mode === 'extended'
+ ? undefined
+ : { title: 'View all pipelines', link: '/pipelines' }
+ }
/>
);
- };
-
- return (
-
-
-
-
- Pipelines
-
- }
- items={pipelines}
- renderItem={renderItem}
- sliced
- virtualized
- search
- itemKey="id"
- viewAll={
- mode === 'extended'
- ? undefined
- : { title: 'View all pipelines', link: '/pipelines' }
- }
- />
- );
-});
+ },
+);
diff --git a/portals-ui/sites/ngs-portal/src/pages/home/home.tsx b/portals-ui/sites/ngs-portal/src/pages/home/home.tsx
index 39327e5995..af41627e07 100644
--- a/portals-ui/sites/ngs-portal/src/pages/home/home.tsx
+++ b/portals-ui/sites/ngs-portal/src/pages/home/home.tsx
@@ -27,7 +27,7 @@ export const HomePage = () => {
diff --git a/portals-ui/sites/ngs-portal/src/pages/pipelines/index.tsx b/portals-ui/sites/ngs-portal/src/pages/pipelines/index.tsx
index 741e5f7970..509acf2d3a 100644
--- a/portals-ui/sites/ngs-portal/src/pages/pipelines/index.tsx
+++ b/portals-ui/sites/ngs-portal/src/pages/pipelines/index.tsx
@@ -20,5 +20,9 @@ export default function PipelinesPage() {
if (!pipelines) {
return
No data
;
}
- return
;
+ return (
+
+ );
}