storyblok / field-plugin

Create and deploy Storyblok Field Plugin
https://www.storyblok.com/docs/plugins/field-plugins/introduction
25 stars 3 forks source link

feat(lib): handle `callbackId` in `contextRequest` #261

Closed demetriusfeijoo closed 1 year ago

demetriusfeijoo commented 1 year ago

What?

Modify the requestContext action to return a Promise in place of returning nothing.

Why?

JIRA: EXT-1920

The corresponding pull request in Storyfront is a prerequisite: https://github.com/storyblok/storyfront/pull/4368

This PR has the same purpose (and approach) as this one but is now for the getContext action (not selectAsset)

Usage implementation: image

Result: image

How to test? (optional)

This function can be tested using our Sandbox application as described in or [CONTRIBUTING.md →]

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plugin-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 2:33pm
eunjae-lee commented 1 year ago

I read it briefly, and it looks good!

Any doubt or question?

demetriusfeijoo commented 1 year ago

Thanks @eunjae-lee.

I was more concerned about being in the right direction with this task @eunjae-lee. No specific question for now.

eunjae-lee commented 1 year ago

Hi Demetrius, Let's pause this task.

Johannes is bringing a big change around this: https://github.com/storyblok/field-plugin/pull/260

We need more work on the Storyfront side to enable this change on the SDK side, but I'm very happy if we get this. Sorry that this PR probably is going to be closed (because it conflicts with #260), but I hope it was a good practice for you. My PR #253 also will be overridden by this, but we're moving very fast at this point, and it was a bit expected.

demetriusfeijoo commented 1 year ago

Hey @eunjae-lee, pausing/closing this task will not be a problem.

This task helped me understand more about how the library works, so enough reward I'd say.

It was really cool working on it. 🚀

eunjae-lee commented 1 year ago

closing this PR in favor of #260