Skip to content
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): Featured link slice #17416

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

RunarVestmann
Copy link
Member

@RunarVestmann RunarVestmann commented Jan 6, 2025

Featured link slice

  • Featured links on the frontpage have now been moved into a reusable component
  • New content type "Featured links" in contentful which allows us to display links on top of organization pages

Organization page slice

Screenshot 2025-01-07 at 12 12 18

Frontpage

Screenshot 2025-01-07 at 12 52 16

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new FeaturedLinks component for displaying featured links.
    • Added a FeaturedLinksSlice component for rendering featured links within slices.
    • Enhanced the SearchSection to utilize the new FeaturedLinks component.
  • Improvements

    • Updated GraphQL fragments to support featured links.
    • Implemented dynamic loading for the FeaturedLinksSlice component.
  • Technical Updates

    • Expanded component exports to include new featured links components.
    • Updated slice rendering mechanisms to accommodate the new featured links structure.

The changes improve link presentation and provide more flexible content rendering across the application.

Copy link
Contributor

coderabbitai bot commented Jan 6, 2025

Walkthrough

The pull request introduces a new FeaturedLinks component and related infrastructure for rendering featured links across the web application. This includes the creation of the FeaturedLinks and FeaturedLinksSlice components, updates to the slice machine for dynamic imports, and modifications to existing components like SearchSection to utilize the new FeaturedLinks component. Additionally, new GraphQL fragments and models are defined to support this functionality, allowing for flexible rendering of featured links with URL resolution.

Changes

File Change Summary
apps/web/components/FeaturedLinks/FeaturedLinks.tsx New component for rendering featured links with URL resolution and custom rendering.
apps/web/components/Organization/Slice/FeaturedLinksSlice/FeaturedLinksSlice.tsx New slice component for rendering featured links with title.
apps/web/components/Organization/Slice/SliceMachine.tsx Added dynamic import and rendering support for FeaturedLinksSlice.
apps/web/components/SearchSection/SearchSection.tsx Replaced existing link rendering with new FeaturedLinks component.
apps/web/components/real.ts Added exports for new FeaturedLinks and FeaturedLinksSlice components.
apps/web/screens/queries/fragments.ts Added GraphQL fragment for FeaturedLinksFields.
libs/cms/src/lib/models/featuredLinks.model.ts New model for FeaturedLinks with mapping function.
libs/cms/src/lib/unions/slice.union.ts Updated slice types and mapping to include FeaturedLinks.

Sequence Diagram

sequenceDiagram
    participant User
    participant SliceMachine
    participant FeaturedLinksSlice
    participant FeaturedLinks
    participant LinkResolver

    User->>SliceMachine: Request page with slice
    SliceMachine->>FeaturedLinksSlice: Render slice
    FeaturedLinksSlice->>FeaturedLinks: Pass featured links
    FeaturedLinks->>LinkResolver: Resolve link URLs
    LinkResolver-->>FeaturedLinks: Return resolved URLs
    FeaturedLinks->>User: Render featured links
Loading

Possibly related PRs

Suggested labels

deploy-feature

Suggested reviewers

  • mannipje
  • Toti91

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@datadog-island-is
Copy link

datadog-island-is bot commented Jan 6, 2025

Datadog Report

All test runs 201a013 🔗

10 Total Test Services: 1 Failed, 8 Passed
🔻 Test Sessions change in coverage: 2 decreased, 2 increased, 28 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
services-user-notification 11 0 0 40 0 1m 19.52s 1 decreased (-0.56%) Link
api 0 0 0 4 0 2.43s 1 no change Link
api-domains-auth-admin 0 0 0 18 0 10.2s 1 no change Link
api-domains-communications 0 0 0 5 0 30.33s 1 increased (+0.04%) Link
api-domains-driving-license 0 0 0 23 0 27.01s 1 no change Link
api-domains-license-service 0 0 0 0 0 475.35ms 1 no change Link
application-system-api 0 0 0 46 0 2m 14.25s 1 no change Link
application-template-api-modules 0 0 0 118 0 2m 4.59s 1 no change Link
cms-translations 0 0 0 3 0 27.09s 1 increased (+0.03%) Link
judicial-system-api 0 0 0 61 0 5.43s 1 no change Link

❌ Failed Tests (11)

