-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split components out in seperate files
- Loading branch information
Showing
13 changed files
with
311 additions
and
303 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
56 changes: 56 additions & 0 deletions
56
src/components/configure-application-github/configure-github-deploykey.tsx
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { List, Progress, Typography } from '@equinor/eds-core-react'; | ||
import { Code } from '../code'; | ||
import imageDeployKey from './deploy-key02.png'; | ||
|
||
import './style.css'; | ||
import type { | ||
ApplicationRegistration, | ||
DeployKeyAndSecret, | ||
} from '../../store/radix-api'; | ||
import { ExternalLink } from '../link/external-link'; | ||
|
||
interface Props { | ||
app: ApplicationRegistration; | ||
secrets?: DeployKeyAndSecret; | ||
} | ||
|
||
export const ConfigureGithubDeploykey = ({ app, secrets }: Props) => { | ||
return ( | ||
<div className="grid grid--gap-medium"> | ||
<Typography> | ||
This allows Radix to clone the repository. Open the and follow the steps | ||
below | ||
</Typography> | ||
<div className="grid grid--gap-medium o-body-text"> | ||
<List variant="numbered"> | ||
<List.Item> | ||
{secrets?.publicDeployKey ? ( | ||
<section className="deploy-key"> | ||
Copy this key: | ||
<Code copy>{secrets?.publicDeployKey}</Code> | ||
</section> | ||
) : ( | ||
<> | ||
<Progress.Circular size={16} /> Please wait… | ||
</> | ||
)} | ||
</List.Item> | ||
<List.Item>Give the key a name, e.g. "Radix deploy key"</List.Item> | ||
<List.Item> | ||
Press "Add key" on Github's{' '} | ||
<ExternalLink href={`${app.repository}/settings/keys/new`}> | ||
Add New Deploy Key page | ||
</ExternalLink> | ||
</List.Item> | ||
</List> | ||
<div className={'screenshot'}> | ||
<img | ||
alt="Add deploy key' steps on GitHub" | ||
src={imageDeployKey} | ||
srcSet={`${imageDeployKey} 2x`} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
55 changes: 55 additions & 0 deletions
55
src/components/configure-application-github/configure-github-webhook.tsx
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { List, Typography } from '@equinor/eds-core-react'; | ||
import { configVariables } from '../../utils/config'; | ||
import { CompactCopyButton } from '../compact-copy-button'; | ||
import { ExternalLink } from '../link/external-link'; | ||
import imageWebhook from './webhook02.png'; | ||
|
||
type Props = { repository: string; appName: string; sharedSecret?: string }; | ||
|
||
export function ConfigureGithubWebhook({ | ||
repository, | ||
appName, | ||
sharedSecret, | ||
}: Props) { | ||
const radixZoneDNS = configVariables.RADIX_CLUSTER_BASE; | ||
return ( | ||
<div className="grid grid--gap-medium"> | ||
<Typography> | ||
GitHub notifies Radix using a webhook whenever a code push is made. | ||
</Typography> | ||
<div className="grid grid--gap-medium o-body-text"> | ||
<List variant="numbered"> | ||
<List.Item> | ||
Open the{' '} | ||
<ExternalLink href={`${repository}/settings/hooks/new`}> | ||
Add Webhook page | ||
</ExternalLink>{' '} | ||
</List.Item> | ||
<List.Item> | ||
As Payload URL, use{' '} | ||
<code>{`https://webhook.${radixZoneDNS}/events/github?appName=${appName}`}</code>{' '} | ||
<CompactCopyButton | ||
content={`https://webhook.${radixZoneDNS}/events/github?appName=${appName}`} | ||
/> | ||
</List.Item> | ||
<List.Item> | ||
Choose <code>application/json</code> as Content type | ||
</List.Item> | ||
<List.Item> | ||
The Shared Secret for this application is{' '} | ||
<code>{sharedSecret}</code>{' '} | ||
<CompactCopyButton content={sharedSecret ?? ''} /> | ||
</List.Item> | ||
<List.Item>Press "Add webhook"</List.Item> | ||
</List> | ||
<div className={'screenshot'}> | ||
<img | ||
alt="'Add webhook' steps on GitHub" | ||
src={imageWebhook} | ||
srcSet={`${imageWebhook} 2x`} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.