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

fix(web): Use || instead of ?? for JSON.parse fallback #16360

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

RunarVestmann
Copy link
Member

@RunarVestmann RunarVestmann commented Oct 10, 2024

Use || instead of ?? for JSON.parse fallback

What

  • The CMS can return an empty string, this means that the JSON.parse call will throw an error
  • By using || instead of ?? we prevent the JSON.parse call from throwing an error in case there is an empty string

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

  • Bug Fixes

    • Updated the handling of fields properties across multiple components to ensure they default to an empty object if falsy, improving reliability and preventing potential errors.
  • Refactor

    • Adjusted variable initialization methods for consistency across various themes and components, enhancing code maintainability.

@RunarVestmann RunarVestmann added the automerge Merge this PR as soon as all checks pass label Oct 10, 2024
@RunarVestmann RunarVestmann requested review from a team as code owners October 10, 2024 15:41
Copy link
Contributor

coderabbitai bot commented Oct 10, 2024

Walkthrough

This pull request updates several components across the application to change the way the fields property is accessed. The logical OR operator (||) is now used instead of the nullish coalescing operator (??). This adjustment ensures that if the fields property is falsy, including cases where it is an empty string, it will default to an empty object. The changes affect various components in the Organization, Project, and screens related to Articles, Categories, Home, and Services.

Changes

