Skip to content

Commit

Permalink
refactor(Pages): Moves containers/components into a pages folder for …
Browse files Browse the repository at this point in the history
…easier code navigation. (#1453 - [LL-186](https://learningpool.atlassian.net/browse/LL-186))
  • Loading branch information
ryasmi authored Sep 19, 2019
1 parent a47d2cb commit dd66a52
Show file tree
Hide file tree
Showing 148 changed files with 94 additions and 254 deletions.
6 changes: 3 additions & 3 deletions ui/src/containers/Admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const renderPage = (routeName) => {

if (testRoute('admin.users')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/SiteUsers')
loader: System.import('ui/pages/SiteUsersPage')
}));
}


if (testRoute('admin.organisations')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/SiteOrgs')
loader: System.import('ui/pages/SiteOrgsPage')
}));
}
};
Expand All @@ -42,7 +42,7 @@ const render = ({ route }) => {
}}>
<AdminSideNav />
<div className="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
{ renderPage(name) }
{renderPage(name)}
</div>
</div>
</AuthContainer>
Expand Down
10 changes: 5 additions & 5 deletions ui/src/containers/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const renderPage = (routeName) => {

if (testRoute('login')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Login')
loader: System.import('ui/pages/LoginPage')
}));
}
if (testRoute('home')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Home')
loader: System.import('ui/pages/HomePage')
}));
}
if (testRoute('organisation')) {
Expand All @@ -36,12 +36,12 @@ const renderPage = (routeName) => {
}
if (testRoute('forgot')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/ForgotPassword')
loader: System.import('ui/pages/ForgotPasswordPage')
}));
}
if (testRoute('reset')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/ResetPassword')
loader: System.import('ui/pages/ResetPasswordPage')
}));
}
if (
Expand All @@ -60,7 +60,7 @@ const component = ({ route }) => {
return (
<div>
<Helmet {...config.app.head} />
{ renderPage(name) }
{renderPage(name)}
<Toasts />
</div>
);
Expand Down
86 changes: 0 additions & 86 deletions ui/src/containers/ExportButton/ExportButton.js

This file was deleted.

36 changes: 0 additions & 36 deletions ui/src/containers/ExportModal/ExportModal.js

This file was deleted.

2 changes: 0 additions & 2 deletions ui/src/containers/ExportModal/exportmodal.css

This file was deleted.

20 changes: 10 additions & 10 deletions ui/src/containers/OrganisationHome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,65 +27,65 @@ const renderPage = (routeName) => {

if (testRoute('organisation.data.source')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Source')
loader: System.import('ui/pages/DataSourcePage')
}));
}

if (testRoute('organisation.data.statementForwarding')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/components/StatementForwarding')
loader: System.import('ui/pages/DataStatementForwardingPage')
}));
}

// People //

if (testRoute('organisation.people.imports')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Personas/PersonasImports')
loader: System.import('ui/pages/PeopleImportPage')
}));
}

if (testRoute('organisation.people.manage')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Personas/PersonaManage')
loader: System.import('ui/pages/PeopleManagePage')
}));
}

// Settings //

if (testRoute('organisation.settings.stores')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Stores')
loader: System.import('ui/pages/SettingsStoresPage')
}));
}

if (testRoute('organisation.settings.users')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Users')
loader: System.import('ui/pages/SettingsUsersPage')
}));
}

if (testRoute('organisation.settings.roles')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Roles')
loader: System.import('ui/pages/SettingsRolesPage')
}));
}

if (testRoute('organisation.settings.suborgs')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/SubOrgs')
loader: System.import('ui/pages/SettingsOrganisationsPage')
}));
}

if (testRoute('organisation.settings.clients')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Clients')
loader: System.import('ui/pages/SettingsClientsPage')
}));
}

if (testRoute('organisation.settings.apps')) {
return React.createElement(createAsyncComponent({
loader: System.import('ui/containers/Apps')
loader: System.import('ui/pages/SettingsAppsPage')
}));
}

Expand Down
35 changes: 0 additions & 35 deletions ui/src/containers/ProjectionInput/ArrayInput/ArrayInput.js

This file was deleted.

2 changes: 1 addition & 1 deletion ui/src/containers/Visualisations/VisualisationViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const VisualisationViewer = ({
case TEMPLATE_CURATR_ACTIVITIES_WITH_MOST_COMMENTS:
return <TemplateCuratrActivitiesWithMostComments visualisationId={visualisationId} showSourceView={showSourceView} />;
default:
console.error(`VisualisationViewer.js does not support type "${type}"`)
console.error(`VisualisationViewer.js does not support type "${type}"`);
return `Type "${type}" is not supported`;
}
};
Expand Down
2 changes: 1 addition & 1 deletion ui/src/containers/VisualiseForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const VisualiseForm = ({ model, orgTimezone }) => {
case TEMPLATE_CURATR_ACTIVITIES_WITH_MOST_COMMENTS:
return <TemplateCuratrActivitiesWithMostComments model={model} orgTimezone={orgTimezone} />;
default:
console.error(`VisualiseForm/index.js does not support type ${model.get('type')}`)
console.error(`VisualiseForm/index.js does not support type ${model.get('type')}`);
return `type "${model.get('type')}" is not supported.`;
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
import { Map } from 'immutable';
import { withProps, compose } from 'recompose';
import Spinner from 'ui/components/Spinner';
import DownloadListItem from 'ui/components/DownloadListItem';
import { withSchema } from 'ui/utils/hocs';
import DownloadListItem from './DownloadListItem';

class ExportDownloadManager extends Component {
static propTypes = {
Expand All @@ -21,9 +21,9 @@ class ExportDownloadManager extends Component {

return (
<div>
{ models.map((model, id) =>
{models.map((model, id) =>
<DownloadListItem key={id} model={model} deleteModel={this.props.deleteModel} />
).valueSeq() }
).valueSeq()}
</div>
);
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import withStyles from 'isomorphic-style-loader/lib/withStyles';
import { withProps, withState, compose } from 'recompose';
import { connect } from 'react-redux';
import { getDefaultProjectionFromType } from 'ui/redux/modules/exports';
import ProjectionInput from 'ui/containers/ProjectionInput';
import ExportOutputPreview from 'ui/containers/ExportOutputPreview';
import { withModel } from 'ui/utils/hocs';
import { downloadExport } from 'ui/redux/actions';
import ProjectionInput from './ProjectionInput';
import ExportOutputPreview from './ExportOutputPreview';
import styles from './styles.css';

const downloadRequestStates = {
Expand Down Expand Up @@ -68,12 +68,12 @@ class ExportForm extends Component {
postDownloadExport = () => {
this.props.setDownloadRequestStates(downloadRequestStates.waiting);
this.props.downloadExport({ exportId: this.props.id, pipelines: [this.getCompletePipeline()] })
.then(() => {
this.props.setDownloadRequestStates(downloadRequestStates.inqueue);
setTimeout(() => {
this.props.setDownloadRequestStates(downloadRequestStates.default);
}, 3000);
});
.then(() => {
this.props.setDownloadRequestStates(downloadRequestStates.inqueue);
setTimeout(() => {
this.props.setDownloadRequestStates(downloadRequestStates.default);
}, 3000);
});
}

getActiveProjection = () => {
Expand Down Expand Up @@ -149,7 +149,7 @@ class ExportForm extends Component {
]}
</div>
<button className="btn btn-default" onClick={this.toggleRaw}><i className="ion ion-code" /></button>
{ this.renderDownloadButton() }
{this.renderDownloadButton()}
</div>
);
}
Expand Down
File renamed without changes.
Loading

0 comments on commit dd66a52

Please sign in to comment.