mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
Fix ctm editview backheader
This commit is contained in:
parent
fff73de9c7
commit
0ff0b2e2aa
@ -131,9 +131,11 @@ export class Edit extends React.Component {
|
|||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.editSuccess !== nextProps.editSuccess) {
|
if (this.props.editSuccess !== nextProps.editSuccess) {
|
||||||
if (!isEmpty(this.props.location.search) && includes(this.props.location.search, '?redirectUrl')) {
|
if (!isEmpty(this.props.location.search) && includes(this.props.location.search, '?redirectUrl')) {
|
||||||
|
const redirectUrl = this.props.location.search.split('?redirectUrl=')[1];
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
pathname: replace(this.props.location.search, '?redirectUrl=', ''),
|
pathname: redirectUrl.split('?')[0],
|
||||||
search: `?source=${this.source}`,
|
search: redirectUrl.split('?')[1],
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
router.push({
|
router.push({
|
||||||
|
@ -89,6 +89,7 @@ export class List extends React.Component {
|
|||||||
init(props) {
|
init(props) {
|
||||||
const source = getQueryParameters(props.location.search, 'source');
|
const source = getQueryParameters(props.location.search, 'source');
|
||||||
const slug = props.match.params.slug;
|
const slug = props.match.params.slug;
|
||||||
|
|
||||||
// Set current model name
|
// Set current model name
|
||||||
this.props.setCurrentModelName(slug.toLowerCase());
|
this.props.setCurrentModelName(slug.toLowerCase());
|
||||||
|
|
||||||
@ -97,8 +98,8 @@ export class List extends React.Component {
|
|||||||
getQueryParameters('sort')) || 'id';
|
getQueryParameters('sort')) || 'id';
|
||||||
|
|
||||||
if (!isEmpty(props.location.search)) {
|
if (!isEmpty(props.location.search)) {
|
||||||
this.props.changePage(toInteger(getQueryParameters('page')), source);
|
this.props.changePage(toInteger(getQueryParameters(props.location.search, 'page')), source);
|
||||||
this.props.changeLimit(toInteger(getQueryParameters('limit')), source);
|
this.props.changeLimit(toInteger(getQueryParameters(props.location.search, 'limit')), source);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.changeSort(sort, source);
|
this.props.changeSort(sort, source);
|
||||||
@ -191,7 +192,7 @@ export class List extends React.Component {
|
|||||||
history={this.props.history}
|
history={this.props.history}
|
||||||
primaryKey={currentModel.primaryKey || 'id'}
|
primaryKey={currentModel.primaryKey || 'id'}
|
||||||
handleDelete={this.toggleModalWarning}
|
handleDelete={this.toggleModalWarning}
|
||||||
redirectUrl={`?redirectUrl=/plugins/content-manager/${this.props.currentModelName.toLowerCase()}/?page=${this.props.currentPage}&limit=${this.props.limit}&sort=${this.props.sort}&source=${source}`}
|
redirectUrl={`?redirectUrl=/plugins/content-manager/${this.props.currentModelName.toLowerCase()}?page=${this.props.currentPage}&limit=${this.props.limit}&sort=${this.props.sort}&source=${source}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user