Skip to content

Commit

Permalink
NCL-8674 Add Push-to-brew action to Group Build detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikk0123 committed Apr 22, 2024
1 parent 01ace04 commit be3ff75
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/components/GroupBuildDetailPage/GroupBuildDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { useTitle } from 'hooks/useTitle';

import { Attributes } from 'components/Attributes/Attributes';
import { AttributesItem } from 'components/Attributes/AttributesItem';
import { BrewPushModal } from 'components/BrewPushModal/BrewPushModal';
import { BrewPushModalButton } from 'components/BrewPushModal/BrewPushModalButton';
import { calculateLongBuildName } from 'components/BuildName/BuildName';
import { BuildStatus } from 'components/BuildStatus/BuildStatus';
import { BuildStatusIcon } from 'components/BuildStatusIcon/BuildStatusIcon';
Expand Down Expand Up @@ -63,9 +65,11 @@ export const GroupBuildDetailPage = ({ componentId = 'gb2' }: IGroupBuildDetailP
const serviceContainerDependencyGraphSetter = serviceContainerDependencyGraph.setData;

const [isCancelGroupBuildModalOpen, setIsCancelGroupBuildModalOpen] = useState<boolean>(false);
const [isBrewPushModalOpen, setIsBrewPushModalOpen] = useState<boolean>(false);

const toggleCancelGroupBuildModal = () =>
setIsCancelGroupBuildModalOpen((isCancelGroupBuildModalOpen) => !isCancelGroupBuildModalOpen);
const toggleBrewPushModal = () => setIsBrewPushModalOpen((isBrewPushModalOpen) => !isBrewPushModalOpen);

const longGroupBuildName = serviceContainerGroupBuild.data
? calculateLongBuildName(serviceContainerGroupBuild.data)
Expand Down Expand Up @@ -136,11 +140,14 @@ export const GroupBuildDetailPage = ({ componentId = 'gb2' }: IGroupBuildDetailP
title={<BuildStatus build={serviceContainerGroupBuild.data!} long hideDatetime hideUsername />}
breadcrumbs={[{ entity: breadcrumbData.groupBuild.id, title: serviceContainerGroupBuild.data?.id }]}
actions={
<CancelBuildModalButton
toggleModal={toggleCancelGroupBuildModal}
build={serviceContainerGroupBuild.data!}
variant="Group Build"
/>
<>
<CancelBuildModalButton
toggleModal={toggleCancelGroupBuildModal}
build={serviceContainerGroupBuild.data!}
variant="Group Build"
/>
<BrewPushModalButton toggleModal={toggleBrewPushModal} build={serviceContainerGroupBuild.data!} />
</>
}
>
<ContentBox padding marginBottom isResponsive>
Expand Down Expand Up @@ -203,6 +210,15 @@ export const GroupBuildDetailPage = ({ componentId = 'gb2' }: IGroupBuildDetailP
variant="Group Build"
/>
)}

{isBrewPushModalOpen && (
<BrewPushModal
isModalOpen={isBrewPushModalOpen}
toggleModal={toggleBrewPushModal}
build={serviceContainerGroupBuild.data!}
variant="Group Build"
/>
)}
</ServiceContainerLoading>
);
};

0 comments on commit be3ff75

Please sign in to comment.