Add admin folder to email plugin to majke the admin works (TEMPORARY FIX)

This commit is contained in:
cyril lopez 2017-11-17 17:49:50 +01:00
parent 51194f28b5
commit 804adb93ef
18 changed files with 480 additions and 4 deletions

View File

@ -110,4 +110,4 @@
"whatwg-fetch": "^2.0.3",
"write-json-webpack-plugin": "^1.0.2"
}
}
}

View File

@ -0,0 +1,5 @@
/*
*
* App actions
*
*/

View File

@ -0,0 +1,5 @@
/*
*
* App constants
*
*/

View File

@ -0,0 +1,57 @@
/**
*
* This component is the skeleton around the actual pages, and should only
* contain code that should be seen on all pages. (e.g. navigation bar)
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { Switch, Route } from 'react-router-dom';
import { bindActionCreators, compose } from 'redux';
// Utils
import { pluginId } from 'app';
// Containers
import HomePage from 'containers/HomePage';
import NotFoundPage from 'containers/NotFoundPage';
class App extends React.Component {
render() {
return (
<div className={pluginId}>
<Switch>
<Route path={`/plugins/${pluginId}`} component={HomePage} exact />
<Route component={NotFoundPage} />
</Switch>
</div>
);
}
}
App.contextTypes = {
plugins: PropTypes.object,
router: PropTypes.object.isRequired,
updatePlugin: PropTypes.func,
};
App.propTypes = {};
export function mapDispatchToProps(dispatch) {
return bindActionCreators(
{},
dispatch,
);
}
const mapStateToProps = createStructuredSelector({});
// Wrap the component to inject dispatch and state into it
const withConnect = connect(mapStateToProps, mapDispatchToProps);
export default compose(
withConnect,
)(App);

View File

@ -0,0 +1,18 @@
/*
*
* App reducer
*
*/
import { fromJS } from 'immutable';
const initialState = fromJS({});
function appReducer(state = initialState, action) {
switch (action.type) {
default:
return state;
}
}
export default appReducer;

View File

@ -0,0 +1,9 @@
// import { createSelector } from 'reselect';
/**
* Direct selector to the list state domain
*/
// const selectGlobalDomain = () => state => state.get('global');
export {};

View File

@ -0,0 +1,13 @@
/*
*
* HomePage actions
*
*/
import { DEFAULT_ACTION } from './constants';
export function defaultAction() {
return {
type: DEFAULT_ACTION,
};
}

View File

@ -0,0 +1,7 @@
/*
*
* HomePage constants
*
*/
export const DEFAULT_ACTION = 'HomePage/DEFAULT_ACTION';

View File

@ -0,0 +1,65 @@
/*
*
* HomePage
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { injectIntl } from 'react-intl';
import { bindActionCreators, compose } from 'redux';
import injectReducer from 'utils/injectReducer';
import injectSaga from 'utils/injectSaga';
// Selectors
import selectHomePage from './selectors';
// Styles
import styles from './styles.scss';
import reducer from './reducer';
import saga from './saga';
export class HomePage extends React.Component {
render() {
return (
<div className={styles.homePage}>
</div>
);
}
}
HomePage.contextTypes = {
router: PropTypes.object,
};
HomePage.propTypes = {
// homePage: PropTypes.object,
};
function mapDispatchToProps(dispatch) {
return bindActionCreators(
{
// Your actions here
},
dispatch,
);
}
const mapStateToProps = createStructuredSelector({
homePage: selectHomePage(),
});
const withConnect = connect(mapStateToProps, mapDispatchToProps);
const withReducer = injectReducer({ key: 'homePage', reducer });
const withSaga = injectSaga({ key: 'homePage', saga });
export default compose(
withReducer,
withSaga,
withConnect,
)(injectIntl(HomePage));

View File

@ -0,0 +1,22 @@
/*
*
* HomePage reducer
*
*/
import { fromJS } from 'immutable';
import { DEFAULT_ACTION } from './constants';
const initialState = fromJS({});
function homePageReducer(state = initialState, action) {
switch (action.type) {
case DEFAULT_ACTION:
return state;
default:
return state;
}
}
export default homePageReducer;

View File

