fix: don't show promote button for members (#17511)

Fix https://github.com/coder/coder/issues/15850
This commit is contained in:
Bruno Quaresma
2025-04-22 12:50:46 -03:00
committed by GitHub
parent cbc699b6df
commit 83b2c9bf41
@@ -33,7 +33,6 @@ export const VersionRow: FC<VersionRowProps> = ({
});
const jobStatus = version.job.status;
const showActions = onPromoteClick || onArchiveClick;
return (
<TimelineEntry
@@ -106,7 +105,7 @@ export const VersionRow: FC<VersionRowProps> = ({
</Pill>
)}
{showActions && jobStatus === "failed" ? (
{jobStatus === "failed" && onArchiveClick && (
<Button
css={styles.promoteButton}
disabled={isActive || version.archived}
@@ -118,7 +117,9 @@ export const VersionRow: FC<VersionRowProps> = ({
>
Archive&hellip;
</Button>
) : (
)}
{jobStatus === "succeeded" && onPromoteClick && (
<Button
css={styles.promoteButton}
disabled={isActive || jobStatus !== "succeeded"}