mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
Merge branch 'master' into fix-fetch-user
This commit is contained in:
commit
a39ec8c3ed
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* SettingsPage
|
* SettingsPage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -36,23 +36,23 @@ class SettingsPage extends React.PureComponent {
|
|||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.props.onReset();
|
this.props.onReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
getModels = (data = this.props.schema.models, destination = '/') => {
|
getModels = (data = this.props.schema.models, destination = '/') => {
|
||||||
const models = Object.keys(data).reduce((acc, curr) => {
|
const models = Object.keys(data).reduce((acc, curr) => {
|
||||||
if (curr !== 'plugins') {
|
if (curr !== 'plugins') {
|
||||||
|
|
||||||
if (!data[curr].fields && _.isObject(data[curr])) {
|
if (!data[curr].fields && _.isObject(data[curr])) {
|
||||||
return this.getModels(data[curr], `${destination}${curr}/`);
|
return acc.concat(this.getModels(data[curr], `${destination}${curr}/`));
|
||||||
}
|
}
|
||||||
|
|
||||||
return acc.concat([{ name: curr, destination: `${destination}${curr}` }]);
|
return acc.concat([{ name: curr, destination: `${destination}${curr}` }]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.getModels(data[curr], `${destination}${curr}/`);
|
return acc.concat(this.getModels(data[curr], `${destination}${curr}/`));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return sortBy(
|
return sortBy(
|
||||||
models.filter(obj => obj.name !== 'permission' && obj.name !== 'role'),
|
models.filter(obj => !!this.props.schema.layout[obj.name]),
|
||||||
['name'],
|
['name'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user