Browse Source

remove single line comment occurences on configuration files

pull/2/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
5c57feba4e
  1. 135
      src/const/ApiConst.js
  2. 2
      src/const/CustomFunc.js
  3. 11
      src/const/GeohrApiFunc.js
  4. 83
      src/const/GeohrMapStyles.js
  5. 4
      src/const/GeoserverFunc.js
  6. 3
      src/const/Kominfo.js
  7. 57
      src/const/LayerTreeConst.js
  8. 63
      src/const/MapConst.js
  9. 1
      src/const/interceptorApi.js

135
src/const/ApiConst.js

@ -1,37 +1,8 @@
import { appConfig, MAP_ID } from './MapConst';
// import axios from 'axios'
// import { createBrowserHistory } from 'history';
// const history = createBrowserHistory();
const roleName = window.localStorage.getItem('role_name');
// const token = localStorage.getItem('apiKey')
// axios.interceptors.request.use(
// async config => {
// // const value = await redisClient.get(rediskey)
// // const keys = JSON.parse(value)
// return config;
// },
// error => {
// Promise.reject(error)
// });
// // Response interceptor for API calls
// export const AXIOS = axios.interceptors.response.use((response) => {
// console.log("token not expire")
// return response
// }, async function (error) {
// // const originalRequest = error.config;
// if (error.response.status == 401) {
// console.log("error", error.response)
// console.log("token expire")
// localStorage.clear();
// window.location = window.location.origin;
// }
// return Promise.reject(error);
// });
// const HOST = "http://127.0.0.1"; // local
// const HOST = "http://192.168.99.110"; // local vagrant Ardhi
const HOST = "https://osmap.id"; // online
export const BASE_URL_GEOHR_API = "https://oslog.id/geohr-api";
@ -50,24 +21,17 @@ export const API_LOG = `${SIOPAS_API}/user/log`
export const API_USER_SESSION = `${SIOPAS_API}/user/get_valid_session`
// http://192.168.99.110/fnc/osmap-php/index.php/map/getColumnNameAndType"
export const API_GET_COLUMN_TABLE = `${BASE_API}/map/getColumnNameAndType`
export const API_CREATE_NEW_LAYER = `${BASE_API}/map/createlayer`
// Load and Save Map View
export const API_LOAD_MAP = `${SIOPAS_API}/map/load/${MAP_ID}`
export const API_UPDATE_MAP = `${SIOPAS_API}/map/update`
// Upload and Get Image Popup
// export const API_UPLOAD_IMAGE = `${SIOPAS_API}/uploadimage`
export const API_UPLOAD_IMAGE = `${SIOPAS_API}/feature/uploadimage`
// export const API_GET_IMAGE = `${SIOPAS_API}/uploadimage/getimage`
export const API_GET_IMAGE = `${SIOPAS_API}/feature/getimage`
// Update Feature
export const API_UPDATE_FEATURE = `${SIOPAS_API}/feature/update`
// Dashboard Chart API
export const API_GET_CHART_TIPE_GEOMETRY = `${SIOPAS_API}/dashboard/chart/tipe-geometry?map_id=${MAP_ID}`
export const API_GET_CHART_KATEGORI = `${SIOPAS_API}/dashboard/chart/tipe-kategori?map_id=${MAP_ID}`
@ -101,7 +65,6 @@ export const API_INSERT_DATA_USERS = `${API_LIST_DATA_USERS}/insertDataUser`
export const API_UPDATE_DATA_USERS = `${API_LIST_DATA_USERS}/updateDataUser`
export const API_DELETE_DATA_USERS = `${API_LIST_DATA_USERS}/deleteDataUser`
// Layer Page
export const API_LAYER_LIST = `${SIOPAS_API}/layer?workspace=${appConfig.workspace_name}`
export const API_LAYER_LABEL = `${SIOPAS_API}/layer/getsearchlabel`
export const API_LAYER_DETAIL = `${SIOPAS_API}/layer/?resourcebase_ptr_id=`
@ -114,7 +77,6 @@ export const API_LAYER_SEARCH_LABEL_UPDATE = `${SIOPAS_API}/layer/updatelayersea
// GEOHR API
export const API_GEOHR_GROUP_SALES_SEARCH = `${BASE_URL_GEOHR_API}/group-sales/search`;
export const API_GEOHR_SALES_MONITORING = `${BASE_URL_GEOHR_API}/sales/monitoring`;
@ -124,12 +86,9 @@ export const API_GEOHR_CUSTOMER_MONITORING = `${BASE_URL_GEOHR_API}/customer/mon
export const API_GEOHR_EMPLOYEE_MONITORING = `${BASE_URL_GEOHR_API}/employee/monitoring`;
export const API_GEOHR_WAYPOINT_SALES_MONITORING = (salesId) => `${BASE_URL_GEOHR_API}/waypoint-sales/monitoring?salesId=${salesId}`;
export const API_GEOHR_WAYPOINT_EMPLOYEE_MONITORING = (employeeId) => `${BASE_URL_GEOHR_API}/waypoint-employee/monitoring?employeeId=${employeeId}`;
// export const API_GEOHR_DAILY_INFO = (typeSales) => `${BASE_URL_GEOHR_API}/dashboard-status-sales?typeSales=${typeSales}`;
export const API_GEOHR_DAILY_INFO = `${BASE_URL_GEOHR_API}/dashboard-status-sales`;
// export const API_GEOHR_WAYPOINT_EMPLOYEE_MONITORING = (employeeId) => `${BASE_URL_GEOHR_API}/waypoint-employee/monitoring?emoloyeeId=${employeeId}`;
export const API_BROADCAST = `${BASE_URL_GEOHR_API}/broadcast`
// API PHP
export const API_GEOHR_EMPLOYEE_DIVISION_LIST = `${BASE_URL_GEOHR_API2}/employee_devision.php?act=get_data`;
export const API_GEOHR_KARYAWAN = `${BASE_URL_GEOHR_API2}/employee.php?`;
export const API_GEOHR_ROLES = `${BASE_URL_GEOHR_API2}/roles.php?`;
@ -146,16 +105,13 @@ export const API_DAILY_INFO_DETAIL = (start, length) => `${BASE_URL_GEOHR_API2}/
// =========================== OSPRO ======================================//
export const APP_MODE = 'KIT' // KIT / ADW / NAWAKARA / IU
export const APP_MODE = 'ADW' // KIT / ADW / NAWAKARA / IU
export const BASE_SIMPRO = "https://oslog.id/simpro-api/v1";
// export const BASE_SIMPRO = "http://localhost:8300/v1";
export const BASE_SIMPRO_V2 = "https://oslog.id/simpro-api/v2";
export const BASE_SIMPRO_LUMENNIAGA = "https://ospro-api.odm-iu.com/api";
export let BASE_OSPRO = "https://ospro-api.ospro.id";
export let BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`;
// for warna host config
export let BASE_SIMPRO_LUMEN_IMAGE = `${BASE_OSPRO}/assets/image`;
export let BASE_SIMPRO_LUMEN_FILE = `${BASE_OSPRO}/assets/file/project`;
@ -171,7 +127,7 @@ switch (APP_MODE) {
break;
case 'ADW':
BASE_OSPRO = "https://ospro-api.ospro.id"
BASE_OSPRO = "http://localhost:80"
BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`;
BASE_SIMPRO_LUMEN_IMAGE = `${BASE_OSPRO}/assets/image`;
@ -192,35 +148,16 @@ switch (APP_MODE) {
}
// export const BASE_OSPRO = "https://ospro.krakatau-it.co.id"; // kit
// export const BASE_OSPRO = "https://ospro-api.ospro.id"; // adyawinsa
// export const BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`;
//for KIT server
// export const BASE_SIMPRO_LUMEN_IMAGE = `${BASE_SIMPRO_LUMEN}/assets/image`;
// export const BASE_SIMPRO_LUMEN_FILE = `${BASE_SIMPRO_LUMEN}/assets/file/project`;
// export const BASE_SIMPRO_LUMEN_R = "https://ospro-api.ospro.id/";
// export const BASE_SIMPRO_LUMEN_R = `${BASE_OSPRO}/`;
// export const BASE_SIMPRO_LUMEN = "http://localhost:8074/simpro-lumen/api";
// export const USER_ADD = `${BASE_SIMPRO}/user/add`
// export const USER_LOGIN = `${BASE_SIMPRO}/user/login`
// export const USER_SEARCH = `${BASE_SIMPRO}/user/search`
// export const USER_LIST = `${BASE_SIMPRO}/user/list`
// export const USER_EDIT = (id) => { return `${BASE_SIMPRO}/user/edit/${id}` }
// export const USER_DELETE = (id) => { return `${BASE_SIMPRO}/user/delete/${id}` }
// export const ROLE_ADD = `${BASE_SIMPRO}/role/add`
// export const ROLE_SEARCH = `${BASE_SIMPRO}/role/search`
// export const ROLE_EDIT = (id) => { return `${BASE_SIMPRO}/role/edit/${id}` }
// export const ROLE_DELETE = (id) => { return `${BASE_SIMPRO}/role/delete/${id}` }
export const USERROLE_ADD = `${BASE_SIMPRO}/user-role/add`
export const USERROLE_SEARCH = `${BASE_SIMPRO}/user-role/search`
@ -234,49 +171,21 @@ export const USERPROYEK_SEARCH = `${BASE_SIMPRO}/user-to-proyek/search`
export const USERPROYEK_EDIT = (id) => { return `${BASE_SIMPRO}/user-to-proyek/edit/${id}` }
export const USERPROYEK_DELETE = (id) => { return `${BASE_SIMPRO}/user-to-proyek/delete/${id}` }
// export const MENU_ADD = `${BASE_SIMPRO}/menu/add`
// export const MENU_MANAGEMENT = (id) => { return `${BASE_SIMPRO}/menu-management/${id}` }
// export const MENU_SEARCH = `${BASE_SIMPRO}/menu/search`
// export const MENU_EDIT = (id) => { return `${BASE_SIMPRO}/menu/edit/${id}` }
// export const MENU_DELETE = (id) => { return `${BASE_SIMPRO}/menu/delete/${id}` }
// export const PROYEK_ADD = `${BASE_SIMPRO}/proyek/add`
// export const PROYEK_LIST = `${BASE_SIMPRO}/proyek/list`
// export const PROYEK_SEARCH = `${BASE_SIMPRO}/proyek/search`
// export const PROYEK_SEARCH_DETAIL = `${BASE_SIMPRO}/proyek/search-detail`
// export const PROYEK_EDIT = (id) => { return `${BASE_SIMPRO}/proyek/edit/${id}` }
// export const PROYEK_DELETE = (id) => { return `${BASE_SIMPRO}/proyek/delete/${id}` }
// export const ROLEMENU_ADD = `${BASE_SIMPRO}/role-menu/add`
// export const ROLEMENU_SEARCH = `${BASE_SIMPRO}/role-menu/search`
// export const ROLEMENU_EDIT = (id) => { return `${BASE_SIMPRO}/role-menu/edit/${id}` }
// export const ROLEMENU_DELETE = (id) => { return `${BASE_SIMPRO}/role-menu/delete/${id}` }
// export const ROLEMENU_DELETE_ROLE = (id) => { return `${BASE_SIMPRO}/role-menu/delete-byrole/${id}` }
export const PRESENSI_ADD = `${BASE_SIMPRO}/clock-in-out/add`
export const PRESENSI_SEARCH = `${BASE_SIMPRO}/clock-in-out/search`
export const PRESENSI_EDIT = (id) => { return `${BASE_SIMPRO}/clock-in-out/edit/${id}` }
export const PRESENSI_DELETE = (id) => { return `${BASE_SIMPRO}/clock-in-out/delete/${id}` }
// export const ABSENSI_ADD = `${BASE_SIMPRO}/absensi/add`
// export const ABSENSI_SEARCH = `${BASE_SIMPRO}/absensi/search`
// export const ABSENSI_EDIT = (id) => { return `${BASE_SIMPRO}/absensi/edit/${id}` }
// export const ABSENSI_DELETE = (id) => { return `${BASE_SIMPRO}/absensi/delete/${id}` }
export const PLANNING_ADD = `${BASE_SIMPRO}/laporan-planning/add`
export const PLANNING_SEARCH = `${BASE_SIMPRO}/laporan-planning/search`
export const PLANNING_EDIT = (id) => { return `${BASE_SIMPRO}/laporan-planning/edit/${id}` }
export const PLANNING_DELETE = (id) => { return `${BASE_SIMPRO}/laporan-planning/delete/${id}` }
// export const CONFIGALERT_ADD = `${BASE_SIMPRO}/config-alert/add`
// export const CONFIGALERT_SEARCH = `${BASE_SIMPRO}/config-alert/search`
// export const CONFIGALERT_EDIT = (id) => { return `${BASE_SIMPRO}/config-alert/edit/${id}` }
// export const CONFIGALERT_DELETE = (id) => { return `${BASE_SIMPRO}/config-alert/delete/${id}` }
// export const CALERTUSER_ADD = `${BASE_SIMPRO}/config-alert-to-user/add`
// export const CALERTUSER_SEARCH = `${BASE_SIMPRO}/config-alert-to-user/search`
// export const CALERTUSER_EDIT = (id) => { return `${BASE_SIMPRO}/config-alert-to-user/edit/${id}` }
// export const CALERTUSER_DELETE = (id) => { return `${BASE_SIMPRO}/config-alert-to-user/delete/${id}` }
export const ALERT_ADD = `${BASE_SIMPRO}/alert/add`
export const ALERT_SEARCH = `${BASE_SIMPRO}/alert/search`
@ -301,7 +210,6 @@ export const PLANNING_REALISASI_SEARCH = `${BASE_SIMPRO}/planning-realisasi/sear
export const DASHBOARD_PROYEK = `${BASE_SIMPRO}/dashboard-proyek/list`
export const DASHBOARD_PROYEK_SEARCH = `${BASE_SIMPRO}/dashboard-proyek/search`
// export const IMAGE_SEARCH = `${BASE_SIMPRO}/image/search`
export const SIMPRO_BASE_IMAGE = `https://oslog.id/simpro-api/assets/images`
export const API_BROADCAST_SIMPRO = `${BASE_SIMPRO}/broadcast`
@ -309,40 +217,16 @@ export const USER_WASPANG = `${BASE_SIMPRO}/user-role/search`
export const USER_TO_PROYEK_SEARCH = `${BASE_SIMPRO}/user-to-proyek`
export const API_SIMPRO_WAYPOINT_WASPANG_MONITORING = (userId) => `${BASE_SIMPRO}/waypoint-monitoring/${userId}/search`;
// export const K3_ADD = `${BASE_SIMPRO}/laporan-k3/add`
// export const K3_SEARCH = `${BASE_SIMPRO}/laporan-k3/search`
// export const K3_EDIT = (id) => { return `${BASE_SIMPRO}/laporan-k3/edit/${id}` }
// export const K3_DELETE = (id) => { return `${BASE_SIMPRO}/laporan-k3/delete/${id}` }
export const SATUAN_KERJA_GET = `${BASE_SIMPRO}/satuan/list`
export const DASHBOARD_STATUS_SEARCH = `${BASE_SIMPRO}/dashboard-status/search`
export const GANTT_CONTROL_MONITORING_SEARCH = `${BASE_SIMPRO}/proyek-monitoring/search-detail`
// export const TYPE_PROYEK = `${BASE_SIMPRO}/type-proyek/list`
// export const MATERIAL_RESOURCE_ADD = `${BASE_SIMPRO}/material-resource/add`
// export const MATERIAL_RESOURCE_ADD_DETAIL = `${BASE_SIMPRO}/material-resource/add-detail`
// export const MATERIAL_RESOURCE_SEARCH = `${BASE_SIMPRO}/material-resource/search`
// export const MATERIAL_RESOURCE_EDIT = (id) => { return `${BASE_SIMPRO}/material-resource/edit/${id}` }
// export const MATERIAL_RESOURCE_DELETE = (id) => { return `${BASE_SIMPRO}/material-resource/delete/${id}` }
// export const TOOLS_RESOURCE_ADD = `${BASE_SIMPRO}/tools-resource/add`
// export const TOOLS_RESOURCE_SEARCH = `${BASE_SIMPRO}/tools-resource/search`
// export const TOOLS_RESOURCE_EDIT = (id) => { return `${BASE_SIMPRO}/tools-resource/edit/${id}` }
// export const TOOLS_RESOURCE_DELETE = (id) => { return `${BASE_SIMPRO}/tools-resource/delete/${id}` }
// export const PROJECT_TYPE_ADD = `${BASE_SIMPRO}/type-proyek/add`
// export const PROJECT_TYPE_SEARCH = `${BASE_SIMPRO}/type-proyek/search`
// export const PROJECT_TYPE_EDIT = (id) => { return `${BASE_SIMPRO}/type-proyek/edit/${id}` }
// export const PROJECT_TYPE_DELETE = (id) => { return `${BASE_SIMPRO}/type-proyek/delete/${id}` }
// export const PROJECT_ROLE_ADD = `${BASE_SIMPRO}/role-proyek/add`
// export const PROJECT_ROLE_SEARCH = `${BASE_SIMPRO}/role-proyek/search`
// export const PROJECT_ROLE_EDIT = (id) => { return `${BASE_SIMPRO}/role-proyek/edit/${id}` }
// export const PROJECT_ROLE_DELETE = (id) => { return `${BASE_SIMPRO}/role-proyek/delete/${id}` }
// export const PROJECT_CHARTER_ADD = `${BASE_SIMPRO}/project-charter/add`
// export const PROJECT_CHARTER_EDIT = (id) => { return `${BASE_SIMPRO}/project-charter/edit/${id}` }
export const MATERIAL_TO_PROYEK_ADD = `${BASE_SIMPRO}/material-to-proyek/add`
export const MATERIAL_TO_PROYEK_ADD_DETAIL = `${BASE_SIMPRO}/material-to-proyek/add-detail`
@ -356,7 +240,6 @@ export const TOOLS_TO_PROYEK_SEARCH = `${BASE_SIMPRO}/tools-to-proyek/search`
export const TOOLS_TO_PROYEK_EDIT = (id) => { return `${BASE_SIMPRO}/tools-to-proyek/edit/${id}` }
export const TOOLS_TO_PROYEK_DELETE = (id) => { return `${BASE_SIMPRO}/tools-to-proyek/delete/${id}` }
// lumen APi
export const USER_LOGIN_V2 = `${BASE_SIMPRO_LUMEN}/login`
export const USER_TO_PROYEK = `${BASE_SIMPRO_LUMEN}/user-to-project/assign`
export const TOOLS_ASSIGN_PROYEK = `${BASE_SIMPRO_LUMEN}/tools-to-project/assign`
@ -364,7 +247,6 @@ export const MATERIAL_ASSIGN_PROYEK = `${BASE_SIMPRO_LUMEN}/material-to-project/
export const TOOLS_CREATE = `${BASE_SIMPRO_LUMEN}/req-tools/create`
export const USER_ADD = `${BASE_SIMPRO_LUMEN}/human-resource/add`
// export const USER_LOGIN = `${BASE_SIMPRO_LUMEN}/user/login`
export const USER_SEARCH = `${BASE_SIMPRO_LUMEN}/human-resource/search`
export const USER_LIST = `${BASE_SIMPRO_LUMEN}/human-resource/list`
export const USER_EDIT = (id) => { return `${BASE_SIMPRO_LUMEN}/human-resource/update/${id}` }
@ -444,7 +326,6 @@ export const CALERTUSER_EDIT = (id) => { return `${BASE_SIMPRO_LUMEN}/config-ale
export const CALERTUSER_DELETE = (id) => { return `${BASE_SIMPRO_LUMEN}/config-alert-to-user/delete/${id}` }
export const MATERIAL_RESOURCE_ADD = `${BASE_SIMPRO_LUMEN}/material-resource/add`
// export const MATERIAL_RESOURCE_ADD_DETAIL = `${BASE_SIMPRO_LUMEN}/material-resource/add-detail`
export const MATERIAL_RESOURCE_SEARCH = `${BASE_SIMPRO_LUMEN}/material-resource/search`
export const MATERIAL_RESOURCE_EDIT = (id) => { return `${BASE_SIMPRO_LUMEN}/material-resource/update/${id}` }
export const MATERIAL_RESOURCE_DELETE = (id) => { return `${BASE_SIMPRO_LUMEN}/material-resource/delete/${id}` }
@ -488,7 +369,6 @@ export const SHIFT_LIST = `${BASE_SIMPRO_LUMEN}/shift/list`
export const USER_SHIFT_ADD = `${BASE_SIMPRO_LUMEN}/user-to-shift/add`
export const USER_SHIFT_SEARCH = `${BASE_SIMPRO_LUMEN}/user-to-shift/search`
// export const USER_SHIFT_EDIT = (id) => { return `${BASE_SIMPRO_LUMEN}/user-to-shift/update/${id}` }
export const USER_SHIFT_DELETE = (id) => { return `${BASE_SIMPRO_LUMEN}/user-to-shift/delete/${id}` }
export const USER_SHIFT_LIST = `${BASE_SIMPRO_LUMEN}/user-to-shift/list`
@ -560,10 +440,8 @@ export const OSPRO_BASE_IMAGE = `${BASE_OSPRO}/api/assets/image`
export const DASHBOARD_COST_PLANNING_ACTUAL = `${BASE_SIMPRO_LUMEN}/dashboard/cost-planning-actual`
export const DASHBOARD_PERSENTASE_PROGRESS_PROYEK = `${BASE_SIMPRO_LUMEN}/dashboard/percentage-planning-actual`
// export const DIVISI_SEARCH = `${BASE_SIMPRO_LUMEN}/divisi/search`
export const DASHBOARD_REPORT_POINTS = `${BASE_SIMPRO_LUMEN}/report-activity/search-point`
export const DASHBOARD_STATUS_PROYEK = `${BASE_SIMPRO_LUMEN}/dashboard/status-proyek`
// export const DASHBOARD_KURVA_S = `${BASE_SIMPRO_LUMEN}/dashboard/curva-s`
export const DASHBOARD_KURVA_S = `${BASE_SIMPRO_LUMEN}/activity/get-curva-s`
export const CURRENCY_LIST = `${BASE_SIMPRO_LUMEN}/currency/list`
@ -583,7 +461,6 @@ export const PROJECT_TO_CHECKLIST_K3_EDIT = (id) => { return `${BASE_SIMPRO_LUME
export const PROJECT_TO_CHECKLIST_K3_DELETE = (id) => { return `${BASE_SIMPRO_LUMEN}/project-to-checklist-k3/delete/${id}` }
export const PROJECT_TO_CHECKLIST_K3_LIST = `${BASE_SIMPRO_LUMEN}/project-to-checklist-k3/list`
// export const WAYPOINT_SEARCH = `${BASE_SIMPRO_LUMEN}/waypoint/search`
export const CONTROL_MONITORING_SEARCH = `${BASE_SIMPRO_LUMEN}/control-monitoring/search`
export const API_PANIC_BUTTON_SIMPRO = `${BASE_SIMPRO_LUMEN}/panic-button`

2
src/const/CustomFunc.js

@ -318,8 +318,6 @@ export const formatThousand = (x) => {
/*
Using it:
// sort the object by a property (descending)
// using parser if sorting ignores uppercase and lowercase
sortBy(data, {
prop: "date",
desc: true,

11
src/const/GeohrApiFunc.js

@ -15,7 +15,6 @@ import {
import { toast } from 'react-toastify';
const id_org = window.localStorage.getItem('id_org');
const roleName = window.localStorage.getItem('role_name');
// Sales Routing
export const getSalesRoutingApi = async (salesId, dateString) => {
// Example
// salesId: int; 8
@ -68,7 +67,6 @@ export const getSalesRoutingApi = async (salesId, dateString) => {
}
}
// Sales Monitoring
export const getSalesFeatures = async (filterGroup, salesGroupTree) => {
const LENGTH_SALES_TREE_CHILDREN = salesGroupTree[0].children.length;
@ -134,7 +132,6 @@ export const getSalesFeatures = async (filterGroup, salesGroupTree) => {
}
}
// Office Monitoring
export const getOfficeFeatures = async () => {
const param = {
method: 'POST',
@ -164,7 +161,6 @@ export const getOfficeFeatures = async () => {
}
}
// Customer Monitoring
export const getCustomerFeatures = async () => {
let bodyParam = {
"paging": {"start": 0, "length": -1},
@ -212,7 +208,6 @@ export const getCustomerFeatures = async () => {
}
// Daily Info
/*
Expected output:
{
@ -315,9 +310,7 @@ export const getDailyInfoApi = async () => {
}
}
// Daily Info Table
/*
// old
export const requestTableDailyInfoApi = async (item) => {
console.log('requestTableDailyInfoApi item', item);
let filterSales = item.sales_ids;
@ -367,7 +360,6 @@ export const requestTableDailyInfoApi = async (item) => {
}
}*/
// new
export const requestTableDailyInfoApi = async (param) => {
const formData = new FormData();
// formData.append('start', 0);
@ -478,7 +470,6 @@ export const getEmployeeFeatures = async (filterGroup, employeeDivTree) => {
}
}
// Sales Routing
export const getEmployeeRoutingApi = async (userId, dateString) => {
// Example
// userId: int; 8
@ -628,7 +619,6 @@ export const getWaspangFeatures = async (proyekIds) => {
}
}
// Waspang Routing
export const getWaspangRoutingApi = async (userId, dateString) => {
// Example
// userId: int; 8
@ -684,7 +674,6 @@ export const getWaspangRoutingApi = async (userId, dateString) => {
}
}
// Waspang Routing
export const getPresensiRoutingApi = async (userId, dateString) => {
// Example
// userId: int; 8

83
src/const/GeohrMapStyles.js

@ -9,13 +9,6 @@ import { BASE_IMAGE_EMPLOYEE } from './ApiConst';
const MAX_RESOLUTION = 25;
// export const SALES_FEATURES_STYLE = new Style({
// image: new CircleStyle({
// radius: 5,
// fill: null,
// stroke: new Stroke({color: 'blue', width: 1}),
// })
// })
export const SALES_FEATURES_STYLE = new Style({
image: new IconOl({
@ -25,14 +18,6 @@ export const SALES_FEATURES_STYLE = new Style({
})
});
// export const EMPLOYEE_FEATURES_STYLE = new Style({
// image: new IconOl({
// anchor: [0.5, 1],
// src: salesPin,
// // src: "https://oslog.id/geohr-api/assets/images/employee/d7c6259c-9a78-4530-b2ec-1d1be9411c46-0.png",
// scale: 0.03
// })
// });
export const EMPLOYEE_FEATURES_STYLE = (feature) => {
const anchor = [0.5, 1];
@ -95,17 +80,6 @@ export const EMPLOYEE_FEATURES_STYLE = (feature) => {
return style;
}
// export const CUSTOMER_FEATURES_STYLE = new Style({
// image: new CircleStyle({
// radius: 5,
// fill: null,
// // fill: new Fill({
// // color: '#db1414',
// // opacity: 0.5
// // }),
// stroke: new Stroke({color: 'green', width: 1}),
// })
// })
export const CUSTOMER_FEATURES_STYLE = new Style({
image: new IconOl({
@ -123,64 +97,7 @@ export const OFFICE_FEATURES_STYLE = new Style({
})
});
// export const OFFICE_FEATURES_STYLE = new Style({
// image: new CircleStyle({
// radius: 5,
// fill: null,
// // fill: new Fill({
// // color: '#db1414',
// // opacity: 0.5
// // }),
// stroke: new Stroke({color: 'red', width: 1}),
// })
// })
// export const ROUTE_MAP_STYLES = {
// 'route': new Style({
// stroke: new Stroke({
// width: 6,
// color: getRandomColor()
// }),
// text: new Text({
// textAlign: "center",
// textBaseline: "middle",
// font: "bold 12px / 1.2 Courier New",
// text: "Route Sales 1",
// // fill: new Fill({color: "#000000"}),
// stroke: new Stroke({color: "ffffff", width: 0.5}),
// offsetX: 0,
// offsetY: 0,
// placement: "point",
// maxAngle: 0.7853981633974483, // 45 degree
// overflow: false,
// rotation: 0,
// })
// }),
// 'pinRouteStart': new Style({
// image: new IconOl({
// anchor: [0.5, 1],
// src: pinRouteStart,
// scale: 0.075
// }),
// }),
// 'pinRouteEnd': new Style({
// image: new IconOl({
// anchor: [0.5, 1],
// src: pinRouteEnd,
// scale: 0.075
// }),
// }),
// 'geoMarker': new Style({
// image: new CircleStyle({
// radius: 7,
// fill: new Fill({color: 'black'}),
// stroke: new Stroke({
// color: 'white',
// width: 2,
// }),
// }),
// }),
// };
export const ROUTE_MAP_STYLES = (feature, resolution) => {
let outputStyle = null;

4
src/const/GeoserverFunc.js

@ -11,7 +11,6 @@ import {Vector as VectorLayer} from 'ol/layer';
import {Vector as VectorSource} from 'ol/source';
import {getArea, getLength} from 'ol/sphere';
// Request table data
export const reqTableData = async (typeName) => {
let xmlDoc = null;
let resTableData = null;
@ -76,7 +75,6 @@ export const reqTableData = async (typeName) => {
}
// Get table columns
/*export const getTableColumns = async (tableName) => {
let result = null;
@ -144,7 +142,6 @@ export const test = () => {
axios.get("http://localhost/osmap-php/index.php/siopas/user/test_user").then((res) => { console.log('test axios', res) });
}
// SIOPAS Login Function
export const loginSiopas = (username, password) => {
let result = null;
fetch(API_LOGIN, {
@ -169,7 +166,6 @@ export const loginSiopas = (username, password) => {
});
}
// get geometry type of layer
export const getGeomType = async (layerName) => {
// The original url looks like this:
// let url = http://192.168.99.110/geoserver/rest/workspaces/bmd_denpasar/featuretypes/tanah_kantor_instansi_pemerintah.json

3
src/const/Kominfo.js

@ -127,7 +127,6 @@ export const opt2G = [
}]
}]
// 2G Mukim
export const opt2G_mukim = [
{
title: 'Operator',
@ -410,7 +409,6 @@ export const opt3G = [
}]
}]
// 3G Mukim
export const opt3G_mukim = [
{
title: 'Operator',
@ -756,7 +754,6 @@ export const opt4G = [
}
]
// 4G Mukim
export const opt4G_mukim = [
{
title: 'Operator',

57
src/const/LayerTreeConst.js

@ -122,63 +122,6 @@ export const demografiTree = [
]
}];
// export const analisaTree = [
// {
// title: 'Analisa',
// key: 'analisa-0',
// children: [
// {
// title: 'Potensi Penambahan Toko',
// key: 'analisa-0-0',
// layers: {
// name: "potensi_penambahan_toko",
// visible: false
// }
// },
// {
// title: 'Buffer Income',
// key: 'analisa-0-1',
// layers: {
// name: "buffer_income",
// visible: false
// },
// children: [
// {
// title: '50 jt',
// key: 'analisa-0-1-0',
// layers: {
// name: "50_jt",
// visible: false
// }
// },
// {
// title: '80 jt',
// key: 'analisa-0-1-1',
// layers: {
// name: "80_jt",
// visible: false
// }
// },
// {
// title: '100 jt',
// key: 'analisa-0-1-2',
// layers: {
// name: "100_jt",
// visible: false
// }
// }
// ]
// },
// {
// title: 'Irisan',
// key: 'analisa-0-2',
// layers: {
// name: "irisan",
// visible: false
// }
// }
// ]
// }]
export const analisaTree = [
{

63
src/const/MapConst.js

@ -1,7 +1,5 @@
import axios from 'axios';
// let workspace_name = window.localStorage.getItem('workspace_name');
// let datastore_name = window.localStorage.getItem('datastore_name');
let workspace_name = "geohr";
let datastore_name = "geohr";
let mapId = window.localStorage.getItem('map_id');
@ -17,52 +15,12 @@ export let appConfig = {
export let MAP_ID = mapId;
// export const reloadConstants = () => {
// console.log('reloading constants...');
// workspace_name = window.localStorage.getItem('workspace_name');
// datastore_name = window.localStorage.getItem('datastore_name');
// mapId = window.localStorage.getItem('map_id');
// appConfig.workspace_name = workspace_name;
// appConfig.datastore_name = datastore_name;
// MAP_ID = mapId;
// console.log('appConfig reloadConstants', appConfig);
// return;
// }
// export const emptyConstants = () => {
// console.log('empty constants...');
// workspace_name = '';
// datastore_name = '';
// mapId = '';
// appConfig.workspace_name = workspace_name;
// appConfig.datastore_name = datastore_name;
// MAP_ID = mapId;
// console.log('appConfig emptyConstants', appConfig);
// return;
// }
// console.log('u_group',u_group);
// if (u_group === 'kominfo') {
// workspace_name = 'kominfo';
// datastore_name = 'kominfo';
// mapId = 2;
// }
// else if (u_group === 'demors') {
// // demors
// workspace_name = 'geonode';
// datastore_name = 'geoshape_imports';
// mapId = 4;
// }
// else {
// // default
// workspace_name = 'bmd_denpasar';
// datastore_name = 'bmd_denpasar_imports';
// mapId = 1;
// }
/*export const appConfig = {
geoserver_host: "http://192.168.99.110/geoserver/", // local ip ardhi
@ -78,24 +36,16 @@ export let MAP_ID = mapId;
export const BMD_DENPASAR_MAPSERVICE_URL = "http://siopas.co.id/bmd-denpasar/public/maps/mbtiles-mapservices-epsg3857.php";
export const IU_MAPSERVICE_URL = "http://202.47.70.196/map-service/mbtiles-mapservices-epsg3857.php";
// WMS_CAPABILITIES_URL (for getting ows/layers from geoserver)
// Please note: CORS headers must be set on server providing capabilities document. Otherwise proxy needed.
// export const WMS_CAPABILITIES_URL = appConfig.geoserver_host+'ows/service?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities';
export const WMS_CAPABILITIES_URL = appConfig.geoserver_host+appConfig.workspace_name+'/ows/service?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities';
export const WMS_CAPABILITIES_URL_2 = appConfig.geoserver_host+'/wms?service?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities';
// Nominatim URL (for search address)
export const nominatimBaseUrl = "https://address.oslog.id/search?";
// WFSDispatcher URL. (CRUD feature)
export const wfsDispatcherUrl = appConfig.geoserver_host+"wfs/WfsDispatcher";
// export const layerStyleUrl = appConfig.geoserver_host+"wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetStyles&LAYERS=bmd_denpasar:tanah_kantor_desa_dan_lurah0";
export const layerStyleUrl = appConfig.geoserver_host+"wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetStyles&LAYERS="+appConfig.workspace_name+":";
// Legend Graphic
// http://192.168.99.110/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=bmd_denpasar:tanah_sekolah
export const legendPicUrl = appConfig.geoserver_host+"wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER="+appConfig.workspace_name+":";
export const layerThumbnailUrl = (layerName) => {
@ -107,7 +57,6 @@ export const layerThumbnailUrl = (layerName) => {
return imageUrl;
}
// Set Request to axios in request geoserver
export const setRequestMapHeader = () => {
axios.interceptors.request.use(function (config) {
// Do something before request is sent

1
src/const/interceptorApi.js

@ -10,7 +10,6 @@ axios.interceptors.request.use(
Promise.reject(error)
});
// Response interceptor for API calls
axios.interceptors.response.use((response) => {
console.log("token not expire")
return response

Loading…
Cancel
Save