File Path Change Summary
apps/web/components/Organization/OrganizationIslandFooter/OrganizationIslandFooter.tsx Updated fields property access to use `
apps/web/components/Organization/Wrapper/Themes/*Header.tsx Updated namespace variable initialization to use `
apps/web/components/Project/Header/*DashboardHeader.tsx Updated fields property access to use `
apps/web/components/SignLanguageButton/SignLanguageButton.tsx Updated fields property access to use `
apps/web/screens/Article/Article.tsx Updated fields property access to use `
apps/web/screens/Category/Categories/Categories.tsx Updated fields property access to use `
apps/web/screens/Home/Home.tsx Updated fields property access to use `
apps/web/screens/Organization/PublishedMaterial/PublishedMaterial.tsx Updated fields property access to use `
apps/web/screens/ServiceWeb/Forms/Forms.tsx Updated fields property access to use `
apps/web/screens/ServiceWeb/Search/ServiceSearch.tsx Updated fields property access to use `

Possibly related PRs


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.

@datadog-island-is
Copy link

datadog-island-is bot commented Oct 10, 2024

Datadog Report

All test runs 15ec0c8 🔗

4 Total Test Services: 0 Failed, 4 Passed
➡️ Test Sessions change in coverage: 8 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 2.9s 1 no change Link
download-service 0 0 0 1 0 18.5s 1 no change Link
portals-admin-regulations-admin 0 0 0 24 0 16.06s 1 no change Link
web 0 0 0 84 0 28.5s 1 no change Link

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: 1

🧹 Outside diff range and nitpick comments (21)
apps/web/screens/Category/Categories/Categories.tsx (1)

61-61: Approved: Good fix for handling empty strings

The change from ?? to || aligns with the PR objective and improves the robustness of the code. It will prevent JSON.parse from throwing an error when encountering an empty string returned by the CMS.

For improved clarity and to make the fallback behavior more explicit, consider using a default value function:

.then((res) => JSON.parse(res?.data?.getNamespace?.fields || '{}') || {})

This ensures that even if JSON.parse returns a falsy value (like null), we still get an empty object.

apps/web/components/Project/Header/DirectorateOfHealthDashboardHeader.tsx (1)

Line range hint 1-68: Well-structured component with room for minor improvement

The DirectorateOfHealthDashboardHeader component is well-structured and follows NextJS and React best practices:

  • Effective use of useMemo for JSON parsing
  • Utilization of custom hooks for reusability
  • Proper TypeScript annotations for props and component definition

To further enhance type safety, consider adding a type assertion or validation for the parsed JSON:

const namespace = useMemo(() => {
  const parsedNamespace = JSON.parse(projectPage?.namespace?.fields || '{}') as Record<string, unknown>;
  return parsedNamespace;
}, [projectPage?.namespace?.fields])

This ensures that namespace is always an object, even if the JSON parsing results in a non-object value.

apps/web/components/Project/Header/FiskistofaDashboardHeader.tsx (2)

16-16: Consider handling invalid JSON and potential falsy values.

The change from ?? to || addresses the PR objective of handling empty strings returned by the CMS. However, consider the following points:

  1. This change will treat all falsy values (including false and 0) as empty objects. Ensure this is the intended behavior.
  2. The current implementation doesn't handle cases where fields contains invalid JSON. Consider adding a try-catch block to handle potential parsing errors.

Here's a suggested implementation that addresses these concerns:

return JSON.parse(projectPage?.namespace?.fields || '{}', (key, value) => {
  if (value === null && key === '') {
    return {};
  }
  return value;
});

This implementation:

  • Uses || to handle empty strings and other falsy values.
  • Uses a reviver function to return an empty object if the parsed result is null.
  • Still throws an error for invalid JSON, which you might want to catch and handle appropriately.

Line range hint 1-72: Consider optimizations for better TypeScript usage and NextJS practices.

The component generally follows good practices, but consider the following improvements:

  1. Enhance error handling, especially for JSON parsing (as mentioned in the previous comment).
  2. Replace any with a more specific type for the namespace object. This will improve type safety and developer experience.
  3. If the projectPage data is static or can be fetched at build time, consider using getStaticProps to improve performance and SEO.

Here's a suggested improvement for the namespace type:

interface Namespace {
  fiskistofaDashboardHeaderLeftCloudImageSrc?: string;
  fiskistofaDashboardHeaderCenterCloudImageSrc?: string;
  fiskistofaDashboardHeaderRightCloudImageSrc?: string;
  fiskistofaDashboard?: string;
  logo?: string;
  [key: string]: string | undefined;
}

const namespace = useMemo<Namespace>(() => {
  // ... (parsing logic here)
}, [projectPage?.namespace?.fields]);

This provides better type safety while still allowing for additional properties.

apps/web/components/Organization/OrganizationIslandFooter/OrganizationIslandFooter.tsx (1)

29-29: Approve the change with a suggestion for error handling

The change from ?? to || aligns with the PR objective to handle cases where the CMS returns an empty string. This modification ensures that JSON.parse receives an empty object string ('{}') instead of an empty string, preventing potential parsing errors.

The change improves the robustness of the code by handling falsy values (including empty strings) from data?.getNamespace?.fields. This adheres to NextJS best practices for efficient state management.

However, to further enhance error handling and type safety, consider wrapping the JSON.parse call in a try-catch block:

const namespace = useMemo(() => {
  try {
    return JSON.parse(data?.getNamespace?.fields || '{}');
  } catch (error) {
    console.error('Error parsing fields:', error);
    return {};
  }
}, [data?.getNamespace?.fields]);

This approach maintains the intended functionality while providing better error logging and ensuring type safety.

apps/web/components/Organization/Wrapper/Themes/FjarsyslaRikisinsTheme/FjarsyslaRikisinsHeader.tsx (1)

33-33: Approved change, but consider additional improvements for robustness and type safety.

The change from ?? to || addresses the PR objective and prevents JSON.parse errors for empty strings. However, consider the following improvements:

  1. Add type checking for the parsed JSON to ensure type safety:
const namespace = useMemo(() => {
  try {
    const parsedNamespace = JSON.parse(organizationPage.organization?.namespace?.fields || '{}');
    // Add type guard here, e.g.:
    if (typeof parsedNamespace === 'object' && parsedNamespace !== null) {
      return parsedNamespace as Record<string, unknown>;
    }
    return {};
  } catch (error) {
    console.error('Error parsing namespace:', error);
    return {};
  }
}, [organizationPage.organization?.namespace?.fields]);
  1. Consider using a default type for the namespace to improve type inference throughout the component.

These changes will further improve the robustness of the code and align with TypeScript best practices.

apps/web/components/SignLanguageButton/SignLanguageButton.tsx (1)

47-47: Approved change, with suggestions for improvement

The change from ?? to || aligns with the PR objective and addresses the issue of handling empty strings in the fields property. This is a good improvement that prevents potential JSON parsing errors.

However, to further enhance the code quality and type safety, consider the following suggestions:

  1. Add type safety for the parsed JSON:
type NamespaceFields = {
  // Define the expected structure of your namespace fields
};

const namespace = useMemo<NamespaceFields>(
  () => JSON.parse(data?.getNamespace?.fields || '{}') as NamespaceFields,
  [data?.getNamespace?.fields],
);
  1. Implement explicit error handling for JSON parsing:
const namespace = useMemo<NamespaceFields>(() => {
  try {
    return JSON.parse(data?.getNamespace?.fields || '{}') as NamespaceFields;
  } catch (error) {
    console.error('Error parsing namespace fields:', error);
    return {} as NamespaceFields;
  }
}, [data?.getNamespace?.fields]);

These changes will improve type safety and error handling, making the component more robust and maintainable.

apps/web/components/Organization/Wrapper/Themes/RikissaksoknariTheme/RikissaksoknariHeader.tsx (1)

36-36: Approved change with a suggestion for improved robustness

The change from ?? to || successfully addresses the issue of handling empty strings returned by the CMS, as mentioned in the PR objectives. This prevents JSON.parse from throwing an error on empty strings, which is the desired behavior.

However, to improve robustness, consider adding a try-catch block to handle potential JSON parsing errors:

const namespace = useMemo(() => {
  try {
    return JSON.parse(organizationPage.organization?.namespace?.fields || '{}')
  } catch (error) {
    console.error('Error parsing namespace fields:', error)
    return {}
  }
}, [organizationPage.organization?.namespace?.fields])

This addition will ensure that any unexpected JSON parsing errors are caught and logged, preventing potential runtime errors.

apps/web/components/Organization/Wrapper/Themes/LandkjorstjornTheme/LandskjorstjornHeader.tsx (1)

Line range hint 17-24: Suggestions for code improvements

While the overall structure is good, here are some suggestions for further improvements:

  1. Consider replacing the getDefaultStyle function with a constant object, as it always returns the same static object.

  2. The background image style could be moved to the CSS module (LandskjorstjornHeader.css) for better maintainability and separation of concerns.

  3. There's some duplication in the logo rendering logic. Consider extracting this into a separate component or function to reduce repetition.

Example refactor for the logo rendering:

const OrganizationLogo: React.FC<{ organization: Organization, logoAltText: string }> = ({ organization, logoAltText }) => (
  <Link
    href={linkResolver('organizationpage', [organizationPage.slug]).href}
    className={styles.iconCircle}
  >
    <img
      src={organization.logo.url}
      className={styles.headerLogo}
      alt={logoAltText}
    />
  </Link>
);

// Then use it in the render method:
{!!organizationPage.organization?.logo && (
  <Hidden above="sm">
    <OrganizationLogo organization={organizationPage.organization} logoAltText={logoAltText} />
  </Hidden>
)}

These changes would improve code maintainability and reduce duplication.

Also applies to: 52-62, 73-83

apps/web/components/Organization/Wrapper/Themes/SHHTheme/ShhHeader.tsx (1)

44-44: Approved: Good fix for handling empty strings. Consider enhancing type safety.

The change from ?? to || effectively addresses the issue of handling empty strings from the CMS, aligning with the PR objectives. This modification ensures that both null, undefined, and empty strings will default to an empty object when parsed.

To further improve type safety, consider adding a type assertion to the parsed JSON:

() => JSON.parse(organizationPage.organization?.namespace?.fields || '{}') as Record<string, unknown>,

This assertion ensures that TypeScript treats the parsed result as an object with string keys and unknown values, providing better type checking for subsequent usage.

apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/FiskistofaHeader.tsx (2)

43-43: Approved: Good fix for handling empty strings, consider adding a comment for clarity.

The change from ?? to || effectively addresses the issue of handling empty strings returned by the CMS, as mentioned in the PR objectives. This modification ensures that JSON.parse doesn't throw an error when encountering an empty string.

Consider adding a brief comment explaining why || is used instead of ?? to improve code maintainability:

-    () => JSON.parse(organizationPage.organization?.namespace?.fields || '{}'),
+    // Use || instead of ?? to handle empty strings from CMS
+    () => JSON.parse(organizationPage.organization?.namespace?.fields || '{}'),

Line range hint 1-105: Consider enhancing TypeScript usage and null checks

While the component generally follows good practices, there are a few areas where we can improve TypeScript usage and null checks:

  1. The organizationPage prop type could be more specific. Instead of using the entire OrganizationPage type, consider creating a more focused type with only the required properties.

  2. Add null checks for nested properties to prevent potential runtime errors.

Here's an example of how you could improve the types and null checks:

interface FiskistofaHeaderProps {
  organizationPage: {
    slug: string;
    title: string;
    organization?: {
      logo?: {
        url: string;
      };
      namespace?: {
        fields?: string;
      };
    };
  };
  logoAltText: string;
}

const FiskistofaHeader: React.FC<FiskistofaHeaderProps> = ({
  organizationPage,
  logoAltText,
}) => {
  // ...

  const namespace = useMemo(
    () => JSON.parse(organizationPage.organization?.namespace?.fields || '{}'),
    [organizationPage.organization?.namespace?.fields],
  )

  // ...

  return (
    // ...
    {organizationPage.organization?.logo && (
      <Link
        href={linkResolver('organizationpage', [organizationPage.slug]).href}
        className={styles.iconCircle}
      >
        <img
          src={organizationPage.organization.logo.url}
          className={styles.headerLogo}
          alt={logoAltText}
        />
      </Link>
    )}
    // ...
  )
}

This refactoring improves type safety and makes the component more robust against potential null or undefined values.

apps/web/components/Organization/Wrapper/Themes/HeilbrigdisstofnunSudurlandsTheme/HeilbrigdisstofnunSudurlandsHeader.tsx (1)

Line range hint 1-114: Suggestion: Consider memoizing more computed values

While the component generally adheres to NextJS best practices and makes good use of TypeScript, there's an opportunity for further performance optimization. Consider memoizing more computed values, especially those that depend on the width from useWindowSize(). For example, you could memoize the result of getDefaultStyle(width) and getScreenWidthString(width).

Here's a suggestion for improvement:

const memoizedStyle = useMemo(() => getDefaultStyle(width), [width]);
const memoizedScreenWidth = useMemo(() => getScreenWidthString(width), [width]);

// Then use these in your JSX
<div
  style={n(`hsuHeader-${memoizedScreenWidth}`, memoizedStyle)}
  className={styles.headerBg}
>
  {/* ... */}
