Skip to content

Fix NamespacesLinkPaths.newCommentTemplate

What does this MR do and why?

Fix NamespacesLinkPaths.newCommentTemplate

Frontend expects the NamespacesLinkPaths.newCommentTemplate field to be a list of objects with text and href instead of a single stringified JSON.

Changelog: fixed

References

Related to:

Screenshots or screen recordings

Query Result

Before

fragment namespaceURLs on Namespace {
  linkPaths {
    newCommentTemplate
  }
}

query getNamespaceLinks {
  user_namespace: namespace(fullPath: "kattie") {
    ...namespaceURLs
  }
  public_group_namespace: namespace(fullPath: "group-public") {
    ...namespaceURLs
  }
  public_project_namespace: namespace(fullPath: "group-public/p1") {
    ...namespaceURLs
  }
  private_group_namespace: namespace(fullPath: "group-private") {
    ...namespaceURLs
  }
  private_project_namespace: namespace(fullPath: "group-private/p1") {
    ...namespaceURLs
  }
}
{
  "data": {
    "user_namespace": {
      "linkPaths": {
        "newCommentTemplate": null
      }
    },
    "public_group_namespace": {
      "linkPaths": {
        "newCommentTemplate": "/-/profile/comment_templates"
      }
    },
    "public_project_namespace": {
      "linkPaths": {
        "newCommentTemplate": "/-/profile/comment_templates"
      }
    },
    "private_group_namespace": {
      "linkPaths": {
        "newCommentTemplate": "/-/profile/comment_templates"
      }
    },
    "private_project_namespace": {
      "linkPaths": {
        "newCommentTemplate": "/-/profile/comment_templates"
      }
    }
  },
  "correlationId": "01JY3W8PDCZ2HAVH979B57QHER"
}

After

fragment namespaceURLs on Namespace {
  linkPaths {
    newCommentTemplate
  }
}

query getNamespaceLinks {
  user_namespace: namespace(fullPath: "kattie") {
    ...namespaceURLs
  }
  public_group_namespace: namespace(fullPath: "group-public") {
    ...namespaceURLs
  }
  public_project_namespace: namespace(fullPath: "group-public/p1") {
    ...namespaceURLs
  }
  private_group_namespace: namespace(fullPath: "group-private") {
    ...namespaceURLs
  }
  private_project_namespace: namespace(fullPath: "group-private/p1") {
    ...namespaceURLs
  }
}
{
  "data": {
    "user_namespace": {
      "linkPaths": {
        "newCommentTemplate": null
      }
    },
    "public_group_namespace": {
      "linkPaths": {
        "newCommentTemplate": [
          {
            "text": "Your comment templates",
            "href": "/-/profile/comment_templates"
          },
          {
            "text": "Group comment templates",
            "href": "/groups/group-public/-/comment_templates"
          }
        ]
      }
    },
    "public_project_namespace": {
      "linkPaths": {
        "newCommentTemplate": [
          {
            "text": "Your comment templates",
            "href": "/-/profile/comment_templates"
          },
          {
            "text": "Project comment templates",
            "href": "/group-public/p1/-/comment_templates"
          },
          {
            "text": "Group comment templates",
            "href": "/groups/group-public/-/comment_templates"
          }
        ]
      }
    },
    "private_group_namespace": {
      "linkPaths": {
        "newCommentTemplate": [
          {
            "text": "Your comment templates",
            "href": "/-/profile/comment_templates"
          },
          {
            "text": "Group comment templates",
            "href": "/groups/group-private/-/comment_templates"
          }
        ]
      }
    },
    "private_project_namespace": {
      "linkPaths": {
        "newCommentTemplate": [
          {
            "text": "Your comment templates",
            "href": "/-/profile/comment_templates"
          },
          {
            "text": "Project comment templates",
            "href": "/group-private/p1/-/comment_templates"
          },
          {
            "text": "Group comment templates",
            "href": "/groups/group-private/-/comment_templates"
          }
        ]
      }
    }
  },
  "correlationId": "01JY3W1M593B17C7DYPXN4288A"
}

How to set up and validate locally

MR acceptance checklist

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

Edited by Kassio Borges

Merge request reports

Loading