Remove dead normalizeIssue function and make legal pages linkable
All checks were successful
Build & Push Container Image / build (push) Successful in 8s

- Remove unused normalizeIssue and JIRA_STORY_POINTS_FIELD env var
- Add URL routing for /terms, /privacy, /support pages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jan Willem Mannaerts 2026-02-27 22:42:01 +01:00
parent 620547c78c
commit 047d0de485
3 changed files with 10 additions and 16 deletions

View file

@ -8,5 +8,4 @@ JIRA_CLIENT_SECRET=
JIRA_OAUTH_REDIRECT_URI=http://localhost:4010/api/jira/oauth/callback JIRA_OAUTH_REDIRECT_URI=http://localhost:4010/api/jira/oauth/callback
JIRA_SCOPES="offline_access read:jira-work write:jira-work read:me" JIRA_SCOPES="offline_access read:jira-work write:jira-work read:me"
JWT_SECRET=change-me-to-a-random-secret JWT_SECRET=change-me-to-a-random-secret
JIRA_STORY_POINTS_FIELD=customfield_10016
JIRA_MOCK_FALLBACK=true JIRA_MOCK_FALLBACK=true

View file

@ -193,20 +193,8 @@ async function jiraFetch(jiraAccountId, path, options = {}) {
return response.json(); return response.json();
} }
function normalizeIssue(issue) {
return {
id: issue.id,
key: issue.key,
title: issue.fields?.summary || issue.key,
description: issue.fields?.description || null,
estimate: issue.fields?.[process.env.JIRA_STORY_POINTS_FIELD || 'customfield_10016'] || 0,
status: issue.fields?.status?.name || 'Unknown',
reporter: issue.fields?.reporter?.displayName || null
};
}
export async function getSprintIssues(jiraAccountId, sprintId, boardId) { export async function getSprintIssues(jiraAccountId, sprintId, boardId) {
let spField = process.env.JIRA_STORY_POINTS_FIELD || 'customfield_10016'; let spField = 'customfield_10016';
if (boardId) { if (boardId) {
try { try {
const config = await jiraFetch(jiraAccountId, `/rest/agile/1.0/board/${boardId}/configuration`); const config = await jiraFetch(jiraAccountId, `/rest/agile/1.0/board/${boardId}/configuration`);

View file

@ -21,7 +21,10 @@ function useDarkMode() {
} }
export default function App() { export default function App() {
const [view, setView] = useState('loading'); const [view, setView] = useState(() => {
const legalPages = { '/terms': 'legal-terms', '/privacy': 'legal-privacy', '/support': 'legal-support' };
return legalPages[window.location.pathname] || 'loading';
});
const [user, setUser] = useState(null); const [user, setUser] = useState(null);
const [activeRoom, setActiveRoom] = useState(null); const [activeRoom, setActiveRoom] = useState(null);
const [prevView, setPrevView] = useState('login'); const [prevView, setPrevView] = useState('login');
@ -92,12 +95,16 @@ export default function App() {
function showLegal(page) { function showLegal(page) {
setPrevView(view); setPrevView(view);
window.history.pushState({}, '', `/${page}`);
setView(`legal-${page}`); setView(`legal-${page}`);
} }
if (view.startsWith('legal-')) { if (view.startsWith('legal-')) {
const page = view.replace('legal-', ''); const page = view.replace('legal-', '');
return <LegalPage page={page} dark={dark} onBack={() => setView(prevView)} />; return <LegalPage page={page} dark={dark} onBack={() => {
window.history.replaceState({}, '', '/');
setView(prevView);
}} />;
} }
if (view === 'login') { if (view === 'login') {