</div>

This change would prevent unnecessary recalculations of these values on re-renders that don't involve width changes, potentially improving performance.

apps/web/components/Organization/Wrapper/Themes/LandlaeknirTheme/LandlaeknirHeader.tsx (1)

55-55: Approved change with a suggestion for improved type safety

The modification from ?? to || in the JSON.parse fallback is a good improvement. It addresses the issue of JSON.parse throwing an error when given an empty string, which aligns with the PR objectives.

To further enhance type safety, consider adding a type assertion or using a type guard:

() => {
  try {
    return JSON.parse(organizationPage.organization?.namespace?.fields || '{}') as Record<string, unknown>;
  } catch {
    return {};
  }
}

This approach ensures that the parsed result is always an object, even if the JSON is invalid, and provides better type information to TypeScript.

apps/web/components/Organization/Wrapper/Themes/IcelandicRadiationSafetyAuthority/IcelandicRadiationSafetyAuthorityHeader.tsx (1)

41-41: Approve change with suggestions for improvement

The change from ?? to || addresses the issue with empty strings as described in the PR objectives. This is a good fix for the JSON parsing error.

However, to improve type safety and error handling, consider the following suggestions:

  1. Add a type assertion for the parsed JSON.
  2. Implement error handling for potential JSON parsing errors.

