Skip to content

Commit

Permalink
chore: remove Travis config (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored Jan 3, 2024
1 parent a86eb1c commit ce51151
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 770 deletions.
1 change: 0 additions & 1 deletion src/__mocks__/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const mockProject = (): FullProject => ({
secret: 'my_secret',
enabled: true,
requester_circleCI: null,
requester_travisCI: null,
responder_slack: null,
id: '123',
repoName: 'my-repo',
Expand Down
10 changes: 0 additions & 10 deletions src/client/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { CircleCILogo } from './icons/CircleCI';
import { SlackLogo } from './icons/Slack';
import { Link } from 'react-router-dom';
import { cx, projectHasAnyConfig, defaultFetchInit, defaultBodyReader } from '../utils';
import { TravisCILogo } from './icons/TravisCI';

export function Dashboard() {
const reposFetch = useFetch<ReposResponse>('/api/repos', defaultFetchInit, defaultBodyReader);
Expand Down Expand Up @@ -147,15 +146,6 @@ export function Dashboard() {
<span>CircleCI</span>
</Pane>
) : null}
{repo.requester_travisCI ? (
<Pane className={styles.configRow}>
<Tooltip content="CFA Requester" position={Position.LEFT}>
<CircleArrowRightIcon color="success" />
</Tooltip>
<TravisCILogo className={styles.configIcon} />
<span>Travis CI</span>
</Pane>
) : null}
{repo.responder_slack ? (
<Pane className={styles.configRow}>
<Tooltip content="CFA Responder" position={Position.LEFT}>
Expand Down
14 changes: 0 additions & 14 deletions src/client/components/RequesterConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { FullProject } from '../../common/types';
import styles from './ReqResConfig.scss';
import { CircleCILogo } from './icons/CircleCI';
import { CircleCIRequesterConfig } from './configurators/CircleCIRequesterConfig';
import { TravisCILogo } from './icons/TravisCI';
import { TravisCIRequesterConfig } from './configurators/TravisCIRequesterConfig';

export interface Props {
project: FullProject;
setProject: (newProject: FullProject) => void;
Expand All @@ -17,12 +14,10 @@ export interface Props {
enum RequesterTab {
NOTHING_YET,
CIRCLE_CI,
TRAVIS_CI,
}

const defaultTabForProject = (project: FullProject) => {
if (project.requester_circleCI) return RequesterTab.CIRCLE_CI;
if (project.requester_travisCI) return RequesterTab.TRAVIS_CI;
return RequesterTab.NOTHING_YET;
};

Expand Down Expand Up @@ -66,13 +61,6 @@ export function RequesterConfig({ project, setProject }: Props) {
>
<CircleCILogo className={styles.tabIcon} /> Circle CI
</Tab>
<Tab
onSelect={() => setActiveTab(RequesterTab.TRAVIS_CI)}
isSelected={activeTab === RequesterTab.TRAVIS_CI}
style={{ paddingLeft: 28, position: 'relative' }}
>
<TravisCILogo className={styles.tabIcon} /> Travis CI
</Tab>
<Tab disabled>More Coming Soon...</Tab>
</Tablist>
</Pane>
Expand All @@ -81,8 +69,6 @@ export function RequesterConfig({ project, setProject }: Props) {
<Paragraph>No Requester has been configured, choose one to get started!</Paragraph>
) : activeTab === RequesterTab.CIRCLE_CI ? (
<CircleCIRequesterConfig project={project} setProject={setProject} />
) : activeTab === RequesterTab.TRAVIS_CI ? (
<TravisCIRequesterConfig project={project} setProject={setProject} />
) : null}
</Pane>
</Pane>
Expand Down
27 changes: 0 additions & 27 deletions src/client/components/__tests__/RequesterConfig.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ jest.mock('../configurators/CircleCIRequesterConfig', () => ({
CircleCIRequesterConfig: () => null,
}));

jest.mock('../configurators/TravisCIRequesterConfig', () => ({
TravisCIRequesterConfig: () => null,
}));

import * as React from 'react';
import { act } from 'react-dom/test-utils';
Expand Down Expand Up @@ -76,20 +73,6 @@ describe('<RequesterConfig />', () => {
expect(mounted.find('CircleCIRequesterConfig')).toHaveLength(1);
});

it('Should show the travisci configurator when that tab is selected', () => {
const setProject = jest.fn();
const mounted = shallow(<RequesterConfig project={mockProject()} setProject={setProject} />);
expect(mounted.find('TravisCIRequesterConfig')).toHaveLength(0);
act(() =>
(mounted
.find('Memo(ForwardRef(Tab))')
.at(1)
.prop('onSelect') as Function)(),
);
mounted.setProps({});
expect(mounted.find('TravisCIRequesterConfig')).toHaveLength(1);
});

it('Should show the circleci configurator when circleci has been configured on the provided project', () => {
const setProject = jest.fn();
const project = mockProject();
Expand All @@ -99,14 +82,4 @@ describe('<RequesterConfig />', () => {
const mounted = mount(<RequesterConfig project={project} setProject={setProject} />);
expect(mounted.find('CircleCIRequesterConfig')).toHaveLength(1);
});

it('Should show the travisci configurator when travisci has been configured on the provided project', () => {
const setProject = jest.fn();
const project = mockProject();
project.requester_travisCI = {
accessToken: 'test123',
};
const mounted = mount(<RequesterConfig project={project} setProject={setProject} />);
expect(mounted.find('TravisCIRequesterConfig')).toHaveLength(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ exports[`<RequesterConfig /> Should render 1`] = `
/>
Circle CI
</Memo(ForwardRef(Tab))>
<Memo(ForwardRef(Tab))
isSelected={false}
onSelect={[Function]}
style={
{
"paddingLeft": 28,
"position": "relative",
}
}
>
<TravisCILogo
className="tabIcon"
/>
Travis CI
</Memo(ForwardRef(Tab))>
<Memo(ForwardRef(Tab))
disabled={true}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Props {
setProject: (newProject: FullProject) => void;
originalAccessToken: string;
children: React.ReactChild | React.ReactChild[];
slug: 'circleci' | 'travisci';
slug: 'circleci';
requesterName: string;
}

Expand Down
38 changes: 0 additions & 38 deletions src/client/components/configurators/TravisCIRequesterConfig.tsx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ exports[`<CircleCIRequesterConfig /> Should render a GenericAccessTokenRequester
"repoName": "my-repo",
"repoOwner": "my-owner",
"requester_circleCI": null,
"requester_travisCI": null,
"responder_slack": null,
"secret": "my_secret",
}
Expand Down

This file was deleted.

Loading

0 comments on commit ce51151

Please sign in to comment.