removed unnecessary try catch and minor ui cleanup
Signed-off-by: npiyush97 <npiyush35@gmail.com>
This commit is contained in:
@@ -177,32 +177,29 @@ the component will become available.\n\nFor more information, read an \
|
||||
}): Promise<{ link: string; location: string }> {
|
||||
const { repositoryUrl, fileContent, title, body } = options;
|
||||
const parseData = YAML.parse(fileContent);
|
||||
try {
|
||||
const validationResponse = await this.catalogApi.validateEntity(
|
||||
parseData,
|
||||
`url:${repositoryUrl}`,
|
||||
);
|
||||
if (!validationResponse.valid) {
|
||||
throw new Error(validationResponse.errors[0].message);
|
||||
}
|
||||
const ghConfig = getGithubIntegrationConfig(
|
||||
this.scmIntegrationsApi,
|
||||
repositoryUrl,
|
||||
);
|
||||
|
||||
if (ghConfig) {
|
||||
return await this.submitGitHubPrToRepo({
|
||||
...ghConfig,
|
||||
repositoryUrl,
|
||||
fileContent,
|
||||
title,
|
||||
body,
|
||||
});
|
||||
}
|
||||
throw new Error('unimplemented!');
|
||||
} catch (err) {
|
||||
throw err;
|
||||
const validationResponse = await this.catalogApi.validateEntity(
|
||||
parseData,
|
||||
`url:${repositoryUrl}`,
|
||||
);
|
||||
if (!validationResponse.valid) {
|
||||
throw new Error(validationResponse.errors[0].message);
|
||||
}
|
||||
const ghConfig = getGithubIntegrationConfig(
|
||||
this.scmIntegrationsApi,
|
||||
repositoryUrl,
|
||||
);
|
||||
|
||||
if (ghConfig) {
|
||||
return await this.submitGitHubPrToRepo({
|
||||
...ghConfig,
|
||||
repositoryUrl,
|
||||
fileContent,
|
||||
title,
|
||||
body,
|
||||
});
|
||||
}
|
||||
throw new Error('unimplemented!');
|
||||
}
|
||||
|
||||
// TODO: this could be part of the catalog api
|
||||
|
||||
-1
@@ -76,7 +76,6 @@ export const StepFinishImportLocation = ({ prepareResult, onReset }: Props) => {
|
||||
<Grid container spacing={0}>
|
||||
<BackButton onClick={onReset}>Register another</BackButton>
|
||||
</Grid>
|
||||
;
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user