- Notifications
You must be signed in to change notification settings - Fork1k
fix(site): show available logs consistently on template creation page#19832
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
+45 −94
Merged
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
3952a03
fix: show logs consistently when there are logs to be shown on the te…
aslilac2d9a54a
hmm
aslilacedd72b9
wow
aslilac19fe0ae
and all this other scrolling logic is no longer needed
aslilac193ae42
ugh
aslilac1622f0e
Merge branch 'main' into lilac/fix-bad-logging-conditions
aslilaca6091c1
ok these conditions are really good I swear
aslilacf4aaf77
:)
aslilac558bf14
ok this case actually shouldn't autoscroll
aslilacb8d80b7
yay linting
aslilacFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
51 changes: 22 additions & 29 deletionssite/src/modules/workspaces/WorkspaceBuildLogs/WorkspaceBuildLogs.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -11,7 +11,7 @@ import { AlertVariant } from "modules/provisioners/ProvisionerAlert"; | ||
import { ProvisionerStatusAlert } from "modules/provisioners/ProvisionerStatusAlert"; | ||
import { useWatchVersionLogs } from "modules/templates/useWatchVersionLogs"; | ||
import { WorkspaceBuildLogs } from "modules/workspaces/WorkspaceBuildLogs/WorkspaceBuildLogs"; | ||
import type{ FC } from "react"; | ||
import { navHeight } from "theme/constants"; | ||
type BuildLogsDrawerProps = { | ||
@@ -29,27 +29,6 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({ | ||
...drawerProps | ||
}) => { | ||
const logs = useWatchVersionLogs(templateVersion); | ||
const isMissingVariables = | ||
error instanceof JobError && | ||
@@ -58,6 +37,7 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({ | ||
const matchingProvisioners = templateVersion?.matched_provisioners?.count; | ||
const availableProvisioners = | ||
templateVersion?.matched_provisioners?.available; | ||
const hasLogs = logs && logs.length > 0; | ||
return ( | ||
<Drawer anchor="right" {...drawerProps}> | ||
@@ -70,8 +50,6 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({ | ||
</IconButton> | ||
</header> | ||
aslilac marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
{isMissingVariables ? ( | ||
<MissingVariablesBanner | ||
onFillVariables={() => { | ||
@@ -80,23 +58,28 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({ | ||
}); | ||
const firstVariableInput = | ||
variablesSectionRef.current?.querySelector("input"); | ||
firstVariableInput?.focus(); | ||
drawerProps.onClose(); | ||
}} | ||
/> | ||
) : ( | ||
<> | ||
{(matchingProvisioners === 0 || !hasLogs) && ( | ||
<ProvisionerStatusAlert | ||
matchingProvisioners={matchingProvisioners} | ||
availableProvisioners={availableProvisioners} | ||
tags={templateVersion?.job.tags ?? {}} | ||
variant={AlertVariant.Inline} | ||
/> | ||
)} | ||
{hasLogs ? ( | ||
<section css={styles.logs}> | ||
<WorkspaceBuildLogs logs={logs} className="border-0" /> | ||
</section> | ||
) : ( | ||
<Loader /> | ||
)} | ||
</> | ||
)} | ||
</div> | ||
14 changes: 1 addition & 13 deletionssite/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -299,6 +299,7 @@ const BuildLogsContent: FC<{ | ||
}} | ||
logs={sortLogsByCreatedAt(logs)} | ||
build={build} | ||
disableAutoscroll | ||
/> | ||
); | ||
}; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.