Merge branch 'main' into tracker-connect-back
# Conflicts: # src/assets/images/accept.png # src/assets/images/mainTaskCommentImg.png # src/components/Modal/TrackerModal/TrackerModal.jsx # src/components/UI/ModalTicket/ModalTicket.jsx # src/components/UI/TicketFullScreen/TicketFullScreen.jsx # src/pages/ProjectTracker/ProjectTracker.js # src/redux/projectsTrackerSlice.js
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
isLoading: false,
|
||||
};
|
||||
|
||||
export const loaderSlice = createSlice({
|
||||
name: 'loader',
|
||||
name: "loader",
|
||||
initialState,
|
||||
reducers: {
|
||||
loading: (state, action) => {
|
||||
|
@ -1,23 +1,23 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
tags: [],
|
||||
profiles: [],
|
||||
filteredCandidates:null,
|
||||
filteredCandidates: null,
|
||||
selectedItems: [],
|
||||
currentCandidate: {},
|
||||
auth: false,
|
||||
positionId: null,
|
||||
profileInfo: {},
|
||||
reportsDates: '',
|
||||
reportsDates: "",
|
||||
partnerEmployees: [],
|
||||
partnerRequestId: null,
|
||||
partnerRequests: [],
|
||||
partnerRequestInfo: {}
|
||||
partnerRequestInfo: {},
|
||||
};
|
||||
|
||||
export const outstaffingSlice = createSlice({
|
||||
name: 'outstaffing',
|
||||
name: "outstaffing",
|
||||
initialState,
|
||||
reducers: {
|
||||
tags: (state, action) => {
|
||||
@ -51,35 +51,55 @@ export const outstaffingSlice = createSlice({
|
||||
state.reportsDates = action.payload;
|
||||
},
|
||||
setPartnerEmployees: (state, action) => {
|
||||
state.partnerEmployees = action.payload
|
||||
state.partnerEmployees = action.payload;
|
||||
},
|
||||
setPartnerRequestId: (state, action) => {
|
||||
state.partnerRequestId = action.payload
|
||||
state.partnerRequestId = action.payload;
|
||||
},
|
||||
setPartnerRequests: (state, action) => {
|
||||
state.partnerRequests = action.payload
|
||||
state.partnerRequests = action.payload;
|
||||
},
|
||||
setPartnerRequestInfo: (state, action) => {
|
||||
state.partnerRequestInfo = action.payload
|
||||
}
|
||||
state.partnerRequestInfo = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { tags, profiles, selectedItems, auth, currentCandidate, filteredCandidates, setPositionId, setUserInfo, setProfileInfo, setReportsDates, setPartnerEmployees, setPartnerRequestId, setPartnerRequests, setPartnerRequestInfo } = outstaffingSlice.actions;
|
||||
export const {
|
||||
tags,
|
||||
profiles,
|
||||
selectedItems,
|
||||
auth,
|
||||
currentCandidate,
|
||||
filteredCandidates,
|
||||
setPositionId,
|
||||
setUserInfo,
|
||||
setProfileInfo,
|
||||
setReportsDates,
|
||||
setPartnerEmployees,
|
||||
setPartnerRequestId,
|
||||
setPartnerRequests,
|
||||
setPartnerRequestInfo,
|
||||
} = outstaffingSlice.actions;
|
||||
|
||||
export const selectProfiles = (state) => state.outstaffing.profiles;
|
||||
export const selectTags = (state) => state.outstaffing.tags;
|
||||
export const selectFilteredCandidates = (state) => state.outstaffing.filteredCandidates;
|
||||
export const selectFilteredCandidates = (state) =>
|
||||
state.outstaffing.filteredCandidates;
|
||||
export const selectItems = (state) => state.outstaffing.selectedItems;
|
||||
export const selectCurrentCandidate = (state) => state.outstaffing.currentCandidate;
|
||||
export const selectCurrentCandidate = (state) =>
|
||||
state.outstaffing.currentCandidate;
|
||||
export const selectAuth = (state) => state.outstaffing.auth;
|
||||
export const getPositionId = (state) => state.outstaffing.positionId;
|
||||
export const getProfileInfo = (state) => state.outstaffing.profileInfo;
|
||||
export const getPartnerRequestInfo = (state) => state.outstaffing.partnerRequestInfo;
|
||||
export const getPartnerRequestInfo = (state) =>
|
||||
state.outstaffing.partnerRequestInfo;
|
||||
export const selectUserInfo = (state) => state.outstaffing.userInfo;
|
||||
export const getReportsDates = (state) => state.outstaffing.reportsDates;
|
||||
export const getPartnerEmployees = (state) => state.outstaffing.partnerEmployees;
|
||||
export const getPartnerRequestId = (state) => state.outstaffing.partnerRequestId;
|
||||
export const getPartnerEmployees = (state) =>
|
||||
state.outstaffing.partnerEmployees;
|
||||
export const getPartnerRequestId = (state) =>
|
||||
state.outstaffing.partnerRequestId;
|
||||
export const getPartnerRequests = (state) => state.outstaffing.partnerRequests;
|
||||
|
||||
export default outstaffingSlice.reducer;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { createAsyncThunk, createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
import { apiRequest } from "../api/request";
|
||||
|
||||
const initialState = {
|
||||
@ -36,11 +37,13 @@ export const projectsTrackerSlice = createSlice({
|
||||
}
|
||||
});
|
||||
},
|
||||
deletePersonOnProject: (state,action) => {
|
||||
state.projectBoard.projectUsers = state.projectBoard.projectUsers.filter((person) => person.user_id !== action.payload)
|
||||
deletePersonOnProject: (state, action) => {
|
||||
state.projectBoard.projectUsers = state.projectBoard.projectUsers.filter(
|
||||
(person) => person.user_id !== action.payload
|
||||
);
|
||||
},
|
||||
addPersonToProject: (state, action) => {
|
||||
state.projectBoard.projectUsers.push(action.payload)
|
||||
state.projectBoard.projectUsers.push(action.payload);
|
||||
},
|
||||
activeLoader: (state) => {
|
||||
state.boardLoader = true;
|
||||
@ -55,7 +58,7 @@ export const projectsTrackerSlice = createSlice({
|
||||
task_id: action.payload.startWrapperIndex.task.id,
|
||||
column_id: column.id,
|
||||
},
|
||||
}).then((res) => {});
|
||||
}).then(() => {});
|
||||
}
|
||||
if (column.id === action.payload.startWrapperIndex.index) {
|
||||
state.projectBoard.columns[index].tasks = column.tasks.filter(
|
||||
@ -75,10 +78,10 @@ export const projectsTrackerSlice = createSlice({
|
||||
})
|
||||
},
|
||||
setColumnName: (state, action) => {
|
||||
state.columnName = action.payload
|
||||
state.columnName = action.payload;
|
||||
},
|
||||
setColumnId: (state, action) => {
|
||||
state.columnId = action.payload
|
||||
state.columnId = action.payload;
|
||||
},
|
||||
setColumnPriority: (state, action) => {
|
||||
state.columnPriority = action.payload
|
||||
@ -93,9 +96,9 @@ export const projectsTrackerSlice = createSlice({
|
||||
editColumnName: (state, action) => {
|
||||
state.projectBoard.columns.forEach((column) => {
|
||||
if (column.id === action.payload.id) {
|
||||
column.title = action.payload.title
|
||||
column.title = action.payload.title;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
modalToggle: (state, action) => {
|
||||
state.modalType = action.payload;
|
||||
|
@ -1,123 +1,125 @@
|
||||
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
|
||||
|
||||
import {apiRequest} from "../api/request";
|
||||
import { createAsyncThunk, createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
import { apiRequest } from "../api/request";
|
||||
|
||||
const initialState = {
|
||||
answers: [
|
||||
{
|
||||
"id": "12",
|
||||
"question_id": "7",
|
||||
"answer_body": "Нsdf sfd fds sdf sf sfsdf sdfеск вsdffsdfsdf sf sdf sdfsdfsdfsdfdsjknsdkf dssdjf sdfbsdhf sd hjdsfv sdhjvар1 отв1 истина"
|
||||
id: "12",
|
||||
question_id: "7",
|
||||
answer_body:
|
||||
"Нsdf sfd fds sdf sf sfsdf sdfеск вsdffsdfsdf sf sdf sdfsdfsdfsdfdsjknsdkf dssdjf sdfbsdhf sd hjdsfv sdhjvар1 отв1 истина",
|
||||
},
|
||||
{
|
||||
"id": "23",
|
||||
"question_id": "7",
|
||||
"answer_body": "Неск вар1 отв1 истина"
|
||||
id: "23",
|
||||
question_id: "7",
|
||||
answer_body: "Неск вар1 отв1 истина",
|
||||
},
|
||||
{
|
||||
"id": "233",
|
||||
"question_id": "7",
|
||||
"answer_body": "lorem sdfdsf dfs sdf "
|
||||
id: "233",
|
||||
question_id: "7",
|
||||
answer_body: "lorem sdfdsf dfs sdf ",
|
||||
},
|
||||
],
|
||||
questionnaires: [],
|
||||
questions: [
|
||||
{
|
||||
"id": "4",
|
||||
"question_type_id": "3",
|
||||
"question_body": "Для чего в Python используется встроенная функция enumerate()?",
|
||||
"question_priority": null,
|
||||
"next_question": null,
|
||||
"time_limit": "00:22:00"
|
||||
id: "4",
|
||||
question_type_id: "3",
|
||||
question_body:
|
||||
"Для чего в Python используется встроенная функция enumerate()?",
|
||||
question_priority: null,
|
||||
next_question: null,
|
||||
time_limit: "00:22:00",
|
||||
},
|
||||
{
|
||||
"id": "24",
|
||||
"question_type_id": "3",
|
||||
"question_body": "Для чего в Python dfsf троенная функция enumerate()?",
|
||||
"question_priority": null,
|
||||
"next_question": null,
|
||||
"time_limit": "00:22:00"
|
||||
id: "24",
|
||||
question_type_id: "3",
|
||||
question_body: "Для чего в Python dfsf троенная функция enumerate()?",
|
||||
question_priority: null,
|
||||
next_question: null,
|
||||
time_limit: "00:22:00",
|
||||
},
|
||||
{
|
||||
"id": "41",
|
||||
"question_type_id": "3",
|
||||
"question_body": "Для чегоsdfsdfя функция enumerate()?",
|
||||
"question_priority": null,
|
||||
"next_question": null,
|
||||
"time_limit": "00:22:00"
|
||||
id: "41",
|
||||
question_type_id: "3",
|
||||
question_body: "Для чегоsdfsdfя функция enumerate()?",
|
||||
question_priority: null,
|
||||
next_question: null,
|
||||
time_limit: "00:22:00",
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"question_type_id": '2',
|
||||
"question_body": "Один ответ2",
|
||||
"question_priority": null,
|
||||
"next_question": null,
|
||||
"time_limit": "00:22:00"
|
||||
}
|
||||
id: "5",
|
||||
question_type_id: "2",
|
||||
question_body: "Один ответ2",
|
||||
question_priority: null,
|
||||
next_question: null,
|
||||
time_limit: "00:22:00",
|
||||
},
|
||||
],
|
||||
selectedTest: {
|
||||
"user_id": 1,
|
||||
"uuid": "d222f858-60fd-47fb-8731-dc9d5fc384c5",
|
||||
"score": 11,
|
||||
"status": 2,
|
||||
"percent_correct_answers": 0.25,
|
||||
"testing_date": "2022-03-17 11:14:22",
|
||||
"questionnaire_title": "Кат1 Анкета 1 активна"
|
||||
selectedTest: {
|
||||
user_id: 1,
|
||||
uuid: "d222f858-60fd-47fb-8731-dc9d5fc384c5",
|
||||
score: 11,
|
||||
status: 2,
|
||||
percent_correct_answers: 0.25,
|
||||
testing_date: "2022-03-17 11:14:22",
|
||||
questionnaire_title: "Кат1 Анкета 1 активна",
|
||||
},
|
||||
selectedAnswers:{},
|
||||
selectedAnswers: {},
|
||||
completedTest: false,
|
||||
result: null,
|
||||
isLoading: false,
|
||||
dataQuestionnairesOfUser: [],
|
||||
passedTests: [],
|
||||
|
||||
userInfo: null,
|
||||
|
||||
userInfo: null,
|
||||
};
|
||||
export const setUserInfo = createAsyncThunk(
|
||||
'userInfo',
|
||||
(id) =>
|
||||
apiRequest(`/profile/get-main-data?user_id=${id}`)
|
||||
export const setUserInfo = createAsyncThunk("userInfo", (id) =>
|
||||
apiRequest(`/profile/get-main-data?user_id=${id}`)
|
||||
);
|
||||
|
||||
export const fetchUserAnswersMany = createAsyncThunk(
|
||||
'answersUserMany',
|
||||
(checkedValues) =>
|
||||
apiRequest('/user-response/set-responses', {method: 'POST', data: {"userResponses": checkedValues}})
|
||||
"answersUserMany",
|
||||
(checkedValues) =>
|
||||
apiRequest("/user-response/set-responses", {
|
||||
method: "POST",
|
||||
data: { userResponses: checkedValues },
|
||||
})
|
||||
);
|
||||
|
||||
export const fetchUserAnswerOne = createAsyncThunk(
|
||||
'answersUserOne',
|
||||
(checkedValues) =>
|
||||
apiRequest('/user-response/set-response', {method: 'POST', data: checkedValues[0]})
|
||||
"answersUserOne",
|
||||
(checkedValues) =>
|
||||
apiRequest("/user-response/set-response", {
|
||||
method: "POST",
|
||||
data: checkedValues[0],
|
||||
})
|
||||
);
|
||||
|
||||
export const fetchGetAnswers = createAsyncThunk(
|
||||
'answers',
|
||||
(question_id) =>
|
||||
apiRequest(`/answer/get-answers?question_id=${question_id}`)
|
||||
export const fetchGetAnswers = createAsyncThunk("answers", (question_id) =>
|
||||
apiRequest(`/answer/get-answers?question_id=${question_id}`)
|
||||
);
|
||||
|
||||
export const fetchResultTest = createAsyncThunk(
|
||||
'result',
|
||||
(uuid) =>
|
||||
apiRequest(`/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}`)
|
||||
export const fetchResultTest = createAsyncThunk("result", (uuid) =>
|
||||
apiRequest(
|
||||
`/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}`
|
||||
)
|
||||
);
|
||||
|
||||
export const quizSlice = createSlice({
|
||||
name: 'quiz',
|
||||
name: "quiz",
|
||||
initialState,
|
||||
reducers: {
|
||||
setQuestionnaires: (state, action) => {
|
||||
state.questionnaires = action.payload;
|
||||
},
|
||||
setSelectedTest: (state, action) => {
|
||||
state.selectedTest = action.payload
|
||||
state.selectedTest = action.payload;
|
||||
},
|
||||
setCompleteTest: (state) => {
|
||||
state.completedTest = true;
|
||||
},
|
||||
setCompleteTest: (state, action) => {
|
||||
state.completedTest = true
|
||||
}
|
||||
},
|
||||
extraReducers: {
|
||||
[setUserInfo.fulfilled]: (state, action) => {
|
||||
@ -132,21 +134,18 @@ export const quizSlice = createSlice({
|
||||
},
|
||||
});
|
||||
|
||||
export const {setQuestionnaires, setSelectedTest, setCompleteTest} = quizSlice.actions;
|
||||
|
||||
export const { setQuestionnaires, setSelectedTest, setCompleteTest } =
|
||||
quizSlice.actions;
|
||||
|
||||
export const answersSelector = (state) => state.quiz.answers;
|
||||
export const questionnairesSelector = (state) => state.quiz.questionnaires;
|
||||
export const selectedAnswersSelector = (state) => state.quiz.selectedAnswers
|
||||
export const questionsSelector = (state) => state.quiz.questions
|
||||
export const completedTestSelector = (state) => state.quiz.completedTest
|
||||
export const selectedAnswersSelector = (state) => state.quiz.selectedAnswers;
|
||||
export const questionsSelector = (state) => state.quiz.questions;
|
||||
export const completedTestSelector = (state) => state.quiz.completedTest;
|
||||
|
||||
export const selectResult = (state) => state.quiz.result;
|
||||
export const selectedTest = (state) => state.quiz.selectedTest;
|
||||
export const selectPassedTests = (state) => state.quiz.passedTests;
|
||||
export const selectUserInfo = (state) => state.quiz.userInfo;
|
||||
|
||||
|
||||
|
||||
export default quizSlice.reducer;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
role: null,
|
||||
};
|
||||
|
||||
export const roleSlice = createSlice({
|
||||
name: 'role',
|
||||
name: "role",
|
||||
initialState,
|
||||
reducers: {
|
||||
setRole: (state, action) => {
|
||||
|
Reference in New Issue
Block a user