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(contentful-apps): Team member - Editor app #16127

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

RunarVestmann
Copy link
Member

@RunarVestmann RunarVestmann commented Sep 23, 2024

Team member - Editor app

What

  • Hide email, free text and phone fields in cms when Team List variant is set to "card"
  • Image container no longer takes up space in TeamList if there is no image provided for a Team Member

Screenshots / Gifs

Card variant

Screenshot 2024-10-02 at 10 12 35

Accordion variant

Screen.Recording.2024-10-02.at.10.13.20.mov

Before

Ignore the red underline, I had document.designMode = "on" in the browser

Screenshot 2024-10-02 at 10 30 10

After

Ignore the red underline, I had document.designMode = "on" in the browser

Screenshot 2024-10-02 at 10 32 03

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

  • New Features
    • Introduced the TeamMemberEditor component for editing team member information.
    • Added the TeamMemberFilterTagsField component for managing filter tags associated with team members.
  • Improvements
    • Updated the handling of the image property in the TeamMember class to allow for nullable types.
    • Improved rendering logic in the TeamList component to conditionally display images based on availability.
  • Chores
    • Updated import paths for several components to reflect a new directory structure.
    • Created a new file to establish TeamMemberEditor as the primary entity for its module.

Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

Walkthrough

The pull request introduces significant updates to the Contentful application components, including the addition of the TeamMemberEditor and TeamMemberFilterTagsField components for managing team member information and filter tags. Import paths for several components have been adjusted to reflect a restructured directory organization. Additionally, a new file for the team-member-editor has been created to facilitate the use of the TeamMemberEditor component. The image property in the TeamMember model has been modified to allow null values, enhancing its flexibility.

Changes

