mirror of
https://github.com/gosticks/web.git
synced 2026-10-06 22:57:01 +00:00
Merge pull request #74 from pi-hole/tweak/restructure-components
Organize components into folders based on where they are used
This commit is contained in:
@@ -12,9 +12,9 @@ import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { NavLink } from "react-router-dom";
|
||||
import { Nav, NavItem } from "reactstrap";
|
||||
import logo from "../img/logo.svg";
|
||||
import logo from "../../img/logo.svg";
|
||||
import { mobileSidebarHide } from "./Header";
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
import StatusBadge from "./StatusBadge";
|
||||
|
||||
const handleClick = (e) => {
|
||||
@@ -11,7 +11,7 @@
|
||||
import React from "react";
|
||||
import { shallow } from "enzyme";
|
||||
import { dropDownClassList, navDropdown, navItem, navList } from "./Sidebar";
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
|
||||
it("expands active drop down items", () => {
|
||||
const classList = dropDownClassList("/testRoute", { location: { pathname: "/testRoute/page" } });
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { api, makeCancelable, ignoreCancel } from '../utils';
|
||||
import { api, makeCancelable, ignoreCancel } from '../../utils';
|
||||
|
||||
class StatusBadge extends Component {
|
||||
state = {
|
||||
@@ -12,7 +12,7 @@ import React, { Component } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Line } from 'react-chartjs-2';
|
||||
import { translate } from 'react-i18next';
|
||||
import { padNumber, api, makeCancelable, ignoreCancel } from '../utils';
|
||||
import { padNumber, api, makeCancelable, ignoreCancel } from '../../utils';
|
||||
import ChartTooltip from "./ChartTooltip";
|
||||
|
||||
class ClientsGraph extends Component {
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
import GenericDoughnutChart from "./GenericDoughnutChart";
|
||||
|
||||
const ForwardDestinationsChart = ({ t }) => (
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
import React, { Component } from "react";
|
||||
import { Doughnut } from "react-chartjs-2";
|
||||
import PropTypes from "prop-types";
|
||||
import { makeCancelable, ignoreCancel } from "../utils";
|
||||
import { makeCancelable, ignoreCancel } from "../../utils";
|
||||
|
||||
class GenericDoughnutChart extends Component {
|
||||
state = {
|
||||
@@ -11,7 +11,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Line } from 'react-chartjs-2';
|
||||
import { translate } from 'react-i18next';
|
||||
import { padNumber, api, makeCancelable, ignoreCancel } from '../utils';
|
||||
import { padNumber, api, makeCancelable, ignoreCancel } from '../../utils';
|
||||
|
||||
class QueriesGraph extends Component {
|
||||
state = {
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
import GenericDoughnutChart from "./GenericDoughnutChart";
|
||||
|
||||
const QueryTypesChart = ({ t }) => (
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { api, ignoreCancel, makeCancelable } from "../utils";
|
||||
import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class SummaryStats extends Component {
|
||||
state = {
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
import TopTable from "./TopTable";
|
||||
|
||||
const TopBlocked = ({ t, ...props }) => (
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
import TopTable from "./TopTable";
|
||||
|
||||
const TopClients = ({ t, ...props }) => (
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
import TopTable from "./TopTable";
|
||||
|
||||
const TopDomains = ({ t, ...props }) => (
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import { ignoreCancel, makeCancelable } from "../utils";
|
||||
import { ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class TopTable extends Component {
|
||||
state = {
|
||||
@@ -11,7 +11,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate } from 'react-i18next';
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
|
||||
class DomainInput extends Component {
|
||||
state = {
|
||||
@@ -11,7 +11,7 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import DomainInput from './DomainInput';
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
|
||||
it('has a placeholder', () => {
|
||||
const placeholder = 'placeholder';
|
||||
@@ -11,7 +11,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate } from 'react-i18next';
|
||||
import { api, ignoreCancel, makeCancelable } from "../utils";
|
||||
import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class DomainList extends Component {
|
||||
onRemove(domain) {
|
||||
@@ -11,7 +11,7 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import DomainList from './DomainList';
|
||||
import { api } from "../utils";
|
||||
import { api } from "../../utils";
|
||||
|
||||
const domains = [
|
||||
'domain1.com',
|
||||
@@ -12,9 +12,9 @@ import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate } from 'react-i18next';
|
||||
import DomainInput from "./DomainInput";
|
||||
import Alert from "./Alert";
|
||||
import Alert from "../common/Alert";
|
||||
import DomainList from "./DomainList";
|
||||
import { ignoreCancel, makeCancelable } from "../utils";
|
||||
import { ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class ListPage extends Component {
|
||||
state = {
|
||||
@@ -150,7 +150,7 @@ class ListPage extends Component {
|
||||
|
||||
ListPage.propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
note: PropTypes.object,
|
||||
note: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
||||
placeholder: PropTypes.string.isRequired,
|
||||
add: PropTypes.func.isRequired,
|
||||
refresh: PropTypes.func.isRequired,
|
||||
@@ -11,7 +11,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import ReactTable from 'react-table';
|
||||
import { translate } from 'react-i18next';
|
||||
import { api, ignoreCancel, makeCancelable, padNumber } from '../utils';
|
||||
import { api, ignoreCancel, makeCancelable, padNumber } from '../../utils';
|
||||
import 'react-table/react-table.css';
|
||||
|
||||
class QueryLog extends Component {
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api, ignoreCancel, makeCancelable } from "../utils";
|
||||
import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class DHCPInfo extends Component {
|
||||
state = {
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api, ignoreCancel, makeCancelable } from "../utils";
|
||||
import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class DNSInfo extends Component {
|
||||
state = {
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api, ignoreCancel, makeCancelable } from "../utils";
|
||||
import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class FTLInfo extends Component {
|
||||
state = {
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api, ignoreCancel, makeCancelable } from "../utils";
|
||||
import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
|
||||
class NetworkInfo extends Component {
|
||||
state = {
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { api, ignoreCancel, makeCancelable } from "../utils";
|
||||
import VersionCard from "../components/VersionCard";
|
||||
import { api, ignoreCancel, makeCancelable } from "../../utils";
|
||||
import VersionCard from "./VersionCard";
|
||||
|
||||
class VersionInfo extends Component {
|
||||
state = {
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Switch, Route, Redirect } from 'react-router-dom'
|
||||
import Header, { mobileSidebarHide } from '../components/Header';
|
||||
import Sidebar from '../components/Sidebar';
|
||||
import Footer from '../components/Footer';
|
||||
import Header, { mobileSidebarHide } from '../components/common/Header';
|
||||
import Sidebar from '../components/common/Sidebar';
|
||||
import Footer from '../components/common/Footer';
|
||||
import Dashboard from '../views/Dashboard';
|
||||
import QueryLog from '../components/QueryLog';
|
||||
import QueryLog from '../components/log/QueryLog';
|
||||
import Whitelist from "../views/Whitelist";
|
||||
import Blacklist from "../views/Blacklist";
|
||||
import Regexlist from "../views/Regexlist";
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { api } from "../utils";
|
||||
import ListPage from "../components/ListPage";
|
||||
import ListPage from "../components/list/ListPage";
|
||||
|
||||
const Blacklist = props => {
|
||||
const { t } = props;
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React, { Fragment } from 'react';
|
||||
import SummaryStats from '../components/SummaryStats';
|
||||
import QueriesGraph from '../components/QueriesGraph';
|
||||
import ClientsGraph from '../components/ClientsGraph';
|
||||
import QueryTypesChart from "../components/QueryTypesChart";
|
||||
import ForwardDestinationsChart from "../components/ForwardDestinationsChart";
|
||||
import TopDomains from '../components/TopDomains';
|
||||
import TopBlocked from '../components/TopBlocked';
|
||||
import TopClients from '../components/TopClients';
|
||||
import SummaryStats from '../components/dashboard/SummaryStats';
|
||||
import QueriesGraph from '../components/dashboard/QueriesGraph';
|
||||
import ClientsGraph from '../components/dashboard/ClientsGraph';
|
||||
import QueryTypesChart from "../components/dashboard/QueryTypesChart";
|
||||
import ForwardDestinationsChart from "../components/dashboard/ForwardDestinationsChart";
|
||||
import TopDomains from '../components/dashboard/TopDomains';
|
||||
import TopBlocked from '../components/dashboard/TopBlocked';
|
||||
import TopClients from '../components/dashboard/TopClients';
|
||||
import { api } from "../utils";
|
||||
|
||||
export default () => (
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import sha from 'sha.js';
|
||||
import { api } from "../utils";
|
||||
import logo from '../img/logo.svg';
|
||||
import { routes } from "../routes";
|
||||
import ForgotPassword from "../components/ForgotPassword";
|
||||
import ForgotPassword from "../components/login/ForgotPassword";
|
||||
import { translate } from 'react-i18next';
|
||||
|
||||
class Login extends Component {
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import DHCPInfo from '../components/DHCPInfo';
|
||||
import DNSInfo from '../components/DNSInfo';
|
||||
import NetworkInfo from '../components/NetworkInfo';
|
||||
import FTLInfo from '../components/FTLInfo';
|
||||
import DHCPInfo from '../components/settings/DHCPInfo';
|
||||
import DNSInfo from '../components/settings/DNSInfo';
|
||||
import NetworkInfo from '../components/settings/NetworkInfo';
|
||||
import FTLInfo from '../components/settings/FTLInfo';
|
||||
|
||||
export default () => (
|
||||
<div className="animated fadeIn">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import ListPage from "../components/ListPage";
|
||||
import ListPage from "../components/list/ListPage";
|
||||
import { api } from "../utils";
|
||||
|
||||
const Regexlist = props => {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React from 'react';
|
||||
import VersionInfo from '../components/VersionInfo';
|
||||
import VersionInfo from '../components/settings/VersionInfo';
|
||||
|
||||
export default () => (
|
||||
<div className="animated fadeIn">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import ListPage from "../components/ListPage";
|
||||
import ListPage from "../components/list/ListPage";
|
||||
import { api } from "../utils";
|
||||
|
||||
const Whitelist = props => {
|
||||
|
||||
Reference in New Issue
Block a user