generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove modules and focus on deployments (#480)
Fixes #474 ![Screenshot 2023-10-11 at 12 25 34 PM](https://github.com/TBD54566975/ftl/assets/51647/365409a6-a239-40ad-8542-8f8c3f0c2345) ![Screenshot 2023-10-11 at 12 25 40 PM](https://github.com/TBD54566975/ftl/assets/51647/2cb75dee-f343-4024-95e3-ff1ac1787daa) ![Screenshot 2023-10-11 at 12 25 43 PM](https://github.com/TBD54566975/ftl/assets/51647/57ee86e3-39f2-427c-8374-f07a22b6333c) ![Screenshot 2023-10-11 at 12 25 48 PM](https://github.com/TBD54566975/ftl/assets/51647/844e16de-4bc3-499a-86e1-536b15d11301)
- Loading branch information
1 parent
22c577b
commit 1ad1869
Showing
30 changed files
with
83 additions
and
1,045 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
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,9 @@ | ||
export const Badge = ({ name, className }: { name: string; className?: string }) => { | ||
return ( | ||
<span | ||
className={`inline-flex items-center rounded-lg bg-gray-100 dark:bg-gray-700 px-2 py-1 text-xs font-medium text-gray-600 dark:text-gray-300 ${className}`} | ||
> | ||
{name} | ||
</span> | ||
) | ||
} |
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,17 @@ | ||
interface Props { | ||
children: React.ReactNode | ||
onClick?: () => void | ||
className?: string | ||
} | ||
|
||
export const ButtonExtraSmall = ({ children, onClick }: Props) => { | ||
return ( | ||
<button | ||
type='button' | ||
onClick={onClick} | ||
className='rounded bg-indigo-600 px-1.5 py-0.5 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600' | ||
> | ||
{children} | ||
</button> | ||
) | ||
} |
38 changes: 34 additions & 4 deletions
38
console/client/src/features/deployments/DeploymentCard.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 |
---|---|---|
@@ -1,13 +1,43 @@ | ||
import { useContext, useEffect, useState } from 'react' | ||
import { useNavigate } from 'react-router-dom' | ||
import { Badge } from '../../components/Badge' | ||
import { Card } from '../../components/Card' | ||
import { Module } from '../../protos/xyz/block/ftl/v1/console/console_pb' | ||
import { modulesContext } from '../../providers/modules-provider' | ||
import { deploymentTextColor } from './deployment.utils' | ||
|
||
export const DeploymentCard = ({ name, className }: { name: string; className?: string }) => { | ||
export const DeploymentCard = ({ deploymentName, className }: { deploymentName: string; className?: string }) => { | ||
const navigate = useNavigate() | ||
const { modules } = useContext(modulesContext) | ||
const [module, setModule] = useState<Module | undefined>() | ||
|
||
useEffect(() => { | ||
if (modules) { | ||
const module = modules.find((module) => module.deploymentName === deploymentName) | ||
setModule(module) | ||
} | ||
}, [modules]) | ||
|
||
return ( | ||
<Card key={name} topBarColor='bg-green-500' className={className} onClick={() => navigate(`/deployments/${name}`)}> | ||
{name} | ||
<p className={`text-xs ${deploymentTextColor(name)}`}>{name}</p> | ||
<Card | ||
key={deploymentName} | ||
topBarColor='bg-green-500' | ||
className={className} | ||
onClick={() => navigate(`/deployments/${deploymentName}`)} | ||
> | ||
<div className='flex flex-col'> | ||
<div className='flex items-center'> | ||
<p className={` ${deploymentTextColor(deploymentName)}`}>{deploymentName}</p> | ||
<Badge className='ml-auto' name={module?.language ?? ''} /> | ||
</div> | ||
<div className='mt-2 gap-1 flex flex-wrap'> | ||
{module?.verbs.map((verb, index) => ( | ||
<span key={index} className='text-xs rounded mr-1 px-1 py-0.5 border border-indigo-500'> | ||
{verb.verb?.name} | ||
</span> | ||
))} | ||
</div> | ||
</div> | ||
</Card> | ||
) | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.