Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/webview/git-import/app/gitImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ export class GitImport extends React.Component<DefaultProps, {
{!isDevFile &&
<div className='strategyContainer strategyWarning'>
<ErrorIcon color='warning' style={{ fontSize: 20 }} />
<Typography variant='body2' style={{ margin: '0 5px' }}>Here is the recommended devfile:</Typography>
<Typography variant='body2' style={{ margin: '0 5px' }}>Here {compDescription?.length > 1 ? 'are' : 'is' } the recommended devfile:</Typography>
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
</div>}
<div className='cardContainer'>
<div className='devfileGalleryGrid'>
Expand Down
5 changes: 5 additions & 0 deletions src/webview/git-import/gitImportLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ async function parseGitURL(event: any) {
} else {
closeWithMessage('Devfile version not supported, Unable to proceed the component creation', clonedFolder);
}
} else {
compDescriptions = getCompDescription(analyzeRes);
}
} finally {
panel?.webview.postMessage({
Expand Down Expand Up @@ -306,6 +308,9 @@ function validateGitURL(event: any) {

function getCompDescription(devfiles: AnalyzeResponse[]): ComponentTypeDescription[] {
const compDescriptions = ComponentTypesView.instance.getCompDescriptions();
if (devfiles.length === 0) {
return Array.from(compDescriptions);
}
return Array.from(compDescriptions).filter(({ name, version, registry }) => devfiles.some((res) => res.devfile === name &&
res.devfileVersion === version && res.devfileRegistry === registry.name));
}
Expand Down