-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(lib): add modalSize object to the toggleModal message #447
feat(lib): add modalSize object to the toggleModal message #447
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…min and isAIEnabled
…y permissions types, add ModalSize type and ModalSize test
4d82b09
to
3d0779d
Compare
… null tests are not needed
…andbox functionality
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.
Hey @Dawntraoz
It took me some time to review (even already had checked it before) it but I guess I finished 🫠 🤣
The only thing I think should be looked at is the Sandbox not returning the callbackId
to the field plugin to allow it to remove the callback from the queue properly and also to return a value correctly to the field plugin application.
Screen.Recording.2025-01-03.at.00.18.36.mov
...ages/field-plugin/src/messaging/pluginMessage/containerToPluginMessage/LoadedMessage.test.ts
Outdated
Show resolved
Hide resolved
...ield-plugin/src/messaging/pluginMessage/containerToPluginMessage/StateChangedMessage.test.ts
Outdated
Show resolved
Hide resolved
...s/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Demetrius Feijóo <[email protected]>
Thanks, @demetriusfeijoo, for the review! I have already introduced the changes you suggested. Can you double-check now? 🫂 |
…and-define-the-new-action
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.
Amazingggg job @Dawntraoz 🚀 🚀
2025, here we go 🎉 🎉
...ld-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Demetrius Feijóo <[email protected]>
What?
isAIEnabled
as plugin staterequestUserContext
action and postMessage functionality to grab the user infoisSpaceAdmin
andpermissions
modalSize
as an optional parameter in thetoggleModal
postMessage to allow setting themax-width
and/ormax-height
of the new modal with portal. (Only applicable whenenablePortalModal
is equal totrue
.Why?
JIRA: SHAPE-7911 & SHAPE-7912
The user info,
isSpaceAdmin
is needed by us and thepermissions
property was requested on this issue and also needed in some of our integrations as, for example, the Akeneo PIM.The need to define custom modal sizes and the
isAIEnabled
state property is an internal demand of an integration we are currently working on.How to test? (optional)
To test it out, you will need to:
Run the Storyfront locally using the
feat/SHAPE-7911-get-the-new-provided-values-and-define-the-new-action
branch (still being reviewed https://github.com/storyblok/storyfront/pull/6904).Open the
packages/demo/src/components/FieldPluginDemo.tsx
file and specify thetargetOrigin
tohttp://localhost:3300
(Storyfront running address):Create a new fieldtype and deploy the field plugin demo:
Now, copy the generated bundle file (located at
packages/demo/dist/index.js
) and paste it into the newly created field.If everything was configured properly, you should see, in your Visual Editor, something similar to:
Test new Actions:
New modal sizing
Check the modal sizing by clicking on the
Toggle Modal
button and check if the modal max-width was set to '50%' accordingly. Try changing this value and also adding aheight
.Request user context
You can change the logged-in user's permissions (under the space's Settings page) and see them reflected in the displayed text when requesting the user context by clicking the "Request user context" button.
Then, access the story with a non-admin user to see if the
isSpaceAdmin
property is set to "No" when the user context is requested.Test new State
Disable/Enable the AI feature under the space's settings page and check if the
isAIEnabled
property is correct.