Skip to content
This repository has been archived by the owner on Oct 6, 2019. It is now read-only.

Commit

Permalink
DNN-18105: don't call _removePageFromTree in duplicate page mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyhfish authored and tpluscode committed Sep 5, 2018
1 parent 7bf9607 commit ec3dec9
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class App extends Component {
tags: "",
filters: [],
pageIndex:0,
searchFields: {}
searchFields: {},

inDuplicateMode: false
};
this.lastActivePageId = null;
this.shouldRunRecursive = true;
Expand Down Expand Up @@ -409,6 +411,7 @@ class App extends Component {
this.buildTree(update.tabId);
//this.onLoadPage(update.tabId);
resolve();
this.setState({inDuplicateMode: false});
});
});
}
Expand Down Expand Up @@ -448,9 +451,13 @@ class App extends Component {
}

onCancelPage(parentPageId) {
this._removePageFromTree(parentPageId);
const {props, state} = this;
if(!state.inDuplicateMode){
this._removePageFromTree(parentPageId);
}
this.props.changeSelectedPagePath("");
this.props.onCancelPage(parentPageId);
this.setState({inDuplicateMode: false});
}

onChangeParentId(newParentId) {
Expand Down Expand Up @@ -522,6 +529,8 @@ class App extends Component {
const newPageList = pageList.concat(this.props.selectedPage);
runUpdateStore(newPageList);
}

this.setState({inDuplicateMode: false});
});
};

Expand Down Expand Up @@ -967,6 +976,7 @@ class App extends Component {
this.props.onDuplicatePage(false);
}
this.props.onChangePageField('parentId', selectedPage.tabId);
this.setState({inDuplicateMode: true});
};
const noPermission = () => this.setEmptyStateMessage(message);
item.canCopyPage ? duplicate() : noPermission();
Expand Down

0 comments on commit ec3dec9

Please sign in to comment.