|
6 | 6 | */
|
7 | 7 |
|
8 | 8 | import { Component, HTMLAttributeAnchorTarget } from 'react'
|
9 | | -import { TextField,Button } from '@material-ui/core' |
| 9 | +import { Button,TextField } from '@material-ui/core' |
10 | 10 | import ReactMarkdown from 'react-markdown'
|
11 | 11 | import rehypeRaw from 'rehype-raw'
|
12 | 12 | import remarkGfm from 'remark-gfm'
|
@@ -124,15 +124,13 @@ const textAreaStyles = (
|
124 | 124 |
|
125 | 125 | class ReportFile extends Component<ReportFileWithStylesProps, ReportFileState> {
|
126 | 126 | getFileId() {
|
127 | | - let id = parseInt(this.props.match.params.fileId, 10) |
128 | | - /* eslint eqeqeq: 1 */ |
129 | | - id = |
130 | | - id == parseInt(this.props.match.params.fileId) |
131 | | - ? id |
132 | | - : parseInt(this.props.match.params.fileId) |
133 | | - /* eslint eqeqeq: 0 */ |
134 | | - |
135 | | - return id |
| 127 | + let fileID = this.props.match.params.fileId |
| 128 | + let parseID = parseInt(fileID, 10) |
| 129 | + |
| 130 | + // To distinct different fileIDs. For example, "72215" and "1_1.sql". |
| 131 | + // {ORG_URL}/reports/268/files/72215/md |
| 132 | + // {ORG_URL}/reports/268/files/1_1.sql/sql?raw |
| 133 | + return (fileID.toString() == parseID.toString()) ? parseID : fileID |
136 | 134 | }
|
137 | 135 |
|
138 | 136 | componentDidMount() {
|
|
0 commit comments