Skip to content

refactor(site): Only show status after first edition #6701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
const [createFileOpen, setCreateFileOpen] = useState(false)
const [deleteFileOpen, setDeleteFileOpen] = useState<string>()
const [renameFileOpen, setRenameFileOpen] = useState<string>()
const [dirty, setDirty] = useState(false)
const [activePath, setActivePath] = useState<string | undefined>(() =>
findInitialFile(fileTree),
)
Expand Down Expand Up @@ -139,11 +140,11 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
previousVersion.current = templateVersion
}, [templateVersion])

const [dirty, setDirty] = useState(false)
const hasIcon = template.icon && template.icon !== ""
const templateVersionSucceeded = templateVersion.job.status === "succeeded"
const showBuildLogs = Boolean(buildLogs)
const editorValue = getFileContent(activePath ?? "", fileTree) as string
const firstTemplateVersionOnEditor = useRef(templateVersion)

useEffect(() => {
window.dispatchEvent(new Event("resize"))
Expand All @@ -170,9 +171,12 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
</div>

<div className={styles.topbarSides}>
<div className={styles.buildStatus}>
<TemplateVersionStatusBadge version={templateVersion} />
</div>
{/* Only start to show the build when a new template version is building */}
{templateVersion.id !== firstTemplateVersionOnEditor.current.id && (
<div className={styles.buildStatus}>
<TemplateVersionStatusBadge version={templateVersion} />
</div>
)}

<Button
title="Build template (Ctrl + Enter)"
Expand Down Expand Up @@ -387,7 +391,7 @@ const useStyles = makeStyles<
{
templateVersionSucceeded: boolean
showBuildLogs: boolean
deploymentBannerVisible: boolean
deploymentBannerVisible?: boolean
}
>((theme) => ({
root: {
Expand Down