This report shows up to 5 failed tests.

  • NotificationsWorkerService should call company registry for companies - apps/services/user-notification/src/app/modules/notifications/notificationsWorker/notificationsWorker.service.spec.ts - Details

    Expand for error
     expect(jest.fn()).toHaveBeenCalledTimes(expected)
     
     Expected number of calls: 1
     Received number of calls: 0
    
  • NotificationsWorkerService should call national registry for persons - apps/services/user-notification/src/app/modules/notifications/notificationsWorker/notificationsWorker.service.spec.ts - Details

    Expand for error
     expect(jest.fn()).toHaveBeenCalledTimes(expected)
     
     Expected number of calls: 1
     Received number of calls: 0
    
  • NotificationsWorkerService should not send email if feature flag is turned off - apps/services/user-notification/src/app/modules/notifications/notificationsWorker/notificationsWorker.service.spec.ts - Details

    Expand for error
     expect(jest.fn()).toHaveBeenCalledTimes(expected)
     
     Expected number of calls: 1
     Received number of calls: 0
    
  • NotificationsWorkerService should not send email if user has email notifications disabled - apps/services/user-notification/src/app/modules/notifications/notificationsWorker/notificationsWorker.service.spec.ts - Details

    Expand for error
     expect(jest.fn()).toHaveBeenCalledTimes(expected)
     
     Expected number of calls: 1
     Received number of calls: 0
    
  • NotificationsWorkerService should not send email if user has no email registered - apps/services/user-notification/src/app/modules/notifications/notificationsWorker/notificationsWorker.service.spec.ts - Details

    Expand for error
     expect(jest.fn()).toHaveBeenCalledTimes(expected)
     
     Expected number of calls: 1
     Received number of calls: 0
    

🔻 Code Coverage Decreases vs Default Branch (2)

  • services-user-notification - jest 68.29% (-0.56%) - Details
  • web - jest 3.23% (-0.01%) - Details

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 27 lines in your changes missing coverage. Please review.

Project coverage is 35.65%. Comparing base (2c438d0) to head (38f26c3).

Files with missing lines Patch % Lines
...pps/web/components/FeaturedLinks/FeaturedLinks.tsx 0.00% 13 Missing ⚠️
libs/cms/src/lib/models/featuredLinks.model.ts 61.53% 5 Missing ⚠️
...web/components/Organization/Slice/SliceMachine.tsx 0.00% 4 Missing ⚠️
...on/Slice/FeaturedLinksSlice/FeaturedLinksSlice.tsx 0.00% 3 Missing ⚠️
libs/cms/src/lib/unions/slice.union.ts 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #17416   +/-   ##
=======================================
  Coverage   35.65%   35.65%           
=======================================
  Files        6939     6942    +3     
  Lines      149153   149171   +18     
  Branches    42653    42652    -1     
=======================================
+ Hits        53182    53191    +9     
- Misses      95971    95980    +9     
Flag Coverage Δ
api 3.33% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
api-domains-communications 39.47% <56.25%> (+0.02%) ⬆️
api-domains-driving-license 44.86% <ø> (ø)
application-system-api 38.75% <56.25%> (+<0.01%) ⬆️
application-template-api-modules 27.72% <56.25%> (+<0.01%) ⬆️
cms 0.39% <0.00%> (-0.01%) ⬇️
cms-translations 38.79% <56.25%> (+0.02%) ⬆️
judicial-system-api 20.23% <ø> (ø)
judicial-system-backend 55.87% <56.25%> (+<0.01%) ⬆️
residence-history 85.00% <ø> (ø)
web 2.39% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...pps/web/components/SearchSection/SearchSection.tsx 0.00% <ø> (ø)
apps/web/screens/queries/fragments.ts 0.00% <ø> (ø)
libs/cms/src/lib/unions/slice.union.ts 31.38% <33.33%> (+0.03%) ⬆️
...on/Slice/FeaturedLinksSlice/FeaturedLinksSlice.tsx 0.00% <0.00%> (ø)
...web/components/Organization/Slice/SliceMachine.tsx 0.00% <0.00%> (ø)
libs/cms/src/lib/models/featuredLinks.model.ts 61.53% <61.53%> (ø)
...pps/web/components/FeaturedLinks/FeaturedLinks.tsx 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c438d0...38f26c3. Read the comment docs.

@RunarVestmann RunarVestmann added the automerge Merge this PR as soon as all checks pass label Jan 7, 2025
@RunarVestmann RunarVestmann marked this pull request as ready for review January 7, 2025 12:13
@RunarVestmann RunarVestmann requested review from a team as code owners January 7, 2025 12:13
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
apps/web/components/SearchSection/SearchSection.tsx (1)

Line range hint 41-49: Remove ts-ignore comments by fixing type definitions.

There are multiple ts-ignore comments in the code. Consider fixing the underlying type issues by:

  1. Properly typing the page prop
  2. Adding proper type definitions for featured, heading, image, etc.
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
-// @ts-ignore make web strict
-featured,
+featured?: Featured[],
🧹 Nitpick comments (3)
apps/web/components/Organization/Slice/FeaturedLinksSlice/FeaturedLinksSlice.tsx (1)

