summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/error_tracking_settings/utils.js
blob: 7ef5f7bbd343f300aede1a5d9ae2970ceeb0410f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
export const projectKeys = ['name', 'organizationName', 'organizationSlug', 'slug'];

export const transformFrontendSettings = ({
  apiHost,
  enabled,
  integrated,
  token,
  selectedProject,
}) => {
  const project = selectedProject
    ? {
        slug: selectedProject.slug,
        name: selectedProject.name,
        organization_name: selectedProject.organizationName,
        organization_slug: selectedProject.organizationSlug,
      }
    : null;

  return { api_host: apiHost || null, enabled, integrated, token: token || null, project };
};

export const getDisplayName = (project) => `${project.organizationName} | ${project.slug}`;