-
Notifications
You must be signed in to change notification settings - Fork 189
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
Incorrect view only channel #4733
Incorrect view only channel #4733
Conversation
@@ -491,6 +497,13 @@ | |||
trackClickEvent(eventLabel) { | |||
this.$analytics.trackClick('channel_editor_toolbar', eventLabel); | |||
}, | |||
reloadChannel(id) { | |||
if (!id) { | |||
this.$store.dispatch('currentChannel/loadChannel').catch(error => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe using mapActions('currentChannel', [ 'loadChannel' ]),
and calling this.loadChannel()
here might be a better way? A promise would still be returned so we should be good with the catch
. I am only conflicted on throwing the error(next line) in this scenario, probably displaying a snackbar would be subtler(for example in situations when the server is disconnected)? @marcellamaki any thoughts?
rootId: { | ||
handler: 'reloadChannel', | ||
immediate: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the below would be useful for maintainability?
rootId: {
handler(id) {
.....
},
immediate: true
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look correct to me. Manual QA also checks out. Thanks @LianaHarris360
Thanks @LianaHarris360 - I confirm that this is implemented as specified above, no issues observed while manually testing. |
Summary
Description of the change(s) you made
This pull request resolves the issue where a channel containing imported resources transitions to the 'Unpublished View-only' display after opening a new tab and selecting a different channel.
This pull request also fixes the console error
Invalid prop: type check failed for prop "nodeId". Expected String, got Undefined
which occurred whenrootId
/nodeId
was undefined withinStudioTree.vue
.TreeViewBase.vue
withrootId
watcher that triggers an API call if rootId is undefined, allowing the accurate view status of the channel to stay displayed.v-else
to v-else-if=“rootId”
to avoid renderingStudioTree
whenrootId
is undefined, preventing the invalid prop error from appearing.Manual verification steps performed
Screenshots (if applicable)
TwoTabChannels.mov
Reviewer guidance
How can a reviewer test these changes?
References
Fixes #4647
Contributor's Checklist
PR process:
CHANGELOG
label been added to this PR. Note: items with this label will be added to the CHANGELOG at a later timedocs
label has been added if this introduces a change that needs to be updated in the user docs?requirements.txt
files also included in this PRStudio-specifc:
notranslate
class been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)pages
,components
, andlayouts
directories as described in the docsTesting:
Reviewer's Checklist
This section is for reviewers to fill out.
yarn
andpip
)