- Notifications
You must be signed in to change notification settings - Fork1k
feat: add View Source button for template administrators in workspace creation#18951
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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
ff4fc2f
91e19e8
a1bb34d
106c383
aca0211
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -27,8 +27,10 @@ import { Switch } from "components/Switch/Switch"; | ||
import { UserAutocomplete } from "components/UserAutocomplete/UserAutocomplete"; | ||
import { type FormikContextType, useFormik } from "formik"; | ||
import type { ExternalAuthPollingState } from "hooks/useExternalAuth"; | ||
import { ExternalLinkIcon } from "lucide-react"; | ||
import { generateWorkspaceName } from "modules/workspaces/generateWorkspaceName"; | ||
import { type FC, useCallback, useEffect, useMemo, useState } from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { | ||
getFormHelpers, | ||
nameValidator, | ||
@@ -67,6 +69,7 @@ interface CreateWorkspacePageViewProps { | ||
presets: TypesGen.Preset[]; | ||
permissions: CreateWorkspacePermissions; | ||
creatingWorkspace: boolean; | ||
canUpdateTemplate?: boolean; | ||
onCancel: () => void; | ||
onSubmit: ( | ||
req: TypesGen.CreateWorkspaceRequest, | ||
@@ -92,6 +95,7 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({ | ||
presets = [], | ||
permissions, | ||
creatingWorkspace, | ||
canUpdateTemplate, | ||
onSubmit, | ||
onCancel, | ||
}) => { | ||
@@ -218,9 +222,21 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({ | ||
<Margins size="medium"> | ||
<PageHeader | ||
actions={ | ||
<Stack direction="row" spacing={2}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. the | ||
{canUpdateTemplate && ( | ||
<Button asChild size="sm" variant="outline"> | ||
<Link | ||
to={`/templates/${template.organization_name}/${template.name}/versions/${versionId}/edit`} | ||
> | ||
<ExternalLinkIcon /> | ||
View source | ||
</Link> | ||
</Button> | ||
)} | ||
<Button size="sm" variant="outline" onClick={onCancel}> | ||
Cancel | ||
</Button> | ||
</Stack> | ||
} | ||
> | ||
<Stack direction="row"> | ||
Uh oh!
There was an error while loading.Please reload this page.