Skip to content

Conversation

joanagmaia
Copy link
Contributor

@joanagmaia joanagmaia commented May 9, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 1097cf1

This pull request improves the error handling and robustness of various components that use platform, tenant, or config data. It uses optional chaining (?.) and fallback values to prevent errors when accessing properties of undefined or null objects. It also fixes some prop types and default values, and adds some conditional rendering to avoid unnecessary or invalid elements. The changes affect files in the frontend/src/modules directory, mostly related to the dashboard, activity, conversation, and member features.

🤖 Generated by Copilot at 1097cf1

We face the doom of undefined and null
We use the ?. operator to survive
We check the values and render with care
We make the dashboard robust and alive

Why

How

🤖 Generated by Copilot at 1097cf1

  • Prevent errors when accessing properties of undefined or null values by using optional chaining and fallback values (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Avoid rendering components when the platform prop is undefined or null by adding v-if directives (link, link, link)
  • Change the key attribute of components to use optional chaining, to avoid errors when the id prop is undefined or null (link, link)
  • Change the default value of the conversations prop from an empty object to an empty array, to match the expected type of the prop (link)
  • Add a fallback value of 'platform' when the platform name is undefined or null (link)
  • Change the attribute prop type from Array to Object, to match the expected shape of the attribute prop (link)
  • Add a condition to check if the targetNodeId value is defined, to avoid errors when accessing the layouts value with an undefined key (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@joanagmaia joanagmaia added the Bug Created by Linear-GitHub Sync label May 9, 2023
@joanagmaia joanagmaia requested a review from gaspergrom May 9, 2023 16:14
@joanagmaia joanagmaia self-assigned this May 9, 2023
@joanagmaia joanagmaia merged commit 88025f4 into main May 10, 2023
@joanagmaia joanagmaia deleted the bug/type-errors branch May 10, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants