Add conditional chaining for systemNoteMetadata
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 |
---|---|
How to set up and validate locally
Prerequisites:
- 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). - 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.