aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/tutorials
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-12-05 17:32:18 +0100
committerSonarTech <sonartech@sonarsource.com>2018-12-05 20:20:59 +0100
commit41c98779d38bda9fdfdca182a5f20c73fcff9a84 (patch)
treed895a9f8bfd0276aee5ffacf7bb33a0109436cbd /server/sonar-web/src/main/js/apps/tutorials
parenta9c22c1185c5fd8c8dc4c9388f4a3b967e3f463d (diff)
downloadsonarqube-41c98779d38bda9fdfdca182a5f20c73fcff9a84.tar.gz
sonarqube-41c98779d38bda9fdfdca182a5f20c73fcff9a84.zip
create global type definitions (#1017)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/tutorials')
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/analyzeProject/AnalyzeTutorial.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/analyzeProject/__tests__/AnalyzeTutorial-test.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/LanguageForm.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/OrganizationStep.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/ProjectAnalysisStep.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/commands/AnalysisCommand.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/projectOnboarding/ProjectOnboarding.tsx5
9 files changed, 11 insertions, 19 deletions
diff --git a/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/AnalyzeTutorial.tsx b/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/AnalyzeTutorial.tsx
index 031af9848cd..6d2ce3130ef 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/AnalyzeTutorial.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/AnalyzeTutorial.tsx
@@ -21,7 +21,6 @@ import * as React from 'react';
import AnalyzeTutorialSuggestion from './AnalyzeTutorialSuggestion';
import ProjectAnalysisStep from '../components/ProjectAnalysisStep';
import TokenStep from '../components/TokenStep';
-import { Component, LoggedInUser } from '../../../app/types';
import { isVSTS } from '../../../helpers/almIntegrations';
import { translate } from '../../../helpers/l10n';
import '../styles.css';
@@ -32,8 +31,8 @@ enum Steps {
}
interface Props {
- component: Component;
- currentUser: LoggedInUser;
+ component: T.Component;
+ currentUser: T.LoggedInUser;
}
interface State {
diff --git a/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/__tests__/AnalyzeTutorial-test.tsx b/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/__tests__/AnalyzeTutorial-test.tsx
index 17617b4b9db..3b8f8ca1433 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/__tests__/AnalyzeTutorial-test.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/analyzeProject/__tests__/AnalyzeTutorial-test.tsx
@@ -20,7 +20,6 @@
import * as React from 'react';
import { shallow } from 'enzyme';
import AnalyzeTutorial from '../AnalyzeTutorial';
-import { LoggedInUser } from '../../../../app/types';
Date.now = jest.fn().mockReturnValue(1540457859031);
@@ -34,7 +33,7 @@ const component = {
version: '0.0.1'
};
-const loggedInUser: LoggedInUser = {
+const loggedInUser: T.LoggedInUser = {
groups: [],
isLoggedIn: true,
login: 'luke',
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/LanguageForm.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/LanguageForm.tsx
index 8762501b301..26e273e936a 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/LanguageForm.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/LanguageForm.tsx
@@ -23,11 +23,10 @@ import NewProjectForm from './NewProjectForm';
import RadioToggle from '../../../components/controls/RadioToggle';
import { translate } from '../../../helpers/l10n';
import { isSonarCloud } from '../../../helpers/system';
-import { Component } from '../../../app/types';
import { isLanguageConfigured, LanguageConfig } from '../utils';
interface Props {
- component?: Component;
+ component?: T.Component;
config?: LanguageConfig;
onDone: (config: LanguageConfig) => void;
onReset: () => void;
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/OrganizationStep.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/OrganizationStep.tsx
index 57c9ffb63d0..203b46cbeed 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/OrganizationStep.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/OrganizationStep.tsx
@@ -32,7 +32,7 @@ import { Button } from '../../../components/ui/buttons';
type Selection = 'personal' | 'existing' | 'new';
interface Props {
- currentUser: { login: string; isLoggedIn: boolean };
+ currentUser: T.CurrentUser;
finished: boolean;
onOpen: () => void;
onContinue: (organization: string) => void;
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/ProjectAnalysisStep.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/ProjectAnalysisStep.tsx
index 3a924f2415e..e4887471654 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/ProjectAnalysisStep.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/ProjectAnalysisStep.tsx
@@ -22,11 +22,10 @@ import Step from './Step';
import LanguageForm from './LanguageForm';
import AnalysisCommand from './commands/AnalysisCommand';
import { translate } from '../../../helpers/l10n';
-import { Component } from '../../../app/types';
import { LanguageConfig } from '../utils';
interface Props {
- component?: Component;
+ component?: T.Component;
displayRowLayout?: boolean;
onFinish?: (projectKey?: string) => void;
onReset?: () => void;
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/commands/AnalysisCommand.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/commands/AnalysisCommand.tsx
index 9f40deec8cd..829463faae3 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/commands/AnalysisCommand.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/commands/AnalysisCommand.tsx
@@ -25,11 +25,10 @@ import Msvc from './Msvc';
import ClangGCC from './ClangGCC';
import Other from './Other';
import { getHostUrl } from '../../../../helpers/urls';
-import { Component } from '../../../../app/types';
import { LanguageConfig } from '../../utils';
interface Props {
- component?: Component;
+ component?: T.Component;
organization?: string;
languageConfig: LanguageConfig;
small?: boolean;
diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx
index d7a8aa94acd..719ba4d4ba1 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx
@@ -26,7 +26,6 @@ import OnboardingProjectIcon from '../../../components/icons-components/Onboardi
import OnboardingTeamIcon from '../../../components/icons-components/OnboardingTeamIcon';
import { Button, ResetButtonLink } from '../../../components/ui/buttons';
import { translate } from '../../../helpers/l10n';
-import { CurrentUser } from '../../../app/types';
import { getCurrentUser, Store } from '../../../store/rootReducer';
import { isLoggedIn } from '../../../helpers/users';
import '../styles.css';
@@ -39,7 +38,7 @@ interface OwnProps {
}
interface StateProps {
- currentUser: CurrentUser;
+ currentUser: T.CurrentUser;
}
type Props = OwnProps & StateProps;
diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx
index ae23029734e..7aa040268ff 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx
@@ -24,7 +24,6 @@ import { InjectedRouter } from 'react-router';
import OnboardingModal from './OnboardingModal';
import { skipOnboarding } from '../../../store/users';
import TeamOnboardingModal from '../teamOnboarding/TeamOnboardingModal';
-import { Organization } from '../../../app/types';
interface DispatchProps {
skipOnboarding: () => void;
@@ -55,7 +54,7 @@ export class OnboardingPage extends React.PureComponent<OwnProps & DispatchProps
this.props.router.replace('/');
};
- closeOrganizationOnboarding = ({ key }: Pick<Organization, 'key'>) => {
+ closeOrganizationOnboarding = ({ key }: Pick<T.Organization, 'key'>) => {
this.closeOnboarding();
this.props.router.push(`/organizations/${key}`);
};
diff --git a/server/sonar-web/src/main/js/apps/tutorials/projectOnboarding/ProjectOnboarding.tsx b/server/sonar-web/src/main/js/apps/tutorials/projectOnboarding/ProjectOnboarding.tsx
index 164f58ed467..e21b74aa1bb 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/projectOnboarding/ProjectOnboarding.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/projectOnboarding/ProjectOnboarding.tsx
@@ -27,7 +27,6 @@ import OrganizationStep from '../components/OrganizationStep';
import TokenStep from '../components/TokenStep';
import handleRequiredAuthentication from '../../../app/utils/handleRequiredAuthentication';
import { getCurrentUser, areThereCustomOrganizations, Store } from '../../../store/rootReducer';
-import { CurrentUser } from '../../../app/types';
import { ResetButtonLink } from '../../../components/ui/buttons';
import { getProjectUrl } from '../../../helpers/urls';
import { translate, translateWithParameters } from '../../../helpers/l10n';
@@ -41,7 +40,7 @@ interface OwnProps {
}
interface StateProps {
- currentUser: CurrentUser;
+ currentUser: T.CurrentUser;
organizationsEnabled?: boolean;
}
@@ -199,7 +198,7 @@ export class ProjectOnboarding extends React.PureComponent<Props, State> {
const mapStateToProps = (state: Store): StateProps => {
return {
- currentUser: getCurrentUser(state),
+ currentUser: getCurrentUser(state) as T.LoggedInUser,
organizationsEnabled: areThereCustomOrganizations(state)
};
};