-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from humanitec/move-plugin
chore: move plugin
- Loading branch information
Showing
20 changed files
with
283 additions
and
149 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@humanitec/backstage-plugin-backend': minor | ||
'@humanitec/backstage-plugin-common': minor | ||
'@humanitec/backstage-plugin': minor | ||
--- | ||
|
||
moved plugin into humanitec organization |
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
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
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,21 +1,50 @@ | ||
import type { FetchAppInfoEnvironment } from '@frontside/backstage-plugin-humanitec-common'; | ||
import type { FetchAppInfoEnvironment } from '@humanitec/backstage-plugin-common'; | ||
import { Typography } from '@material-ui/core'; | ||
import React from 'react'; | ||
import { useStyles } from '../hooks/useStyles'; | ||
|
||
export function DeploymentStatus({ env }: { env: FetchAppInfoEnvironment; }) { | ||
export function DeploymentStatus({ env }: { env: FetchAppInfoEnvironment }) { | ||
const classes = useStyles(); | ||
|
||
switch (env.last_deploy?.status) { | ||
case 'succeeded': | ||
return (<Typography className={`${classes.deploymentStatus} ${classes.successColor}`}>Succeeded</Typography>); | ||
return ( | ||
<Typography | ||
className={`${classes.deploymentStatus} ${classes.successColor}`} | ||
> | ||
Succeeded | ||
</Typography> | ||
); | ||
case 'pending': | ||
return (<Typography className={`${classes.deploymentStatus}`} color="primary">Pending</Typography>); | ||
return ( | ||
<Typography className={`${classes.deploymentStatus}`} color="primary"> | ||
Pending | ||
</Typography> | ||
); | ||
case 'in progress': | ||
return (<Typography className={`${classes.deploymentStatus} ${classes.inProgressColor}`} color="secondary">In Progress</Typography>); | ||
return ( | ||
<Typography | ||
className={`${classes.deploymentStatus} ${classes.inProgressColor}`} | ||
color="secondary" | ||
> | ||
In Progress | ||
</Typography> | ||
); | ||
case 'failed': | ||
return (<Typography className={`${classes.deploymentStatus} ${classes.failColor}`}>Failed</Typography>); | ||
return ( | ||
<Typography | ||
className={`${classes.deploymentStatus} ${classes.failColor}`} | ||
> | ||
Failed | ||
</Typography> | ||
); | ||
default: | ||
return (<Typography className={`${classes.deploymentStatus} ${classes.unknownColor}`}>Never deployed</Typography>); | ||
return ( | ||
<Typography | ||
className={`${classes.deploymentStatus} ${classes.unknownColor}`} | ||
> | ||
Never deployed | ||
</Typography> | ||
); | ||
} | ||
} |
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,32 +1,43 @@ | ||
import type { FetchAppInfoEnvironment } from '@frontside/backstage-plugin-humanitec-common'; | ||
import { | ||
Box, | ||
Typography | ||
} from '@material-ui/core'; | ||
import type { FetchAppInfoEnvironment } from '@humanitec/backstage-plugin-common'; | ||
import { Box, Typography } from '@material-ui/core'; | ||
import React, { useCallback } from 'react'; | ||
import { useStyles } from '../hooks/useStyles'; | ||
import { DeploymentStatus } from './DeploymentStatus'; | ||
|
||
interface EnvironmentCardProps { | ||
env: FetchAppInfoEnvironment; | ||
active: boolean; | ||
onClick: (envId: string) => void | ||
onClick: (envId: string) => void; | ||
} | ||
|
||
export function EnvironmentCard({ env, onClick, active }: EnvironmentCardProps) { | ||
export function EnvironmentCard({ | ||
env, | ||
onClick, | ||
active, | ||
}: EnvironmentCardProps) { | ||
const classes = useStyles(); | ||
|
||
const _onClick = useCallback(() => { | ||
onClick(env.id); | ||
}, [env, onClick]) | ||
}, [env, onClick]); | ||
|
||
return ( | ||
<Box role="button" className={`${classes.miniCard} ${active && classes.environmentCardActive}`} onClick={_onClick}> | ||
<Box | ||
role="button" | ||
className={`${classes.miniCard} ${ | ||
active && classes.environmentCardActive | ||
}`} | ||
onClick={_onClick} | ||
> | ||
<Box className={classes.miniCardTitleContainer}> | ||
<Typography className={classes.miniCardTitle} variant="h6">{env.name}</Typography> | ||
<Typography className={classes.miniCardTitle} variant="h6"> | ||
{env.name} | ||
</Typography> | ||
</Box> | ||
<Typography className={classes.miniCardSubTitle} variant="subtitle1">{env.id}</Typography> | ||
<Typography className={classes.miniCardSubTitle} variant="subtitle1"> | ||
{env.id} | ||
</Typography> | ||
<DeploymentStatus env={env} /> | ||
</Box> | ||
) | ||
} | ||
); | ||
} |
Oops, something went wrong.