diff --git a/products/ASC.People/Client/src/components/dialogs/Invite/index.js b/products/ASC.People/Client/src/components/dialogs/Invite/index.js index 027f22e59a..97ce373f19 100644 --- a/products/ASC.People/Client/src/components/dialogs/Invite/index.js +++ b/products/ASC.People/Client/src/components/dialogs/Invite/index.js @@ -11,12 +11,13 @@ import { Textarea, Text } from "asc-web-components"; -import { getShortenedLink } from "../../../store/services/api"; import { withTranslation, I18nextProvider } from "react-i18next"; import i18n from "./i18n"; import { typeGuests } from "./../../../helpers/customNames"; import styled from "styled-components"; import copy from "copy-to-clipboard"; +import { api } from "asc-web-common"; +const { getShortenedLink } = api.portal; const ModalDialogContainer = styled.div` .margin-text { diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js index d617afeddb..906fa01a3d 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js @@ -32,14 +32,14 @@ import { } from "../../../../../store/people/selectors"; import { EmployeeStatus } from "../../../../../helpers/constants"; import { - resendUserInvites, sendInstructionsToDelete, sendInstructionsToChangePassword, deleteUser } from "../../../../../store/services/api"; import { isMobileOnly } from "react-device-detect"; -import { store } from 'asc-web-common'; +import { store, api } from 'asc-web-common'; const { isAdmin, isMe } = store.auth.selectors; +const { resendUserInvites } = api.people; class SectionBodyContent extends React.PureComponent { diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js b/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js index 1fe57a6c49..b8d9511058 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js @@ -26,12 +26,12 @@ import { typeGuest } from "../../../../../helpers/../helpers/customNames"; import { - resendUserInvites, deleteUsers } from "../../../../../store/services/api"; import { deleteGroup } from "../../../../../store/group/actions"; -import { store } from 'asc-web-common'; +import { store, api } from 'asc-web-common'; const { isAdmin } = store.auth.selectors; +const { resendUserInvites } = api.people; const StyledContainer = styled.div` .group-button-menu-container { diff --git a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js index 434c81ed54..a00d033fb4 100644 --- a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js +++ b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js @@ -1,7 +1,7 @@ import React from "react"; import { Trans } from 'react-i18next'; import { department as departmentName, position, employedSinceDate } from '../../../../../../helpers/customNames'; -import { resendUserInvites, sendInstructionsToChangeEmail } from "../../../../../../store/services/api"; +import { sendInstructionsToChangeEmail } from "../../../../../../store/services/api"; import { Text, TextInput, @@ -14,7 +14,8 @@ import { HelpButton } from "asc-web-components"; import styled from 'styled-components'; -import { history } from "asc-web-common"; +import { history, api } from "asc-web-common"; +const { resendUserInvites } = api.people; const InfoContainer = styled.div` margin-bottom: 24px; diff --git a/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js b/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js index 5b99f799ed..720df4bbb5 100644 --- a/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js +++ b/products/ASC.People/Client/src/components/pages/Profile/Section/Header/index.js @@ -15,7 +15,6 @@ import { import { withRouter } from "react-router"; import { getUserStatus, toEmployeeWrapper } from "../../../../../store/people/selectors"; import { withTranslation } from 'react-i18next'; -import { resendUserInvites } from "../../../../../store/services/api"; import { EmployeeStatus } from "../../../../../helpers/constants"; import { updateUserStatus, fetchPeople } from "../../../../../store/people/actions"; import { fetchProfile } from '../../../../../store/profile/actions'; @@ -29,8 +28,9 @@ import { deleteUser } from "../../../../../store/services/api"; import styled from 'styled-components'; -import { store } from 'asc-web-common'; +import { store, api } from 'asc-web-common'; const { isAdmin, isMe } = store.auth.selectors; +const { resendUserInvites } = api.people; const wrapperStyle = { display: "flex", diff --git a/products/ASC.People/Client/src/store/services/api.js b/products/ASC.People/Client/src/store/services/api.js index 45afa73c82..6aa31436c2 100644 --- a/products/ASC.People/Client/src/store/services/api.js +++ b/products/ASC.People/Client/src/store/services/api.js @@ -173,14 +173,6 @@ export function updateUserType(type, userIds) { }); } -export function resendUserInvites(userIds) { - return request({ - method: "put", - url: "/people/invite", - data: { userIds } - }); -} - export function sendInstructionsToDelete() { return request({ method: "put", @@ -261,14 +253,6 @@ export function getInvitationLink(isGuest) { }); } -export function getShortenedLink(link) { - return request({ - method: "put", - url: "/portal/getshortenlink.json", - data: link - }); -} - export function createGroup(groupName, groupManager, members) { const data = { groupName, groupManager, members }; return request({ diff --git a/products/ASC.People/Client/src/store/services/fakeApi.js b/products/ASC.People/Client/src/store/services/fakeApi.js index 47dac89ea6..e1bf861c23 100644 --- a/products/ASC.People/Client/src/store/services/fakeApi.js +++ b/products/ASC.People/Client/src/store/services/fakeApi.js @@ -381,53 +381,6 @@ export function updateUserType(type, userIds) { ]); } -export function resendUserInvites(userIds) { - return fakeResponse([ - { - id: userIds[0], - userName: "Mike.Zanyatski", - isVisitor: false, - firstName: "Mike", - lastName: "Zanyatski", - email: "my@gmail.com", - birthday: "2019-08-19T01:39:25.3240031Z", - sex: "male", - status: 1, - activationStatus: 0, - terminated: "2019-08-19T01:39:25.3240031Z", - department: "Marketing", - workFrom: "2019-08-19T01:39:25.3240031Z", - location: "Palo Alto", - notes: "Notes to worker", - displayName: null, - title: "Manager", - contacts: [ - { - type: "GTalk", - value: "my@gmail.com" - } - ], - groups: [ - { - id: "00000000-0000-0000-0000-000000000000", - name: "Group Name", - manager: "Jake.Zazhitski" - } - ], - avatarMedium: "url to medium avatar", - avatar: "url to big avatar", - isAdmin: false, - isLDAP: false, - listAdminModules: ["projects", "crm"], - isOwner: false, - cultureName: "en-EN", - isSSO: false, - avatarSmall: "url to small avatar", - profileUrl: "" - } - ]); -} - export function deleteUser(userId) { return fakeResponse([ { diff --git a/web/ASC.Web.Common/src/store/services/api/index.js b/web/ASC.Web.Common/src/store/services/api/index.js index f2eb7475ef..3ae7814f11 100644 --- a/web/ASC.Web.Common/src/store/services/api/index.js +++ b/web/ASC.Web.Common/src/store/services/api/index.js @@ -3,5 +3,6 @@ import * as people from './people'; import * as user from './user'; import * as settings from './settings'; import * as modules from './modules'; +import * as portal from './portal'; -export default { Filter, people, user, settings, modules }; \ No newline at end of file +export default { Filter, people, user, settings, modules, portal }; \ No newline at end of file diff --git a/web/ASC.Web.Common/src/store/services/api/people/index.js b/web/ASC.Web.Common/src/store/services/api/people/index.js index bea5d7b4a4..cfdeb07799 100644 --- a/web/ASC.Web.Common/src/store/services/api/people/index.js +++ b/web/ASC.Web.Common/src/store/services/api/people/index.js @@ -124,4 +124,12 @@ export function getUserList(filter = Filter.getDefault()) { method: "get", url: `/people/${userId}` }); + } + + export function resendUserInvites(userIds) { + return request({ + method: "put", + url: "/people/invite", + data: { userIds } + }); } \ No newline at end of file diff --git a/web/ASC.Web.Common/src/store/services/api/portal/index.js b/web/ASC.Web.Common/src/store/services/api/portal/index.js new file mode 100644 index 0000000000..f8291d5deb --- /dev/null +++ b/web/ASC.Web.Common/src/store/services/api/portal/index.js @@ -0,0 +1,9 @@ +import { request } from "../client"; + +export function getShortenedLink(link) { + return request({ + method: "put", + url: "/portal/getshortenlink.json", + data: link + }); + } \ No newline at end of file