"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tools/sapp/sapp/frontend/src/Trace.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).

Trace.js  (pyre-check-0.0.53):Trace.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 {withRouter} from 'react-router'; import {withRouter} from 'react-router';
import {Breadcrumb, Card, Modal, Skeleton} from 'antd';
import {Controlled as CodeMirror} from 'react-codemirror2'; import {Controlled as CodeMirror} from 'react-codemirror2';
import {useQuery, gql} from '@apollo/client'; import {useQuery, gql} from '@apollo/client';
require('codemirror/lib/codemirror.css'); require('codemirror/lib/codemirror.css');
require('codemirror/mode/python/python.js'); require('codemirror/mode/python/python.js');
const TraceQuery = gql` const TraceQuery = gql`
query Trace($issue_id: ID) { query Trace($issue_id: ID) {
trace(issue_id: $issue_id) { trace(issue_id: $issue_id) {
skipping to change at line 42 skipping to change at line 44
} }
`; `;
function Trace(props) { function Trace(props) {
const {loading, error, data} = useQuery(TraceQuery, { const {loading, error, data} = useQuery(TraceQuery, {
variables: { variables: {
issue_id: props.match.params.issue_id, issue_id: props.match.params.issue_id,
}, },
}); });
if (loading) return <p>Loading...</p>; if (error) {
if (error) return <p>Error:(</p>; return (
<Modal title="Error" visible={true} footer={null}>
<p>{error.toString()}</p>
</Modal>
);
}
return ( var content = <></>;
<>
<h3>Trace: {props.match.params.issue_id}</h3> if (loading) {
<ul> content = (
<Card>
<Skeleton active />
</Card>
);
} else {
content = (
<>
{data.trace.edges.map(({node}, index) => ( {data.trace.edges.map(({node}, index) => (
<> <>
<h4>{index + 1}</h4> <Card>
<p>Callable: {node.callee}</p> <h4>{index + 1}</h4>
<p>Port: {node.callee}</p> <p>Callable: {node.callee}</p>
<p> <p>Port: {node.callee}</p>
Location: {node.filename}:{node.callee_location} <p>
</p> Location: {node.filename}:{node.callee_location}
</p>
<br />
<CodeMirror
value={node.file_content}
onBeforeChange={(editor, data, value) => {}}
options={{
lineNumbers: true,
}}
onChange={(editor, data, value) => {}}
/>
</Card>
<br /> <br />
<CodeMirror
value={node.file_content}
onBeforeChange={(editor, data, value) => {}}
options={{
lineNumbers: true,
}}
onChange={(editor, data, value) => {}}
/>
</> </>
))} ))}
</ul> </>
);
}
return (
<>
<Breadcrumb style={{margin: '16px 0'}}>
<Breadcrumb.Item href="/">Issues</Breadcrumb.Item>
<Breadcrumb.Item>
Trace for Issue {props.match.params.issue_id}
</Breadcrumb.Item>
</Breadcrumb>
{content}
</> </>
); );
} }
export default withRouter(Trace); export default withRouter(Trace);
 End of changes. 7 change blocks. 
21 lines changed or deleted 50 lines changed or added

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