Here's an example of how you could improve this:

const namespace = useMemo(() => {
  try {
    return JSON.parse(organizationPage.organization?.namespace?.fields || '{}') as Record<string, unknown>;
  } catch (error) {
    console.error('Error parsing namespace fields:', error);
    return {};
  }
}, [organizationPage.organization?.namespace?.fields]);

This approach maintains the fix for empty strings while adding type safety and error handling.

apps/web/screens/Home/Home.tsx (2)

Line range hint 20-24: Enhance type safety for the locale prop

While the code generally adheres to NextJS best practices and makes good use of TypeScript, we can further improve type safety for the locale prop. Consider using a more specific type instead of Locale from a shared types file.

Replace the Locale type with a union type of specific locales supported by your application. For example:

type SupportedLocale = 'is' | 'en';

interface HomeProps {
  // ... other props
  locale: SupportedLocale;
}

Home.getProps = async ({ apolloClient, locale }: { apolloClient: ApolloClient<any>, locale: SupportedLocale }) => {
  // ... existing code
}

This change will provide better type checking and autocompletion for supported locales throughout the component.

Also applies to: 166-170


Line range hint 131-173: Improve error handling for GraphQL queries

The current implementation of getProps efficiently fetches data using concurrent requests. However, it lacks explicit error handling for failed GraphQL queries. Consider adding try-catch blocks to handle potential errors gracefully.

Here's a suggested improvement:

Home.getProps = async ({ apolloClient, locale }) => {
  try {
    const [
      { data: { getArticleCategories } },
      { data: { getNews: { items: news } } },
      { data: { getFrontpage } },
    ] = await Promise.all([
      // ... existing queries
    ]);

    return {
      // ... existing return object
    };
  } catch (error) {
    console.error('Error fetching data for Home component:', error);
    // Handle the error appropriately, e.g., return default values or throw a custom error
    return {
      news: [],
      categories: [],
      page: null,
      showSearchInHeader: false,
      locale: locale as Locale,
    };
  }
};

This change will ensure that any errors during data fetching are caught and handled appropriately, improving the robustness of the application.

apps/web/components/Organization/Wrapper/Themes/IcelandicNaturalDisasterInsuranceTheme/IcelandicNaturalDisasterInsuranceHeader.tsx (1)

73-73: Approved with a suggestion for improved type safety

The change from ?? to || effectively addresses the PR objective and prevents potential errors when parsing empty strings. This is a good improvement that aligns with the intended fix.

To further enhance type safety, consider adding a type assertion or validation for the parsed result:

const namespace = useMemo(
  () => JSON.parse(organizationPage.organization?.namespace?.fields || '{}') as Record<string, unknown>,
  [organizationPage.organization?.namespace?.fields],
)

This ensures that namespace is always treated as an object with string keys and unknown values, providing better TypeScript support throughout the component.

apps/web/screens/ServiceWeb/Search/ServiceSearch.tsx (1)

434-434: Approved: Consistent JSON parsing fallback

This change correctly implements the same fallback mechanism as in the previous instance, ensuring consistent behavior across the component. It effectively prevents JSON.parse errors on empty strings.

Consider extracting this JSON parsing logic into a utility function for reusability and consistency. For example:

const safeParseJSON = (jsonString: string | null | undefined, fallback = {}) => {
  try {
    return JSON.parse(jsonString || '{}');
  } catch {
    return fallback;
  }
};

This function could then be used in both places:

const organizationNamespace = useMemo(
  () => safeParseJSON(organization?.namespace?.fields),
  [organization?.namespace?.fields],
);

// and

