Skip to content

Conversation

@taoerman
Copy link
Member

Summary

  1. made the submit panel publishing-aware: it shows a centered “Channel is being published” loader, disables form and submit while publishing, then re-enables after polling.
  2. Backend now blocks submissions if the channel is publishing (via main_tree.publishing).
  3. Added unit tests for both frontend behavior and backend validation.

References

Fixed #5452

Reviewer guidance

run frontend and backend unit tests,
test the frontend manually.

Comment on lines +57 to +61
# Prevent creating submissions while a publish is in progress
if getattr(getattr(channel, "main_tree", None), "publishing", False):
raise ValidationError(
"Cannot create a community library submission while the channel is being published."
)
Copy link
Member

Choose a reason for hiding this comment

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

Great!

Comment on lines +255 to +269
let publishPollId = null;
function startPublishPolling() {
if (publishPollId || !isPublishing.value) return;
publishPollId = setInterval(() => {
Channel.fetchModel(props.channel.id).then(ch => {
if (ch) {
isPublishing.value = Boolean(ch.publishing);
if (!isPublishing.value) {
currentChannelVersion.value = ch.version;
clearInterval(publishPollId);
publishPollId = null;
}
}
});
}, 2000);
Copy link
Member

Choose a reason for hiding this comment

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

Oh, I think here we can use the liveQuery method instead? Just as you did for the draft version publishing! https://github.com/taoerman/studio/blob/781d95378f7f20dd1dc1cf2f4f10bdf15b0457a2/contentcuration/contentcuration/frontend/shared/data/resources.js#L1275

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.

Add loader if channel is being published and community library side panel is open.

2 participants