diff --git a/ui/src/features/project/project-details/project-details.tsx b/ui/src/features/project/project-details/project-details.tsx index cd5017007..6b13db194 100644 --- a/ui/src/features/project/project-details/project-details.tsx +++ b/ui/src/features/project/project-details/project-details.tsx @@ -2,6 +2,7 @@ import { createPromiseClient } from '@connectrpc/connect'; import { createConnectQueryKey, useMutation, useQuery } from '@connectrpc/connect-query'; import { faDocker } from '@fortawesome/free-brands-svg-icons'; import { + faChevronDown, faCircleCheck, faClipboard, faCopy, @@ -9,12 +10,16 @@ import { faEllipsisV, faEye, faEyeSlash, + faMasksTheater, + faPalette, faPencil, - faRefresh + faRefresh, + faWandSparkles, + faWarehouse } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useQueryClient } from '@tanstack/react-query'; -import { Button, Dropdown, Empty, message } from 'antd'; +import { Button, Dropdown, Space, Tooltip, message } from 'antd'; import { graphlib, layout } from 'dagre'; import React from 'react'; import { useParams } from 'react-router-dom'; @@ -32,6 +37,7 @@ import { FreightlineHeader } from '@ui/features/freightline/freightline-header'; import { StageIndicators } from '@ui/features/freightline/stage-indicators'; import { StageDetails } from '@ui/features/stage/stage-details'; import { getStageColors } from '@ui/features/stage/utils'; +import { clearColors } from '@ui/features/stage/utils'; import { Time } from '@ui/gen/k8s.io/apimachinery/pkg/apis/meta/v1/generated_pb'; import { approveFreight, @@ -48,6 +54,8 @@ import { Freight, Stage, Warehouse } from '@ui/gen/v1alpha1/generated_pb'; import { useDocumentEvent } from '@ui/utils/document'; import { useLocalStorage } from '@ui/utils/use-local-storage'; +import { CreateStageModal } from './create-stage-modal'; +import { CreateWarehouseModal } from './create-warehouse-modal'; import { Images } from './images'; import { RepoNode } from './nodes/repo-node'; import { Nodule, StageNode } from './nodes/stage-node'; @@ -85,6 +93,13 @@ export const ProjectDetails = () => { const client = useQueryClient(); + const { show: showCreateStage } = useModal( + name ? (p) => : undefined + ); + const { show: showCreateWarehouse } = useModal( + name ? (p) => : undefined + ); + const isVisible = useDocumentEvent( 'visibilitychange', () => document.visibilityState === 'visible' @@ -527,13 +542,6 @@ export const ProjectDetails = () => { if (isLoading || isLoadingFreight) return ; - if ( - (!data || data.stages.length === 0) && - (!warehouseData || warehouseData.warehouses.length === 0) - ) { - return ; - } - const stage = stageName && (data?.stages || []).find((item) => item.metadata?.name === stageName); const isFaded = (stage: Stage): boolean => { @@ -727,9 +735,60 @@ export const ProjectDetails = () => {
-
- - PIPELINE +
+
+ + PIPELINE +
+
+ + + {' '} + + {' '} + Stage + + ), + onClick: () => showCreateStage() + }, + { + key: '2', + label: ( + <> + {' '} + Warehouse + + ), + onClick: () => showCreateWarehouse() + } + ] + }} + placement='bottomRight' + trigger={['click']} + > + + +
{ const { name } = useParams(); const navigate = useNavigate(); - const { show: showCreateStage } = useModal( - name ? (p) => : undefined - ); - const { show: showCreateWarehouse } = useModal( - name ? (p) => : undefined - ); - - // const [activeTab, setActiveTab] = useState(tab || 'details'); // we must render the tab contents outside of the Antd tabs component to prevent layout issues in the ProjectDetails component const renderTab = (key: ProjectTab) => { switch (key) { @@ -75,51 +54,6 @@ export const Project = ({ tab = 'details' }: { tab?: ProjectTab }) => {
PROJECT
{name}
- - - {' '} - - Stage - - ), - onClick: () => showCreateStage() - }, - { - key: '2', - label: ( - <> - Warehouse - - ), - onClick: () => showCreateWarehouse() - } - ] - }} - placement='bottomRight' - trigger={['click']} - > - -