Skip to content

Add display label and tooltip for nested fields in mapping builder

Olena Horal-Koretska requested to merge 324047-custom-mapping-label into master

What does this MR do?

Formats how labels are displayed when fields are nested in alerts http integration custom mapping tool

👀 To check (you need GitLab Ultimate license)

  1. navigate to Operations=> Settings=>expand Alert integrations section or the direct link will be localhost/group/project/-/settings/operations#js-alert-management-settings
  2. Click Add integration
  3. Fill the form (make sure to select HTTP endpoint type on step 1)
  4. Toggle active
  5. Now you can paste and parse payload (any valid JSON) but for this case we need fields that are nested
{
	"id": "1",
	"type": "articles",
	"title": "lalal",
	"another": {
		"type": "lalal"
	},
	"attributes": [
		{
			"body": "this is a description",
			"title": "CPU at 95%",
			"created": "2015-05-22T14:56:29.000Z"
		},
		{
			"body": "this is 2nd description",
			"title": "CPU at 95%",
			"created": "2015-05-22T14:56:29.000Z"
		}
	]
}
  1. Now make sure that in the mapping tool nested fields are displayed with ... before the field's name and have a tooltip that shows the field path in the JSON

Screenshots (strongly suggested)

Before After
Screen_Shot_2021-04-20_at_20.19.19 2021-04-21_14.05.20
Screen_Shot_2021-04-20_at_20.20.26 2021-04-21_14.05.39

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #324047 (closed)

Edited by Olena Horal-Koretska

Merge request reports