aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.js')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.js b/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.js
index 6dff8ffa6de..c892a1eafba 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/PerspectiveSelect.js
@@ -24,20 +24,24 @@ import PerspectiveSelectOption from './PerspectiveSelectOption';
import { translate } from '../../../helpers/l10n';
import { VIEWS, VISUALIZATIONS } from '../utils';
+/*::
export type Option = { label: string, type: string, value: string };
+*/
+/*::
type Props = {|
className?: string,
onChange: ({ view: string, visualization?: string }) => void,
view: string,
visualization?: string
|};
+*/
export default class PerspectiveSelect extends React.PureComponent {
- options: Array<Option>;
- props: Props;
+ /*:: options: Array<Option>; */
+ /*:: props: Props; */
- constructor(props: Props) {
+ constructor(props /*: Props */) {
super(props);
this.options = [
...VIEWS.map(opt => ({
@@ -53,7 +57,7 @@ export default class PerspectiveSelect extends React.PureComponent {
];
}
- handleChange = (option: Option) => {
+ handleChange = (option /*: Option */) => {
if (option.type === 'view') {
this.props.onChange({ view: option.value });
} else if (option.type === 'visualization') {