From 62d99f949a0af11014e016c38e80395d56b0ecdf Mon Sep 17 00:00:00 2001 From: Freya Gustavsson Date: Wed, 13 Nov 2024 14:06:36 +0100 Subject: [PATCH] feat(Copr): Improved installation instructions This splits the packages up in easier chunks for installation. --- frontend/src/components/copr/CoprBuild.tsx | 106 ++++++++++++++++----- 1 file changed, 82 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/copr/CoprBuild.tsx b/frontend/src/components/copr/CoprBuild.tsx index 0caac65..4c92631 100644 --- a/frontend/src/components/copr/CoprBuild.tsx +++ b/frontend/src/components/copr/CoprBuild.tsx @@ -4,7 +4,13 @@ import { Card, CardBody, + ClipboardCopy, Content, + DataList, + DataListCell, + DataListItem, + DataListItemCells, + DataListItemRow, List, ListItem, PageSection, @@ -12,6 +18,7 @@ import { } from "@patternfly/react-core"; import { useQuery } from "@tanstack/react-query"; +import { useEffect, useState } from "react"; import { CoprBuildPackage } from "../../apiDefinitions"; import { coprBuildQueryOptions } from "../../queries/copr/coprBuildQuery"; import { Route as CoprRoute } from "../../routes/jobs_/copr.$id"; @@ -26,6 +33,12 @@ export const CoprBuild = () => { const { data, isError, isLoading } = useQuery(coprBuildQueryOptions({ id })); + const [packagesToInstall, setPackagesToInstall] = useState([]); + + useEffect(() => { + if (data) setPackagesToInstall(getPackagesToInstall(data.built_packages)); + }, [data?.built_packages]); + // If backend API is down if (isError) { return ; @@ -79,32 +92,77 @@ export const CoprBuild = () => { - - You can install the built RPMs by following these steps: - + Installation instructions + Please note that the RPMs should be used only in a testing + environment + + + Repository + + + + sudo dnf install -y 'dnf*-command(copr)' + + + + + sudo dnf copr enable {data.copr_owner}/ + {data.copr_project} {data.chroot} + + + -
- - - sudo dnf install -y dnf-plugins-core - - - - sudo dnf copr enable {data.copr_owner}/{data.copr_project}{" "} - {data.chroot} - - - - - sudo dnf install -y{" "} - {getPackagesToInstall(data.built_packages).join(" ")} - - - -
- Please note that the RPMs should be used only in a testing - environment. + Built packages + {packagesToInstall.length <= 1 ? ( + <> + + sudo dnf install -y {packagesToInstall.join(" ")} + + + ) : ( + <> + All packages + + sudo dnf install -y {packagesToInstall.join(" ")} + + Individual packages + + {packagesToInstall.map((pkg) => ( + + + sudo dnf install -y {pkg} + + + ))} + + + )}