Skip to content
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

refactor(template): utilize new GET /v1/templates/{id} endpoint for template and deployment detail #506

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ygrishajev
Copy link
Contributor

refs #477

@ygrishajev ygrishajev requested a review from a team as a code owner November 28, 2024 13:25
@ygrishajev ygrishajev force-pushed the feature/template branch 3 times, most recently from d3c6b21 to 6f931cb Compare November 28, 2024 13:29
Copy link
Contributor

@baktun14 baktun14 left a comment

Choose a reason for hiding this comment

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

Cool! Were you planning on changing the template list endpoint in another pr?


export default DeploymentDetailPage;
export const getServerSideProps = getValidatedServerSideProps(contextSchema, async ({ params }) => {
const remoteDeployTemplate = await services.template.findById(CI_CD_TEMPLATE_ID);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we necessarily need to have loaded on the server. Especially since it's for a specific feature (Git repo deploy) that not that many deployments have currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looking into the logic in the components it seems like this template is still needed there. Perhaps this could be changed ofc.

But I was thinking of how often that template is changed? perhaps let's move it to static props and call it a day?

Copy link
Contributor

Choose a reason for hiding this comment

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

Previously it was loaded through a hook,, but now it'll wait for the template to load to render the page. It should be fast enough that it doesn't affect the ux, but generally I'd put it as a fetch hook in the component.

@ygrishajev
Copy link
Contributor Author

Cool! Were you planning on changing the template list endpoint in another pr?

This PR doesn't complete the issue, yes. So more is to come. May be I'll switch to some other outstanding things though. I was just pushing what's done. It's ready to merge though

@baktun14
Copy link
Contributor

Cool! Were you planning on changing the template list endpoint in another pr?

This PR doesn't complete the issue, yes. So more is to come. May be I'll switch to some other outstanding things though. I was just pushing what's done. It's ready to merge though

Ok sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants