Skip to content

Use work item type in UI text

Simon Knox requested to merge psi-dynamic-task-translations into master

What does this MR do and why?

Fixes #368003 (closed) - use work item type when creating, updating, or deleting a work item.

Update the following UI text:

before after
Task deleted %{workItemType} deleted
Are you sure you want to delete the task? This action cannot be reversed. Are you sure you want to delete the %{workItemType}? This action cannot be reversed.
Delete task Delete %{workItemType}
Something went wrong when creating a task. Please try again Something went wrong when creating %{workItemType}. Please try again.
Something went wrong when deleting the work item. Please try again. Something went wrong when deleting the %{workItemType}. Please try again.
Something went wrong while updating the work item. Please try again. Something went wrong while updating the %{workItemType}. Please try again."

Moves most UI text to constants.js, and pass in the workItemType string. This means components can import i18nForType instead of needing to import s__, sprintf, and capitalizeFirstLetter.

How to set up and validate locally

  1. Enable work_items and work_items_mvc_2 feature flags
  2. Go to gdk.test:3000/gitlab-org/gitlab-test/-/work_items/new to create a new work item
  3. To force errors in creating/updating. Either gdk stop (after loading the page), or Disable network in throttling section of Network tab in devtools
  4. To view delete, create a work item, click ellipsis menu

Screen_Shot_2022-08-11_at_9.03.36_pm

Screen_Shot_2022-08-11_at_9.03.34_pm

Edited by Simon Knox

Merge request reports

Loading