@ -0,0 +1,9 @@
// import { LOCATION_CHANGE } from 'react-router-redux';
// import { takeLatest, put, fork, take, cancel } from 'redux-saga/effects';
// Individual exports for testing
export function* defaultSaga() {
}
// All sagas to be loaded
export default defaultSaga;

View File

@ -0,0 +1,17 @@
import { createSelector } from 'reselect';
/**
* Direct selector to the homePage state domain
*/
const selectHomePageDomain = () => state => state.get('homePage');
/**
* Default selector used by HomePage
*/
const selectHomePage = () => createSelector(
selectHomePageDomain(),
(substate) => substate.toJS(),
);
export default selectHomePage;

View File

@ -0,0 +1,3 @@
.homePage {
}

View File

@ -0,0 +1,20 @@
/**
* NotFoundPage
*
* This is the page we show when the user visits a url that doesn't have a 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 NotFound from 'components/NotFound';
export default class NotFoundPage extends React.Component {
render() {
return <NotFound {...this.props} />;
}
}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{}

View File

@ -2,6 +2,230 @@
"0": {
"description": "",
"name": "",
"permissions": {}
"permissions": {
"content-manager": {
"controllers": {
"contentmanager": {
"models": {
"enabled": false,
"policy": ""
},
"find": {
"enabled": false,
"policy": ""
},
"count": {
"enabled": false,
"policy": ""
},
"findOne": {
"enabled": false,
"policy": ""
},
"create": {
"enabled": false,
"policy": ""
},
"update": {
"enabled": false,
"policy": ""
},
"delete": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
}
}
},
"content-type-builder": {
"controllers": {
"contenttypebuilder": {
"getModels": {
"enabled": false,
"policy": ""
},
"getModel": {
"enabled": false,
"policy": ""
},
"getConnections": {
"enabled": false,
"policy": ""
},
"createModel": {
"enabled": false,
"policy": ""
},
"updateModel": {
"enabled": false,
"policy": ""
},
"deleteModel": {
"enabled": false,
"policy": ""
},
"autoReload": {
"enabled": false,
"policy": ""
},
"checkTableExists": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
}
}
},
"settings-manager": {
"controllers": {
"settingsmanager": {
"menu": {
"enabled": false,
"policy": ""
},
"environments": {
"enabled": false,
"policy": ""
},
"languages": {
"enabled": false,
"policy": ""
},
"databases": {
"enabled": false,
"policy": ""
},
"database": {
"enabled": false,
"policy": ""
},
"databaseModel": {
"enabled": false,
"policy": ""
},
"get": {
"enabled": false,
"policy": ""
},
"update": {
"enabled": false,
"policy": ""
},
"createLanguage": {
"enabled": false,
"policy": ""
},
"deleteLanguage": {
"enabled": false,
"policy": ""
},
"createDatabase": {
"enabled": false,
"policy": ""
},
"updateDatabase": {
"enabled": false,
"policy": ""
},
"deleteDatabase": {
"enabled": false,
"policy": ""
},
"autoReload": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
}
}
},
"users-permissions": {
"controllers": {
"auth": {
"callback": {
"enabled": false,
"policy": ""
},
"register": {
"enabled": false,
"policy": ""
},
"forgotPassword": {
"enabled": false,
"policy": ""
},
"changePassword": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
},
"user": {
"find": {
"enabled": false,
"policy": ""
},
"findOne": {
"enabled": false,
"policy": ""
},
"create": {
"enabled": false,
"policy": ""
},
"update": {
"enabled": false,
"policy": ""
},
"destroy": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
},
"userspermissions": {
"getPermissions": {
"enabled": false,
"policy": ""
},
"getRole": {
"enabled": false,
"policy": ""
},
"index": {
"enabled": false,
"policy": ""
},
"init": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
}
}
},
"toto": {
"controllers": {}
}
}
}
}
}

View File

@ -20,7 +20,7 @@ module.exports = {
return acc;
}, {}));
const appControllers = Object.keys(strapi.api).reduce((acc, key) => {
const appControllers = Object.keys(strapi.api || {}).reduce((acc, key) => {
acc.controllers[key] = generateActions(strapi.api[key].controllers[key]);
return acc;