Skip to content

Commit

Permalink
chore(SHAPE-7610): include userid in field plugin response data
Browse files Browse the repository at this point in the history
  • Loading branch information
ECJ222 committed Nov 29, 2024
1 parent e119464 commit ebca696
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type FieldPluginData<Content> = {
content: Content
options: Record<string, string>
spaceId: number | undefined
userId: number | undefined
interfaceLang: string
storyLang: string
story: StoryData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe('createPluginActions', () => {
interfaceLanguage: 'en',
model: randomString,
spaceId: null,
userId: undefined,
blockId: undefined,
releases: [],
releaseId: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe('handlePluginMessage', () => {
interfaceLanguage: 'en',
model: 123,
spaceId: 1234,
userId: 2345,
story: { content: {} },
schema: { options: [], field_type: 'avh', translatable: false },
storyId: 1344,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const pluginStateFromStateChangeMessage = <Content>(
return {
interfaceLang: message.interfaceLanguage,
spaceId: message.spaceId ?? undefined,
userId: message.spaceId ?? undefined,
story: message.story ?? undefined,
storyId: message.storyId ?? undefined,
storyLang: message.language === '' ? 'default' : message.language,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const stub: LoadedMessage = {
action: 'loaded',
uid: '-preview',
spaceId: null,
userId: undefined,
model: undefined,
isModalOpen: false,
token: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type LoadedMessage = MessageToPlugin<'loaded'> & {
language: string
interfaceLanguage: string
spaceId: number | null
userId: number | undefined
story: StoryData
storyId: number | undefined
blockId: string | undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type StateChangedMessage = MessageToPlugin<'state-changed'> & {
language: string
interfaceLanguage: string
spaceId: number | null
userId: number | undefined
story: StoryData
storyId: number | undefined
blockId: string | undefined
Expand Down
2 changes: 2 additions & 0 deletions packages/lib-helpers/test/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const getContainer = (sendToFieldPlugin: (data: unknown) => void) => {
const language = 'default'
const storyId = 'test-story-id'
const spaceId = 'test-space-id'
const userId = 'test-user-id'
const token = 'test-token'
const story = {
content: {},
Expand All @@ -49,6 +50,7 @@ const getContainer = (sendToFieldPlugin: (data: unknown) => void) => {
language,
storyId,
spaceId,
userId,
token,
action,
})
Expand Down
1 change: 1 addition & 0 deletions packages/sandbox/src/components/FieldPluginSandbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const useSandbox = (
blockId: undefined,
language,
spaceId: null,
userId: undefined,
story,
storyId: undefined,
token: null,
Expand Down

0 comments on commit ebca696

Please sign in to comment.