Document `getProjectSlug`

Understand and document why getProjectSlug needs to verify it's on project page.

export const getProjectSlug = () => {
  if (isInProjectPage()) {
    return $('body').data('project');
  }
  return null;
};
window.gl.utils.getProjectSlug = getProjectSlug;

The following discussion from gitlab-ce!14074 should be addressed:

  • @iamphill started a discussion: (+1 comment)

    Why do we need the if around this one & the group one?

Assignee Loading
Time tracking Loading