-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(template): utilize new GET /v1/templates/{id} endpoint for t…
…emplate and deployment detail refs #477
- Loading branch information
1 parent
7bd3a89
commit d3c6b21
Showing
16 changed files
with
162 additions
and
109 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
"repo", | ||
"styling", | ||
"observability", | ||
"analytics" | ||
"analytics", | ||
"template" | ||
] | ||
] | ||
} | ||
|
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,19 +1,27 @@ | ||
import { DeploymentDetail } from "@src/components/deployments/DeploymentDetail"; | ||
import type { GetServerSideProps } from "next"; | ||
import { z } from "zod"; | ||
|
||
type Props = { | ||
dseq: string; | ||
}; | ||
import { DeploymentDetail, DeploymentDetailProps } from "@src/components/deployments/DeploymentDetail"; | ||
import { CI_CD_TEMPLATE_ID } from "@src/config/remote-deploy.config"; | ||
import { services } from "@src/services/http/http-server.service"; | ||
|
||
const DeploymentDetailPage: React.FunctionComponent<Props> = ({ dseq }) => { | ||
return <DeploymentDetail dseq={dseq} />; | ||
}; | ||
export default DeploymentDetail; | ||
|
||
export default DeploymentDetailPage; | ||
const contextSchema = z.object({ | ||
params: z.object({ | ||
dseq: z.string() | ||
}) | ||
}); | ||
type Params = z.infer<typeof contextSchema>["params"]; | ||
|
||
export const getServerSideProps: GetServerSideProps<DeploymentDetailProps, Params> = async context => { | ||
const { params } = contextSchema.parse(context); | ||
const remoteDeployTemplate = await services.template.findById(CI_CD_TEMPLATE_ID); | ||
|
||
export async function getServerSideProps({ params }) { | ||
return { | ||
props: { | ||
dseq: params?.dseq | ||
remoteDeployTemplate, | ||
dseq: params.dseq | ||
} | ||
}; | ||
} | ||
}; |
This file contains 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 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 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 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 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.