return safeParseJSON(variables?.data?.getNamespace?.fields);

This refactoring would improve code maintainability and reduce duplication.

apps/web/screens/ServiceWeb/Forms/Forms.tsx (1)

Line range hint 437-451: Approved: Enhanced JSON parsing fallback with refactor suggestion

These changes from ?? to || align with the PR objective and improve the robustness of the JSON parsing. They ensure that empty objects or arrays are used as fallbacks when the parsed data is falsy, preventing potential runtime errors.

However, the nesting of optional chaining, nullish coalescing, and logical OR operators makes the code somewhat complex to read. Consider refactoring for improved readability:

const parseNamespaceFields = (data: any) => {
  const fields = data?.getNamespace?.fields || '{}'
  return JSON.parse(fields)
}

// ...

.then((variables) => {
  const parsedFields = parseNamespaceFields(variables.data)
  return parsedFields.entities || []
}),

// ...

.then((variables) => parseNamespaceFields(variables.data)),

This refactoring extracts the parsing logic into a separate function, making the code more readable and maintainable while preserving the intended functionality.

apps/web/screens/Article/Article.tsx (1)

853-853: Approved change, but consider a more explicit check

The change from ?? to || aligns with the PR objectives and makes the code more robust against empty strings returned by the CMS. However, this approach might have unintended consequences if fields is intentionally set to other falsy values like false or 0.

Consider using a more explicit check for empty string to avoid potential issues with other falsy values:

-        return JSON.parse(content?.data?.getNamespace?.fields || '{}')
+        const fields = content?.data?.getNamespace?.fields
+        return JSON.parse(fields === '' ? '{}' : fields ?? '{}')

This change ensures that only empty strings are replaced with '{}', while still falling back to '{}' for null or undefined values.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b8b850d and 8b04ade.

📒 Files selected for processing (30)
  • apps/web/components/Organization/OrganizationIslandFooter/OrganizationIslandFooter.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/FiskistofaHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/FjarsyslaRikisinsTheme/FjarsyslaRikisinsHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/GevTheme/GevHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/HeilbrigdisstofnunAusturlandsTheme/HeilbrigdisstofnunAusturlandsHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/HeilbrigdisstofnunNordurlandsTheme/HeilbrigdisstofnunNordurlandsHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/HeilbrigdisstofnunSudurlandsTheme/HeilbrigdisstofnunSudurlandsHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/HmsTheme/HmsHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/HveTheme/HveHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/IcelandicNaturalDisasterInsuranceTheme/IcelandicNaturalDisasterInsuranceHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/IcelandicRadiationSafetyAuthority/IcelandicRadiationSafetyAuthorityHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/LandkjorstjornTheme/LandskjorstjornHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/LandlaeknirTheme/LandlaeknirHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/RikislogmadurTheme/RikislogmadurHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/RikissaksoknariTheme/RikissaksoknariHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/SAkTheme/SAkHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/SHHTheme/ShhHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/TransportAuthorityTheme/TransportAuthorityHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/UtlendingastofnunTheme/UtlendingastofnunHeader.tsx (1 hunks)
  • apps/web/components/Organization/Wrapper/Themes/VinnueftirlitidTheme/VinnueftirlitidHeader.tsx (1 hunks)
  • apps/web/components/Project/Header/DirectorateOfHealthDashboardHeader.tsx (1 hunks)
  • apps/web/components/Project/Header/FiskistofaDashboardHeader.tsx (1 hunks)
  • apps/web/components/SignLanguageButton/SignLanguageButton.tsx (1 hunks)
  • apps/web/screens/Article/Article.tsx (1 hunks)
  • apps/web/screens/Category/Categories/Categories.tsx (1 hunks)
  • apps/web/screens/Home/Home.tsx (1 hunks)
  • apps/web/screens/Organization/PublishedMaterial/PublishedMaterial.tsx (1 hunks)
  • apps/web/screens/ServiceWeb/Forms/Forms.tsx (3 hunks)
  • apps/web/screens/ServiceWeb/Search/ServiceSearch.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/web/screens/Organization/PublishedMaterial/PublishedMaterial.tsx
