Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Fix some type errors and rename constants
  • Loading branch information
scottybollinger committed Nov 23, 2020
1 parent 5b3de6d commit 4bd6418
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export const getContentSourcePath = (
sourceId: string,
isOrganization: boolean
): string => generatePath(isOrganization ? path : `${PERSONAL_PATH}${path}`, { sourceId });
export const getGroupPath = (groupId: string) => generatePath(GROUP_PATH, { groupId });
export const getGroupSourcePrioritizationPath = (groupId: string) =>
export const getGroupPath = (groupId: string): string => generatePath(GROUP_PATH, { groupId });
export const getGroupSourcePrioritizationPath = (groupId: string): string =>
`${GROUPS_PATH}/${groupId}/source_prioritization`;
export const getSourcesPath = (path: string, isOrganization: boolean) =>
export const getSourcesPath = (path: string, isOrganization: boolean): string =>
isOrganization ? path : `${PERSONAL_PATH}${path}`;
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import { EuiButtonTo } from '../../../../shared/react_router_helpers';

import { Group } from '../../../types';
import { ORG_SOURCES_PATH } from '../../../routes';
import { SOURCES_PATH } from '../../../routes';

import noSharedSourcesIcon from '../../../assets/share_circle.svg';

Expand Down Expand Up @@ -96,7 +96,7 @@ export const GroupManagerModal: React.FC<GroupManagerModalProps> = ({
const handleSelectAll = () => selectAll(allSelected ? [] : allItems);

const sourcesButton = (
<EuiButtonTo to={ORG_SOURCES_PATH} fill color="primary">
<EuiButtonTo to={SOURCES_PATH} fill color="primary">
{ADD_SOURCE_BUTTON_TEXT}
</EuiButtonTo>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { setMockValues } from './__mocks__';
import React from 'react';
import { shallow } from 'enzyme';

import { ORG_SOURCES_PATH, USERS_PATH } from '../../routes';
import { SOURCES_PATH, USERS_PATH } from '../../routes';

import { OnboardingSteps, OrgNameOnboarding } from './onboarding_steps';
import { OnboardingCard } from './onboarding_card';
Expand All @@ -32,7 +32,7 @@ describe('OnboardingSteps', () => {
const wrapper = shallow(<OnboardingSteps />);

expect(wrapper.find(OnboardingCard)).toHaveLength(1);
expect(wrapper.find(OnboardingCard).prop('actionPath')).toBe(ORG_SOURCES_PATH);
expect(wrapper.find(OnboardingCard).prop('actionPath')).toBe(SOURCES_PATH);
expect(wrapper.find(OnboardingCard).prop('description')).toBe(
'Add shared sources for your organization to start searching.'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import sharedSourcesIcon from '../../components/shared/assets/source_icons/share_circle.svg';
import { TelemetryLogic } from '../../../shared/telemetry';
import { getWorkplaceSearchUrl } from '../../../shared/enterprise_search_url';
import { ORG_SOURCES_PATH, USERS_PATH, ORG_SETTINGS_PATH } from '../../routes';
import { SOURCES_PATH, USERS_PATH, ORG_SETTINGS_PATH } from '../../routes';

import { ContentSection } from '../../components/shared/content_section';

Expand Down Expand Up @@ -75,7 +75,7 @@ export const OnboardingSteps: React.FC = () => {

const accountsPath =
!isFederatedAuth && (canCreateInvitations || isCurated) ? USERS_PATH : undefined;
const sourcesPath = canCreateContentSources || isCurated ? ORG_SOURCES_PATH : undefined;
const sourcesPath = canCreateContentSources || isCurated ? SOURCES_PATH : undefined;

const SOURCES_CARD_DESCRIPTION = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.sourcesOnboardingCard.description',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import { ContentSection } from '../../components/shared/content_section';
import { ORG_SOURCES_PATH, USERS_PATH } from '../../routes';
import { SOURCES_PATH, USERS_PATH } from '../../routes';

import { AppLogic } from '../../app_logic';
import { OverviewLogic } from './overview_logic';
Expand Down Expand Up @@ -43,7 +43,7 @@ export const OrganizationStats: React.FC = () => {
{ defaultMessage: 'Shared sources' }
)}
count={sourcesCount}
actionPath={ORG_SOURCES_PATH}
actionPath={SOURCES_PATH}
/>
{!isFederatedAuth && (
<>
Expand Down

0 comments on commit 4bd6418

Please sign in to comment.