Organise imports in frontend and API
This commit is contained in:
parent
24b8b13ad6
commit
175d3236eb
@ -1,12 +1,11 @@
|
|||||||
import express from 'express';
|
|
||||||
import bodyParser from 'body-parser';
|
import bodyParser from 'body-parser';
|
||||||
|
import express from 'express';
|
||||||
import { authUser, getNewUserAPIKey, logout } from './services/user';
|
|
||||||
import { queryLocation } from './services/search';
|
|
||||||
|
|
||||||
import buildingsRouter from './routes/buildingsRouter';
|
import buildingsRouter from './routes/buildingsRouter';
|
||||||
import usersRouter from './routes/usersRouter';
|
|
||||||
import extractsRouter from './routes/extractsRouter';
|
import extractsRouter from './routes/extractsRouter';
|
||||||
|
import usersRouter from './routes/usersRouter';
|
||||||
|
import { queryLocation } from './services/search';
|
||||||
|
import { authUser, getNewUserAPIKey, logout } from './services/user';
|
||||||
|
|
||||||
|
|
||||||
const server = express.Router();
|
const server = express.Router();
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
||||||
|
import asyncController from '../routes/asyncController';
|
||||||
import * as buildingService from '../services/building';
|
import * as buildingService from '../services/building';
|
||||||
import * as userService from '../services/user';
|
import * as userService from '../services/user';
|
||||||
import asyncController from '../routes/asyncController';
|
|
||||||
|
|
||||||
|
|
||||||
// GET buildings
|
// GET buildings
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import * as dataExtractService from '../services/dataExtract';
|
|
||||||
import asyncController from '../routes/asyncController';
|
import asyncController from '../routes/asyncController';
|
||||||
|
import * as dataExtractService from '../services/dataExtract';
|
||||||
|
|
||||||
|
|
||||||
const getAllDataExtracts = asyncController(async function(req: express.Request, res: express.Response) {
|
const getAllDataExtracts = asyncController(async function(req: express.Request, res: express.Response) {
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import { URL } from 'url';
|
|
||||||
|
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
||||||
import * as userService from '../services/user';
|
import asyncController from '../routes/asyncController';
|
||||||
import * as passwordResetService from '../services/passwordReset';
|
import * as passwordResetService from '../services/passwordReset';
|
||||||
import { TokenVerificationError } from '../services/passwordReset';
|
import { TokenVerificationError } from '../services/passwordReset';
|
||||||
import asyncController from '../routes/asyncController';
|
import * as userService from '../services/user';
|
||||||
import { ValidationError } from '../validation';
|
import { ValidationError } from '../validation';
|
||||||
|
|
||||||
const createUser = asyncController(async (req: express.Request, res: express.Response) => {
|
const createUser = asyncController(async (req: express.Request, res: express.Response) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Request, Response, NextFunction } from 'express';
|
import { NextFunction, Request, Response } from 'express';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper for controller functions that return a Promise, enabling them to be used with Express
|
* A wrapper for controller functions that return a Promise, enabling them to be used with Express
|
||||||
@ -14,4 +14,4 @@ function asyncController(fn: (req: Request, res: Response, next: NextFunction) =
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default asyncController;
|
export default asyncController;
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
* Building data access
|
* Building data access
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
import { ITask } from 'pg-promise';
|
||||||
|
|
||||||
import db from '../../db';
|
import db from '../../db';
|
||||||
import { tileCache } from '../../tiles/rendererDefinition';
|
import { tileCache } from '../../tiles/rendererDefinition';
|
||||||
import { BoundingBox } from '../../tiles/types';
|
import { BoundingBox } from '../../tiles/types';
|
||||||
import { ITask } from 'pg-promise';
|
|
||||||
|
|
||||||
// data type note: PostgreSQL bigint (64-bit) is handled as string in JavaScript, because of
|
// data type note: PostgreSQL bigint (64-bit) is handled as string in JavaScript, because of
|
||||||
// JavaScript numerics are 64-bit double, giving only partial coverage.
|
// JavaScript numerics are 64-bit double, giving only partial coverage.
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import url, { URL } from 'url';
|
|
||||||
import { errors } from 'pg-promise';
|
|
||||||
import nodemailer from 'nodemailer';
|
import nodemailer from 'nodemailer';
|
||||||
|
import { errors } from 'pg-promise';
|
||||||
|
import url, { URL } from 'url';
|
||||||
|
|
||||||
import db from '../../db';
|
import db from '../../db';
|
||||||
import * as userService from './user';
|
|
||||||
import { transporter } from './email';
|
|
||||||
import { validatePassword } from '../validation';
|
import { validatePassword } from '../validation';
|
||||||
|
|
||||||
|
import { transporter } from './email';
|
||||||
|
import * as userService from './user';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a password reset token for the specified account and send the password reset link by email
|
* Generate a password reset token for the specified account and send the password reset link by email
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { errors } from 'pg-promise';
|
import { errors } from 'pg-promise';
|
||||||
|
import { promisify } from 'util';
|
||||||
|
|
||||||
import db from '../../db';
|
import db from '../../db';
|
||||||
import { validateUsername, ValidationError, validatePassword } from '../validation';
|
import { validatePassword, validateUsername, ValidationError } from '../validation';
|
||||||
import { promisify } from 'util';
|
|
||||||
|
|
||||||
|
|
||||||
async function createUser(user) {
|
async function createUser(user) {
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
* Client-side entry point to shared frontend React App
|
* Client-side entry point to shared frontend React App
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { hydrate } from 'react-dom';
|
import { hydrate } from 'react-dom';
|
||||||
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
|
|
||||||
import App from './frontend/app';
|
import App from './frontend/app';
|
||||||
|
|
||||||
|
@ -1,29 +1,27 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import { Route, Switch, Link } from 'react-router-dom';
|
import { Link, Route, Switch } from 'react-router-dom';
|
||||||
|
|
||||||
|
import Header from './header';
|
||||||
|
import MapApp from './map-app';
|
||||||
|
import { Building } from './models/building';
|
||||||
|
import { User } from './models/user';
|
||||||
|
import AboutPage from './pages/about';
|
||||||
|
import ContactPage from './pages/contact';
|
||||||
|
import ContributorAgreementPage from './pages/contributor-agreement';
|
||||||
|
import DataAccuracyPage from './pages/data-accuracy';
|
||||||
|
import DataExtracts from './pages/data-extracts';
|
||||||
|
import OrdnanceSurveyLicencePage from './pages/ordnance-survey-licence';
|
||||||
|
import OrdnanceSurveyUprnPage from './pages/ordnance-survey-uprn';
|
||||||
|
import PrivacyPolicyPage from './pages/privacy-policy';
|
||||||
|
import ForgottenPassword from './user/forgotten-password';
|
||||||
|
import Login from './user/login';
|
||||||
|
import MyAccountPage from './user/my-account';
|
||||||
|
import PasswordReset from './user/password-reset';
|
||||||
|
import SignUp from './user/signup';
|
||||||
|
|
||||||
import '../../node_modules/bootstrap/dist/css/bootstrap.min.css';
|
import '../../node_modules/bootstrap/dist/css/bootstrap.min.css';
|
||||||
import './app.css';
|
import './app.css';
|
||||||
|
|
||||||
import Header from './header';
|
|
||||||
import AboutPage from './pages/about';
|
|
||||||
import ContributorAgreementPage from './pages/contributor-agreement';
|
|
||||||
import PrivacyPolicyPage from './pages/privacy-policy';
|
|
||||||
import DataExtracts from './pages/data-extracts';
|
|
||||||
|
|
||||||
import Login from './user/login';
|
|
||||||
import MyAccountPage from './user/my-account';
|
|
||||||
import SignUp from './user/signup';
|
|
||||||
import ForgottenPassword from './user/forgotten-password';
|
|
||||||
import PasswordReset from './user/password-reset';
|
|
||||||
|
|
||||||
import MapApp from './map-app';
|
|
||||||
import ContactPage from './pages/contact';
|
|
||||||
import DataAccuracyPage from './pages/data-accuracy';
|
|
||||||
import OrdnanceSurveyLicencePage from './pages/ordnance-survey-licence';
|
|
||||||
import OrdnanceSurveyUprnPage from './pages/ordnance-survey-uprn';
|
|
||||||
import { Building } from './models/building';
|
|
||||||
import { User } from './models/user';
|
|
||||||
|
|
||||||
|
|
||||||
interface AppProps {
|
interface AppProps {
|
||||||
user?: User;
|
user?: User;
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import BuildingNotFound from './building-not-found';
|
|
||||||
|
|
||||||
import LocationContainer from './data-containers/location';
|
|
||||||
import UseContainer from './data-containers/use';
|
|
||||||
import TypeContainer from './data-containers/type';
|
|
||||||
import AgeContainer from './data-containers/age';
|
|
||||||
import SizeContainer from './data-containers/size';
|
|
||||||
import ConstructionContainer from './data-containers/construction';
|
|
||||||
import TeamContainer from './data-containers/team';
|
|
||||||
import SustainabilityContainer from './data-containers/sustainability';
|
|
||||||
import StreetscapeContainer from './data-containers/streetscape';
|
|
||||||
import CommunityContainer from './data-containers/community';
|
|
||||||
import PlanningContainer from './data-containers/planning';
|
|
||||||
import LikeContainer from './data-containers/like';
|
|
||||||
import { Building } from '../models/building';
|
import { Building } from '../models/building';
|
||||||
|
|
||||||
|
import BuildingNotFound from './building-not-found';
|
||||||
|
import AgeContainer from './data-containers/age';
|
||||||
|
import CommunityContainer from './data-containers/community';
|
||||||
|
import ConstructionContainer from './data-containers/construction';
|
||||||
|
import LikeContainer from './data-containers/like';
|
||||||
|
import LocationContainer from './data-containers/location';
|
||||||
|
import PlanningContainer from './data-containers/planning';
|
||||||
|
import SizeContainer from './data-containers/size';
|
||||||
|
import StreetscapeContainer from './data-containers/streetscape';
|
||||||
|
import SustainabilityContainer from './data-containers/sustainability';
|
||||||
|
import TeamContainer from './data-containers/team';
|
||||||
|
import TypeContainer from './data-containers/type';
|
||||||
|
import UseContainer from './data-containers/use';
|
||||||
|
|
||||||
|
|
||||||
interface BuildingViewProps {
|
interface BuildingViewProps {
|
||||||
cat: string;
|
cat: string;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import { DataTitleCopyable } from './data-title';
|
|
||||||
import { BaseDataEntryProps } from './data-entry';
|
import { BaseDataEntryProps } from './data-entry';
|
||||||
|
import { DataTitleCopyable } from './data-title';
|
||||||
|
|
||||||
interface CheckboxDataEntryProps extends BaseDataEntryProps {
|
interface CheckboxDataEntryProps extends BaseDataEntryProps {
|
||||||
value: boolean;
|
value: boolean;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React, { Fragment, useState } from "react";
|
import React, { Fragment, useState } from "react";
|
||||||
|
|
||||||
|
import { DownIcon, RightIcon } from "../../components/icons";
|
||||||
|
|
||||||
import './data-entry-group.css';
|
import './data-entry-group.css';
|
||||||
import { RightIcon, DownIcon } from "../../components/icons";
|
|
||||||
|
|
||||||
interface DataEntryGroupProps {
|
interface DataEntryGroupProps {
|
||||||
/** Name of the group */
|
/** Name of the group */
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import { DataTitleCopyable } from './data-title';
|
|
||||||
import { CopyProps } from '../data-containers/category-view-props';
|
import { CopyProps } from '../data-containers/category-view-props';
|
||||||
|
|
||||||
|
import { DataTitleCopyable } from './data-title';
|
||||||
|
|
||||||
interface BaseDataEntryProps {
|
interface BaseDataEntryProps {
|
||||||
slug: string;
|
slug: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { Component, Fragment } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
|
|
||||||
import { sanitiseURL } from '../../helpers';
|
import { sanitiseURL } from '../../helpers';
|
||||||
import { DataTitleCopyable } from './data-title';
|
|
||||||
import { BaseDataEntryProps } from './data-entry';
|
import { BaseDataEntryProps } from './data-entry';
|
||||||
|
import { DataTitleCopyable } from './data-title';
|
||||||
|
|
||||||
|
|
||||||
interface MultiDataEntryProps extends BaseDataEntryProps {
|
interface MultiDataEntryProps extends BaseDataEntryProps {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import { DataTitleCopyable } from './data-title';
|
|
||||||
import { BaseDataEntryProps } from './data-entry';
|
import { BaseDataEntryProps } from './data-entry';
|
||||||
|
import { DataTitleCopyable } from './data-title';
|
||||||
|
|
||||||
|
|
||||||
interface NumericDataEntryProps extends BaseDataEntryProps {
|
interface NumericDataEntryProps extends BaseDataEntryProps {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import { DataTitleCopyable } from './data-title';
|
|
||||||
import { BaseDataEntryProps } from './data-entry';
|
import { BaseDataEntryProps } from './data-entry';
|
||||||
|
import { DataTitleCopyable } from './data-title';
|
||||||
|
|
||||||
interface SelectDataEntryProps extends BaseDataEntryProps {
|
interface SelectDataEntryProps extends BaseDataEntryProps {
|
||||||
value: string;
|
value: string;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import { DataTitleCopyable } from './data-title';
|
|
||||||
import { BaseDataEntryProps } from './data-entry';
|
import { BaseDataEntryProps } from './data-entry';
|
||||||
|
import { DataTitleCopyable } from './data-title';
|
||||||
|
|
||||||
interface TextboxDataEntryProps extends BaseDataEntryProps {
|
interface TextboxDataEntryProps extends BaseDataEntryProps {
|
||||||
value: string;
|
value: string;
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import React, { Component, Fragment } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
|
|
||||||
import NumericDataEntry from './numeric-data-entry';
|
|
||||||
import { dataFields } from '../../data_fields';
|
import { dataFields } from '../../data_fields';
|
||||||
import { CopyProps } from '../data-containers/category-view-props';
|
import { CopyProps } from '../data-containers/category-view-props';
|
||||||
|
|
||||||
|
import NumericDataEntry from './numeric-data-entry';
|
||||||
|
|
||||||
interface YearDataEntryProps {
|
interface YearDataEntryProps {
|
||||||
year: number;
|
year: number;
|
||||||
upper: number;
|
upper: number;
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import { Redirect, NavLink } from 'react-router-dom';
|
import { NavLink, Redirect } from 'react-router-dom';
|
||||||
|
|
||||||
import ContainerHeader from './container-header';
|
|
||||||
import ErrorBox from '../components/error-box';
|
import ErrorBox from '../components/error-box';
|
||||||
import InfoBox from '../components/info-box';
|
import InfoBox from '../components/info-box';
|
||||||
import { CopyControl } from './header-buttons/copy-control';
|
import { compareObjects } from '../helpers';
|
||||||
import { ViewEditControl } from './header-buttons/view-edit-control';
|
|
||||||
import { Building } from '../models/building';
|
import { Building } from '../models/building';
|
||||||
import { User } from '../models/user';
|
import { User } from '../models/user';
|
||||||
import { compareObjects } from '../helpers';
|
|
||||||
|
import ContainerHeader from './container-header';
|
||||||
import { CategoryViewProps, CopyProps } from './data-containers/category-view-props';
|
import { CategoryViewProps, CopyProps } from './data-containers/category-view-props';
|
||||||
|
import { CopyControl } from './header-buttons/copy-control';
|
||||||
|
import { ViewEditControl } from './header-buttons/view-edit-control';
|
||||||
|
|
||||||
interface DataContainerProps {
|
interface DataContainerProps {
|
||||||
title: string;
|
title: string;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import { dataFields } from '../../data_fields';
|
||||||
import MultiDataEntry from '../data-components/multi-data-entry';
|
import MultiDataEntry from '../data-components/multi-data-entry';
|
||||||
import NumericDataEntry from '../data-components/numeric-data-entry';
|
import NumericDataEntry from '../data-components/numeric-data-entry';
|
||||||
import SelectDataEntry from '../data-components/select-data-entry';
|
import SelectDataEntry from '../data-components/select-data-entry';
|
||||||
import TextboxDataEntry from '../data-components/textbox-data-entry';
|
import TextboxDataEntry from '../data-components/textbox-data-entry';
|
||||||
import YearDataEntry from '../data-components/year-data-entry';
|
import YearDataEntry from '../data-components/year-data-entry';
|
||||||
import { dataFields } from '../../data_fields';
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import withCopyEdit from '../data-container';
|
||||||
import DataEntry from '../data-components/data-entry';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construction view/edit section
|
* Construction view/edit section
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
|
||||||
import LikeDataEntry from '../data-components/like-data-entry';
|
import LikeDataEntry from '../data-components/like-data-entry';
|
||||||
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import InfoBox from '../../components/info-box';
|
||||||
|
import { dataFields } from '../../data_fields';
|
||||||
import DataEntry from '../data-components/data-entry';
|
import DataEntry from '../data-components/data-entry';
|
||||||
import NumericDataEntry from '../data-components/numeric-data-entry';
|
import NumericDataEntry from '../data-components/numeric-data-entry';
|
||||||
import UPRNsDataEntry from '../data-components/uprns-data-entry';
|
import UPRNsDataEntry from '../data-components/uprns-data-entry';
|
||||||
import InfoBox from '../../components/info-box';
|
import withCopyEdit from '../data-container';
|
||||||
import { dataFields } from '../../data_fields';
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
|
const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
|
||||||
import DataEntry from '../data-components/data-entry';
|
|
||||||
import CheckboxDataEntry from '../data-components/checkbox-data-entry';
|
|
||||||
import SelectDataEntry from '../data-components/select-data-entry';
|
|
||||||
import { DataEntryGroup } from '../data-components/data-entry-group';
|
|
||||||
import { dataFields } from '../../data_fields';
|
import { dataFields } from '../../data_fields';
|
||||||
|
import CheckboxDataEntry from '../data-components/checkbox-data-entry';
|
||||||
|
import DataEntry from '../data-components/data-entry';
|
||||||
|
import { DataEntryGroup } from '../data-components/data-entry-group';
|
||||||
|
import SelectDataEntry from '../data-components/select-data-entry';
|
||||||
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import { dataFields } from '../../data_fields';
|
||||||
|
import { DataEntryGroup } from '../data-components/data-entry-group';
|
||||||
import NumericDataEntry from '../data-components/numeric-data-entry';
|
import NumericDataEntry from '../data-components/numeric-data-entry';
|
||||||
import SelectDataEntry from '../data-components/select-data-entry';
|
import SelectDataEntry from '../data-components/select-data-entry';
|
||||||
import { DataEntryGroup } from '../data-components/data-entry-group';
|
import withCopyEdit from '../data-container';
|
||||||
import { dataFields } from '../../data_fields';
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
|
||||||
import DataEntry from '../data-components/data-entry';
|
|
||||||
import SelectDataEntry from '../data-components/select-data-entry';
|
|
||||||
import NumericDataEntry from '../data-components/numeric-data-entry';
|
|
||||||
import { dataFields } from '../../data_fields';
|
import { dataFields } from '../../data_fields';
|
||||||
|
import NumericDataEntry from '../data-components/numeric-data-entry';
|
||||||
|
import SelectDataEntry from '../data-components/select-data-entry';
|
||||||
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
const EnergyCategoryOptions = ["A", "B", "C", "D", "E", "F", "G"];
|
const EnergyCategoryOptions = ["A", "B", "C", "D", "E", "F", "G"];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import withCopyEdit from '../data-container';
|
||||||
import DataEntry from '../data-components/data-entry';
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
|
||||||
import SelectDataEntry from '../data-components/select-data-entry';
|
|
||||||
import NumericDataEntry from '../data-components/numeric-data-entry';
|
|
||||||
import DataEntry from '../data-components/data-entry';
|
|
||||||
import { dataFields } from '../../data_fields';
|
import { dataFields } from '../../data_fields';
|
||||||
|
import DataEntry from '../data-components/data-entry';
|
||||||
|
import NumericDataEntry from '../data-components/numeric-data-entry';
|
||||||
|
import SelectDataEntry from '../data-components/select-data-entry';
|
||||||
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
const AttachmentFormOptions = [
|
const AttachmentFormOptions = [
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
|
|
||||||
import withCopyEdit from '../data-container';
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { EditHistoryEntry } from '../models/edit-history-entry';
|
|
||||||
import { arrayToDictionary, parseDate } from '../../helpers';
|
|
||||||
import { dataFields } from '../../data_fields';
|
import { dataFields } from '../../data_fields';
|
||||||
|
import { arrayToDictionary, parseDate } from '../../helpers';
|
||||||
|
import { EditHistoryEntry } from '../../models/edit-history-entry';
|
||||||
|
|
||||||
import { CategoryEditSummary } from './category-edit-summary';
|
import { CategoryEditSummary } from './category-edit-summary';
|
||||||
|
|
||||||
import './building-edit-summary.css';
|
import './building-edit-summary.css';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import './category-edit-summary.css';
|
|
||||||
import { FieldEditSummary } from './field-edit-summary';
|
import { FieldEditSummary } from './field-edit-summary';
|
||||||
|
|
||||||
|
import './category-edit-summary.css';
|
||||||
|
|
||||||
interface CategoryEditSummaryProps {
|
interface CategoryEditSummaryProps {
|
||||||
category: string;
|
category: string;
|
||||||
fields: {
|
fields: {
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { EditHistoryEntry } from '../models/edit-history-entry';
|
|
||||||
|
import { Building } from '../../models/building';
|
||||||
|
import { EditHistoryEntry } from '../../models/edit-history-entry';
|
||||||
|
import ContainerHeader from '../container-header';
|
||||||
|
|
||||||
import { BuildingEditSummary } from './building-edit-summary';
|
import { BuildingEditSummary } from './building-edit-summary';
|
||||||
|
|
||||||
import './edit-history.css';
|
import './edit-history.css';
|
||||||
import { Building } from '../../models/building';
|
|
||||||
import ContainerHeader from '../container-header';
|
|
||||||
|
|
||||||
interface EditHistoryProps {
|
interface EditHistoryProps {
|
||||||
building: Building;
|
building: Building;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Building } from '../../models/building';
|
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import { ViewIcon, EditIcon } from '../../components/icons';
|
|
||||||
|
import { EditIcon, ViewIcon } from '../../components/icons';
|
||||||
|
import { Building } from '../../models/building';
|
||||||
|
|
||||||
interface ViewEditControlProps {
|
interface ViewEditControlProps {
|
||||||
cat: string;
|
cat: string;
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
|
import { parse } from 'query-string';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link, Redirect, RouteComponentProps } from 'react-router-dom';
|
import { Link, Redirect, RouteComponentProps } from 'react-router-dom';
|
||||||
import { parse } from 'query-string';
|
|
||||||
|
|
||||||
import Sidebar from './sidebar';
|
import { BackIcon } from '../components/icons';
|
||||||
import InfoBox from '../components/info-box';
|
import InfoBox from '../components/info-box';
|
||||||
import { BackIcon }from '../components/icons';
|
|
||||||
import DataEntry from './data-components/data-entry';
|
|
||||||
import { dataFields } from '../data_fields';
|
import { dataFields } from '../data_fields';
|
||||||
import { User } from '../models/user';
|
import { User } from '../models/user';
|
||||||
|
|
||||||
|
import DataEntry from './data-components/data-entry';
|
||||||
|
import Sidebar from './sidebar';
|
||||||
|
|
||||||
interface MultiEditRouteParams {
|
interface MultiEditRouteParams {
|
||||||
cat: string;
|
cat: string;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* Mini-library of icons
|
* Mini-library of icons
|
||||||
*/
|
*/
|
||||||
import React from 'react'
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import { faAngleLeft, faCaretDown, faCaretRight, faCaretUp, faCheck, faCheckDouble,
|
||||||
|
faEye, faInfoCircle, faPaintBrush, faQuestionCircle, faSearch, faTimes } from '@fortawesome/free-solid-svg-icons'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||||
import { faQuestionCircle, faPaintBrush, faInfoCircle, faTimes, faCheck, faCheckDouble,
|
import React from 'react'
|
||||||
faAngleLeft, faCaretDown, faSearch, faEye, faCaretUp, faCaretRight } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
library.add(
|
library.add(
|
||||||
faQuestionCircle,
|
faQuestionCircle,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import './logo.css';
|
import './logo.css';
|
||||||
|
|
||||||
interface LogoProps {
|
interface LogoProps {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import './tooltip.css';
|
|
||||||
import { InfoIcon } from './icons';
|
import { InfoIcon } from './icons';
|
||||||
|
|
||||||
|
import './tooltip.css';
|
||||||
|
|
||||||
interface TooltipProps {
|
interface TooltipProps {
|
||||||
text: string;
|
text: string;
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import React, { Fragment } from 'react';
|
|
||||||
import { Switch, Route, RouteComponentProps, Redirect } from 'react-router-dom';
|
|
||||||
|
|
||||||
import Welcome from './pages/welcome';
|
|
||||||
import Sidebar from './building/sidebar';
|
|
||||||
import Categories from './building/categories';
|
|
||||||
import MultiEdit from './building/multi-edit';
|
|
||||||
import BuildingView from './building/building-view';
|
|
||||||
import ColouringMap from './map/map';
|
|
||||||
import { parse } from 'query-string';
|
import { parse } from 'query-string';
|
||||||
|
import React, { Fragment } from 'react';
|
||||||
|
import { Redirect, Route, RouteComponentProps, Switch } from 'react-router-dom';
|
||||||
|
|
||||||
|
import BuildingView from './building/building-view';
|
||||||
|
import Categories from './building/categories';
|
||||||
import { EditHistory } from './building/edit-history/edit-history';
|
import { EditHistory } from './building/edit-history/edit-history';
|
||||||
|
import MultiEdit from './building/multi-edit';
|
||||||
|
import Sidebar from './building/sidebar';
|
||||||
|
import ColouringMap from './map/map';
|
||||||
import { Building } from './models/building';
|
import { Building } from './models/building';
|
||||||
|
import Welcome from './pages/welcome';
|
||||||
|
|
||||||
interface MapAppRouteParams {
|
interface MapAppRouteParams {
|
||||||
mode: 'view' | 'edit' | 'multi-edit';
|
mode: 'view' | 'edit' | 'multi-edit';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import './legend.css';
|
import { DownIcon, UpIcon } from '../components/icons';
|
||||||
import { Logo } from '../components/logo';
|
import { Logo } from '../components/logo';
|
||||||
import { DownIcon, UpIcon, BackIcon } from '../components/icons';
|
|
||||||
|
import './legend.css';
|
||||||
|
|
||||||
const LEGEND_CONFIG = {
|
const LEGEND_CONFIG = {
|
||||||
location: {
|
location: {
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import React, { Component, Fragment } from 'react';
|
|
||||||
import { Map, TileLayer, ZoomControl, AttributionControl, GeoJSON } from 'react-leaflet-universal';
|
|
||||||
import { GeoJsonObject } from 'geojson';
|
import { GeoJsonObject } from 'geojson';
|
||||||
|
import React, { Component, Fragment } from 'react';
|
||||||
import '../../../node_modules/leaflet/dist/leaflet.css'
|
import { AttributionControl, GeoJSON, Map, TileLayer, ZoomControl } from 'react-leaflet-universal';
|
||||||
import './map.css'
|
|
||||||
|
|
||||||
import { HelpIcon } from '../components/icons';
|
import { HelpIcon } from '../components/icons';
|
||||||
|
import { Building } from '../models/building';
|
||||||
|
|
||||||
import Legend from './legend';
|
import Legend from './legend';
|
||||||
import SearchBox from './search-box';
|
import SearchBox from './search-box';
|
||||||
import ThemeSwitcher from './theme-switcher';
|
import ThemeSwitcher from './theme-switcher';
|
||||||
import { Building } from '../models/building';
|
|
||||||
|
import '../../../node_modules/leaflet/dist/leaflet.css'
|
||||||
|
import './map.css'
|
||||||
|
|
||||||
const OS_API_KEY = 'NVUxtY5r8eA6eIfwrPTAGKrAAsoeI9E9';
|
const OS_API_KEY = 'NVUxtY5r8eA6eIfwrPTAGKrAAsoeI9E9';
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import { Point } from 'geojson';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import './search-box.css';
|
|
||||||
import { SearchIcon } from '../components/icons';
|
import { SearchIcon } from '../components/icons';
|
||||||
import { Point } from 'geojson';
|
|
||||||
|
import './search-box.css';
|
||||||
|
|
||||||
interface SearchResult {
|
interface SearchResult {
|
||||||
type: string;
|
type: string;
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import SupporterLogos from '../components/supporter-logos';
|
|
||||||
import './about.css';
|
|
||||||
import Categories from '../building/categories';
|
import Categories from '../building/categories';
|
||||||
|
import SupporterLogos from '../components/supporter-logos';
|
||||||
|
|
||||||
|
import './about.css';
|
||||||
|
|
||||||
const AboutPage = () => (
|
const AboutPage = () => (
|
||||||
<article>
|
<article>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import InfoBox from '../components/info-box';
|
|
||||||
|
|
||||||
const ContributorAgreementPage : React.SFC<any> = () => (
|
const ContributorAgreementPage : React.SFC<any> = () => (
|
||||||
<article>
|
<article>
|
||||||
<section className='main-col'>
|
<section className='main-col'>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { FunctionComponent } from 'react';
|
import React, { FunctionComponent } from 'react';
|
||||||
|
import { NavLink } from 'react-router-dom';
|
||||||
|
|
||||||
import { dateReviver } from '../../helpers';
|
import { dateReviver } from '../../helpers';
|
||||||
import { NavLink } from 'react-router-dom';
|
|
||||||
|
|
||||||
interface ExtractViewModel {
|
interface ExtractViewModel {
|
||||||
extract_id: number;
|
extract_id: number;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import InfoBox from '../components/info-box';
|
|
||||||
|
|
||||||
const PrivacyPolicyPage: React.SFC<any> = () => (
|
const PrivacyPolicyPage: React.SFC<any> = () => (
|
||||||
<article>
|
<article>
|
||||||
<section className='main-col'>
|
<section className='main-col'>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { FormEvent, ChangeEvent } from 'react';
|
import React, { ChangeEvent, FormEvent } from 'react';
|
||||||
import InfoBox from '../components/info-box';
|
|
||||||
import ErrorBox from '../components/error-box';
|
import ErrorBox from '../components/error-box';
|
||||||
|
import InfoBox from '../components/info-box';
|
||||||
|
|
||||||
interface ForgottenPasswordState {
|
interface ForgottenPasswordState {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect, Link } from 'react-router-dom';
|
import { Link, Redirect } from 'react-router-dom';
|
||||||
|
|
||||||
import ErrorBox from '../components/error-box';
|
import ErrorBox from '../components/error-box';
|
||||||
import InfoBox from '../components/info-box';
|
import InfoBox from '../components/info-box';
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React, { FormEvent } from 'react';
|
import React, { FormEvent } from 'react';
|
||||||
import { RouteComponentProps, Redirect } from 'react-router';
|
import { Redirect, RouteComponentProps } from 'react-router';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import ErrorBox from '../components/error-box';
|
import ErrorBox from '../components/error-box';
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
|
|
||||||
interface PasswordResetState {
|
interface PasswordResetState {
|
||||||
error: string;
|
error: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect, Link } from 'react-router-dom';
|
import { Link, Redirect } from 'react-router-dom';
|
||||||
|
|
||||||
import ErrorBox from '../components/error-box';
|
import ErrorBox from '../components/error-box';
|
||||||
import InfoBox from '../components/info-box';
|
import InfoBox from '../components/info-box';
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StaticRouter } from 'react-router-dom';
|
|
||||||
|
|
||||||
import { renderToString } from 'react-dom/server';
|
import { renderToString } from 'react-dom/server';
|
||||||
|
import { StaticRouter } from 'react-router-dom';
|
||||||
import serialize from 'serialize-javascript';
|
import serialize from 'serialize-javascript';
|
||||||
|
|
||||||
import App from './frontend/app';
|
|
||||||
|
|
||||||
import { parseBuildingURL } from './parse';
|
|
||||||
import { getUserById } from './api/services/user';
|
|
||||||
import {
|
import {
|
||||||
getBuildingById,
|
getBuildingById,
|
||||||
getBuildingLikeById,
|
getBuildingLikeById,
|
||||||
getBuildingUPRNsById,
|
getBuildingUPRNsById,
|
||||||
getLatestRevisionId
|
getLatestRevisionId
|
||||||
} from './api/services/building';
|
} from './api/services/building';
|
||||||
|
import { getUserById } from './api/services/user';
|
||||||
|
import App from './frontend/app';
|
||||||
|
import { parseBuildingURL } from './parse';
|
||||||
|
|
||||||
|
|
||||||
// reference packed assets
|
// reference packed assets
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
* - entry-point to shared React App
|
* - entry-point to shared React App
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import express from 'express';
|
|
||||||
|
|
||||||
import session from 'express-session';
|
|
||||||
import pgConnect from 'connect-pg-simple';
|
import pgConnect from 'connect-pg-simple';
|
||||||
|
import express from 'express';
|
||||||
|
import session from 'express-session';
|
||||||
|
|
||||||
import db from './db';
|
|
||||||
import tileserver from './tiles/tileserver';
|
|
||||||
import apiServer from './api/api';
|
import apiServer from './api/api';
|
||||||
|
import db from './db';
|
||||||
import frontendRoute from './frontendRoute';
|
import frontendRoute from './frontendRoute';
|
||||||
|
import tileserver from './tiles/tileserver';
|
||||||
|
|
||||||
// create server
|
// create server
|
||||||
const server = express();
|
const server = express();
|
||||||
|
@ -1,6 +1,18 @@
|
|||||||
{
|
{
|
||||||
"defaultSeverity": "warning",
|
"defaultSeverity": "warning",
|
||||||
"rules": {
|
"rules": {
|
||||||
"eofline": true
|
"eofline": true,
|
||||||
|
"ordered-imports": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"grouped-imports": true,
|
||||||
|
"groups": [
|
||||||
|
{ "name": "css", "match": "\\.css$", "order": 40 },
|
||||||
|
{ "name": "parent directories", "match": "^\\.\\.", "order": 20 },
|
||||||
|
{ "name": "current directory", "match": "^\\.", "order": 30 },
|
||||||
|
{ "name": "libraries", "match": ".*", "order": 10 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user