🧰 Additional context used
📓 Path-based instructions (29)
apps/web/components/Organization/OrganizationIslandFooter/OrganizationIslandFooter.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/Themes/FiskistofaTheme/FiskistofaHeader.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/Themes/FjarsyslaRikisinsTheme/FjarsyslaRikisinsHeader.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/Themes/GevTheme/GevHeader.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/Themes/HeilbrigdisstofnunAusturlandsTheme/HeilbrigdisstofnunAusturlandsHeader.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/Themes/HeilbrigdisstofnunNordurlandsTheme/HeilbrigdisstofnunNordurlandsHeader.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/Themes/HeilbrigdisstofnunSudurlandsTheme/HeilbrigdisstofnunSudurlandsHeader.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/Themes/HmsTheme/HmsHeader.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/Themes/HveTheme/HveHeader.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/Themes/IcelandicNaturalDisasterInsuranceTheme/IcelandicNaturalDisasterInsuranceHeader.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/Themes/IcelandicRadiationSafetyAuthority/IcelandicRadiationSafetyAuthorityHeader.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/Themes/LandkjorstjornTheme/LandskjorstjornHeader.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/Themes/LandlaeknirTheme/LandlaeknirHeader.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/Themes/RikislogmadurTheme/RikislogmadurHeader.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/Themes/RikissaksoknariTheme/RikissaksoknariHeader.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/Themes/SAkTheme/SAkHeader.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/Themes/SHHTheme/ShhHeader.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/Themes/SyslumennTheme/SyslumennHeader.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/Themes/TransportAuthorityTheme/TransportAuthorityHeader.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/Themes/UtlendingastofnunTheme/UtlendingastofnunHeader.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/Themes/VinnueftirlitidTheme/VinnueftirlitidHeader.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/Project/Header/DirectorateOfHealthDashboardHeader.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/Project/Header/FiskistofaDashboardHeader.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/SignLanguageButton/SignLanguageButton.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/Article/Article.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/Category/Categories/Categories.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/Home/Home.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/ServiceWeb/Forms/Forms.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/ServiceWeb/Search/ServiceSearch.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 (21)
apps/web/components/Project/Header/DirectorateOfHealthDashboardHeader.tsx (1)

21-21: Approved: Improved fallback handling for JSON.parse

The change from ?? to || aligns with the PR objectives and improves the robustness of the code. This modification ensures that JSON.parse will receive an empty object string '{}' when projectPage?.namespace?.fields is falsy (including an empty string), preventing potential parsing errors.

apps/web/components/Organization/Wrapper/Themes/VinnueftirlitidTheme/VinnueftirlitidHeader.tsx (1)

22-22: Approved: Improved error handling for JSON parsing

This change from ?? to || enhances the robustness of the code by preventing JSON.parse errors when fields is an empty string. It now correctly defaults to an empty object for all falsy values (including null, undefined, and empty string), which aligns with the PR objectives and improves the overall reliability of the component.

apps/web/components/Organization/Wrapper/Themes/SAkTheme/SAkHeader.tsx (2)

22-22: Approved: Improved error handling for JSON.parse

This change from ?? to || in the JSON.parse fallback is a good improvement. It addresses the issue of potential errors when parsing empty strings, making the code more robust. The logical OR operator (||) will return an empty object {} for null, undefined, and empty string cases, preventing runtime errors.

This modification aligns well with the PR objectives and improves the overall reliability of the component.


Line range hint 1-93: Overall code quality is high

The SAkHeader component demonstrates good adherence to NextJS and React best practices:

  1. Efficient use of hooks like useMemo for performance optimization.
  2. Proper use of TypeScript for type safety (e.g., in component props).
  3. Clean component structure with clear separation of concerns.
  4. Effective use of island.is ecosystem components and utilities.

The code maintains a high standard of quality and readability.

apps/web/components/Organization/Wrapper/Themes/HeilbrigdisstofnunNordurlandsTheme/HeilbrigdisstofnunNordurlandsHeader.tsx (2)

34-34: Approved: Improved JSON parsing fallback

This change from ?? to || aligns with the PR objective and enhances the robustness of the code. By using ||, we ensure that any falsy value (including empty strings) defaults to '{}', preventing potential JSON.parse errors. This is a good practice for handling potentially invalid JSON data from external sources.


Line range hint 1-95: Approved: Well-structured NextJS component with good practices

The HeilbrigdisstofnunNordurlandsHeader component demonstrates good NextJS and React practices:

  1. It uses functional component structure with hooks.
  2. TypeScript is properly utilized for type safety (e.g., in props definition).
  3. Custom hooks like useLinkResolver, useNamespace, and useWindowSize are used effectively.
  4. useMemo is employed for performance optimization when parsing JSON.
  5. The component integrates well with the island.is UI ecosystem.

These practices contribute to a maintainable and efficient codebase.

apps/web/components/Organization/Wrapper/Themes/RikislogmadurTheme/RikislogmadurHeader.tsx (1)

36-36: Approved: Fallback handling improved for empty strings

The change from ?? to || aligns with the PR objective and improves the handling of empty strings returned by the CMS. This prevents potential JSON.parse errors when dealing with empty strings.

However, be aware that this change might introduce different behavior for other falsy values (e.g., 0, false) if they are valid in your context. Ensure this doesn't affect the expected functionality in edge cases.

To verify the impact of this change, we can check for other usages of JSON.parse with similar patterns:

apps/web/components/Organization/Wrapper/Themes/HveTheme/HveHeader.tsx (1)

42-42: Approved: Effective fix for JSON parsing fallback

This change successfully addresses the issue described in the PR objectives. By using the logical OR operator (||) instead of the nullish coalescing operator (??), the code now handles cases where fields might be an empty string, preventing JSON.parse from throwing an error.

