2019-03-01 09:51:54 -05:00
|
|
|
export const projectKeys = ['name', 'organizationName', 'organizationSlug', 'slug'];
|
|
|
|
|
2021-09-15 17:11:12 -04:00
|
|
|
export const transformFrontendSettings = ({
|
|
|
|
apiHost,
|
|
|
|
enabled,
|
|
|
|
integrated,
|
|
|
|
token,
|
|
|
|
selectedProject,
|
|
|
|
}) => {
|
2019-03-01 09:51:54 -05:00
|
|
|
const project = selectedProject
|
|
|
|
? {
|
|
|
|
slug: selectedProject.slug,
|
|
|
|
name: selectedProject.name,
|
|
|
|
organization_name: selectedProject.organizationName,
|
|
|
|
organization_slug: selectedProject.organizationSlug,
|
|
|
|
}
|
|
|
|
: null;
|
|
|
|
|
2021-09-15 17:11:12 -04:00
|
|
|
return { api_host: apiHost || null, enabled, integrated, token: token || null, project };
|
2019-03-01 09:51:54 -05:00
|
|
|
};
|
|
|
|
|
2020-12-23 16:10:24 -05:00
|
|
|
export const getDisplayName = (project) => `${project.organizationName} | ${project.slug}`;
|