9-17: Consider memoizing the component for performance optimization.

The component is well-structured, but since it's likely to be rendered frequently in a list, consider wrapping it with React.memo to prevent unnecessary re-renders.

-export const FeaturedLinksSlice = ({ slice }: FeaturedLinksSliceProps) => {
+export const FeaturedLinksSlice = React.memo(({ slice }: FeaturedLinksSliceProps) => {
   if (!slice.featuredLinks?.length) return null
   return (
     <Stack space={2}>
       <Text variant="h4">{slice.title}</Text>
       <FeaturedLinks links={slice.featuredLinks} />
     </Stack>
   )
-}
+})
libs/cms/src/lib/models/featuredLinks.model.ts (1)

19-27: Consider adding input validation in the mapping function.

While the mapping function handles null cases, it might benefit from additional validation for the input fields.

 export const mapFeaturedLinks = ({
   fields,
   sys,
 }: IFeaturedLinks): SystemMetadata<FeaturedLinks> => ({
   typename: 'FeaturedLinks',
   id: sys.id,
-  title: fields.displayedTitle ?? '',
+  title: fields.displayedTitle?.trim() ?? '',
   featuredLinks: fields.links?.filter(Boolean).map(mapFeatured) ?? [],
 })
apps/web/components/FeaturedLinks/FeaturedLinks.tsx (1)

22-31: Extract CustomLink component for better maintainability.

The inline CustomLink component definition could be moved outside the render method to improve readability and prevent unnecessary recreations.

+const CustomLink = ({ children, title, ...props }) => (
+  <LinkV2 {...props} dataTestId="featured-link">
+    {children}
+  </LinkV2>
+)

 export const FeaturedLinks = ({ links }: FeaturedLinksProps) => {
   // ... rest of the component
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 550571d and 44a08a3.

⛔ Files ignored due to path filters (1)
  • libs/cms/src/lib/generated/contentfulTypes.d.ts is excluded by !**/generated/**
📒 Files selected for processing (8)
  • apps/web/components/FeaturedLinks/FeaturedLinks.tsx (1 hunks)
  • apps/web/components/Organization/Slice/FeaturedLinksSlice/FeaturedLinksSlice.tsx (1 hunks)
  • apps/web/components/Organization/Slice/SliceMachine.tsx (2 hunks)
  • apps/web/components/SearchSection/SearchSection.tsx (2 hunks)
  • apps/web/components/real.ts (1 hunks)
  • apps/web/screens/queries/fragments.ts (2 hunks)
  • libs/cms/src/lib/models/featuredLinks.model.ts (1 hunks)
  • libs/cms/src/lib/unions/slice.union.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
apps/web/components/real.ts (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/Slice/SliceMachine.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/queries/fragments.ts (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/Slice/FeaturedLinksSlice/FeaturedLinksSlice.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/FeaturedLinks/FeaturedLinks.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/SearchSection/SearchSection.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."
libs/cms/src/lib/models/featuredLinks.model.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/cms/src/lib/unions/slice.union.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
🔇 Additional comments (6)
apps/web/components/Organization/Slice/FeaturedLinksSlice/FeaturedLinksSlice.tsx (1)

5-7: LGTM! Well-defined TypeScript interface.

The interface is properly typed with the GraphQL schema type, ensuring type safety throughout the component.

libs/cms/src/lib/models/featuredLinks.model.ts (1)

8-17: LGTM! Well-structured GraphQL object type.

The class is properly decorated with GraphQL decorators and includes appropriate field types and nullability checks.

apps/web/components/real.ts (1)

99-100: LGTM! Exports follow the established pattern.

The new exports maintain consistency with the existing barrel file structure and documentation guidelines.

libs/cms/src/lib/unions/slice.union.ts (1)

51-51: Integration of FeaturedLinks follows established patterns!

The addition of the FeaturedLinks type and its mapping function is well-structured and maintains consistency with the existing type system.

Also applies to: 197-197, 250-250, 348-349

apps/web/screens/queries/fragments.ts (1)

924-936: Please clarify the purpose of the attention field.

The FeaturedLinksFields fragment is well-structured, but the purpose of the attention field in featuredLinks is not immediately clear. Consider adding a comment or documentation to explain its usage.

apps/web/components/Organization/Slice/SliceMachine.tsx (1)

110-112: Implementation follows NextJS best practices!

The dynamic import and slice rendering implementation for FeaturedLinks follows the established patterns and NextJS best practices for code splitting.

Also applies to: 227-228

apps/web/components/FeaturedLinks/FeaturedLinks.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/web/components/Organization/Slice/SliceMachine.tsx (2)

228-229: Consider improving type safety

While the implementation is correct, the function uses multiple @ts-ignore comments. Consider improving type safety by:

  1. Properly typing the slice parameter
  2. Using a discriminated union type for different slice types
  3. Removing the need for @ts-ignore comments

Example type improvement:

type SliceUnion = 
  | { __typename: 'FeaturedLinks'; /* ... other props */ }
  | { __typename: 'HeadingSlice'; /* ... other props */ }
  // ... other slice types

