Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint fp/no-class:0 */
import React from 'react';
import Relay from 'react-relay/classic';
import { connect } from 'react-redux';
import { parse } from 'query-string';
import { handleStateChange } from '@ncigdc/dux/relayProgress';
import ProjectsPage from '@ncigdc/containers/ProjectsPage';
import { parseIntParam, parseFilterParam, parseJSURLParam } from '@ncigdc/utils/uri';
import { viewerQuery } from './queries';
const DEFAULT_PROJECT_SORT = [{ field: 'summary.case_count', order: 'desc' }];
class ProjectsRoute extends Relay.Route {
static routeName = 'ProjectsRoute';
static queries = viewerQuery;
static prepareParams = ({ location: { search } }) => {
const q = parse(search);
return {
offset: parseIntParam(q.offset, 0),
size: 1000,
filters: parseFilterParam(q.filters, null),
projects_sort: parseJSURLParam(q.projects_sort, DEFAULT_PROJECT_SORT),
};
}
}
import Relay from 'react-relay/classic';
class SourceRoute extends Relay.Route {
static queries = {
source: () => Relay.QL`query ProjectSource { project_source(ids: $ids) }`,
};
static paramDefinitions = {
ids: { required: true },
};
static routeName = 'SourceRoute';
}
export default SourceRoute;
import ExploreLink from '@ncigdc/components/Links/ExploreLink';
import withRouter from '@ncigdc/utils/withRouter';
import { RepositoryFilesLink } from '@ncigdc/components/Links/RepositoryLink';
import { makeFilter } from '@ncigdc/utils/filters';
import EntityPageHorizontalTable from '@ncigdc/components/EntityPageHorizontalTable';
import { Row } from '@ncigdc/uikit/Flex';
import { Tooltip } from '@ncigdc/uikit/Tooltip';
import Pagination from '@ncigdc/components/Pagination';
import TableActions from '@ncigdc/components/TableActions';
import MutationsCount from '@ncigdc/components/MutationsCount';
import { ForTsvExport } from '@ncigdc/components/DownloadTableToTsvButton';
import withPropsOnChange from '@ncigdc/utils/withPropsOnChange';
import { createClassicRenderer } from '@ncigdc/modern_components/Query';
import timestamp from '@ncigdc/utils/timestamp';
class Route extends Relay.Route {
static routeName = 'AffectedCasesTableRoute';
static queries = {
...viewerQuery,
exploreSsms: () => Relay.QL`query { viewer }`,
};
static prepareParams = ({
location: { search },
defaultSize = 10,
defaultFilters = null,
}) => {
const q = parse(search);
return {
affectedCasesTable_filters: parseFilterParam(
q.affectedCasesTable_filters,
defaultFilters,
keyPrefix: 'ncigdcActive',
},
});
window.store = store;
store.dispatch(fetchApiVersionInfo());
if (process.env.NODE_ENV !== 'development') {
store.dispatch(fetchUser());
if (!AWG) {
store.dispatch(fetchNotifications());
}
}
class RelayRoute extends Relay.Route {
static routeName = 'RootRoute';
static queries = viewerQuery;
}
const HasUser = connect(state => state.auth)(props => {
return props.children({
error: props.error,
failed: props.failed,
user: props.user,
});
});
const Root = (rootProps: mixed) => (
} persistor={persistor}>
import Relay from 'react-relay/classic';
export default class PrInfoByUrlRoute extends Relay.Route {
static routeName = 'pr-info-by-url-route'
static queries = {
query: (Component, variables) => Relay.QL`
query {
relay {
${Component.getFragment('query', variables)}
}
}
`,
}
static paramDefinitions = {
prUrl: {required: true},
}
}
import Relay from 'react-relay/classic';
class TaskRoute extends Relay.Route {
static queries = {
task: () => Relay.QL`query Task { task(id: $id) }`,
};
static paramDefinitions = {
id: { required: true },
};
static routeName = 'TaskRoute';
}
export default TaskRoute;
import Relay from 'react-relay/classic';
class ProjectRoute extends Relay.Route {
static queries = {
project: (Component, contextId) => Relay.QL`
query Project {
project(id: $contextId) {
${Component.getFragment('project', contextId)}
}
}
`,
};
static paramDefinitions = {
contextId: { required: true },
};
static routeName = 'ProjectRoute';
}
query {
viewer {
${component.getFragment("viewer", params)}
}
}
`,
}
static paramDefinitions = {
selectedArtist: { required: false },
}
static routeName = "WorksForYouRoute"
}
class MyAccount extends Relay.Route {
static queries = {
me: (component, params) => Relay.QL`
query {
me {
${component.getFragment("me", params)}
}
}
`,
}
static routeName = "MyAccountRoute"
}
class Inquiry extends Relay.Route {
static queries = {
inquiryArtwork: (component, params) => Relay.QL`
this.reset();
}
commitUpdate(mutation, callbacks) {
return this.update(callbacks);
}
applyUpdate(mutation, callbacks) {
return this.update(callbacks);
}
}
module.exports = {
QL: Relay.QL,
Mutation: Relay.Mutation,
Route: Relay.Route,
RootContainer: ({ renderFetched }) => renderFetched({}),
createContainer: component => component,
Store: new MockStore(),
};
import Relay from 'react-relay/classic';
export default class IssueishInfoByNumberRoute extends Relay.Route {
static routeName = 'pr-info-by-number-route'
static queries = {
query: (Component, variables) => Relay.QL`
query {
relay {
${Component.getFragment('query', variables)}
}
}
`,
}
static paramDefinitions = {
repoOwner: {required: true},
repoName: {required: true},
issueishNumber: {required: true},