New channel modal toggle tabs#2643
Conversation
…refactor to use props rather than refer directly to route
MisRob
left a comment
There was a problem hiding this comment.
Thank you, @marcellamaki, all is working as expected.
Before merging, could you address the following edge-case? When I insert an URL directly to address bar containing unsupported tab value (example: /en/channels/#/66a31fdbdd745c7c9e499206f3c4cced/abc?last=CHANNELS_EDITABLE) then I get:
Maybe we could just redirect to /edit by default when the value provided is not supported (this is how it worked till now automatically due to using edit as the default value of sharing query parameter)?
| tab: value, | ||
| }, | ||
| }) | ||
| .catch(() => {}); |
There was a problem hiding this comment.
What's the purpose of this catch?
There was a problem hiding this comment.
I don't remember off the top of my head, but I know there was a purpose, as I remember researching it. I will see if I can look it up again and I will follow up with you!
There was a problem hiding this comment.
I am afraid that this might result in losing information or swallowing errors that need to be handled. It's okay if there is a reason - it would be nice to add the information to the comment.
| expect(wrapper.find('[data-test="share-content"]').isVisible()).toBe(true); | ||
| expect(wrapper.find('[data-test="edit-content"]').isVisible()).toBe(false); | ||
| }); | ||
| it('when the current tab is edit, the edit content should display in the modal', async () => { |

Description
Updates routing to use a
/:tabvalue that can be either 'edit' or 'share' rather than the querysharing=truein the share and detail modal. Also makes sure the tab indicator aligns with 'share' correctly on open. Replaces PR2547.Issue Addressed (if applicable)
Addresses #2004
Before/After Screenshots (if applicable)
Steps to Test
Option 1:
Option 2: