aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/users
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2022-03-08 16:59:11 +0100
committersonartech <sonartech@sonarsource.com>2022-03-14 20:03:08 +0000
commit15e088d040984e033a74877b5e42babeb365ded9 (patch)
tree0eb06082e2e46e627ae5de1065e1b35f34d9b8c3 /server/sonar-web/src/main/js/apps/users
parent80bdd0543ac958ae1a6684c638ee569cfd3d2721 (diff)
downloadsonarqube-15e088d040984e033a74877b5e42babeb365ded9.tar.gz
sonarqube-15e088d040984e033a74877b5e42babeb365ded9.zip
SONAR-15913 Extract users from redux
Diffstat (limited to 'server/sonar-web/src/main/js/apps/users')
-rw-r--r--server/sonar-web/src/main/js/apps/users/UsersApp.tsx7
-rw-r--r--server/sonar-web/src/main/js/apps/users/UsersList.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/DeactivateForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/GroupsForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/PasswordForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/TokensFormModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserActions.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserForm.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserGroups.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserListItem.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserListItemIdentity.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx2
12 files changed, 18 insertions, 15 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 932e5e11f5d..a7e2877cec7 100644
--- a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx
+++ b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx
@@ -20,12 +20,13 @@
import * as React from 'react';
import { Helmet } from 'react-helmet-async';
import { getIdentityProviders, searchUsers } from '../../api/users';
+import withCurrentUserContext from '../../app/components/current-user/withCurrentUserContext';
import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
import ListFooter from '../../components/controls/ListFooter';
-import { withCurrentUser } from '../../components/hoc/withCurrentUser';
import { Location, Router, withRouter } from '../../components/hoc/withRouter';
import { translate } from '../../helpers/l10n';
-import { IdentityProvider, Paging, User } from '../../types/types';
+import { IdentityProvider, Paging } from '../../types/types';
+import { User } from '../../types/users';
import Header from './Header';
import Search from './Search';
import UsersList from './UsersList';
@@ -141,4 +142,4 @@ export class UsersApp extends React.PureComponent<Props, State> {
}
}
-export default withRouter(withCurrentUser(UsersApp));
+export default withRouter(withCurrentUserContext(UsersApp));
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 5de6057fde4..d4761fc7c60 100644
--- a/server/sonar-web/src/main/js/apps/users/UsersList.tsx
+++ b/server/sonar-web/src/main/js/apps/users/UsersList.tsx
@@ -19,7 +19,8 @@
*/
import * as React from 'react';
import { translate } from '../../helpers/l10n';
-import { IdentityProvider, User } from '../../types/types';
+import { IdentityProvider } from '../../types/types';
+import { User } from '../../types/users';
import UserListItem from './components/UserListItem';
interface Props {
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 34909a28c5a..8f4b6414e0f 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
@@ -22,7 +22,7 @@ import { deactivateUser } from '../../../api/users';
import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons';
import Modal from '../../../components/controls/Modal';
import { translate, translateWithParameters } from '../../../helpers/l10n';
-import { UserActive } from '../../../types/types';
+import { UserActive } from '../../../types/users';
export interface Props {
onClose: () => void;
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 82e1a4938b6..0a112561f3a 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
@@ -27,7 +27,7 @@ import SelectList, {
SelectListSearchParams
} from '../../../components/controls/SelectList';
import { translate } from '../../../helpers/l10n';
-import { User } from '../../../types/types';
+import { User } from '../../../types/users';
interface Props {
onClose: () => void;
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 8c4a3bbc806..b4b0d24b776 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
@@ -28,7 +28,7 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
import { translate } from '../../../helpers/l10n';
import { parseError } from '../../../helpers/request';
-import { User } from '../../../types/types';
+import { User } from '../../../types/users';
interface Props {
isCurrentUser: boolean;
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 448e54cde47..85981cf315e 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
@@ -22,7 +22,7 @@ import { FormattedMessage } from 'react-intl';
import { ResetButtonLink } from '../../../components/controls/buttons';
import Modal from '../../../components/controls/Modal';
import { translate } from '../../../helpers/l10n';
-import { User } from '../../../types/types';
+import { User } from '../../../types/users';
import TokensForm from './TokensForm';
interface Props {
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 dc718645298..32d01fd35c5 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
@@ -23,8 +23,7 @@ import ActionsDropdown, {
ActionsDropdownItem
} from '../../../components/controls/ActionsDropdown';
import { translate } from '../../../helpers/l10n';
-import { isUserActive } from '../../../helpers/users';
-import { User } from '../../../types/types';
+import { isUserActive, User } from '../../../types/users';
import DeactivateForm from './DeactivateForm';
import PasswordForm from './PasswordForm';
import UserForm from './UserForm';
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 c61a68f94be..e0d954293d6 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
@@ -28,7 +28,7 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker';
import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { parseError } from '../../../helpers/request';
-import { User } from '../../../types/types';
+import { User } from '../../../types/users';
import UserScmAccountInput from './UserScmAccountInput';
export interface Props {
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 c35ef36a9e2..cea99845583 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
@@ -21,7 +21,7 @@ import * as React from 'react';
import { ButtonIcon } from '../../../components/controls/buttons';
import BulletListIcon from '../../../components/icons/BulletListIcon';
import { translate, translateWithParameters } from '../../../helpers/l10n';
-import { User } from '../../../types/types';
+import { User } from '../../../types/users';
import GroupsForm from './GroupsForm';
interface Props {
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 ad0cc57e727..8dd7b8784f9 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,7 +23,8 @@ import BulletListIcon from '../../../components/icons/BulletListIcon';
import DateFromNow from '../../../components/intl/DateFromNow';
import Avatar from '../../../components/ui/Avatar';
import { translate } from '../../../helpers/l10n';
-import { IdentityProvider, User } from '../../../types/types';
+import { IdentityProvider } from '../../../types/types';
+import { User } from '../../../types/users';
import TokensFormModal from './TokensFormModal';
import UserActions from './UserActions';
import UserGroups from './UserGroups';
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 3980cad5176..6cb47ae2a3a 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
@@ -21,7 +21,8 @@ import * as React from 'react';
import { colors } from '../../../app/theme';
import { getTextColor } from '../../../helpers/colors';
import { getBaseUrl } from '../../../helpers/system';
-import { IdentityProvider, User } from '../../../types/types';
+import { IdentityProvider } from '../../../types/types';
+import { User } from '../../../types/users';
export interface Props {
identityProvider?: IdentityProvider;
diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx
index 1a713c128b2..ab949c308f9 100644
--- a/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/UserListItem-test.tsx
@@ -20,7 +20,7 @@
import { shallow } from 'enzyme';
import * as React from 'react';
import { click } from '../../../../helpers/testUtils';
-import { User } from '../../../../types/types';
+import { User } from '../../../../types/users';
import UserListItem from '../UserListItem';
jest.mock('../../../../components/intl/DateFromNow');