Skip to content

VideoGallery UUID for its local video tile to dock to.#1111

Merged
mgamis-msft merged 13 commits intomainfrom
mgamis/videogallery-uuid
Nov 23, 2021
Merged

VideoGallery UUID for its local video tile to dock to.#1111
mgamis-msft merged 13 commits intomainfrom
mgamis/videogallery-uuid

Conversation

@mgamis-msft
Copy link
Copy Markdown
Contributor

@mgamis-msft mgamis-msft commented Nov 18, 2021

What

Assigning VideoGallery containerRef.current.id using a UUID. Then using containerRef.current.id which is assigned to root div as the Modal's hostId.

Why

https://skype.visualstudio.com/SPOOL/_workitems/edit/2649260

When there are multiple VideoGallery's in the same page their id's will be the same since it was hardcoded and thus all local video tiles will dock to the first VideoGallery.

How Tested

Verified docs in storybook. Please check chromatic.

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

<span
className="ms-layer"
/>
>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the FluentUI Modal. Not sure why the old snapshot did not have it.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "ui change" label to the PR for updating the snapshot.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "ui change" label to the PR for updating the snapshot.

Copy link
Copy Markdown
Member

@JamesBurnside JamesBurnside left a comment

Choose a reason for hiding this comment

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

Great fix!


useEffect(() => {
if (containerRef.current) {
containerRef.current.id = `video-gallery-${uuidv4()}`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The idea is that whenever our containerRef changes we want to use a new UUID so we don't have collisions between different video gallery instances?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

curious to know too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This useEffect only happens since containerRef is instantiated only once during the lifetime of the VideoGallery component. So the UUID is only created once so it should be the same for a VIdeoGallery's lifetime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not simply generate an id once.

containerId = useRef(`video-gallery-${uuidv4()}`)
...

return (<div id={containerId.current}> .... </div>)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like that better too. Changed. Thanks.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Comment thread common/config/rollup/rollup.config.js Outdated
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "ui change" label to the PR for updating the snapshot.

@mgamis-msft mgamis-msft force-pushed the mgamis/videogallery-uuid branch from 2ccd019 to ef5009d Compare November 22, 2021 22:24
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "ui change" label to the PR for updating the snapshot.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the composite UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "ui change" label to the PR for updating the snapshot.

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "ui change" label to the PR for updating the snapshot.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "ui change" label to the PR for updating the snapshot.

@mgamis-msft mgamis-msft merged commit ab3b77d into main Nov 23, 2021
@mgamis-msft mgamis-msft deleted the mgamis/videogallery-uuid branch November 23, 2021 02:28
@mgamis-msft mgamis-msft restored the mgamis/videogallery-uuid branch November 23, 2021 08:37
@mgamis-msft mgamis-msft deleted the mgamis/videogallery-uuid branch November 8, 2023 22:14
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.

5 participants