chore(scaffolder): fixing the no templates view with link to readme
This commit is contained in:
@@ -62,16 +62,14 @@ export const runDockerContainer = async ({
|
||||
dockerClient,
|
||||
createOptions = {},
|
||||
}: RunDockerContainerOptions) => {
|
||||
await new Promise((resolve, reject) =>
|
||||
dockerClient.pull(imageName, {}, (err, res) => {
|
||||
console.warn(err, res);
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(res);
|
||||
}
|
||||
}),
|
||||
);
|
||||
await new Promise((resolve, reject) => {
|
||||
dockerClient.pull(imageName, {}, (err, stream) => {
|
||||
if (err) return reject(err);
|
||||
stream.pipe(logStream);
|
||||
stream.on('end', () => resolve());
|
||||
stream.on('error', (error: Error) => reject(error));
|
||||
});
|
||||
});
|
||||
const [{ Error: error, StatusCode: statusCode }] = await dockerClient.run(
|
||||
imageName,
|
||||
args,
|
||||
|
||||
@@ -102,10 +102,20 @@ export const ScaffolderPage: React.FC<{}> = () => {
|
||||
</Link>
|
||||
.
|
||||
</Typography>
|
||||
{templates && !templates.length && (
|
||||
<Typography variant="body2">
|
||||
Shoot! Looks like you don't have any templates. Check out the
|
||||
documentation{' '}
|
||||
<Link href="docs/backstage/features/software-templates/adding-templates">
|
||||
here!
|
||||
</Link>
|
||||
</Typography>
|
||||
)}
|
||||
{!templates && isValidating && <LinearProgress />}
|
||||
<Grid container>
|
||||
{templates &&
|
||||
templates.map(template => {
|
||||
templates?.length > 0 &&
|
||||
templates!.map(template => {
|
||||
return (
|
||||
<Grid item xs={12} sm={6} md={3}>
|
||||
<TemplateCard {...getTemplateCardProps(template)} />
|
||||
|
||||
Reference in New Issue
Block a user