Skip to content
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 interfaceLang and releases to FieldPluginData #345

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Feb 6, 2024

What?

This PR adds interfaceLang and releases to FieldPluginData.

resolves #344

Why?

JIRA:

How to test? (optional)

storyblok.com needs to be updated first in order for us to get this data in the library.

Copy link

vercel bot commented Feb 6, 2024

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 Feb 16, 2024 3:03pm

@@ -8,10 +8,24 @@ export type FieldPluginData<Content> = {
content: Content
options: Record<string, string>
spaceId: number | undefined
interfaceLang: string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we have storyLang, I named it interfaceLang, but any other suggestion is welcome.

Copy link
Contributor

Choose a reason for hiding this comment

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

interfaceLang is not bad, IMO.
I also though about storyfrontLang, though. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

storyfront is our project name for the frontend, and it's not publicly used. So I picked interface 🤔

@eunjae-lee eunjae-lee requested review from a team and demetriusfeijoo and removed request for a team February 7, 2024 09:35
Copy link
Contributor

@demetriusfeijoo demetriusfeijoo left a comment

Choose a reason for hiding this comment

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

Hey @eunjae-lee, as per the discussion on the open ticket, I think we'll need to also accept a releaseId, right?

Or just the releases: [] would be enough? wdyt?

@@ -8,10 +8,24 @@ export type FieldPluginData<Content> = {
content: Content
options: Record<string, string>
spaceId: number | undefined
interfaceLang: string
Copy link
Contributor

Choose a reason for hiding this comment

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

interfaceLang is not bad, IMO.
I also though about storyfrontLang, though. 🤔

@eunjae-lee
Copy link
Contributor Author

Hey @eunjae-lee, as per the discussion on the open ticket, I think we'll need to also accept a releaseId, right?

Or just the releases: [] would be enough? wdyt?

yeah, I tested it, and storyfront doesn't always provide releaseId (I don't understand the logic yet). It's sometimes undefined. So I thought I could expose releases only, and see if people really need releaseId :)

@demetriusfeijoo
Copy link
Contributor

yeah, I tested it, and storyfront doesn't always provide releaseId (I don't understand the logic yet). It's sometimes undefined. So I thought I could expose releases only, and see if people really need releaseId :)

Yeah, I don't have experience on that side either, so I don't know how it behaves 😞 but we may use the open ticket to ask the user if this would be enough, wdyt?

I mean, It can happen that the user doesn't need this in the end but as it was explicitly requested, it may be better to check with him/her before.

What do you think?

@eunjae-lee
Copy link
Contributor Author

If you're in a release, and click a story that belongs to the release, you'll get releaseId.

Screenshot 2024-02-16 at 12 01 15

@eunjae-lee eunjae-lee enabled auto-merge (squash) February 16, 2024 14:58
@eunjae-lee eunjae-lee enabled auto-merge (squash) February 16, 2024 14:59
@eunjae-lee eunjae-lee merged commit 8fb5303 into main Feb 16, 2024
17 of 18 checks passed
@eunjae-lee eunjae-lee deleted the EXT-2151-update-the-type-definition-of-field-plugin-sdk-to-include-the-releases-data branch February 16, 2024 14:59
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.

Add selected interface app language
2 participants