mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
Harmonize pluginId between plugins
This commit is contained in:
parent
85774b2f51
commit
9e1084ed04
@ -12,6 +12,7 @@ import { createStructuredSelector } from 'reselect';
|
||||
import PropTypes from 'prop-types';
|
||||
import { isEmpty, get } from 'lodash';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
import getQueryParameters from 'utils/getQueryParameters';
|
||||
|
||||
@ -93,8 +94,8 @@ const mapStateToProps = createStructuredSelector({
|
||||
});
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId: 'content-manager' });
|
||||
const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId: 'content-manager' });
|
||||
const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import pluginId from 'pluginId';
|
||||
/**
|
||||
* Direct selector to the list state domain
|
||||
*/
|
||||
const selectGlobalDomain = () => state => state.get('content-manager-global');
|
||||
const selectGlobalDomain = () => state => state.get(`${pluginId}-global`);
|
||||
|
||||
/**
|
||||
* Other specific selectors
|
||||
|
||||
@ -23,6 +23,7 @@ import {
|
||||
import HTML5Backend from 'react-dnd-html5-backend';
|
||||
import { DragDropContext } from 'react-dnd';
|
||||
import cn from 'classnames';
|
||||
import pluginId from 'pluginId';
|
||||
// You can find these components in either
|
||||
// ./node_modules/strapi-helper-plugin/lib/src
|
||||
// or strapi/packages/strapi-helper-plugin/lib/src
|
||||
@ -600,8 +601,8 @@ const withConnect = connect(
|
||||
mapDispatchToProps,
|
||||
);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'editPage', reducer, pluginId: 'content-manager' });
|
||||
const withSaga = strapi.injectSaga({ key: 'editPage', saga, pluginId: 'content-manager' });
|
||||
const withReducer = strapi.injectReducer({ key: 'editPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'editPage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -5,11 +5,12 @@
|
||||
*/
|
||||
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the listPage state domain
|
||||
*/
|
||||
const selectEditPageDomain = () => state => state.get('content-manager-editPage');
|
||||
const selectEditPageDomain = () => state => state.get(`${pluginId}-editPage`);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Home
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import PluginHeader from 'components/PluginHeader';
|
||||
|
||||
import styles from './styles.scss';
|
||||
|
||||
export class Home extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<div className={`container-fluid ${styles.containerFluid}`}>
|
||||
<PluginHeader
|
||||
title={{
|
||||
id: 'content-manager.containers.Home.pluginHeaderTitle',
|
||||
}}
|
||||
description={{
|
||||
id: 'content-manager.containers.Home.pluginHeaderDescription',
|
||||
}}
|
||||
actions={[]}
|
||||
/>
|
||||
<p>
|
||||
<FormattedMessage id="content-manager.containers.Home.introduction" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Home.propTypes = {};
|
||||
|
||||
export function mapDispatchToProps() {
|
||||
return {};
|
||||
}
|
||||
|
||||
const mapStateToProps = createStructuredSelector({});
|
||||
|
||||
// Wrap the component to inject dispatch and state into it
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Home);
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"pluginHeaderDescription": {
|
||||
"id": "contentManager.containers.Home.pluginHeaderDescription",
|
||||
"defaultMessage": "A powerful UI to easily manage your data."
|
||||
},
|
||||
"introduction": {
|
||||
"id": "contentManager.containers.Home.introduction",
|
||||
"defaultMessage": "To edit your content's entries go to the specific link in the left menu."
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
/**
|
||||
* styles.scss
|
||||
*
|
||||
* Home container styles
|
||||
*/
|
||||
|
||||
.containerFluid { /* stylelint-disable */
|
||||
padding: 18px 30px;
|
||||
|
||||
p {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding-bottom: 14px;
|
||||
line-height: 18px;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
@ -13,6 +13,7 @@ import { capitalize, findIndex, get, isUndefined, toInteger, upperFirst } from '
|
||||
import { ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import cn from 'classnames';
|
||||
import pluginId from 'pluginId';
|
||||
// App selectors
|
||||
import { makeSelectSchema } from 'containers/App/selectors';
|
||||
// You can find these components in either
|
||||
@ -679,7 +680,7 @@ const mapStateToProps = createStructuredSelector({
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'listPage', reducer, pluginId: 'content-manager' });
|
||||
const withSaga = strapi.injectSaga({ key: 'listPage', saga, pluginId: 'content-manager' });
|
||||
const withReducer = strapi.injectReducer({ key: 'listPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'listPage', saga, pluginId });
|
||||
|
||||
export default compose(withReducer, withSaga, withConnect)(ListPage);
|
||||
|
||||
@ -5,11 +5,12 @@
|
||||
*/
|
||||
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the listPage state domain
|
||||
*/
|
||||
const selectListPageDomain = () => state => state.get('content-manager-listPage');
|
||||
const selectListPageDomain = () => state => state.get(`${pluginId}-listPage`);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -14,6 +14,7 @@ import { DragDropContext } from 'react-dnd';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
||||
import PropTypes from 'prop-types';
|
||||
import pluginId from 'pluginId';
|
||||
import {
|
||||
beginMove,
|
||||
endMove,
|
||||
@ -1158,8 +1159,8 @@ const withConnect = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
);
|
||||
const withReducer = strapi.injectReducer({ key: 'settingPage', reducer, pluginId: 'content-manager' });
|
||||
const withSaga = strapi.injectSaga({ key: 'settingPage', saga, pluginId: 'content-manager' });
|
||||
const withReducer = strapi.injectReducer({ key: 'settingPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'settingPage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -4,11 +4,12 @@
|
||||
*/
|
||||
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the settingPage state domain
|
||||
*/
|
||||
const selectSettingPageDomain = () => state => state.get('content-manager-settingPage');
|
||||
const selectSettingPageDomain = () => state => state.get(`${pluginId}-settingPage`);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -10,6 +10,7 @@ import { createStructuredSelector } from 'reselect';
|
||||
import cn from 'classnames';
|
||||
import { get, sortBy } from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import pluginId from 'pluginId';
|
||||
import { onChange, onSubmit, onReset } from 'containers/App/actions';
|
||||
import { makeSelectModifiedSchema, makeSelectSubmitSuccess } from 'containers/App/selectors';
|
||||
import Input from 'components/InputsIndex';
|
||||
@ -209,8 +210,8 @@ const mapStateToProps = createStructuredSelector({
|
||||
submitSuccess: makeSelectSubmitSuccess(),
|
||||
});
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
const withReducer = strapi.injectReducer({ key: 'settingsPage', reducer, pluginId: 'content-manager' });
|
||||
const withSaga = strapi.injectSaga({ key: 'settingsPage', saga, pluginId: 'content-manager' });
|
||||
const withReducer = strapi.injectReducer({ key: 'settingsPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'settingsPage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -4,11 +4,12 @@
|
||||
*/
|
||||
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the settingsPage state domain
|
||||
*/
|
||||
const selectSettingsPageDomain = () => state => state.get('content-manager-settingsPage');
|
||||
const selectSettingsPageDomain = () => state => state.get(`${pluginId}-settingsPage`);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
const pluginPkg = require('../../package.json');
|
||||
const pluginId = pluginPkg.name.replace(
|
||||
/^strapi-plugin-/i,
|
||||
''
|
||||
);
|
||||
|
||||
module.exports = pluginId;
|
||||
@ -12,7 +12,7 @@ import { bindActionCreators, compose } from 'redux';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
import { Switch, Route, withRouter } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { pluginId } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
import HomePage from 'containers/HomePage';
|
||||
import ModelPage from 'containers/ModelPage';
|
||||
@ -93,10 +93,10 @@ const mapStateToProps = createStructuredSelector({
|
||||
});
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId: 'content-type-builder' });
|
||||
const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId: 'content-type-builder' });
|
||||
const withFormReducer = strapi.injectReducer({ key: 'form', reducer: formReducer, pluginId: 'content-type-builder' });
|
||||
const withFormSaga = strapi.injectSaga({ key: 'form', saga: formSaga, pluginId: 'content-type-builder' });
|
||||
const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId });
|
||||
const withFormReducer = strapi.injectReducer({ key: 'form', reducer: formReducer, pluginId });
|
||||
const withFormSaga = strapi.injectSaga({ key: 'form', saga: formSaga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the list state domain
|
||||
*/
|
||||
|
||||
const selectGlobalDomain = () => state => state.get('content-type-builder-global');
|
||||
const selectGlobalDomain = () => state => state.get(`${pluginId}-global`);
|
||||
|
||||
const makeSelectLoading = () => createSelector(
|
||||
selectGlobalDomain(),
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the form state domain
|
||||
*/
|
||||
const selectFormDomain = () => state => state.get('content-type-builder-form');
|
||||
const selectFormDomain = () => state => state.get(`${pluginId}-form`);
|
||||
|
||||
/**
|
||||
* Other specific selectors
|
||||
|
||||
@ -12,6 +12,7 @@ import { size } from 'lodash';
|
||||
import Helmet from 'react-helmet';
|
||||
import PropTypes from 'prop-types';
|
||||
import { router } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
import { makeSelectLoading, makeSelectMenu, makeSelectModels } from 'containers/App/selectors';
|
||||
import { deleteContentType } from 'containers/App/actions';
|
||||
@ -139,8 +140,8 @@ function mapDispatchToProps(dispatch) {
|
||||
}
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId: 'content-type-builder' });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId: 'content-type-builder' });
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the homePage state domain
|
||||
*/
|
||||
const selectHomePageDomain = () => state => state.get('content-type-builder-homePage');
|
||||
const selectHomePageDomain = () => state => state.get(`${pluginId}-homePage`);
|
||||
|
||||
/**
|
||||
* Other specific selectors
|
||||
|
||||
@ -13,6 +13,7 @@ import { FormattedMessage } from 'react-intl';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { router } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
// Global selectors
|
||||
import { makeSelectMenu } from 'containers/App/selectors';
|
||||
import { makeSelectContentTypeUpdated } from 'containers/Form/selectors';
|
||||
@ -353,8 +354,8 @@ function mapDispatchToProps(dispatch) {
|
||||
}
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
const withSaga = strapi.injectSaga({ key: 'modelPage', saga, pluginId: 'content-type-builder' });
|
||||
const withReducer = strapi.injectReducer({ key: 'modelPage', reducer, pluginId: 'content-type-builder' });
|
||||
const withSaga = strapi.injectSaga({ key: 'modelPage', saga, pluginId });
|
||||
const withReducer = strapi.injectReducer({ key: 'modelPage', reducer, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the modelPage state domain
|
||||
*/
|
||||
const selectModelPageDomain = () => state => state.get('content-type-builder-modelPage');
|
||||
const selectModelPageDomain = () => state => state.get(`${pluginId}-modelPage`);
|
||||
|
||||
/**
|
||||
* Other specific selectors
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
const pluginPkg = require('../../package.json');
|
||||
const pluginId = pluginPkg.name.replace(
|
||||
/^strapi-plugin-/i,
|
||||
''
|
||||
);
|
||||
|
||||
module.exports = pluginId;
|
||||
@ -8,7 +8,7 @@
|
||||
import React from 'react';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
// Utils
|
||||
import { pluginId } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
// Containers
|
||||
import HomePage from 'containers/HomePage';
|
||||
import NotFoundPage from 'containers/NotFoundPage';
|
||||
|
||||
@ -12,6 +12,7 @@ import { CopyToClipboard } from 'react-copy-to-clipboard';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
import { get, isEmpty } from 'lodash';
|
||||
import cn from 'classnames';
|
||||
import pluginId from 'pluginId';
|
||||
// Components
|
||||
import PluginHeader from 'components/PluginHeader';
|
||||
import PopUpWarning from 'components/PopUpWarning';
|
||||
@ -19,7 +20,6 @@ import Block from 'components/Block';
|
||||
import Row from 'components/Row';
|
||||
import LoadingIndicatorPage from 'components/LoadingIndicatorPage';
|
||||
import Input from 'components/InputsIndex';
|
||||
import { pluginId } from 'app';
|
||||
// Utils
|
||||
import auth from 'utils/auth';
|
||||
import openWithNewTab from 'utils/openWithNewTab';
|
||||
@ -243,8 +243,8 @@ const withConnect = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
);
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId: 'documentation' });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId: 'documentation' });
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the homePage state domain
|
||||
*/
|
||||
const selectHomePageDomain = () => state => state.get('documentation-homePage');
|
||||
const selectHomePageDomain = () => state => state.get(`${pluginId}-homePage`);
|
||||
|
||||
/**
|
||||
* Default selector used by HomePage
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
const pluginPkg = require('../../package.json');
|
||||
const pluginId = pluginPkg.name.replace(
|
||||
/^strapi-plugin-/i,
|
||||
''
|
||||
);
|
||||
|
||||
module.exports = pluginId;
|
||||
@ -7,9 +7,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
|
||||
// Utils
|
||||
import { pluginId } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// Containers
|
||||
import ConfigPage from 'containers/ConfigPage';
|
||||
|
||||
@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
import { findIndex, get, isEmpty } from 'lodash';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// You can find these components in either
|
||||
// ./node_modules/strapi-helper-plugin/lib/src
|
||||
@ -174,8 +175,8 @@ const mapStateToProps = selectConfigPage();
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'configPage', reducer, pluginId: 'email' });
|
||||
const withSaga = strapi.injectSaga({ key: 'configPage', saga, pluginId: 'email' });
|
||||
const withReducer = strapi.injectReducer({ key: 'configPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'configPage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the configPage state domain
|
||||
*/
|
||||
const selectConfigPageDomain = () => state => state.get('email-configPage');
|
||||
const selectConfigPageDomain = () => state => state.get(`${pluginId}-configPage`);
|
||||
|
||||
/**
|
||||
* Default selector used by ConfigPage
|
||||
|
||||
7
packages/strapi-plugin-email/admin/src/pluginId.js
Normal file
7
packages/strapi-plugin-email/admin/src/pluginId.js
Normal file
@ -0,0 +1,7 @@
|
||||
const pluginPkg = require('../../package.json');
|
||||
const pluginId = pluginPkg.name.replace(
|
||||
/^strapi-plugin-/i,
|
||||
''
|
||||
);
|
||||
|
||||
module.exports = pluginId;
|
||||
@ -14,7 +14,7 @@ import 'flag-icon-css/css/flag-icon.css';
|
||||
import 'react-select/dist/react-select.css';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { pluginId } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
import HomePage from 'containers/HomePage';
|
||||
|
||||
@ -94,8 +94,8 @@ const mapStateToProps = createStructuredSelector({
|
||||
// Wrap the component to inject dispatch and state into it
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId: 'settings-manager' });
|
||||
const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId: 'settings-manager' });
|
||||
const withReducer = strapi.injectReducer({ key: 'global', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'global', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the list state domain
|
||||
*/
|
||||
|
||||
const selectGlobalDomain = () => state => state.get('settings-manager-global');
|
||||
const selectGlobalDomain = () => state => state.get(`${pluginId}-global`);
|
||||
|
||||
const selectLocationState = () => {
|
||||
let prevRoutingState;
|
||||
|
||||
@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
import {
|
||||
endsWith,
|
||||
@ -562,8 +563,8 @@ HomePage.propTypes = {
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId: 'settings-manager' });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId: 'settings-manager' });
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the home state domain
|
||||
*/
|
||||
const selectHomePageDomain = () => state => state.get('settings-manager-homePage');
|
||||
const selectHomePageDomain = () => state => state.get(`${pluginId}-homePage`);
|
||||
|
||||
/**
|
||||
* Other specific selectors
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
const pluginPkg = require('../../package.json');
|
||||
const pluginId = pluginPkg.name.replace(
|
||||
/^strapi-plugin-/i,
|
||||
''
|
||||
);
|
||||
|
||||
module.exports = pluginId;
|
||||
@ -8,8 +8,7 @@
|
||||
import React from 'react';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
|
||||
// Utils
|
||||
import { pluginId } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// Containers
|
||||
import ConfigPage from 'containers/ConfigPage';
|
||||
|
||||
@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
import { findIndex, get, isEmpty } from 'lodash';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// You can find these components in either
|
||||
// ./node_modules/strapi-helper-plugin/lib/src
|
||||
@ -174,8 +175,8 @@ const mapStateToProps = selectConfigPage();
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'configPage', reducer, pluginId: 'upload' });
|
||||
const withSaga = strapi.injectSaga({ key: 'configPage', saga, pluginId: 'upload' });
|
||||
const withReducer = strapi.injectReducer({ key: 'configPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'configPage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the configPage state domain
|
||||
*/
|
||||
const selectConfigPageDomain = () => state => state.get('upload-configPage');
|
||||
const selectConfigPageDomain = () => state => state.get(`${pluginId}-configPage`);
|
||||
|
||||
/**
|
||||
* Default selector used by ConfigPage
|
||||
|
||||
@ -11,6 +11,7 @@ import { connect } from 'react-redux';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
import { isEmpty } from 'lodash';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// You can find these components in either
|
||||
// ./node_modules/strapi-helper-plugin/lib/src
|
||||
@ -219,8 +220,8 @@ const mapStateToProps = selectHomePage();
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId: 'upload' });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId: 'upload' });
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the homePage state domain
|
||||
*/
|
||||
const selectHomePageDomain = () => state => state.get('upload-homePage');
|
||||
const selectHomePageDomain = () => state => state.get(`${pluginId}-homePage`);
|
||||
|
||||
/**
|
||||
* Default selector used by HomePage
|
||||
|
||||
7
packages/strapi-plugin-upload/admin/src/pluginId.js
Normal file
7
packages/strapi-plugin-upload/admin/src/pluginId.js
Normal file
@ -0,0 +1,7 @@
|
||||
const pluginPkg = require('../../package.json');
|
||||
const pluginId = pluginPkg.name.replace(
|
||||
/^strapi-plugin-/i,
|
||||
''
|
||||
);
|
||||
|
||||
module.exports = pluginId;
|
||||
@ -7,12 +7,8 @@
|
||||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
// import { connect } from 'react-redux';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
// import { bindActionCreators, compose } from 'redux';
|
||||
|
||||
// Utils
|
||||
import { pluginId } from 'app';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// Containers
|
||||
import AuthPage from 'containers/AuthPage';
|
||||
@ -58,17 +54,4 @@ App.propTypes = {
|
||||
location: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
// export function mapDispatchToProps(dispatch) {
|
||||
// return bindActionCreators(
|
||||
// {},
|
||||
// dispatch,
|
||||
// );
|
||||
// }
|
||||
|
||||
// Wrap the component to inject dispatch and state into it
|
||||
// const withConnect = connect(null, mapDispatchToProps);
|
||||
export default App;
|
||||
|
||||
// export default compose(
|
||||
// withConnect,
|
||||
// )(App);
|
||||
|
||||
@ -12,6 +12,7 @@ import { Link } from 'react-router-dom';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { findIndex, get, isBoolean, isEmpty, map, replace } from 'lodash';
|
||||
import cn from 'classnames';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// Logo
|
||||
import LogoStrapi from 'assets/images/logo_strapi.png';
|
||||
@ -326,8 +327,8 @@ function mapDispatchToProps(dispatch) {
|
||||
}
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
const withReducer = strapi.injectReducer({ key: 'authPage', reducer, pluginId: 'users-permissions' });
|
||||
const withSaga = strapi.injectSaga({ key: 'authPage', saga, pluginId: 'users-permissions' });
|
||||
const withReducer = strapi.injectReducer({ key: 'authPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'authPage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the authPage state domain
|
||||
*/
|
||||
const selectAuthPageDomain = () => (state) => state.get('users-permissions-authPage');
|
||||
const selectAuthPageDomain = () => (state) => state.get(`${pluginId}-authPage`);
|
||||
|
||||
/**
|
||||
* Default selector used by AuthPage
|
||||
|
||||
@ -12,6 +12,7 @@ import { bindActionCreators, compose } from 'redux';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { findIndex, get, isEmpty, isEqual, size } from 'lodash';
|
||||
import cn from 'classnames';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// Design
|
||||
import BackHeader from 'components/BackHeader';
|
||||
@ -323,8 +324,8 @@ function mapDispatchToProps(dispatch) {
|
||||
}
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
const withReducer = strapi.injectReducer({ key: 'editPage', reducer, pluginId: 'users-permissions'});
|
||||
const withSaga = strapi.injectSaga({ key: 'editPage', saga, pluginId: 'users-permissions' });
|
||||
const withReducer = strapi.injectReducer({ key: 'editPage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'editPage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the editPage state domain
|
||||
*/
|
||||
const selectEditPageDomain = () => (state) => state.get('users-permissions-editPage');
|
||||
const selectEditPageDomain = () => (state) => state.get(`${pluginId}-editPage`);
|
||||
|
||||
/**
|
||||
* Default selector used by EditPage
|
||||
|
||||
@ -11,6 +11,7 @@ import { injectIntl } from 'react-intl';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
import cn from 'classnames';
|
||||
import { clone, get, includes, isEqual, isEmpty } from 'lodash';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
// Design
|
||||
import EditForm from 'components/EditForm';
|
||||
@ -275,9 +276,8 @@ function mapDispatchToProps(dispatch) {
|
||||
const mapStateToProps = selectHomePage();
|
||||
|
||||
const withConnect = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId: 'users-permissions' });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId: 'users-permissions' });
|
||||
const withReducer = strapi.injectReducer({ key: 'homePage', reducer, pluginId });
|
||||
const withSaga = strapi.injectSaga({ key: 'homePage', saga, pluginId });
|
||||
|
||||
export default compose(
|
||||
withReducer,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import pluginId from 'pluginId';
|
||||
|
||||
/**
|
||||
* Direct selector to the homePage state domain
|
||||
*/
|
||||
const selectHomePageDomain = () => state => state.get('users-permissions-homePage');
|
||||
const selectHomePageDomain = () => state => state.get(`${pluginId}-homePage`);
|
||||
|
||||
/**
|
||||
* Default selector used by HomePage
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
const pluginPkg = require('../../package.json');
|
||||
const pluginId = pluginPkg.name.replace(
|
||||
/^strapi-plugin-/i,
|
||||
''
|
||||
);
|
||||
|
||||
module.exports = pluginId;
|
||||
Loading…
x
Reference in New Issue
Block a user