This modification improves the robustness of the code by ensuring that:

  1. If fields is undefined or null, it falls back to '{}'.
  2. If fields is an empty string, it also falls back to '{}'.
  3. For any other truthy value, fields will be parsed as JSON.

The change aligns well with NextJS best practices and maintains type safety.

apps/web/components/Organization/Wrapper/Themes/HmsTheme/HmsHeader.tsx (1)

41-41: Approved: Improved JSON parsing fallback

This change aligns with the PR objectives and enhances the robustness of the code. By using the logical OR operator (||) instead of the nullish coalescing operator (??), the code now handles cases where fields might be an empty string, preventing potential JSON.parse errors.

The fallback to '{}' ensures that even if fields is falsy (including an empty string), a valid empty object will be parsed. This improvement handles more edge cases and aligns with best practices for defensive programming.

apps/web/components/Organization/Wrapper/Themes/LandkjorstjornTheme/LandskjorstjornHeader.tsx (2)

39-39: Approved: Improved JSON parsing fallback

The change from ?? to || in the JSON parsing fallback is a good improvement. This modification aligns with the PR objectives and addresses the potential issue of errors when parsing empty strings. Using || ensures that any falsy value (including empty strings) will default to an empty object, making the code more robust and less prone to parsing errors.


Line range hint 1-110: Approved: Well-structured component with proper TypeScript usage

The LandskjorstjornHeader component is well-structured and follows React and NextJS best practices. It effectively uses TypeScript for type safety, including proper typing for props and the functional component. The use of custom hooks (useLinkResolver, useNamespace, useWindowSize) and memoization for the namespace calculation demonstrates good performance considerations and adherence to React patterns.

apps/web/components/Organization/Wrapper/Themes/UtlendingastofnunTheme/UtlendingastofnunHeader.tsx (1)

38-38: Approved: Improved robustness in JSON parsing

This change from the nullish coalescing operator (??) to the logical OR operator (||) aligns well with the PR objective. It enhances the robustness of the code by handling additional edge cases, such as when the CMS returns an empty string for the fields property.

The modification ensures that any falsy value (including empty strings) will default to an empty object string, preventing potential JSON parsing errors. This approach maintains good TypeScript practices and adheres to NextJS best practices for efficient state management through the use of useMemo.

apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennHeader.tsx (1)

45-45: Approved: Improved fallback handling for JSON.parse

This change aligns with the PR objectives and improves the robustness of the code. By using the logical OR operator (||) instead of the nullish coalescing operator (??), we ensure that JSON.parse receives an empty object string ('{}') when fields is falsy (including empty string, undefined, or null). This prevents potential errors when parsing empty strings and adheres to NextJS best practices for type safety.

apps/web/components/Organization/Wrapper/Themes/HeilbrigdisstofnunSudurlandsTheme/HeilbrigdisstofnunSudurlandsHeader.tsx (1)

45-45: Approved: Improved robustness in JSON parsing

This change aligns well with the PR objectives and improves the component's robustness. By using the logical OR operator (||) instead of the nullish coalescing operator (??), the code now handles both null/undefined values and empty strings returned from the CMS. This prevents potential errors when JSON.parse encounters an empty string, making the component more resilient to various input scenarios.

The use of useMemo is appropriate here, ensuring that the parsing only occurs when the input changes. The dependency array is correctly set to re-compute when organizationPage.organization?.namespace?.fields changes.

apps/web/components/Organization/Wrapper/Themes/TransportAuthorityTheme/TransportAuthorityHeader.tsx (2)

44-44: Approved: Effective solution for handling empty strings

This change from ?? to || in the JSON.parse fallback is a good solution. It prevents errors when parsing empty strings, which aligns with the PR objectives. The || operator will use the fallback (empty object) for any falsy value, including empty strings, null, and undefined. This makes the code more robust without sacrificing readability or performance.


Line range hint 1-116: LGTM: Adherence to coding guidelines and best practices

The TransportAuthorityHeader component adheres well to the specified coding guidelines:

  1. It effectively uses TypeScript for type safety, as seen in the HeaderProps interface.
  2. The component employs efficient state management techniques, utilizing useMemo for performance optimization.
  3. The file structure and component organization align with NextJS best practices.
  4. The component makes good use of custom hooks like useNamespace and useLinkResolver, promoting code reusability.

Overall, the component demonstrates good coding practices and maintainability.

apps/web/components/Organization/Wrapper/Themes/HeilbrigdisstofnunAusturlandsTheme/HeilbrigdisstofnunAusturlandsHeader.tsx (1)

53-53: Approved: Improved error handling for JSON parsing

This change from ?? to || aligns with the PR objective and enhances the robustness of the code. It effectively handles cases where fields might be an empty string, preventing potential JSON parsing errors. This is a good improvement in error handling and maintains the intended functionality.

apps/web/components/Organization/Wrapper/Themes/LandlaeknirTheme/LandlaeknirHeader.tsx (1)

