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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- User feedback FAB and dialog with `/api/feedback` proxy route and unit test
- GitHub issue templates, pull request template, and CODEOWNERS
- GitHub Issues link beside Contact us in the homepage support section

### Fixed
- Production `npm audit` findings resolved: Next.js upgraded to **16.3.0**,
Expand Down
23 changes: 18 additions & 5 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import styles from './home.module.css';
import { useAuth } from '@/components/auth/AuthProvider';
import Alert from '@mui/material/Alert';
import AlertTitle from '@mui/material/AlertTitle';
import { GITHUB_ISSUES_URL } from '@/components/feedback/feedbackOptions';

type AuthMethod = 'rast' | 'patric';

Expand Down Expand Up @@ -406,11 +407,23 @@ function HomePageContent() {
<Typography variant="h6" sx={{ fontWeight: 600, mt: 3, mb: 1 }}>
Questions, comments, and bug reports?
</Typography>
<Typography>
<a href="mailto:help@modelseed.org" style={{ color: '#30BCCF', textDecoration: 'none' }}>
Contact us
</a>
</Typography>
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 2 }}>
<Typography>
<a href="mailto:help@modelseed.org" style={{ color: '#30BCCF', textDecoration: 'none' }}>
Contact us
</a>
</Typography>
<Typography>
<a
href={GITHUB_ISSUES_URL}
target="_blank"
rel="noopener noreferrer"
style={{ color: '#30BCCF', textDecoration: 'none' }}
>
GitHub Issues
</a>
</Typography>
</Box>
</Container>
</Box>
</>
Expand Down
3 changes: 2 additions & 1 deletion components/feedback/feedbackOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type Environment = (typeof ENVIRONMENTS)[number];

// Maps the dialog "Type" to the GitHub Issue Form template filename + label to prefill.
export const GITHUB_REPO = 'ModelSEED/ModelSEED-UI';
export const GITHUB_ISSUES_URL = `https://github.com/${GITHUB_REPO}/issues`;
export const TEMPLATE_BY_TYPE: Record<FeedbackType, string> = {
Bug: 'bug_report.yml',
Feature: 'feature_request.yml',
Expand Down Expand Up @@ -72,5 +73,5 @@ export function buildGitHubIssueUrl(input: {
params.set('environment', ENV_TO_GH_OPTION[input.environment]);
params.set('question', input.description);
}
return `https://github.com/${GITHUB_REPO}/issues/new?${params.toString()}`;
return `${GITHUB_ISSUES_URL}/new?${params.toString()}`;
}
14 changes: 14 additions & 0 deletions tests/e2e/suite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ test.describe('01. Public Pages', () => {
expect(await links.count()).toBeGreaterThan(5);
});

test('Homepage support section has Contact us and GitHub Issues links', async ({ page }) => {
await page.goto('/');
const contactLink = page.getByRole('link', { name: 'Contact us' });
await expect(contactLink).toBeVisible();
await expect(contactLink).toHaveAttribute('href', 'mailto:help@modelseed.org');

const issuesLink = page.getByRole('link', { name: 'GitHub Issues' });
await expect(issuesLink).toBeVisible();
await expect(issuesLink).toHaveAttribute('href', 'https://github.com/ModelSEED/ModelSEED-UI/issues');
await expect(issuesLink).toHaveAttribute('target', '_blank');
await expect(issuesLink).toHaveAttribute('rel', /noopener/);
await expect(issuesLink).toHaveAttribute('rel', /noreferrer/);
});

const publicPages = [
{ path: '/about', name: 'About' },
{ path: '/about/version', name: 'Version' },
Expand Down
Loading