diff --git a/webui/src/pages/repositories/repository/compare.jsx b/webui/src/pages/repositories/repository/compare.jsx index aca75af0a4c..e1b9150c94b 100644 --- a/webui/src/pages/repositories/repository/compare.jsx +++ b/webui/src/pages/repositories/repository/compare.jsx @@ -36,7 +36,7 @@ const CompareContainer = () => { reference={reference} compareReference={compare} showActionsBar={true} - prefix={(prefix) ? prefix : ""} + prefix={prefix} onSelectRef={onSelectRef} onSelectCompare={onSelectCompare} /> diff --git a/webui/src/pages/repositories/repository/pulls/pullDetails.jsx b/webui/src/pages/repositories/repository/pulls/pullDetails.jsx index bc48ca6e5ca..9e637094134 100644 --- a/webui/src/pages/repositories/repository/pulls/pullDetails.jsx +++ b/webui/src/pages/repositories/repository/pulls/pullDetails.jsx @@ -25,33 +25,27 @@ const BranchLink = ({repo, branch}) => {branch} ; -const getStatusBadgeParams = status => { +const StatusBadge = ({status}) => { + const text = {status}; switch (status) { case PullStatus.open: - return {bgColor: "success", icon: }; + return {} {text}; case PullStatus.closed: - return {bgColor: "purple", icon: }; + return {} {text}; case PullStatus.merged: - return {bgColor: "danger", icon: }; + return {} {text}; default: - return {bgColor: "secondary", icon: null}; + return {text}; } }; -const StatusBadge = ({status}) => { - const {bgColor, icon} = getStatusBadgeParams(status); - return - {icon} {status} - ; -}; - const PullDetailsContent = ({repo, pull}) => { const createdAt = dayjs.unix(pull.creation_date); return (

{pull.title} {pull.id}

-
+
{pull.author} wants to merge {""} @@ -91,12 +85,12 @@ const PullDetailsContent = ({repo, pull}) => { const PullDetails = ({repo, pullId}) => { const {response: pull, error, loading} = useAPI(async () => { - console.log({repo, pullId}); return pullsAPI.get(repo.id, pullId); }, [repo.id, pullId]); if (loading) return ; if (error) return ; + return ; }