Skip to content

Add conditional chaining for systemNoteMetadata

Deepika Guliani requested to merge dg-add-conditional-chaining-for-metadata into master

What does this MR do and why?

Fixes a bug when the systemNoteMetadata is null results in the system note not being shown on the frontend. Found out during WorkItem: Add GraphQl mutation to update color (!140847 - merged). Adding conditional chaining avoids following error in the browser console.

[Vue warn]: Error in render: "TypeError: Cannot read properties of null (reading 'descriptionVersion')"found in---> <SystemNote> at work_items/components/notes/system_note.vue
<WorkItemNotes> at work_items/components/work_item_notes.vue
<WorkItemDetail> at work_items/components/work_item_detail.vue
<WorkItemRoot> at work_items/pages/work_item_root.vue
<Root>

Note: This should have been fixed from backend but the solution is still being investigated.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-01-04_at_10.50.02_AM Screenshot_2024-01-04_at_10.39.31_AM

How to set up and validate locally

Prerequisites:

  1. Enable the OKRs feature as mentioned in the OKRs docs (e.g. ::Feature.enabled?(:okrs_mvc, Project.find(<PROJECT_ID>)) and the namespace must have Ultimate plan).
  2. Enable namespace_level_work_items FF - Feature.enable(:namespace_level_work_items)

Steps to verify:

Follow the steps mentioned in WorkItem: Add GraphQl mutation to update color (!140847 - merged) and check if the system note is rendered properly without any error in browser console.

Edited by Rajan Mistry

Merge request reports

Loading