Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUP-17899: Fixed time-management opening from edit-mode #439

Open
wants to merge 1 commit into
base: hotfix-6.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Editor User Interface: Fixed an issue when attempting to opening the time-management from a page when in edit- or preview-mode.
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,13 @@ ins.gtx-diff {
// if page has timemanagement set or timemanagement setting request in queue so that publishing it would override those settings
if ((PublishableStateUtil.statePlanned(page) && PublishableStateUtil.statePlannedOnline(page)) || PublishableStateUtil.stateInQueue(page)) {
// The modal will handle refreshing the item list and closing the editor.
publishReq = this.modalService.fromComponent(PublishTimeManagedPagesModal, {}, { pages: [ page ], allPages: 1, closeEditor })
publishReq = this.modalService.fromComponent(
PublishTimeManagedPagesModal,
{},
{ pages: [ page ], allPages: 1, closeEditor },
)
.then(modal => modal.open())
.catch(err => this.errorHandler.catch(err));
} else {
publishReq = this.folderActions.publishPages([ page ])
.then(() => {
Expand Down Expand Up @@ -1251,23 +1256,22 @@ ins.gtx-diff {
}

promise.then(result => {
if (typeof result !== 'boolean') {
if (typeof result !== 'boolean' || !result) {
return;
}

setTimeout(() => {
this.modalService.fromComponent(TimeManagementModal, {}, { item, currentNodeId: this.currentNode.id })
.then(modal => modal.open())
.then(() => {
// prevent ConfirmNavigationModal pop up a second time triggered by route guard when TimeManagementModal closes editor
this.contentModified = false;
this.markContentAsModifiedInState(false);
// refresh folder content list to display new TimeManagement settings
this.folderActions.refreshList('page');
// then close content frame
this.navigationService.instruction({ detail: null }).navigate();
});
}, 1);
this.modalService.fromComponent(TimeManagementModal, {}, { item, currentNodeId: this.currentNode.id })
.then(modal => modal.open())
.then(() => {
// prevent ConfirmNavigationModal pop up a second time triggered by route guard when TimeManagementModal closes editor
this.contentModified = false;
this.markContentAsModifiedInState(false);
// refresh folder content list to display new TimeManagement settings
this.folderActions.refreshList('page');
// then close content frame
this.navigationService.instruction({ detail: null }).navigate();
})
.catch(err => this.errorHandler.catch(err));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@ export class TimeManagementModal extends BaseModal<TimeManagement> implements On
if (this.item.languageVariants && Object.keys(this.item.languageVariants).length > 0) {
// eslint-disable-next-line guard-for-in
for (const key in this.item.languageVariants) {
const pageID = this.item.languageVariants[key];
this.folderActions.getPage(pageID as number)
let pageID = this.item.languageVariants[key];
if (pageID == null) {
continue;
} else if (typeof pageID === 'object') {
pageID = pageID.id;
}

this.folderActions.getPage(pageID)
.then(page => {
this.itemsToBeModified.push(page);
});
Expand Down