refactoring
This commit is contained in:
@@ -63,11 +63,11 @@ import { fetchGisStationsStaticDistrictThunk } from "../../redux/thunks/webservi
|
|||||||
import { fetchGisStationsStatusDistrictThunk } from "../../redux/thunks/webservice/fetchGisStationsStatusDistrictThunk";
|
import { fetchGisStationsStatusDistrictThunk } from "../../redux/thunks/webservice/fetchGisStationsStatusDistrictThunk";
|
||||||
import { fetchLocationDevicesThunk } from "../../redux/thunks/database/fetchLocationDevicesThunk";
|
import { fetchLocationDevicesThunk } from "../../redux/thunks/database/fetchLocationDevicesThunk";
|
||||||
import { fetchPriorityConfigThunk } from "../../redux/thunks/database/fetchPriorityConfigThunk";
|
import { fetchPriorityConfigThunk } from "../../redux/thunks/database/fetchPriorityConfigThunk";
|
||||||
import { fetchGisLinesThunk } from "../../redux/thunks/database/fetchGisLinesThunk";
|
import { fetchGisLinesThunk } from "../../redux/thunks/database/polylines/fetchGisLinesThunk.js";
|
||||||
import { fetchGisLinesStatusThunk } from "../../redux/thunks/webservice/fetchGisLinesStatusThunk";
|
import { fetchGisLinesStatusThunk } from "../../redux/thunks/webservice/fetchGisLinesStatusThunk";
|
||||||
import { fetchUserRightsThunk } from "../../redux/thunks/webservice/fetchUserRightsThunk";
|
import { fetchUserRightsThunk } from "../../redux/thunks/webservice/fetchUserRightsThunk";
|
||||||
import { fetchPoiIconsDataThunk } from "../../redux/thunks/database/fetchPoiIconsDataThunk";
|
import { fetchPoiIconsDataThunk } from "../../redux/thunks/database/pois/fetchPoiIconsDataThunk.js";
|
||||||
import { fetchPoiTypThunk } from "../../redux/thunks/database/fetchPoiTypThunk";
|
import { fetchPoiTypThunk } from "../../redux/thunks/database/pois/fetchPoiTypThunk.js";
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------
|
||||||
const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { useDispatch, useSelector } from "react-redux";
|
|||||||
import { selectGisStationsStaticDistrict } from "../../redux/slices/webservice/gisStationsStaticDistrictSlice";
|
import { selectGisStationsStaticDistrict } from "../../redux/slices/webservice/gisStationsStaticDistrictSlice";
|
||||||
import { fetchPoiTypes } from "../../redux/slices/database/poiTypesSlice";
|
import { fetchPoiTypes } from "../../redux/slices/database/poiTypesSlice";
|
||||||
import { incrementTrigger } from "../../redux/slices/poiReadFromDbTriggerSlice";
|
import { incrementTrigger } from "../../redux/slices/poiReadFromDbTriggerSlice";
|
||||||
import { addPoiThunk } from "../../redux/thunks/database/addPoiThunk";
|
import { addPoiThunk } from "../../redux/thunks/database/pois/addPoiThunk";
|
||||||
import { fetchPoiIconsDataThunk } from "../../redux/thunks/database/fetchPoiIconsDataThunk";
|
import { fetchPoiIconsDataThunk } from "../../redux/thunks/database/pois/fetchPoiIconsDataThunk";
|
||||||
|
|
||||||
const AddPOIModal = ({ onClose, map, latlng }) => {
|
const AddPOIModal = ({ onClose, map, latlng }) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import React, { useState, useEffect } from "react";
|
|||||||
import Select from "react-select";
|
import Select from "react-select";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { fetchLocationDevicesThunk } from "../../redux/thunks/database/fetchLocationDevicesThunk";
|
import { fetchLocationDevicesThunk } from "../../redux/thunks/database/fetchLocationDevicesThunk";
|
||||||
import { fetchPoiTypThunk } from "../../redux/thunks/database/fetchPoiTypThunk";
|
import { fetchPoiTypThunk } from "../../redux/thunks/database/pois/fetchPoiTypThunk";
|
||||||
import { selectMapLayersState } from "../../redux/slices/mapLayersSlice";
|
import { selectMapLayersState } from "../../redux/slices/mapLayersSlice";
|
||||||
import { selectPoiTypData, selectPoiTypStatus } from "../../redux/slices/database/poiTypSlice";
|
import { selectPoiTypData, selectPoiTypStatus } from "../../redux/slices/database/poiTypSlice";
|
||||||
import { deletePoiThunk } from "../../redux/thunks/database/deletePoiThunk";
|
import { deletePoiThunk } from "../../redux/thunks/database/pois/deletePoiThunk";
|
||||||
import { updatePoiThunk } from "../../redux/thunks/database/updatePoiThunk";
|
import { updatePoiThunk } from "../../redux/thunks/database/pois/updatePoiThunk";
|
||||||
|
|
||||||
const PoiUpdateModal = ({ onClose, poiData }) => {
|
const PoiUpdateModal = ({ onClose, poiData }) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// /config/appVersion
|
// /config/appVersion
|
||||||
export const APP_VERSION = "1.1.168";
|
export const APP_VERSION = "1.1.169";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { selectGisLinesStatusFromWebservice } from "../redux/slices/webservice/gisLinesStatusSlice";
|
import { selectGisLinesStatusFromWebservice } from "../redux/slices/webservice/gisLinesStatusSlice";
|
||||||
import { fetchGisLinesThunk } from "../redux/thunks/database/fetchGisLinesThunk";
|
import { fetchGisLinesThunk } from "../redux/thunks/database/polylines/fetchGisLinesThunk";
|
||||||
import { fetchGisLinesStatusThunk } from "../redux/thunks/webservice/fetchGisLinesStatusThunk";
|
import { fetchGisLinesStatusThunk } from "../redux/thunks/webservice/fetchGisLinesStatusThunk";
|
||||||
|
|
||||||
const useLineData = () => {
|
const useLineData = () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createSlice } from "@reduxjs/toolkit";
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
import { addPoiThunk } from "../../thunks/database/addPoiThunk";
|
import { addPoiThunk } from "../../thunks/database/pois/addPoiThunk";
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
status: "idle", // idle | loading | succeeded | failed
|
status: "idle", // idle | loading | succeeded | failed
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/slices/database/gisLinesSlice.js
|
// /redux/slices/database/gisLinesSlice.js
|
||||||
import { createSlice } from "@reduxjs/toolkit";
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
import { fetchGisLinesThunk } from "../../thunks/database/fetchGisLinesThunk";
|
import { fetchGisLinesThunk } from "../../thunks/database/polylines/fetchGisLinesThunk";
|
||||||
|
|
||||||
const gisLinesSlice = createSlice({
|
const gisLinesSlice = createSlice({
|
||||||
name: "gisLinesFromDatabase",
|
name: "gisLinesFromDatabase",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/slices/database/poiIconsDataSlice.js
|
// /redux/slices/database/poiIconsDataSlice.js
|
||||||
import { createSlice } from "@reduxjs/toolkit";
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
import { fetchPoiIconsDataThunk } from "../../thunks/database/fetchPoiIconsDataThunk";
|
import { fetchPoiIconsDataThunk } from "../../thunks/database/pois/fetchPoiIconsDataThunk";
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
data: [],
|
data: [],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/slices/database/poiTypSlice.js
|
// /redux/slices/database/poiTypSlice.js
|
||||||
import { createSlice } from "@reduxjs/toolkit";
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
import { fetchPoiTypThunk } from "../../thunks/database/fetchPoiTypThunk";
|
import { fetchPoiTypThunk } from "../../thunks/database/pois/fetchPoiTypThunk";
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
data: [],
|
data: [],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/thunks/database/addPoiThunk.js
|
// /redux/thunks/database/pois/addPoiThunk.js
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { addPoiService } from "../../../services/database/pois/addPoiService";
|
import { addPoiService } from "../../../../services/database/pois/addPoiService";
|
||||||
|
|
||||||
export const addPoiThunk = createAsyncThunk("poi/add", async (formData, thunkAPI) => {
|
export const addPoiThunk = createAsyncThunk("poi/add", async (formData, thunkAPI) => {
|
||||||
try {
|
try {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// /redux/thunks/database/deletePoiThunk.js
|
// /redux/thunks/database/deletePoiThunk.js
|
||||||
|
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { deletePoiService } from "../../../services/database/pois/deletePoiService";
|
import { deletePoiService } from "../../../../services/database/pois/deletePoiService";
|
||||||
|
|
||||||
export const deletePoiThunk = createAsyncThunk("poi/delete", async (id, thunkAPI) => {
|
export const deletePoiThunk = createAsyncThunk("poi/delete", async (id, thunkAPI) => {
|
||||||
try {
|
try {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/thunks/database/fetchPoiIconsDataThunk.js
|
// /redux/thunks/database/fetchPoiIconsDataThunk.js
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { fetchPoiIconsDataService } from "../../../services/database/pois/fetchPoiIconsDataService";
|
import { fetchPoiIconsDataService } from "../../../../services/database/pois/fetchPoiIconsDataService";
|
||||||
|
|
||||||
export const fetchPoiIconsDataThunk = createAsyncThunk("poiIconsData/fetch", async (_, thunkAPI) => {
|
export const fetchPoiIconsDataThunk = createAsyncThunk("poiIconsData/fetch", async (_, thunkAPI) => {
|
||||||
try {
|
try {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/thunks/database/fetchPoiTypThunk.js
|
// /redux/thunks/database/fetchPoiTypThunk.js
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { fetchPoiTypService } from "../../../services/database/pois/fetchPoiTypService";
|
import { fetchPoiTypService } from "../../../../services/database/pois/fetchPoiTypService";
|
||||||
|
|
||||||
export const fetchPoiTypThunk = createAsyncThunk("poiTyp/fetch", async (_, thunkAPI) => {
|
export const fetchPoiTypThunk = createAsyncThunk("poiTyp/fetch", async (_, thunkAPI) => {
|
||||||
try {
|
try {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// /redux/thunks/database/updatePoiThunk.js
|
// /redux/thunks/database/updatePoiThunk.js
|
||||||
|
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { updatePoiService } from "../../../services/database/pois/updatePoiService";
|
import { updatePoiService } from "../../../../services/database/pois/updatePoiService";
|
||||||
|
|
||||||
export const updatePoiThunk = createAsyncThunk("pois/update", async (poi, thunkAPI) => {
|
export const updatePoiThunk = createAsyncThunk("pois/update", async (poi, thunkAPI) => {
|
||||||
try {
|
try {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/thunks/database/fetchGisLinesThunk.js
|
// /redux/thunks/database/fetchGisLinesThunk.js
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { fetchGisLinesService } from "../../../services/database/polylines/fetchGisLinesService";
|
import { fetchGisLinesService } from "../../../../services/database/polylines/fetchGisLinesService";
|
||||||
|
|
||||||
export const fetchGisLinesThunk = createAsyncThunk("gisLines/fetch", async () => {
|
export const fetchGisLinesThunk = createAsyncThunk("gisLines/fetch", async () => {
|
||||||
return await fetchGisLinesService();
|
return await fetchGisLinesService();
|
||||||
Reference in New Issue
Block a user