-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(web): Organization parent subpage - Use organization layout in case theme is not set to 'standalone' #17144
Conversation
WalkthroughThe pull request introduces several modifications across multiple files, primarily focusing on the handling of organization-related pages in a web application. Key changes include updating the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17144 +/- ##
==========================================
- Coverage 35.74% 35.74% -0.01%
==========================================
Files 6925 6926 +1
Lines 147647 147582 -65
Branches 42049 42012 -37
==========================================
- Hits 52779 52753 -26
+ Misses 94868 94829 -39
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 17 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportBranch report: ✅ 0 Failed, 84 Passed, 0 Skipped, 24.8s Total Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Outside diff range and nitpick comments (3)
apps/web/screens/Organization/ParentSubpage.tsx (2)
81-83
: Verify appropriate heading levelsThe
Text
component usesvariant="h1"
andas="h1"
. Ensure that using anh1
heading here aligns with the overall heading hierarchy of the page, especially if there are multipleh1
headings which may impact accessibility and SEO.
20-23
: Avoid potential circular dependencies withgetProps
importImporting
getProps
from./Standalone/ParentSubpage
may introduce a circular dependency. Consider extractinggetProps
into a shared module or defining it within this file to prevent such issues.apps/web/screens/Organization/Standalone/ParentSubpage.tsx (1)
141-141
: Simplify TypeScript type declaration forgetProps
Using
typeof StandaloneParentSubpage['getProps']
can be less clear. Consider defining an explicit type forgetProps
to improve readability.For example:
type GetPropsFunction = typeof StandaloneParentSubpage['getProps']; export const getProps: GetPropsFunction = async ({ /* params */ }) => { // function body };
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (5)
apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx
(1 hunks)apps/web/pages/s/[...slugs]/index.tsx
(6 hunks)apps/web/screens/Organization/ParentSubpage.tsx
(1 hunks)apps/web/screens/Organization/Standalone/ParentSubpage.tsx
(2 hunks)apps/web/screens/Organization/SubPage.tsx
(4 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
apps/web/screens/Organization/ParentSubpage.tsx (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/web/screens/Organization/SubPage.tsx (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/web/screens/Organization/Standalone/ParentSubpage.tsx (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/web/pages/s/[...slugs]/index.tsx (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (4)
apps/web/screens/Organization/Standalone/ParentSubpage.tsx (1)
265-266
: Ensure consistency in function assignments
Assigning getProps
to StandaloneParentSubpage.getProps
is acceptable, but ensure this pattern is consistently used across similar components for maintainability.
apps/web/pages/s/[...slugs]/index.tsx (2)
299-306
: Verify error handling in getProps
function
When catching errors in getProps
, ensure that unhandled exceptions are properly re-thrown to avoid masking unexpected errors.
Consider modifying the catch block:
} catch (error) {
if (!(error instanceof CustomNextError)) {
throw error;
}
+ // You might want to handle CustomNextError specifically or log it
}
Also applies to: 385-392, 395-396
83-85
: Integration of PageType.PARENT_SUBPAGE
looks good
The new PageType.PARENT_SUBPAGE
has been correctly added to the pageMap
and Props
interface, following the existing patterns.
Also applies to: 122-128
apps/web/screens/Organization/SubPage.tsx (1)
222-223
: Handle potential exceptions when using new URL()
Using new URL(router.asPath, 'https://island.is')
can throw exceptions if router.asPath
is not a valid URL. Ensure that router.asPath
is correctly formatted or consider alternative methods to parse the path.
…ase theme is not set to 'standalone' (#17144) * Add different layout in case theme is not set to 'standalone' * Simplify translation code --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Organization parent subpage - Use organization layout in case theme is not set to 'standalone'
Screenshots / Gifs
Before
After
Checklist:
Summary by CodeRabbit
New Features
OrganizationParentSubpage
component for enhanced organization-related content display.getSubpageNavList
method for improved routing.Improvements
pageFeaturedImage
property to allow explicitnull
values for better flexibility.getProps
function from the component definition.Bug Fixes