diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-12-05 17:32:18 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-12-05 20:20:59 +0100 |
commit | 41c98779d38bda9fdfdca182a5f20c73fcff9a84 (patch) | |
tree | d895a9f8bfd0276aee5ffacf7bb33a0109436cbd /server/sonar-web/src/main/js/apps/users | |
parent | a9c22c1185c5fd8c8dc4c9388f4a3b967e3f463d (diff) | |
download | sonarqube-41c98779d38bda9fdfdca182a5f20c73fcff9a84.tar.gz sonarqube-41c98779d38bda9fdfdca182a5f20c73fcff9a84.zip |
create global type definitions (#1017)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/users')
11 files changed, 16 insertions, 27 deletions
diff --git a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx index 9c898e36ad6..e833d41cd55 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx @@ -28,7 +28,6 @@ import { parseQuery, Query, serializeQuery } from './utils'; import ListFooter from '../../components/controls/ListFooter'; import Suggestions from '../../app/components/embed-docs-modal/Suggestions'; import { getIdentityProviders, searchUsers } from '../../api/users'; -import { Paging, IdentityProvider, User } from '../../app/types'; import { translate } from '../../helpers/l10n'; interface Props { @@ -38,10 +37,10 @@ interface Props { } interface State { - identityProviders: IdentityProvider[]; + identityProviders: T.IdentityProvider[]; loading: boolean; - paging?: Paging; - users: User[]; + paging?: T.Paging; + users: T.User[]; } export default class UsersApp extends React.PureComponent<Props, State> { diff --git a/server/sonar-web/src/main/js/apps/users/UsersList.tsx b/server/sonar-web/src/main/js/apps/users/UsersList.tsx index cb91c04a60a..19eb40284b9 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersList.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersList.tsx @@ -19,16 +19,15 @@ */ import * as React from 'react'; import UserListItem from './components/UserListItem'; -import { IdentityProvider, User } from '../../app/types'; import { translate } from '../../helpers/l10n'; interface Props { currentUser: { isLoggedIn: boolean; login?: string }; - identityProviders: IdentityProvider[]; + identityProviders: T.IdentityProvider[]; onUpdateUsers: () => void; organizationsEnabled?: boolean; updateTokensCount: (login: string, tokensCount: number) => void; - users: User[]; + users: T.User[]; } export default function UsersList({ diff --git a/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx b/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx index 062a463d444..8bb6d61728d 100644 --- a/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx @@ -19,7 +19,6 @@ */ import * as React from 'react'; import { deactivateUser } from '../../../api/users'; -import { User } from '../../../app/types'; import Modal from '../../../components/controls/Modal'; import { SubmitButton, ResetButtonLink } from '../../../components/ui/buttons'; import { translate, translateWithParameters } from '../../../helpers/l10n'; @@ -27,7 +26,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; export interface Props { onClose: () => void; onUpdateUsers: () => void; - user: User; + user: T.User; } interface State { diff --git a/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx b/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx index c09f4297e9c..144ce96cf54 100644 --- a/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx @@ -19,7 +19,6 @@ */ import * as React from 'react'; import { find, without } from 'lodash'; -import { User } from '../../../app/types'; import Modal from '../../../components/controls/Modal'; import SelectList, { Filter } from '../../../components/SelectList/SelectList'; import { translate } from '../../../helpers/l10n'; @@ -29,7 +28,7 @@ import { addUserToGroup, removeUserFromGroup } from '../../../api/user_groups'; interface Props { onClose: () => void; onUpdateUsers: () => void; - user: User; + user: T.User; } interface State { diff --git a/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx b/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx index 5ee73668115..a937d9610fd 100644 --- a/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx @@ -19,7 +19,6 @@ */ import * as React from 'react'; import { changePassword } from '../../../api/users'; -import { User } from '../../../app/types'; import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage'; import throwGlobalError from '../../../app/utils/throwGlobalError'; import Modal from '../../../components/controls/Modal'; @@ -30,7 +29,7 @@ import { Alert } from '../../../components/ui/Alert'; interface Props { isCurrentUser: boolean; - user: User; + user: T.User; onClose: () => void; } diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx index 6a96b785357..99a3eb5c1c9 100644 --- a/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx @@ -19,12 +19,11 @@ */ import * as React from 'react'; import TokensForm from './TokensForm'; -import { User } from '../../../app/types'; import Modal from '../../../components/controls/Modal'; import { translate } from '../../../helpers/l10n'; interface Props { - user: User; + user: T.User; onClose: () => void; updateTokensCount: (login: string, tokensCount: number) => void; } diff --git a/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx b/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx index 5c132436de1..84d6f05326e 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserActions.tsx @@ -21,7 +21,6 @@ import * as React from 'react'; import DeactivateForm from './DeactivateForm'; import PasswordForm from './PasswordForm'; import UserForm from './UserForm'; -import { User } from '../../../app/types'; import ActionsDropdown, { ActionsDropdownItem, ActionsDropdownDivider @@ -31,7 +30,7 @@ import { translate } from '../../../helpers/l10n'; interface Props { isCurrentUser: boolean; onUpdateUsers: () => void; - user: User; + user: T.User; } interface State { diff --git a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx index 381d58ff3df..05c2384a004 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx @@ -21,7 +21,6 @@ import * as React from 'react'; import { uniq } from 'lodash'; import UserScmAccountInput from './UserScmAccountInput'; import { createUser, updateUser } from '../../../api/users'; -import { User } from '../../../app/types'; import throwGlobalError from '../../../app/utils/throwGlobalError'; import Modal from '../../../components/controls/Modal'; import { Button, ResetButtonLink, SubmitButton } from '../../../components/ui/buttons'; @@ -30,7 +29,7 @@ import { parseError } from '../../../helpers/request'; import { Alert } from '../../../components/ui/Alert'; export interface Props { - user?: User; + user?: T.User; onClose: () => void; onUpdateUsers: () => void; } diff --git a/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx b/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx index 53ab715e8da..2fc3ae5bc67 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx @@ -20,14 +20,13 @@ import * as React from 'react'; import GroupsForm from './GroupsForm'; import BulletListIcon from '../../../components/icons-components/BulletListIcon'; -import { User } from '../../../app/types'; import { ButtonIcon } from '../../../components/ui/buttons'; import { translate, translateWithParameters } from '../../../helpers/l10n'; interface Props { groups: string[]; onUpdateUsers: () => void; - user: User; + user: T.User; } interface State { diff --git a/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx b/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx index 10d34f4a158..8e0c82dd167 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx @@ -23,19 +23,18 @@ import UserActions from './UserActions'; import UserGroups from './UserGroups'; import UserListItemIdentity from './UserListItemIdentity'; import UserScmAccounts from './UserScmAccounts'; -import { IdentityProvider, User } from '../../../app/types'; import BulletListIcon from '../../../components/icons-components/BulletListIcon'; import Avatar from '../../../components/ui/Avatar'; import { ButtonIcon } from '../../../components/ui/buttons'; import { translate } from '../../../helpers/l10n'; interface Props { - identityProvider?: IdentityProvider; + identityProvider?: T.IdentityProvider; isCurrentUser: boolean; onUpdateUsers: () => void; organizationsEnabled?: boolean; updateTokensCount: (login: string, tokensCount: number) => void; - user: User; + user: T.User; } interface State { diff --git a/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx b/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx index 1d3ff144df0..4751d64b0ba 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx @@ -19,13 +19,12 @@ */ import * as React from 'react'; import * as theme from '../../../app/theme'; -import { IdentityProvider, User } from '../../../app/types'; import { getTextColor } from '../../../helpers/colors'; import { getBaseUrl } from '../../../helpers/urls'; interface Props { - identityProvider?: IdentityProvider; - user: User; + identityProvider?: T.IdentityProvider; + user: T.User; } export default function UserListItemIdentity({ identityProvider, user }: Props) { |