From 1b293c6112511f4c8f5769e51042f76ab517b1ee Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Fri, 27 Sep 2019 14:42:17 +0300 Subject: [PATCH 1/2] web: People: Fixed set filter by url --- .../components/pages/Home/Section/Filter/index.js | 12 ------------ products/ASC.People/Client/src/store/auth/actions.js | 10 ++++++++-- .../ASC.People/Client/src/store/people/actions.js | 6 +++++- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Filter/index.js b/products/ASC.People/Client/src/components/pages/Home/Section/Filter/index.js index 8128d70c85..1d14adfc96 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Filter/index.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Filter/index.js @@ -12,18 +12,6 @@ import { department } from "./../../../../../helpers/customNames"; import { withRouter } from "react-router"; -import Filter from "../../../../../store/people/filter"; -import { - EMPLOYEE_STATUS, - ACTIVATION_STATUS, - ROLE, - GROUP, - SEARCH, - SORT_BY, - SORT_ORDER, - PAGE, - PAGE_COUNT -} from "../../../../../helpers/constants"; import { getFilterByLocation } from "../../../../../helpers/converters"; const getEmployeeStatus = filterValues => { diff --git a/products/ASC.People/Client/src/store/auth/actions.js b/products/ASC.People/Client/src/store/auth/actions.js index 5d0441fea7..b7eed49761 100644 --- a/products/ASC.People/Client/src/store/auth/actions.js +++ b/products/ASC.People/Client/src/store/auth/actions.js @@ -2,6 +2,7 @@ import * as api from "../services/api"; import { setGroups, fetchPeopleAsync } from "../people/actions"; import setAuthorizationToken from "../../store/services/setAuthorizationToken"; import { getFilterByLocation } from "../../helpers/converters"; +import config from "../../../package.json"; export const LOGIN_POST = "LOGIN_POST"; export const SET_CURRENT_USER = "SET_CURRENT_USER"; @@ -60,9 +61,14 @@ export async function getUserInfo(dispatch) { dispatch(setGroups(groupResp.data.response)); - const newFilter = getFilterByLocation(window.location); + var re = new RegExp(`${config.homepage}((/?)$|/filter)`, "gm"); + const match = window.location.pathname.match(re); - await fetchPeopleAsync(dispatch, newFilter); + if (match && match.length > 0) + { + const newFilter = getFilterByLocation(window.location); + await fetchPeopleAsync(dispatch, newFilter); + } return dispatch(setIsLoaded(true)); } diff --git a/products/ASC.People/Client/src/store/people/actions.js b/products/ASC.People/Client/src/store/people/actions.js index 6a246de579..744a8553ff 100644 --- a/products/ASC.People/Client/src/store/people/actions.js +++ b/products/ASC.People/Client/src/store/people/actions.js @@ -86,7 +86,7 @@ export function deselectUser(user) { }; } -export function setFilter(filter) { +export function setFilterUrl(filter) { const defaultFilter = Filter.getDefault(); const params = []; @@ -121,6 +121,10 @@ export function setFilter(filter) { if (params.length > 0) { history.push(`${config.homepage}/filter?${params.join("&")}`); } +} + +export function setFilter(filter) { + setFilterUrl(filter); return { type: SET_FILTER, filter From 49ba16ba4bb04669647986e6c4bd78a5934fea8f Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Fri, 27 Sep 2019 15:05:38 +0300 Subject: [PATCH 2/2] Web: Client: fixed change password link --- .../pages/Confirm/sub-components/changePassword.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js index 8d50d9da26..6b45332854 100644 --- a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js +++ b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js @@ -65,9 +65,13 @@ const Form = props => { console.log("changePassword onSubmit", match, location, history); const str = location.search.split("&"); - const userId = str[1].slice(4); + const userId = str[2].slice(4); const key = `type=PasswordChange&${location.search.slice(1)}`; + //console.log("str", str); + //console.log("key", key); + //console.log("userId", userId); + changePassword(userId, {password}, key) .then(() => { console.log("UPDATE PASSWORD");