Skip to content

feat(site): show version files diff based on active version #11686

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
Jan 18, 2024

Conversation

BrunoQuaresma
Copy link
Collaborator

Close #11295

@BrunoQuaresma BrunoQuaresma requested a review from a team January 18, 2024 16:28
@BrunoQuaresma BrunoQuaresma self-assigned this Jan 18, 2024
@BrunoQuaresma BrunoQuaresma requested review from Parkreiner and removed request for a team January 18, 2024 16:28
Copy link
Member

@Parkreiner Parkreiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks really good! Just had one possible suggestion, but I don't know enough about the business to logic to say if it's a good idea

@@ -236,6 +237,38 @@ export const resources = (versionId: string) => {
};
};

export const templateFiles = (fileId: string) => {
return {
queryKey: ["templateFiles", fileId],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it makes sense to update the query keys for templateFiles and previousTemplateVersion to start with something like "template"? Feels like it'd be a good way to make sure we have an easy way to invalidate any template queries down the line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we had the template ID or name I would say yes, but since they are "isolated" I'm ok to keep the current names until we see value in changing them.

tab,
}) => {
const filenames = Object.keys(currentFiles);
const selectedFilename = filenames[Number(tab.value)];
const currentFile = currentFiles[selectedFilename];
const previousFile = previousFiles && previousFiles[selectedFilename];
const previousFile = baseFiles && baseFiles[selectedFilename];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a call out to your code, but there's some weird behavior here (based around undefined) that I'm guessing that the compiler isn't complaining about right now, because we don't have it set strictly enough.

Here's a TypeScript snippet with the compiler tightened up. I'm going to be bringing this up at the Frontend Variety later today

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrunoQuaresma BrunoQuaresma merged commit 156aaba into main Jan 18, 2024
@BrunoQuaresma BrunoQuaresma deleted the bq/show-diff-with-active-version branch January 18, 2024 19:08
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

template versions: show diff with active version
2 participants