fixed config paths

This commit is contained in:
muerwre 2018-12-03 15:35:07 +07:00
parent 9c0038f0a3
commit bf1b92fdf1
18 changed files with 92 additions and 124 deletions

View file

@ -1,7 +1,6 @@
import React from 'react';
import { GuestButton } from '$components/user/GuestButton';
import { TEST } from '$constants/api';
import { DEFAULT_USER, ROLES } from '$constants/auth';
import { UserButton } from '$components/user/UserButton';
import { UserMenu } from '$components/user/UserMenu';
@ -12,6 +11,7 @@ import type { UserType } from '$constants/types';
import { Icon } from '$components/panels/Icon';
import classnames from 'classnames';
import { CLIENT } from '$config/frontend';
type Props = {
user: UserType,
@ -62,8 +62,7 @@ export class Component extends React.PureComponent<Props, void> {
const left = (width - 700) / 2;
window.open(
// `https://oauth.vk.com/authorize?client_id=5987644&scope=&redirect_uri=${SERVER}/engine/oauthOrchid.php&response_type=code`,
`https://oauth.vk.com/authorize?client_id=5987644&scope=&redirect_uri=${TEST}/auth/social/vk`,
`https://oauth.vk.com/authorize?client_id=5987644&scope=&redirect_uri=${CLIENT.API_ADDR}/auth/social/vk`,
'socialPopupWindow',
`location=no,width=700,height=370,scrollbars=no,top=${top},left=${left},resizable=no`
);

View file

@ -1,12 +0,0 @@
import { DEFAULT_PROVIDER, PROVIDERS } from '$constants/providers';
export const CONFIG = {
OSRM_URL: 'http://vault48.org:5000/route/v1',
STROKE_WIDTH: 5,
};
export const COLORS = {
PATH_COLOR: ['#ff7700', '#ff3344'],
};
export const PROVIDER = PROVIDERS[DEFAULT_PROVIDER];

View file

@ -1,9 +1,8 @@
export const SERVER = 'http://alpha-map.vault48.org';
export const TEST = 'http://localhost:3000';
import { CLIENT } from '$config/frontend';
export const API = {
GET_GUEST: `${TEST}/auth`,
CHECK_TOKEN: `${TEST}/auth`,
GET_MAP: `${TEST}/route`,
POST_MAP: `${TEST}/route`,
GET_GUEST: `${CLIENT.API_ADDR}/auth`,
CHECK_TOKEN: `${CLIENT.API_ADDR}/auth`,
GET_MAP: `${CLIENT.API_ADDR}/route`,
POST_MAP: `${CLIENT.API_ADDR}/route`,
};

View file

@ -1,6 +1,4 @@
// Стили карт
import { editor } from '$modules/Editor';
const TILEMAPS = {
WATERCOLOR: {
name: 'Watercolor',

View file

@ -1,5 +1,3 @@
import { ROLES } from '$constants/auth';
export type UserType = {
new_messages: Number,
place_types: Object,

View file

@ -1,7 +1,7 @@
import { map, tileLayer } from 'leaflet';
import 'leaflet/dist/leaflet.css';
import 'leaflet-editable';
import { PROVIDER } from '$config';
import { PROVIDER } from '$config/frontend';
import { DEFAULT_PROVIDER, PROVIDERS } from '$constants/providers';
export class Map {

View file

@ -2,7 +2,7 @@ import L from 'leaflet';
import 'leaflet-geometryutil';
import { simplify } from '$utils/simplify';
import { findDistance, middleCoord } from '$utils/geom';
import { CONFIG } from '$config';
import { CLIENT } from '$config/frontend';
const polyStyle = {
color: 'url(#activePathGradient)',
@ -50,7 +50,7 @@ export class Poly {
latlngs[i - 1],
[mid.lat, mid.lng]
],
{ color: 'none', weight: CONFIG.STROKE_WIDTH }
{ color: 'none', weight: CLIENT.STROKE_WIDTH }
).addTo(this.arrows);
slide._path.setAttribute('marker-end', 'url(#long-arrow)');

View file

@ -1,6 +1,6 @@
import L from 'leaflet';
import Routing from 'leaflet-routing-machine/src/index';
import { CONFIG } from '$config';
import { CLIENT } from '$config/frontend';
import { DomMarker } from '$utils/DomMarker';
export class Router {
@ -22,7 +22,7 @@ export class Router {
}).on('linetouched', this.lockPropagations);
this.router = Routing.control({
serviceUrl: CONFIG.OSRM_URL,
serviceUrl: CLIENT.OSRM_URL,
profile: 'bike',
fitSelectedRoutes: false,
routeLine,

View file

@ -1,7 +1,7 @@
import { editor } from '$modules/Editor';
import { COLORS, CONFIG } from '$config';
import { COLORS, CLIENT } from '$config/frontend';
import saveAs from 'file-saver';
import { DEFAULT_PROVIDER, PROVIDERS, replaceProviderUrl } from '$constants/providers';
import { replaceProviderUrl } from '$constants/providers';
const latLngToTile = latlng => {
const { map } = editor.map;
@ -119,7 +119,7 @@ export const composePoly = ({ points, ctx }) => {
ctx.strokeStyle = 'red';
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
ctx.lineWidth = CONFIG.STROKE_WIDTH + 0.5;
ctx.lineWidth = CLIENT.STROKE_WIDTH + 0.5;
ctx.beginPath();
ctx.moveTo(points[0].x, points[0].y);