mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +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) {
|
||||
if (this.props.editSuccess !== nextProps.editSuccess) {
|
||||
if (!isEmpty(this.props.location.search) && includes(this.props.location.search, '?redirectUrl')) {
|
||||
const redirectUrl = this.props.location.search.split('?redirectUrl=')[1];
|
||||
|
||||
router.push({
|
||||
pathname: replace(this.props.location.search, '?redirectUrl=', ''),
|
||||
search: `?source=${this.source}`,
|
||||
pathname: redirectUrl.split('?')[0],
|
||||
search: redirectUrl.split('?')[1],
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
|
@ -89,6 +89,7 @@ export class List extends React.Component {
|
||||
init(props) {
|
||||
const source = getQueryParameters(props.location.search, 'source');
|
||||
const slug = props.match.params.slug;
|
||||
|
||||
// Set current model name
|
||||
this.props.setCurrentModelName(slug.toLowerCase());
|
||||
|
||||
@ -97,8 +98,8 @@ export class List extends React.Component {
|
||||
getQueryParameters('sort')) || 'id';
|
||||
|
||||
if (!isEmpty(props.location.search)) {
|
||||
this.props.changePage(toInteger(getQueryParameters('page')), source);
|
||||
this.props.changeLimit(toInteger(getQueryParameters('limit')), source);
|
||||
this.props.changePage(toInteger(getQueryParameters(props.location.search, 'page')), source);
|
||||
this.props.changeLimit(toInteger(getQueryParameters(props.location.search, 'limit')), source);
|
||||
}
|
||||
|
||||
this.props.changeSort(sort, source);
|
||||
@ -191,7 +192,7 @@ export class List extends React.Component {
|
||||
history={this.props.history}
|
||||
primaryKey={currentModel.primaryKey || 'id'}
|
||||
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