diff --git a/public/app/app.js b/public/app/app.js index 0e789aa1ad..20477d72dc 100644 --- a/public/app/app.js +++ b/public/app/app.js @@ -12,17 +12,17 @@ import '!file?name=[name].[ext]!./manifest.json'; import 'file?name=[name].[ext]!./.htaccess'; /* eslint-enable import/no-unresolved */ // Import all the third party stuff -import React from 'react'; +// import React from 'react'; // import ReactDOM from 'react-dom'; -import { Provider } from 'react-redux'; -import { applyRouterMiddleware, Router, browserHistory } from 'react-router'; -import { syncHistoryWithStore } from 'react-router-redux'; -import useScroll from 'react-router-scroll'; +// import { Provider } from 'react-redux'; +import { browserHistory } from 'react-router'; +// import { syncHistoryWithStore } from 'react-router-redux'; +// import useScroll from 'react-router-scroll'; // import LanguageProvider from 'containers/LanguageProvider'; import configureStore from './store'; // Import i18n messages -import { translationMessages } from './i18n'; +// import { translationMessages } from './i18n'; // Import the CSS reset, which HtmlWebpackPlugin transfers to the build folder import 'sanitize.css/sanitize.css'; @@ -37,10 +37,10 @@ const store = configureStore(initialState, browserHistory); // Sync history and store, as the react-router-redux reducer // is under the non-default key ("routing"), selectLocationState // must be provided for resolving how to retrieve the "route" in the state -import { selectLocationState } from 'containers/App/selectors'; -const history = syncHistoryWithStore(browserHistory, store, { - selectLocationState: selectLocationState(), -}); +// import { selectLocationState } from 'containers/App/selectors'; +// const history = syncHistoryWithStore(browserHistory, store, { +// selectLocationState: selectLocationState(), +// }); // Set up the router, wrapping all Routes in the App component import App from 'containers/App'; @@ -50,29 +50,31 @@ const rootRoute = { childRoutes: createRoutes(store), }; +// import SettingsManagerApp from 'containers/App/index'; -const render = () => ( - - - -); +// const render = () => ( +// {/**/} +// {/**/} +// {/**/} + // +// ); // Hot reloadable translation json files -if (module.hot) { +// if (module.hot) { // modules.hot.accept does not accept dynamic dependencies, // have to be constants at compile-time - module.hot.accept('./i18n', () => { - render(translationMessages); - }); -} + // module.hot.accept('./i18n', () => { + // render(translationMessages); + // }); +// } // Chunked polyfill for browsers without Intl support // if (!window.Intl) { @@ -90,7 +92,7 @@ if (module.hot) { // import { install } from 'offline-plugin/runtime'; // install(); -// import SettingsManagerHomePage from 'containers/HomePage/index'; +import SettingsManagerHomePage from 'containers/HomePage/index'; // Register the plugin window.Strapi.registerPlugin({ @@ -100,5 +102,7 @@ window.Strapi.registerPlugin({ label: 'Settings Manager', to: '/settings-manager', }, - mainComponent: () => (render()), + routes: rootRoute, + mainComponent: App, + homePage: SettingsManagerHomePage, }); diff --git a/public/app/containers/App/index.js b/public/app/containers/App/index.js index 33d330b203..f6a57ce9b3 100644 --- a/public/app/containers/App/index.js +++ b/public/app/containers/App/index.js @@ -12,7 +12,6 @@ */ import React from 'react'; -// import { hashHistory } from 'react-router'; import styles from './styles.css'; @@ -23,7 +22,6 @@ export default class App extends React.Component { // eslint-disable-line react/ }; render() { - // hashHistory.push('/'); return (
{React.Children.toArray(this.props.children)} diff --git a/public/app/containers/DatabasesPage/index.js b/public/app/containers/DatabasesPage/index.js index 02de0b8088..8b1b0642b0 100644 --- a/public/app/containers/DatabasesPage/index.js +++ b/public/app/containers/DatabasesPage/index.js @@ -1,38 +1,27 @@ /* - * * DatabasesPage * + * This is the first thing users see of our App, at the '/' route + * + * NOTE: while this component should technically be a stateless functional + * component (SFC), hot reloading does not currently support SFCs. If hot + * reloading is not a neccessity for you then you can refactor it and remove + * the linting exception. */ import React from 'react'; -import { connect } from 'react-redux'; -import Helmet from 'react-helmet'; import { FormattedMessage } from 'react-intl'; import messages from './messages'; -import styles from './styles.css'; -export class DatabasesPage extends React.Component { // eslint-disable-line react/prefer-stateless-function +export default class DatabasesPage extends React.Component { // eslint-disable-line react/prefer-stateless-function + render() { return ( -
- - -

Databases

+
+

+ +

); } } - - -function mapDispatchToProps(dispatch) { - return { - dispatch, - }; -} - -export default connect(mapDispatchToProps)(DatabasesPage); diff --git a/public/app/containers/DatabasesPage/messages.js b/public/app/containers/DatabasesPage/messages.js index beccdc58c7..a20595cc75 100644 --- a/public/app/containers/DatabasesPage/messages.js +++ b/public/app/containers/DatabasesPage/messages.js @@ -7,7 +7,7 @@ import { defineMessages } from 'react-intl'; export default defineMessages({ header: { - id: 'app.containers.DatabasesPage.header', - defaultMessage: 'This is DatabasesPage container !', + id: 'app.components.DatabasesPage.header', + defaultMessage: 'This is the Databases page of the Settings Manager plugin!', }, }); diff --git a/public/app/containers/DatabasesPage/styles.css b/public/app/containers/DatabasesPage/styles.css deleted file mode 100644 index 828f414de3..0000000000 --- a/public/app/containers/DatabasesPage/styles.css +++ /dev/null @@ -1,3 +0,0 @@ -.databasesPage { /* stylelint-disable */ - -} diff --git a/public/app/containers/DatabasesPage/tests/index.test.js b/public/app/containers/DatabasesPage/tests/index.test.js deleted file mode 100644 index 4966427e88..0000000000 --- a/public/app/containers/DatabasesPage/tests/index.test.js +++ /dev/null @@ -1,11 +0,0 @@ -// import DatabasesPage from '../index'; - -import expect from 'expect'; -// import { shallow } from 'enzyme'; -// import React from 'react'; - -describe('', () => { - it('Expect to have unit tests specified', () => { - expect(true).toEqual(true); - }); -}); diff --git a/public/app/routes.js b/public/app/routes.js index 02f92f9116..56b38b47b7 100644 --- a/public/app/routes.js +++ b/public/app/routes.js @@ -18,7 +18,7 @@ export default function createRoutes(store) { return [ { - path: '/plugins/settings-manager', + path: '', name: 'home', getComponent(nextState, cb) { const importModules = Promise.all([ @@ -34,8 +34,8 @@ export default function createRoutes(store) { importModules.catch(errorLoading); }, }, { - path: '/plugins/settings-manager/databases', - name: 'home', + path: '/databases', + name: 'databases', getComponent(nextState, cb) { const importModules = Promise.all([ System.import('containers/DatabasesPage'),