File Change Summary
apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberEditor.tsx Introduced TeamMemberEditor component for editing team member information.
apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberFilterTagsField.tsx Introduced TeamMemberFilterTagsField component for managing filter tags associated with team members.
apps/contentful-apps/components/editors/lists/GenericListEditor/GenericListEditor.tsx Updated import paths for mapLocalesToFieldApis and ContentfulField; no logic changes.
apps/contentful-apps/components/editors/lists/GenericListItemEditor/GenericListItemEditor.tsx Updated import paths for mapLocalesToFieldApis and ContentfulField; no logic changes.
apps/contentful-apps/pages/editors/generic-list-editor.ts Updated import path for GenericListEditor to reflect new directory structure.
apps/contentful-apps/pages/editors/generic-list-item-editor.ts Updated import path for GenericListItemEditor to reflect new directory structure.
apps/contentful-apps/pages/editors/team-member-editor.ts Created new file to export TeamMemberEditor as the default export.
libs/cms/src/lib/models/teamMember.model.ts Updated image property to allow nullable type (`Image
libs/island-ui/contentful/src/lib/TeamList/TeamList.tsx Modified conditional rendering for TeamMemberImageUrlProvider based on member.image?.url.

Possibly related PRs

Suggested reviewers

  • mannipje
  • Toti91
  • eirikurn

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 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.

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 1.14943% with 86 lines in your changes missing coverage. Please review.

Project coverage is 36.77%. Comparing base (0e45aa5) to head (c6982e8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ors/TeamMemberEditor/TeamMemberFilterTagsField.tsx 0.00% 58 Missing ⚠️
...ents/editors/TeamMemberEditor/TeamMemberEditor.tsx 0.00% 21 Missing ⚠️
...tors/lists/GenericListEditor/GenericListEditor.tsx 0.00% 2 Missing ⚠️
...ts/GenericListItemEditor/GenericListItemEditor.tsx 0.00% 2 Missing ⚠️
libs/cms/src/lib/models/teamMember.model.ts 33.33% 2 Missing ⚠️
...entful-apps/components/editors/ContentfulField.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16127      +/-   ##
==========================================
- Coverage   36.96%   36.77%   -0.19%     
==========================================
  Files        6779     6775       -4     
  Lines      139879   139565     -314     
  Branches    39778    39636     -142     
==========================================
- Hits        51700    51321     -379     
- Misses      88179    88244      +65     
Flag Coverage Δ
api 3.37% <ø> (ø)
api-domains-auth-admin 48.77% <ø> (ø)
api-domains-communications 39.92% <33.33%> (-0.01%) ⬇️
application-system-api 41.66% <33.33%> (-0.01%) ⬇️
application-template-api-modules 24.38% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-ui-shell 21.29% <ø> (ø)
cms 0.43% <0.00%> (-0.01%) ⬇️
cms-translations 39.04% <33.33%> (-0.01%) ⬇️
contentful-apps 5.58% <0.00%> (-0.19%) ⬇️
judicial-system-api 18.30% <ø> (ø)
judicial-system-backend 55.28% <33.33%> (-0.01%) ⬇️
services-user-notification 47.07% <33.33%> (+0.02%) ⬆️
skilavottord-ws 24.24% <ø> (ø)
web 1.83% <ø> (ø)

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

Files with missing lines Coverage Δ
apps/contentful-apps/components/editors/utils.ts 0.00% <ø> (ø)
...entful-apps/components/editors/ContentfulField.tsx 0.00% <0.00%> (ø)
...tors/lists/GenericListEditor/GenericListEditor.tsx 0.00% <0.00%> (ø)
...ts/GenericListItemEditor/GenericListItemEditor.tsx 0.00% <0.00%> (ø)
libs/cms/src/lib/models/teamMember.model.ts 43.13% <33.33%> (-0.87%) ⬇️
...ents/editors/TeamMemberEditor/TeamMemberEditor.tsx 0.00% <0.00%> (ø)
...ors/TeamMemberEditor/TeamMemberFilterTagsField.tsx 0.00% <0.00%> (ø)

... and 120 files 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 0e45aa5...c6982e8. Read the comment docs.

@RunarVestmann RunarVestmann marked this pull request as ready for review October 2, 2024 08:26
@RunarVestmann RunarVestmann requested a review from a team as a code owner October 2, 2024 08:26
@RunarVestmann RunarVestmann added the automerge Merge this PR as soon as all checks pass label Oct 2, 2024
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: 6

🧹 Outside diff range and nitpick comments (4)
apps/contentful-apps/components/editors/ContentfulField.tsx (2)

8-15: LGTM! Consider adding JSDoc comments for better documentation.

The introduction of the ContentfulFieldProps interface significantly improves type safety and code clarity. The use of keyof for the fieldID property is particularly good, ensuring that only valid keys from localeToFieldMapping can be used.

Consider adding JSDoc comments to the interface properties for better documentation. For example:

export interface ContentfulFieldProps {
  /** The Contentful SDK instance */
  sdk: EditorExtensionSDK;
  /** Mapping of locales to field APIs */
  localeToFieldMapping: Record<string, ReturnType<typeof mapLocalesToFieldApis>>;
  // ... (add comments for other properties)
}

17-17: LGTM! Consider using arrow function syntax for consistency.

The update to use ContentfulFieldProps for the component's props improves type safety and code clarity. The component follows React best practices and appears to be compatible with Next.js.

For consistency with modern React practices and to align with the arrow function syntax used elsewhere in the file, consider updating the component definition to:

export const ContentfulField: React.FC<ContentfulFieldProps> = (props) => {
  // ... (rest of the component implementation)
}

This change also explicitly declares the return type of the component as a React Functional Component.

apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberFilterTagsField.tsx (2)

100-102: Safely Access Nested Fields with Optional Chaining

Accessing nested fields like fields.title[sdk.locales.default] without checking for their existence might lead to runtime errors if any part of the chain is undefined or null.

Consider using optional chaining and providing a fallback value:

- return sortAlpha(sdk.locales.default)(
-   a.fields.title,
-   b.fields.title,
- )

+ return sortAlpha(sdk.locales.default)(
+   a.fields.title?.[sdk.locales.default] ?? '',
+   b.fields.title?.[sdk.locales.default] ?? '',
+ )

...

- {tagGroup.fields.title[sdk.locales.default]}

+ {tagGroup.fields.title?.[sdk.locales.default] ?? 'Untitled'}

...

- {tag.fields.title[sdk.locales.default]}

+ {tag.fields.title?.[sdk.locales.default] ?? 'Untitled'}

Also applies to: 143-144, 177-178


50-189: Specify Return Type for Functional Component

For better type safety and clarity, explicitly specify the return type of the TeamMemberFilterTagsField component.

Add the return type annotation:

export const TeamMemberFilterTagsField = ({
  sdk,
}: TeamMemberFilterTagsField)
+ : JSX.Element => {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a4421c5 and 6bc1c8a.

📒 Files selected for processing (8)
  • apps/contentful-apps/components/editors/ContentfulField.tsx (1 hunks)
  • apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberEditor.tsx (1 hunks)
  • apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberFilterTagsField.tsx (1 hunks)
  • apps/contentful-apps/components/editors/lists/GenericListEditor/GenericListEditor.tsx (2 hunks)
  • apps/contentful-apps/components/editors/lists/GenericListItemEditor/GenericListItemEditor.tsx (2 hunks)
  • apps/contentful-apps/pages/editors/generic-list-editor.ts (1 hunks)
  • apps/contentful-apps/pages/editors/generic-list-item-editor.ts (1 hunks)
  • apps/contentful-apps/pages/editors/team-member-editor.ts (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • apps/contentful-apps/components/editors/lists/GenericListEditor/GenericListEditor.tsx
  • apps/contentful-apps/pages/editors/generic-list-editor.ts
  • apps/contentful-apps/pages/editors/generic-list-item-editor.ts
  • apps/contentful-apps/pages/editors/team-member-editor.ts
🧰 Additional context used
📓 Path-based instructions (4)
apps/contentful-apps/components/editors/ContentfulField.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/contentful-apps/components/editors/TeamMemberEditor/TeamMemberEditor.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/contentful-apps/components/editors/TeamMemberEditor/TeamMemberFilterTagsField.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/contentful-apps/components/editors/lists/GenericListItemEditor/GenericListItemEditor.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 (3)
apps/contentful-apps/components/editors/lists/GenericListItemEditor/GenericListItemEditor.tsx (2)

29-31: LGTM. Import path change is consistent.

The update to the dynamic import path for ContentfulField is consistent with the previous import path change. This modification maintains the correct relative path after the apparent directory structure change.

The use of dynamic import here is a good practice, especially for components that rely on browser-specific APIs, adhering to Next.js best practices for optimizing client-side rendering when necessary.


Line range hint 1-85: Overall, the code demonstrates good adherence to Next.js and React best practices.

The GenericListItemEditor component is well-structured and follows Next.js conventions. Key observations:

  1. Effective use of TypeScript for type safety, particularly with the Contentful SDK.
  2. Proper implementation of React hooks like useMemo for performance optimization.
  3. Good use of dynamic imports to handle client-side rendering for components with browser-specific dependencies.
  4. Consistent and clear component structure with appropriate use of Contentful SDK and custom utilities.

The recent changes to import paths are consistent and reflect a modification in the directory structure without affecting the overall functionality or best practices.

apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberEditor.tsx (1)

87-93: Conditionally enforce the 'image' field requirement based on teamList variant

Per the PR objectives, the 'image' field should be marked as required only for the 'card' variant of the teamList. Currently, the 'image' field is always rendered and may not have conditional validation enforcing its required status.

Consider implementing conditional validation or rendering for the 'image' field based on the teamList variant:

{teamList?.fields?.variant?.[sdk.locales.default] === 'card' ? (
  <ContentfulField
    displayName="Image"
    fieldID="image"
    localeToFieldMapping={localeToFieldMapping}
    sdk={sdk}
    widgetId="assetLinkEditor"
    isRequired
  />
) : (
  <ContentfulField
    displayName="Image"
    fieldID="image"
    localeToFieldMapping={localeToFieldMapping}
    sdk={sdk}
    widgetId="assetLinkEditor"
  />
)}

This conditionally enforces the isRequired prop when the variant is 'card'.

Would you like assistance in implementing this conditional logic?

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

🧹 Outside diff range and nitpick comments (3)
libs/cms/src/lib/models/teamMember.model.ts (2)

37-38: LGTM! Consider adding a comment for clarity.

The change to make the image property nullable aligns with the PR objective and maintains good TypeScript practices. This allows for more flexibility in handling team member data across different variants.

Consider adding a brief comment explaining why the image property is nullable, e.g.:

// Image is nullable to accommodate different Team List variants
@CacheField(() => Image, { nullable: true })
image!: Image | null

This would improve code readability and make the intent clearer for future developers.


92-92: LGTM! Consider using optional chaining for consistency.

The update to the image assignment in the mapTeamMember function correctly handles the case when no image is provided, aligning with the PR objectives and the changes made to the TeamMember class.

For consistency with the imageOnSelect assignment on the next line, consider using optional chaining:

image: fields.mynd ? mapImage(fields.mynd) : null,
imageOnSelect: fields.imageOnSelect ? mapImage(fields.imageOnSelect) : null,

This makes the code more uniform and easier to read.

libs/island-ui/contentful/src/lib/TeamList/TeamList.tsx (1)

Line range hint 1-238: Consider further modularization for improved reusability

While the file adheres well to the coding guidelines for the libs directory, consider the following suggestion to enhance modularity and reusability:

The TeamMemberImageUrlProvider component could potentially be extracted into a separate file. This would:

  1. Improve the overall structure of the codebase.
  2. Enhance reusability by making it easier to import this component in other parts of the application if needed.
  3. Potentially improve tree-shaking by allowing unused components to be more easily identified.

Would you like me to provide a code snippet demonstrating how to extract this component?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6bc1c8a and c9d222b.

📒 Files selected for processing (2)
  • libs/cms/src/lib/models/teamMember.model.ts (2 hunks)
  • libs/island-ui/contentful/src/lib/TeamList/TeamList.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/cms/src/lib/models/teamMember.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/island-ui/contentful/src/lib/TeamList/TeamList.tsx (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 (2)
libs/cms/src/lib/models/teamMember.model.ts (1)

Line range hint 1-102: Verify alignment with PR objectives

The changes implemented in this file partially address the PR objectives by making the image field nullable. However, the objectives also mentioned hiding email, free text, and phone fields when the Team List variant is set to "card". These changes are not reflected in the current modifications.

Please confirm if these additional changes are intended to be implemented in a different file or if they should be addressed here. If they should be implemented in this file, consider updating the TeamMember class and mapTeamMember function to accommodate the variant-specific field visibility.

To verify the implementation of these changes elsewhere in the codebase, you can run the following script:

This will help identify if the variant-specific behavior is implemented in other parts of the codebase.

libs/island-ui/contentful/src/lib/TeamList/TeamList.tsx (1)

162-175: Improved conditional rendering for image column

The changes improve the TeamMemberAccordionList component by conditionally rendering the image column only when member.image?.url exists. This enhancement:

  1. Prevents the creation of empty image slots in the UI.
  2. Aligns with React best practices for conditional rendering.
  3. Potentially improves performance by reducing unnecessary DOM elements.

The modification maintains the component's reusability and adheres to the coding guidelines for the libs directory.

@datadog-island-is
Copy link

datadog-island-is bot commented Oct 2, 2024

Datadog Report

All test runs 7ac8e10 🔗

11 Total Test Services: 0 Failed, 10 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.18%), 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
api 0 0 0 4 0 3.2s 1 no change Link
api-domains-auth-admin 0 0 0 18 0 14.26s 1 no change Link
api-domains-communications 0 0 0 5 0 32.27s 1 no change Link
api-domains-license-service 0 0 0 0 0 707.84ms 1 no change Link
application-system-api 0 0 0 111 2 3m 20.73s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 54.77s 1 no change Link
cms-translations 0 0 0 3 0 29.86s 1 no change Link
judicial-system-api 0 0 0 57 0 7.02s 1 no change Link
judicial-system-backend 0 0 0 20972 0 18m 51.66s 1 no change Link
services-user-notification 0 0 0 51 0 1m 26.83s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • contentful-apps - jest 4.83% (-0.18%) - Details

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c9d222b and d5ec47f.

📒 Files selected for processing (1)
  • apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberEditor.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/contentful-apps/components/editors/TeamMemberEditor/TeamMemberEditor.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/contentful-apps/components/editors/TeamMemberEditor/TeamMemberEditor.tsx (4)

1-18: LGTM: Imports and dynamic import are well-structured

The imports are appropriate for the component's functionality, and the dynamic import of ContentfulField is a good practice to avoid SSR issues with window and navigator objects.


61-63: Verify variant check against PR objectives

The current code checks for an 'accordion' variant, but the PR objectives mention a "card" variant. Ensure that this logic aligns with the intended functionality:

- const teamListIsAccordionVariant =
-   teamList?.fields?.variant?.[sdk.locales.default] === 'accordion'
+ const teamListIsCardVariant =
+   teamList?.fields?.variant?.[sdk.locales.default] === 'card'

Please confirm if this change is necessary or if the PR objectives need to be updated.


20-35: ⚠️ Potential issue

Ensure consistent field names for the 'image' field

In createLocaleToFieldMapping, the field is created with createField('mynd', sdk), but later in the component, it's referred to as 'image'. This discrepancy may lead to issues where the field does not display or function as expected.

To resolve this, ensure that the field names are consistent:

-    mynd: createField('mynd', sdk),
+    image: createField('image', sdk),

47-59: 🛠️ Refactor suggestion

Optimize useEffect dependencies

The useEffect hook depends on cma.entry and sdk.entry, which may cause unnecessary re-runs. Consider optimizing the dependency array:

 useEffect(() => {
   const fetchTeamList = async () => {
     // Fetch logic
   }

   fetchTeamList()
- }, [cma.entry, sdk.entry])
+ }, [sdk.entry.getSys().id])

This ensures the effect only re-runs when the entry ID changes, potentially improving performance.

Copy link
Member

@Toti91 Toti91 left a comment

Choose a reason for hiding this comment

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

ui code LGTM

@kodiakhq kodiakhq bot merged commit 81e07f5 into main Oct 2, 2024
71 checks passed
@kodiakhq kodiakhq bot deleted the feature/contentful-apps-team-member-editor-app branch October 2, 2024 15:39
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.

3 participants