Skip to content

fix(#3192): fix missing proposals dashboard title#3654

Merged
MSzalowski merged 1 commit into
developfrom
fix/3192-proposals-title-missing-from-detail-pages
May 22, 2025
Merged

fix(#3192): fix missing proposals dashboard title#3654
MSzalowski merged 1 commit into
developfrom
fix/3192-proposals-title-missing-from-detail-pages

Conversation

@MSzalowski
Copy link
Copy Markdown
Contributor

List of changes

  • Fix missing proposals dashboard title

Checklist

  • related issue
  • My changes generate no new warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the changelog
  • I have added tests that prove my fix is effective or that my feature works

@MSzalowski MSzalowski requested a review from Ryun1 as a code owner May 20, 2025 13:08
@MSzalowski MSzalowski linked an issue May 20, 2025 that may be closed by this pull request
@MSzalowski MSzalowski requested a review from Ciabas May 20, 2025 13:08
@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks succeeded

2 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks succeeded

@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks succeeded

@MSzalowski MSzalowski force-pushed the fix/3192-proposals-title-missing-from-detail-pages branch from 88ff7b3 to f57b314 Compare May 21, 2025 20:34
@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks succeeded

2 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks succeeded

@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks succeeded

Copy link
Copy Markdown
Contributor

@Ciabas Ciabas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job. Just a small suggestion for consideration.

return outcomesNavItem ?? "";
}

if (path.startsWith(BUDGET_DISCUSSION_PATHS.budgetDiscussion)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor suggestion]
Have you though about defining the path mapping object first and then extending the definition if needed?
Something like:

  const getPageTitle = (path: string): string => {
    const pathMappings = [
      { basePath: PATHS.dashboard, title: t("dashboard.title") },
      {
        basePath: OUTCOMES_PATHS.governanceActionsOutcomes,
        title: findNavItem(CONNECTED_NAV_ITEMS, OUTCOMES_PATHS.governanceActionsOutcomes),
      },
      {
        basePath: BUDGET_DISCUSSION_PATHS.budgetDiscussion,
        title: findNavItem(CONNECTED_NAV_ITEMS, BUDGET_DISCUSSION_PATHS.budgetDiscussion),
      },
      {
        basePath: PDF_PATHS.proposalDiscussion,
        title: findNavItem(CONNECTED_NAV_ITEMS, PDF_PATHS.proposalDiscussion),
      },
    ];

    const matchedPath = pathMappings.find(({ basePath }) => path.startsWith(basePath));
    return matchedPath?.title ?? findNavItem(CONNECTED_NAV_ITEMS, path) ?? "";
  };

@MSzalowski MSzalowski merged commit ae73c1d into develop May 22, 2025
8 checks passed
@MSzalowski MSzalowski deleted the fix/3192-proposals-title-missing-from-detail-pages branch May 22, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Proposals title missing from detail pages

2 participants