"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tools/sapp/sapp/frontend/src/Issues.js" between
pyre-check-0.0.53.tar.gz and pyre-check-0.0.54.tar.gz

About: Pyre is a performant type checker for Python (ships with Pysa, a security focused static analysis tool).

Issues.js  (pyre-check-0.0.53):Issues.js  (pyre-check-0.0.54)
/** /**
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Facebook, Inc. and its affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
* *
* @format * @format
* @flow
*/ */
import React from 'react'; import React from 'react';
import {Link} from 'react-router-dom'; import {useQuery, gql} from '@apollo/client';
import {Card, Breadcrumb} from 'antd'; import {Modal, Breadcrumb} from 'antd';
import IssuesList from './IssuesList';
import Filter from './Filter';
class Issues extends React.Component { import './Issues.css';
constructor(props) {
super(props);
this.fetchIssues = this.fetchIssues.bind(this);
}
fetchIssues() { const IssueQuery = gql`
const endCursor = this.props.data.issues.pageInfo.endCursor; query Issue(
this.props.fetchMore({ $after: String
variables: {after: endCursor}, $codes: [Int]
updateQuery: (prevResult, {fetchMoreResult}) => { $file_names: [String]
fetchMoreResult.issues.edges = [ $callables: [String]
...prevResult.issues.edges, $min_trace_length_to_sinks: Int
...fetchMoreResult.issues.edges, $max_trace_length_to_sinks: Int
]; $min_trace_length_to_sources: Int
return fetchMoreResult; $max_trace_length_to_sources: Int
}, ) {
}); issues(
first: 20
after: $after
codes: $codes
file_names: $file_names
callables: $callables
min_trace_length_to_sinks: $min_trace_length_to_sinks
max_trace_length_to_sinks: $max_trace_length_to_sinks
min_trace_length_to_sources: $min_trace_length_to_sources
max_trace_length_to_sources: $max_trace_length_to_sources
) {
edges {
node {
issue_id
filename
location
code
callable
message
min_trace_length_to_sources
min_trace_length_to_sinks
}
}
pageInfo {
endCursor
}
}
} }
`;
const Issues = () => {
const {loading, error, data, fetchMore, refetch} = useQuery(IssueQuery);
render() { var content = (
return ( <IssuesList data={data} fetchMore={fetchMore} loading={loading} />
<> );
<Breadcrumb style={{margin: '16px 0'}}>
<Breadcrumb.Item>Issues</Breadcrumb.Item> if (error) {
</Breadcrumb> content = (
{this.props.data.issues.edges.map(({node}) => ( <Modal title="Error" visible={true} footer={null}>
<> <p>{error.toString()}</p>
<Card extra={<>Issue {node.issue_id}</>}> </Modal>
<p>Code: {node.code}</p>
<p>Message: {node.message}</p>
<p>Callable: {node.callable}</p>
<p>
Location: {node.filename}:{node.location}
</p>
<div id="trace_lengths">
<strong>Min Trace Lengths</strong>
<p>Sources: {node.min_trace_length_to_sources}</p>
<p>Sinks: {node.min_trace_length_to_sinks}</p>
</div>
<br />
<Link to={`/trace/${node.issue_id}`}>
<button>See Trace >></button>
</Link>
</Card>
<br />
</>
))}
<button onClick={this.fetchIssues}>More</button>
</>
); );
} }
}
return (
<>
<Filter refetch={refetch} />
<Breadcrumb style={{margin: '16px 0'}}>
<Breadcrumb.Item>Issues</Breadcrumb.Item>
</Breadcrumb>
{content}
</>
);
};
export default Issues; export default Issues;
 End of changes. 7 change blocks. 
50 lines changed or deleted 68 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)