Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Binary file added .tmp/proof/issue-137-github-templates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .tmp/proof/issue-137-template-previews.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/app/src/components/showcase/ShowcaseCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const baseItem: ShowcaseItem = {
'Scaffold a Model Context Protocol server that AI assistants connect to for domain-specific tools and context.',
category: 'templates',
link: templateShowcaseLink('mcp-server'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'ai', 'mcp', 'github'],
isRecommended: true,
};
Expand Down Expand Up @@ -50,7 +50,7 @@ describe('ShowcaseCard', () => {
it('links the action button to the item link with its label', async () => {
await renderInTestApp(<ShowcaseCard item={baseItem} />);

const link = screen.getByRole('link', { name: 'Use template' });
const link = screen.getByRole('link', { name: 'Preview template' });
expect(link).toHaveAttribute(
'href',
'/self-service/templates/default/mcp-server',
Expand Down
32 changes: 28 additions & 4 deletions packages/app/src/components/showcase/ShowcasePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ import { ShowcasePage } from './ShowcasePage';
import { showcaseItems, countByCategory } from './showcaseConfig';

describe('ShowcasePage', () => {
it('explains guest preview access before linking to templates', async () => {
await renderInTestApp(<ShowcasePage />);

expect(screen.getByText(/Guest access is read-only/)).toHaveTextContent(
'You can preview template forms and steps. Running a template to create a repository or pull request requires developer permissions.',
);
const templateLinks = screen.getAllByRole('link', {
name: 'Preview template',
});
expect(templateLinks).toHaveLength(8);
templateLinks.forEach(link => {
expect(link).toHaveAttribute(
'href',
expect.stringMatching(/^\/self-service\/templates\/default\//),
);
});
expect(
screen.getByRole('link', { name: 'Browse templates' }),
).toHaveAttribute('href', '/self-service');
expect(
screen.queryByRole('link', { name: /Use template|Create component/ }),
).not.toBeInTheDocument();
});

it('labels search and exposes the active category and result count', async () => {
await renderInTestApp(<ShowcasePage />);

Expand Down Expand Up @@ -69,9 +93,9 @@ describe('ShowcasePage', () => {

fireEvent.click(screen.getByText(/^Answer Engine \(/));

expect(screen.getByRole('alert')).toHaveTextContent(
'The demo does not generate answers.',
);
expect(
screen.getByText(/The demo does not generate answers/),
).toHaveTextContent('The demo does not generate answers.');
const search = within(
screen.getByTestId('showcase-card-answer-engine-search'),
);
Expand All @@ -89,7 +113,7 @@ describe('ShowcasePage', () => {
extension.getByText(/your own document index and AI Hub/),
).toBeInTheDocument();
expect(
extension.getByRole('link', { name: 'Use template' }),
extension.getByRole('link', { name: 'Preview template' }),
).toHaveAttribute(
'href',
'/self-service/templates/default/answer-engine-worker',
Expand Down
12 changes: 9 additions & 3 deletions packages/app/src/components/showcase/ShowcasePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ export const ShowcasePage = () => {
What this portal can do
</Typography>
<Typography variant="body2" color="text.secondary">
Start a new service from a proven template, publish it to GitHub,
and make it findable through the catalog and docs search. Pick a
card to explore a portal feature or preview a software template.
Explore how templates, GitHub integration and catalog search fit
together. Pick a card to try a portal feature or preview a software
template.
</Typography>
</Box>

<Alert severity="info" sx={{ mb: 2 }}>
Guest access is read-only. You can preview template forms and steps.
Running a template to create a repository or pull request requires
developer permissions.
</Alert>

<Alert severity="info" sx={{ mb: 3 }}>
Catalog and TechDocs keyword search runs in this portal. Generated
answers are an extension you can build with the Answer Engine Worker
Expand Down
18 changes: 9 additions & 9 deletions packages/app/src/components/showcase/showcaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Scaffold a provider-agnostic gateway in front of your organisation LLM providers, with auth, rate limiting, cost tracking and audit logging.',
category: 'templates',
link: templateShowcaseLink('ai-hub-service'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'ai', 'llm', 'github'],
isRecommended: true,
},
Expand All @@ -53,7 +53,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Scaffold a queue consumer that retrieves context from a document index and produces cited answers, with an indexer and query API.',
category: 'templates',
link: templateShowcaseLink('answer-engine-worker'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'ai', 'rag', 'github'],
isRecommended: true,
},
Expand All @@ -64,7 +64,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Scaffold a Model Context Protocol server that AI assistants connect to for domain-specific tools and context.',
category: 'templates',
link: templateShowcaseLink('mcp-server'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'ai', 'mcp', 'github'],
isRecommended: true,
},
Expand All @@ -75,7 +75,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Create a new blank repository in GitHub from a local skeleton and register it in the catalog.',
category: 'templates',
link: templateShowcaseLink('github-blank-repo'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'github', 'repo'],
isRecommended: true,
},
Expand All @@ -86,7 +86,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Create a documentation site in a GitHub repository and open it as a pull request for review.',
category: 'templates',
link: templateShowcaseLink('github-pull-request-docs'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'github', 'techdocs'],
isRecommended: true,
},
Expand All @@ -97,7 +97,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Create a new blank repository in GitLab from a local skeleton and register it in the catalog.',
category: 'templates',
link: templateShowcaseLink('docs-blank-repo'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'gitlab', 'repo'],
isRecommended: true,
},
Expand All @@ -108,7 +108,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Create a documentation site in a GitLab repository and open it as a merge request for review.',
category: 'templates',
link: templateShowcaseLink('docs-template-gitlab-merge-request'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['recommended', 'gitlab', 'techdocs'],
isRecommended: true,
},
Expand All @@ -129,7 +129,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Publish new repositories and pull requests from templates with the GitHub scaffolder actions.',
category: 'github',
link: '/self-service',
linkLabel: 'Create component',
linkLabel: 'Browse templates',
tags: ['github', 'scaffolder', 'automation'],
},
{
Expand Down Expand Up @@ -161,7 +161,7 @@ export const showcaseItems: ShowcaseItem[] = [
'Scaffold an answer engine worker to connect to your own document index and AI Hub for cited answers.',
category: 'answer-engine',
link: templateShowcaseLink('answer-engine-worker'),
linkLabel: 'Use template',
linkLabel: 'Preview template',
tags: ['ai', 'rag', 'template'],
isRecommended: true,
availability: 'Extension template',
Expand Down
Loading