function renderSlice(slice: SliceUnion, namespace: Record<string, string>, slug: string, params: unknown) {
  switch (slice.__typename) {
    // ... cases
  }
}

Line range hint 1-290: Consider restructuring for better maintainability

The file has grown to handle many slice types and could benefit from restructuring:

  1. Group related slices into separate modules
  2. Create a registry pattern for slice types
  3. Move slice type definitions to a separate file

Example restructure:

// sliceRegistry.ts
const sliceRegistry = {
  content: {
    HeadingSlice: () => import('./slices/content/HeadingSlice'),
    OneColumnTextSlice: () => import('./slices/content/OneColumnTextSlice'),
    // ...
  },
  features: {
    FeaturedLinksSlice: () => import('./slices/features/FeaturedLinksSlice'),
    FeaturedArticlesSlice: () => import('./slices/features/FeaturedArticlesSlice'),
    // ...
  }
};

// This would simplify SliceMachine.tsx and make it more maintainable
libs/cms/src/lib/unions/slice.union.ts (1)

51-51: Well-structured changes maintaining library guidelines.

The changes follow best practices for library code:

  • Proper TypeScript type definitions ensuring type safety
  • Clean integration with the CMS type system
  • Maintains reusability across NextJS apps
  • Supports tree-shaking through specific exports

Also applies to: 150-150, 203-203, 256-257, 355-356

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44a08a3 and 38f26c3.

⛔ Files ignored due to path filters (1)
  • libs/cms/src/lib/generated/contentfulTypes.d.ts is excluded by !**/generated/**
📒 Files selected for processing (4)
  • apps/web/components/FeaturedLinks/FeaturedLinks.tsx (1 hunks)
  • apps/web/components/Organization/Slice/SliceMachine.tsx (2 hunks)
  • apps/web/screens/queries/fragments.ts (2 hunks)
  • libs/cms/src/lib/unions/slice.union.ts (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/screens/queries/fragments.ts
  • apps/web/components/FeaturedLinks/FeaturedLinks.tsx
🧰 Additional context used
📓 Path-based instructions (2)
apps/web/components/Organization/Slice/SliceMachine.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."
libs/cms/src/lib/unions/slice.union.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
🔇 Additional comments (4)
apps/web/components/Organization/Slice/SliceMachine.tsx (1)

110-112: LGTM! Dynamic import follows best practices

The dynamic import implementation follows NextJS best practices for code splitting and maintains consistency with existing patterns.

libs/cms/src/lib/unions/slice.union.ts (3)

51-51: LGTM! Type definitions and imports are well-organized.

The new FeaturedLinks related imports and type definitions are properly integrated, maintaining consistency with existing patterns.

Also applies to: 150-150, 203-203


256-257: LGTM! Union type integration is correct.

The FeaturedLinks type is properly added to the SliceUnion array, maintaining the type system integrity.


355-356: Verify the FeaturedLinks mapping implementation.

The mapping case is correctly added. Let's verify the implementation of the imported mapFeaturedLinks function.

Run this script to check the mapping function implementation:

✅ Verification successful

✓ FeaturedLinks mapping implementation is correct

The mapFeaturedLinks function properly transforms IFeaturedLinks into SystemMetadata<FeaturedLinks> with appropriate field mapping and null handling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the FeaturedLinks mapping implementation
# Expected: Find the mapFeaturedLinks function implementation that converts IFeaturedLinks to SystemMetadata<FeaturedLinks>

ast-grep --pattern 'export const mapFeaturedLinks = (slice: IFeaturedLinks)' 

Length of output: 78


Script:

#!/bin/bash
# Search for any mentions of mapFeaturedLinks
rg "mapFeaturedLinks" -A 2

# Find files related to FeaturedLinks
fd -t f "FeaturedLinks"

# Look for import statements containing mapFeaturedLinks
rg "import.*mapFeaturedLinks"

Length of output: 1013


Script:

#!/bin/bash
# Get the complete implementation of mapFeaturedLinks
cat libs/cms/src/lib/models/featuredLinks.model.ts

Length of output: 795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants