Add support for service variables to Railway integration, add docs for Railway

This commit is contained in:
Tuan Dang
2023-04-09 15:00:40 +03:00
parent f6e23127ac
commit 710364e3a1
35 changed files with 307 additions and 16 deletions
@@ -45,6 +45,7 @@ type Props = {
handleDeleteIntegration: (args: { integration: Integration }) => void;
};
// TODO: refactor
const IntegrationTile = ({
integration,
integrations,
@@ -55,7 +56,6 @@ const IntegrationTile = ({
handleDeleteIntegration
}: Props) => {
// set initial environment. This find will only execute when component is mounting
const [integrationEnvironment, setIntegrationEnvironment] = useState<Props['environments'][0]>(
environments.find(({ slug }) => slug === integration?.environment) || {
name: '',
@@ -176,6 +176,21 @@ const IntegrationTile = ({
/>
</div>
);
case 'railway':
return (
<div>
<div className="mb-2 text-xs font-semibold text-gray-400">ENVIRONMENT</div>
<ListBox
data={
!integration.isActive
? ['Production', 'Deploy previews', 'Branch deploys', 'Local development']
: null
}
isSelected={integration.targetEnvironment}
onChange={setIntegrationTargetEnvironment}
/>
</div>
);
default:
return <div />;
}