strapi-plugin-content-manager
Advanced tools
Comparing version 3.0.0-alpha.4.8 to 3.0.0-alpha.5
@@ -11,8 +11,4 @@ /** | ||
import { define } from 'i18n'; | ||
import messages from './messages.json'; | ||
import styles from './styles.scss'; | ||
define(messages); | ||
@@ -51,3 +47,4 @@ class LimitSelect extends React.Component { | ||
<label className={styles.label} htmlFor={id}> | ||
<FormattedMessage {...messages.itemsPerPage} />:</label> | ||
<FormattedMessage id="content-manager.components.LimitSelect.itemsPerPage" />: | ||
</label> | ||
<div className={styles.selectWrapper}> | ||
@@ -54,0 +51,0 @@ <select |
import _ from 'lodash'; | ||
import { takeLatest } from 'redux-saga'; | ||
import { fork, put, select } from 'redux-saga/effects'; | ||
import { fork, put, select, call } from 'redux-saga/effects'; | ||
import request from 'utils/request'; | ||
import { generateSchema } from 'utils/schema'; | ||
@@ -14,14 +15,8 @@ | ||
try { | ||
const opts = { | ||
method: 'GET', | ||
mode: 'cors', | ||
cache: 'default', | ||
}; | ||
const response = yield fetch( | ||
'/content-manager/models', | ||
opts | ||
); | ||
const data = yield response.json(); | ||
const response = yield call(request, | ||
`${window.Strapi.apiUrl}/content-manager/models`, { | ||
method: 'GET', | ||
}); | ||
yield put(loadedModels(data)); | ||
yield put(loadedModels(response)); | ||
} catch (err) { | ||
@@ -55,9 +50,12 @@ window.Strapi.notification.error( | ||
// Map links to format them | ||
const leftMenuLinks = _.map(displayedModels, (model, key) => ({ | ||
label: model.labelPlural || model.label || key, | ||
to: key, | ||
})); | ||
const leftMenuSections = [{ | ||
name: 'Content Types', | ||
links: _.map(displayedModels, (model, key) => ({ | ||
label: model.labelPlural || model.label || key, | ||
destination: key, | ||
})), | ||
}]; | ||
// Update the admin left menu links | ||
window.Strapi.refresh('content-manager').leftMenuLinks(leftMenuLinks); | ||
window.Strapi.refresh('content-manager').leftMenuSections(leftMenuSections); | ||
} | ||
@@ -73,2 +71,2 @@ | ||
// All sagas to be loaded | ||
export default [defaultSaga]; | ||
export default [defaultSaga]; |
@@ -13,3 +13,2 @@ /* | ||
import { router } from 'app'; | ||
import { define } from 'i18n'; | ||
@@ -38,7 +37,3 @@ import Container from 'components/Container'; | ||
} from './selectors'; | ||
import messages from './messages.json'; | ||
define(messages); | ||
export class Edit extends React.Component { | ||
@@ -86,3 +81,3 @@ componentWillMount() { | ||
{ | ||
label: messages.cancel, | ||
label: 'content-manager.containers.Edit.cancel', | ||
class: 'btn-default', | ||
@@ -94,3 +89,3 @@ onClick: () => { | ||
{ | ||
label: this.props.editing ? messages.editing : messages.submit, | ||
label: this.props.editing ? 'content-manager.containers.Edit.editing' : 'content-manager.containers.Edit.submit', | ||
class: 'btn-primary', | ||
@@ -105,3 +100,3 @@ onClick: this.props.editRecord, | ||
pluginHeaderActions.push({ | ||
label: messages.delete, | ||
label: 'content-manager.containers.Edit.delete', | ||
class: 'btn-danger', | ||
@@ -123,6 +118,3 @@ onClick: this.props.deleteRecord, | ||
<PluginHeader | ||
title={{ | ||
id: 'plugin-content-manager-title', | ||
defaultMessage: `${pluginHeaderTitle}`, | ||
}} | ||
title={pluginHeaderTitle} | ||
description={{ | ||
@@ -129,0 +121,0 @@ id: 'plugin-content-manager-description', |
@@ -26,10 +26,10 @@ import { takeLatest } from 'redux-saga'; | ||
try { | ||
const requestUrl = `/content-manager/explorer/${currentModelName}/${params.id}`; | ||
const requestUrl = `${window.Strapi.apiUrl}/content-manager/explorer/${currentModelName}/${params.id}`; | ||
// Call our request helper (see 'utils/request') | ||
const data = yield call(request, requestUrl, { | ||
const response = yield call(request, requestUrl, { | ||
method: 'GET', | ||
}); | ||
yield put(recordLoaded(data)); | ||
yield put(recordLoaded(response)); | ||
} catch (err) { | ||
@@ -49,3 +49,3 @@ window.Strapi.notification.error('An error occurred during record fetch.'); | ||
try { | ||
const requestUrl = `/content-manager/explorer/${currentModelName}/${id}`; | ||
const requestUrl = `${window.Strapi.apiUrl}/content-manager/explorer/${currentModelName}/${id}`; | ||
@@ -76,3 +76,3 @@ // Call our request helper (see 'utils/request') | ||
try { | ||
const requestUrl = `/content-manager/explorer/${currentModelName}/${recordJSON.id}`; | ||
const requestUrl = `${window.Strapi.apiUrl}/content-manager/explorer/${currentModelName}/${recordJSON.id}`; | ||
@@ -116,2 +116,2 @@ // Call our request helper (see 'utils/request') | ||
// All sagas to be loaded | ||
export default [defaultSaga]; | ||
export default [defaultSaga]; |
@@ -10,11 +10,6 @@ /* | ||
import { define } from 'i18n'; | ||
import Container from 'components/Container'; | ||
import messages from './messages.json'; | ||
import styles from './styles.scss'; | ||
define(messages); | ||
export class Home extends React.Component { | ||
@@ -28,11 +23,10 @@ render() { | ||
<PluginHeader | ||
title={{ | ||
id: 'plugin-content-manager-title', | ||
defaultMessage: 'Content Manager', | ||
title="Content Manager" | ||
description={{ | ||
id: 'content-manager.containers.Home.pluginHeaderDescription', | ||
}} | ||
description={messages.pluginHeaderDescription} | ||
/> | ||
<Container> | ||
<p> | ||
<FormattedMessage {...messages.introduction} /> | ||
<FormattedMessage id="content-manager.containers.Home.introduction" /> | ||
</p> | ||
@@ -39,0 +33,0 @@ </Container> |
@@ -11,3 +11,2 @@ /* | ||
import _ from 'lodash'; | ||
import { define } from 'i18n'; | ||
@@ -39,6 +38,3 @@ import { makeSelectModels, makeSelectSchema } from 'containers/App/selectors'; | ||
} from './selectors'; | ||
import messages from './messages.json'; | ||
define(messages); | ||
export class List extends React.Component { | ||
@@ -122,3 +118,3 @@ componentWillMount() { | ||
{ | ||
label: messages.addAnEntry, | ||
label: 'content-manager.containers.List.addAnEntry', | ||
class: 'btn-primary', | ||
@@ -131,5 +127,2 @@ onClick: () => this.context.router.push(this.addRoute), | ||
const pluginHeaderTitle = this.props.schema[this.props.currentModelName].label || 'Content Manager'; | ||
messages.pluginHeaderDescription.values = { | ||
label: this.props.schema[this.props.currentModelName].labelPlural.toLowerCase(), | ||
}; | ||
@@ -140,7 +133,9 @@ return ( | ||
<PluginHeader | ||
title={{ | ||
id: 'plugin-content-manager-title', | ||
defaultMessage: `${pluginHeaderTitle}`, | ||
title={pluginHeaderTitle} | ||
description={{ | ||
id: 'content-manager.containers.List.pluginHeaderDescription', | ||
values: { | ||
label: this.props.schema[this.props.currentModelName].labelPlural.toLowerCase(), | ||
}, | ||
}} | ||
description={messages.pluginHeaderDescription} | ||
actions={pluginHeaderActions} | ||
@@ -147,0 +142,0 @@ /> |
@@ -33,6 +33,6 @@ import { takeLatest } from 'redux-saga'; | ||
try { | ||
const requestUrl = `/content-manager/explorer/${currentModel}`; | ||
const requestUrl = `${window.Strapi.apiUrl}/content-manager/explorer/${currentModel}`; | ||
// Call our request helper (see 'utils/request') | ||
const data = yield call(request, requestUrl, { | ||
const response = yield call(request, requestUrl, { | ||
method: 'GET', | ||
@@ -42,3 +42,3 @@ params, | ||
yield put(loadedRecord(data)); | ||
yield put(loadedRecord(response)); | ||
} catch (err) { | ||
@@ -53,15 +53,8 @@ window.Strapi.notification.error('An error occurred during records fetch.'); | ||
try { | ||
const opts = { | ||
method: 'GET', | ||
mode: 'cors', | ||
cache: 'default', | ||
}; | ||
const response = yield fetch( | ||
`/content-manager/explorer/${currentModel}/count`, | ||
opts | ||
const response = yield call( | ||
request, | ||
`${window.Strapi.apiUrl}/content-manager/explorer/${currentModel}/count`, | ||
); | ||
const data = yield response.json(); | ||
yield put(loadedCount(data.count)); | ||
yield put(loadedCount(response.count)); | ||
} catch (err) { | ||
@@ -86,2 +79,2 @@ window.Strapi.notification.error( | ||
// All sagas to be loaded | ||
export default [defaultSaga]; | ||
export default [defaultSaga]; |
@@ -15,4 +15,2 @@ /** | ||
import messages from './messages'; | ||
export default class NotFound extends React.Component { | ||
@@ -24,3 +22,3 @@ render() { | ||
<h1> | ||
<FormattedMessage {...messages.pageNotFound} /> | ||
<FormattedMessage id="pageNotFound" /> | ||
</h1> | ||
@@ -27,0 +25,0 @@ </div> |
{ | ||
"/": { | ||
"name": "home", | ||
"container": "Home" | ||
}, | ||
"/:slug": { | ||
"name": "list", | ||
"container": "List" | ||
}, | ||
"/:slug/:id": { | ||
"name": "edit", | ||
"container": "Edit" | ||
} | ||
} |
@@ -1,1 +0,13 @@ | ||
{} | ||
{ | ||
"containers.Home.introduction": "A powerful UI to easily manage your data.", | ||
"containers.Home.pluginHeaderDescription": "To edit your content's entries go to the specific link in the left menu.", | ||
"containers.Edit.submit": "Submit", | ||
"containers.Edit.editing": "Editing...", | ||
"containers.Edit.delete": "Delete", | ||
"containers.Edit.cancel": "Cancel", | ||
"containers.List.addAnEntry": "Add an entry", | ||
"containers.List.pluginHeaderDescription": "Manage your {label}", | ||
"components.LimitSelect.itemsPerPage": "Number of items per page", | ||
"containers.List.errorFetchRecords": "Error", | ||
"pageNotFound": "Page not found" | ||
} |
{ | ||
"contentManager.containers.Home.introduction": "Pour éditer du contenu, choisissez un type de données dans le menu de gauche.", | ||
"contentManager.containers.Home.pluginHeaderDescription": "Un outil complet pour gérer facilement vos données.", | ||
"contentManager.containers.Edit.submit": "Valider", | ||
"contentManager.containers.Edit.editing": "Édition en cours...", | ||
"contentManager.containers.Edit.delete": "Supprimer", | ||
"contentManager.containers.Edit.cancel": "Annuler", | ||
"contentManager.containers.List.addAnEntry": "Ajouter une entrée", | ||
"contentManager.containers.List.pluginHeaderDescription": "Gérér vos {label}", | ||
"contentManager.components.LimitSelect.itemsPerPage": "Nombre d'éléments par page", | ||
"contentManager.containers.List.errorFetchRecords": "Erreur" | ||
"containers.Home.introduction": "Pour éditer du contenu, choisissez un type de données dans le menu de gauche.", | ||
"containers.Home.pluginHeaderDescription": "Un outil complet pour gérer facilement vos données.", | ||
"containers.Edit.submit": "Valider", | ||
"containers.Edit.editing": "Édition en cours...", | ||
"containers.Edit.delete": "Supprimer", | ||
"containers.Edit.cancel": "Annuler", | ||
"containers.List.addAnEntry": "Ajouter une entrée", | ||
"containers.List.pluginHeaderDescription": "Gérér vos {label}", | ||
"components.LimitSelect.itemsPerPage": "Nombre d'éléments par page", | ||
"containers.List.errorFetchRecords": "Erreur" | ||
} |
'use strict'; | ||
const _ = require('lodash'); | ||
/** | ||
@@ -4,0 +6,0 @@ * A set of functions called "actions" for `ContentManager` |
{ | ||
"name": "strapi-plugin-content-manager", | ||
"version": "3.0.0-alpha.4.8", | ||
"version": "3.0.0-alpha.5", | ||
"description": "A powerful UI to easily manage your data.", | ||
@@ -28,20 +28,19 @@ "engines": { | ||
"name": "Content Manager", | ||
"icon": "fa-plug" | ||
"icon": "plug" | ||
}, | ||
"scripts": { | ||
"analyze:clean": "node_modules/rimraf/bin.js stats.json", | ||
"analyze:clean": "rimraf stats.json", | ||
"preanalyze": "npm run analyze:clean", | ||
"analyze": "node node_modules/strapi-helper-plugin/lib/internals/scripts/analyze.js", | ||
"postinstall": "npm run build:dll", | ||
"prebuild": "npm run build:clean && npm run test", | ||
"build": "node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress", | ||
"build:clean": "node_modules/rimraf/bin.js admin/build", | ||
"build:dll": "node node_modules/strapi-helper-plugin/lib/internals/scripts/dependencies.js", | ||
"start": "node_modules/cross-env/bin/cross-env.js NODE_ENV=development node lib/server", | ||
"build": "cross-env NODE_ENV=production webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress", | ||
"build:clean": "rimraf admin/build", | ||
"start": "cross-env NODE_ENV=development node node_modules/strapi-helper-plugin/lib/server", | ||
"generate": "node_modules/plop/plop.js --plopfile node_modules/strapi-helper-plugin/lib/internals/generators/index.js", | ||
"lint": "node_modules/eslint/bin/eslint.js --ignore-path .gitignore --config node_modules/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json admin", | ||
"lint": "eslint --ignore-path .gitignore --config node_modules/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json admin", | ||
"pretest": "npm run lint", | ||
"prettier": "node_modules/prettier/bin/prettier.js --single-quote --trailing-comma es5 --write \"{admin,__{tests,mocks}__}/**/*.js\"", | ||
"prettier": "prettier --single-quote --trailing-comma es5 --write \"{admin,__{tests,mocks}__}/**/*.js\"", | ||
"test": "echo Tests are not implemented.", | ||
"prepublish": "npm run build" | ||
"prepublish": "npm run build", | ||
"postinstall": "node node_modules/strapi-helper-plugin/lib/internals/scripts/postinstall.js" | ||
}, | ||
@@ -52,4 +51,19 @@ "dependencies": { | ||
"devDependencies": { | ||
"strapi-helper-plugin": "^3.0.0-alpha.4.5" | ||
"cross-env": "^3.1.3", | ||
"eslint": "^3.9.0", | ||
"eslint-config-airbnb": "^12.0.0", | ||
"eslint-config-airbnb-base": "^9.0.0", | ||
"eslint-config-prettier": "^2.3.0", | ||
"eslint-import-resolver-webpack": "^0.6.0", | ||
"eslint-plugin-babel": "^4.1.2", | ||
"eslint-plugin-import": "^2.0.1", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.4.1", | ||
"eslint-plugin-redux-saga": "^0.1.5", | ||
"plop": "^1.5.0", | ||
"prettier": "^1.5.3", | ||
"rimraf": "^2.5.4", | ||
"strapi-helper-plugin": "^3.0.0-alpha.5", | ||
"webpack": "^2.1.0-beta.25" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
1
107644
16
60
2414