Line range hint 1-124: Well-structured component following NextJS and TypeScript best practices

The LandlaeknirHeader component is well-implemented, adhering to NextJS best practices and making effective use of TypeScript. The component demonstrates efficient state management through the appropriate use of hooks like useMemo, useNamespace, and useWindowSize. The file structure and naming conventions align with NextJS standards.

The recent change improves the robustness of the code, and with the suggested type safety enhancement, it will further strengthen the implementation.

apps/web/screens/Home/Home.tsx (1)

42-42: Approved: Improved fallback handling for JSON.parse

This change aligns with the PR objective and improves the robustness of the code. Using || instead of ?? ensures that JSON.parse will receive a valid input even when page?.namespace?.fields is an empty string, null, or undefined. This prevents potential runtime errors and makes the code more resilient.

apps/web/screens/ServiceWeb/Search/ServiceSearch.tsx (1)

86-86: Approved: Improved JSON parsing fallback

This change effectively addresses the issue with JSON.parse throwing an error on empty strings. By using || instead of ??, we ensure that an empty object is used as a fallback for both null and empty string cases, making the code more robust.

apps/web/screens/ServiceWeb/Forms/Forms.tsx (1)

99-99: Approved: Improved JSON parsing fallback

This change from ?? to || aligns with the PR objective and enhances the robustness of the JSON parsing. It ensures that an empty object is used as a fallback not only when organization?.namespace?.fields is null or undefined, but also when it's an empty string or any other falsy value. This prevents potential runtime errors that could occur if JSON.parse receives an empty string.

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 36.74%. Comparing base (8e82475) to head (50bd35c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
apps/web/screens/ServiceWeb/Forms/Forms.tsx 0.00% 3 Missing ⚠️
...ps/web/screens/ServiceWeb/Search/ServiceSearch.tsx 0.00% 2 Missing ⚠️
...anizationIslandFooter/OrganizationIslandFooter.tsx 0.00% 1 Missing ⚠️
...rapper/Themes/FiskistofaTheme/FiskistofaHeader.tsx 0.00% 1 Missing ⚠️
...FjarsyslaRikisinsTheme/FjarsyslaRikisinsHeader.tsx 0.00% 1 Missing ⚠️
...Organization/Wrapper/Themes/GevTheme/GevHeader.tsx 0.00% 1 Missing ⚠️
...landsTheme/HeilbrigdisstofnunAusturlandsHeader.tsx 0.00% 1 Missing ⚠️
...landsTheme/HeilbrigdisstofnunNordurlandsHeader.tsx 0.00% 1 Missing ⚠️
...rlandsTheme/HeilbrigdisstofnunSudurlandsHeader.tsx 0.00% 1 Missing ⚠️
...Organization/Wrapper/Themes/HmsTheme/HmsHeader.tsx 0.00% 1 Missing ⚠️
... and 20 more
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16360   +/-   ##
=======================================
  Coverage   36.73%   36.74%           
=======================================
  Files        6804     6804           
  Lines      140861   140837   -24     
  Branches    40118    40109    -9     
=======================================
- Hits        51751    51749    -2     
+ Misses      89110    89088   -22     
Flag Coverage Δ
api 3.37% <ø> (ø)
download-service 44.20% <ø> (ø)
portals-admin-regulations-admin 1.85% <ø> (ø)
web 1.83% <0.00%> (ø)

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

Files with missing lines Coverage Δ
...anizationIslandFooter/OrganizationIslandFooter.tsx 0.00% <0.00%> (ø)
...rapper/Themes/FiskistofaTheme/FiskistofaHeader.tsx 0.00% <0.00%> (ø)
...FjarsyslaRikisinsTheme/FjarsyslaRikisinsHeader.tsx 0.00% <0.00%> (ø)
...Organization/Wrapper/Themes/GevTheme/GevHeader.tsx 0.00% <0.00%> (ø)
...landsTheme/HeilbrigdisstofnunAusturlandsHeader.tsx 0.00% <0.00%> (ø)
...landsTheme/HeilbrigdisstofnunNordurlandsHeader.tsx 0.00% <0.00%> (ø)
...rlandsTheme/HeilbrigdisstofnunSudurlandsHeader.tsx 0.00% <0.00%> (ø)
...Organization/Wrapper/Themes/HmsTheme/HmsHeader.tsx 0.00% <0.00%> (ø)
...Organization/Wrapper/Themes/HveTheme/HveHeader.tsx 0.00% <0.00%> (ø)
...eTheme/IcelandicNaturalDisasterInsuranceHeader.tsx 0.00% <0.00%> (ø)
... and 20 more

... and 5 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 8e82475...50bd35c. Read the comment docs.

@kodiakhq kodiakhq bot merged commit 0c4b341 into main Oct 10, 2024
44 checks passed
@kodiakhq kodiakhq bot deleted the fix/web-change-namespace-json-parse-fallback-logic branch October 10, 2024 17:17
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