aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/component
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-08-18 18:53:44 +0200
committerGitHub <noreply@github.com>2017-08-18 18:53:44 +0200
commit7983068e4d2a45531ba0942688e659adf9ee61a2 (patch)
treec481c4ef137cf8b1f4ac69d2917b51317d8c4dad /server/sonar-web/src/main/js/apps/component
parentf98b26b3f33e0eb2788ca93a4b115585c527c737 (diff)
downloadsonarqube-7983068e4d2a45531ba0942688e659adf9ee61a2.tar.gz
sonarqube-7983068e4d2a45531ba0942688e659adf9ee61a2.zip
translate all routes files to ts (#2378)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/component')
-rw-r--r--server/sonar-web/src/main/js/apps/component/components/App.tsx (renamed from server/sonar-web/src/main/js/apps/component/components/App.js)21
-rw-r--r--server/sonar-web/src/main/js/apps/component/routes.ts (renamed from server/sonar-web/src/main/js/apps/component/routes.js)4
2 files changed, 13 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/apps/component/components/App.js b/server/sonar-web/src/main/js/apps/component/components/App.tsx
index e8c1c9f2128..a1fb59f825c 100644
--- a/server/sonar-web/src/main/js/apps/component/components/App.js
+++ b/server/sonar-web/src/main/js/apps/component/components/App.tsx
@@ -17,20 +17,19 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-// @flow
-import React from 'react';
+import * as React from 'react';
import SourceViewer from '../../../components/SourceViewer/SourceViewer';
-export default class App extends React.PureComponent {
- /*:: props: {
- location: {
- query: {
- id: string,
- line?: string
- }
- }
+interface Props {
+ location: {
+ query: {
+ id: string;
+ line?: string;
+ };
};
-*/
+}
+
+export default class App extends React.PureComponent<Props> {
scrollToLine = () => {
const { line } = this.props.location.query;
if (line) {
diff --git a/server/sonar-web/src/main/js/apps/component/routes.js b/server/sonar-web/src/main/js/apps/component/routes.ts
index 9943b1d8380..c5105eeca4e 100644
--- a/server/sonar-web/src/main/js/apps/component/routes.js
+++ b/server/sonar-web/src/main/js/apps/component/routes.ts
@@ -17,10 +17,12 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { RouterState, RouteComponent } from 'react-router';
+
const routes = [
{
indexRoute: {
- getComponent(_, callback) {
+ getComponent(_: RouterState, callback: (err: any, component: RouteComponent) => any) {
import('./components/App').then(i => callback(null, i.default));
}
}