Merge remote-tracking branch 'upstream/master' into mcalus3/add-catalog-import-plugin
This commit is contained in:
@@ -73,6 +73,18 @@ const useStyles = makeStyles(theme => ({
|
||||
boxShadow: `inset 4px 0px 0px ${theme.palette.success.main}`,
|
||||
},
|
||||
},
|
||||
jobStatusTitle: {
|
||||
display: 'flex',
|
||||
width: '100%',
|
||||
alignItems: 'center',
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
[theme.breakpoints.down('xs')]: {
|
||||
flexDirection: 'column',
|
||||
alignItems: 'flex-start',
|
||||
justifyContent: 'flex-start',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
type Props = {
|
||||
@@ -118,7 +130,7 @@ export const JobStage = ({ endedAt, startedAt, name, log, status }: Props) => {
|
||||
className: classes.button,
|
||||
}}
|
||||
>
|
||||
<Typography variant="button">
|
||||
<Typography variant="button" className={classes.jobStatusTitle}>
|
||||
{name} {timeElapsed && `(${timeElapsed})`}{' '}
|
||||
{startedAt && !endedAt && <CircularProgress size="1em" />}
|
||||
</Typography>
|
||||
|
||||
@@ -108,12 +108,15 @@ export const TemplatePage = () => {
|
||||
);
|
||||
|
||||
const handleCreateComplete = async (job: Job) => {
|
||||
const componentYaml = job.metadata.remoteUrl?.replace(
|
||||
const target = job.metadata.remoteUrl?.replace(
|
||||
/\.git$/,
|
||||
// TODO(Rugvip): This is not the location we want. As part of scaffodler v2 we
|
||||
// want this to be more flexible, but before that we might want
|
||||
// to update all templates to use catalog-info.yaml instead.
|
||||
'/blob/master/component-info.yaml',
|
||||
);
|
||||
|
||||
if (!componentYaml) {
|
||||
if (!target) {
|
||||
errorApi.post(
|
||||
new Error(
|
||||
`Failed to find component-info.yaml file in ${job.metadata.remoteUrl}.`,
|
||||
@@ -124,7 +127,7 @@ export const TemplatePage = () => {
|
||||
|
||||
const {
|
||||
entities: [createdEntity],
|
||||
} = await catalogApi.addLocation('github', componentYaml);
|
||||
} = await catalogApi.addLocation({ target });
|
||||
|
||||
setEntity((createdEntity as any) as TemplateEntityV1alpha1);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user