This commit is contained in:
NikolayRechkin 2019-09-27 15:25:40 +03:00
commit aa2b44bad6
4 changed files with 18 additions and 16 deletions

View File

@ -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 => {

View File

@ -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));
}

View File

@ -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

View File

@ -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");