mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Add admin folder to email plugin to majke the admin works (TEMPORARY FIX)
This commit is contained in:
parent
51194f28b5
commit
804adb93ef
@ -110,4 +110,4 @@
|
||||
"whatwg-fetch": "^2.0.3",
|
||||
"write-json-webpack-plugin": "^1.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
5
packages/strapi-plugin-email/admin/src/containers/App/actions.js
Executable file
5
packages/strapi-plugin-email/admin/src/containers/App/actions.js
Executable file
@ -0,0 +1,5 @@
|
||||
/*
|
||||
*
|
||||
* App actions
|
||||
*
|
||||
*/
|
||||
5
packages/strapi-plugin-email/admin/src/containers/App/constants.js
Executable file
5
packages/strapi-plugin-email/admin/src/containers/App/constants.js
Executable file
@ -0,0 +1,5 @@
|
||||
/*
|
||||
*
|
||||
* App constants
|
||||
*
|
||||
*/
|
||||
57
packages/strapi-plugin-email/admin/src/containers/App/index.js
Executable file
57
packages/strapi-plugin-email/admin/src/containers/App/index.js
Executable 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);
|
||||
18
packages/strapi-plugin-email/admin/src/containers/App/reducer.js
Executable file
18
packages/strapi-plugin-email/admin/src/containers/App/reducer.js
Executable 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;
|
||||
9
packages/strapi-plugin-email/admin/src/containers/App/selectors.js
Executable file
9
packages/strapi-plugin-email/admin/src/containers/App/selectors.js
Executable file
@ -0,0 +1,9 @@
|
||||
// import { createSelector } from 'reselect';
|
||||
|
||||
/**
|
||||
* Direct selector to the list state domain
|
||||
*/
|
||||
|
||||
// const selectGlobalDomain = () => state => state.get('global');
|
||||
|
||||
export {};
|
||||
13
packages/strapi-plugin-email/admin/src/containers/HomePage/actions.js
Executable file
13
packages/strapi-plugin-email/admin/src/containers/HomePage/actions.js
Executable file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
*
|
||||
* HomePage actions
|
||||
*
|
||||
*/
|
||||
|
||||
import { DEFAULT_ACTION } from './constants';
|
||||
|
||||
export function defaultAction() {
|
||||
return {
|
||||
type: DEFAULT_ACTION,
|
||||
};
|
||||
}
|
||||
7
packages/strapi-plugin-email/admin/src/containers/HomePage/constants.js
Executable file
7
packages/strapi-plugin-email/admin/src/containers/HomePage/constants.js
Executable file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
*
|
||||
* HomePage constants
|
||||
*
|
||||
*/
|
||||
|
||||
export const DEFAULT_ACTION = 'HomePage/DEFAULT_ACTION';
|
||||
65
packages/strapi-plugin-email/admin/src/containers/HomePage/index.js
Executable file
65
packages/strapi-plugin-email/admin/src/containers/HomePage/index.js
Executable 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));
|
||||
22
packages/strapi-plugin-email/admin/src/containers/HomePage/reducer.js
Executable file
22
packages/strapi-plugin-email/admin/src/containers/HomePage/reducer.js
Executable 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;
|
||||
9
packages/strapi-plugin-email/admin/src/containers/HomePage/saga.js
Executable file
9
packages/strapi-plugin-email/admin/src/containers/HomePage/saga.js
Executable 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;
|
||||
17
packages/strapi-plugin-email/admin/src/containers/HomePage/selectors.js
Executable file
17
packages/strapi-plugin-email/admin/src/containers/HomePage/selectors.js
Executable 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;
|
||||
3
packages/strapi-plugin-email/admin/src/containers/HomePage/styles.scss
Executable file
3
packages/strapi-plugin-email/admin/src/containers/HomePage/styles.scss
Executable file
@ -0,0 +1,3 @@
|
||||
.homePage {
|
||||
|
||||
}
|
||||
20
packages/strapi-plugin-email/admin/src/containers/NotFoundPage/index.js
Executable file
20
packages/strapi-plugin-email/admin/src/containers/NotFoundPage/index.js
Executable 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} />;
|
||||
}
|
||||
}
|
||||
1
packages/strapi-plugin-email/admin/src/translations/en.json
Executable file
1
packages/strapi-plugin-email/admin/src/translations/en.json
Executable file
@ -0,0 +1 @@
|
||||
{}
|
||||
1
packages/strapi-plugin-email/admin/src/translations/fr.json
Executable file
1
packages/strapi-plugin-email/admin/src/translations/fr.json
Executable file
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -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": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user