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

EM-778: Documents in published collection can be unpublished #253

Merged
merged 1 commit into from
Apr 23, 2018

Conversation

mjfortier
Copy link

Currently, collections require a published document in order to be published themselves, so that there are no 'empty collections' showing up on the public site. However, the sole published document in a published collection can be unpublished, leaving the collection with no published document.

This issue has been resolved. As well, the confirm modals for unpublishing and deleting documents have been standardized.

self.confirmText = "Are you sure you want to unpublish the following file(s) and/or folder(s)?";
if (folderCnt > unpublishableFolderCnt || fileCnt > unpublishableFileCnt ) {
self.hasBlockedContent = true;
self.bannerText = " One or more of the following files or folders cannot be unpublished.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit.: heading spaces in message string (in next ones as well).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were changes to the .scss; these were necessary but may no longer be. I will check, and remove if possible.


// Collect unpublishable folders and files.
function collect(items) {
// Filter out items that are already unpublished
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems out of context here. Maybe it should be moved outside of the function, as an addition to what is on line 110?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this was supposed to be removed. Thanks for the reminder, will update.

fClone.displayName = item.model.name;
fClone.isPublished = item.model.published;
}
fClone.canBeUnpublished = fClone.userCanUnpublish && !fClone.isPublished;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to indicate a file/folder can be unpublished if:

  • the current user has permission to unpublish - it makes sense
  • the file/folder is not published - this seems odd
    What am I missing here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not missing anything; just a redundancy I forgot to remove when refactoring this code block. I'll snip it and re-commit.

@esune esune merged commit 277c544 into bcgov:dev Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants