From 9e0eff7e5a6f3161a825a11e633bbe65e930096c Mon Sep 17 00:00:00 2001 From: Nevo David Date: Sat, 3 Jan 2026 11:00:06 +0700 Subject: [PATCH] feat: payload wizard --- .../src/components/media/media.component.tsx | 33 +++- .../public-api/public.component.tsx | 176 ++++++++++-------- 2 files changed, 122 insertions(+), 87 deletions(-) diff --git a/apps/frontend/src/components/media/media.component.tsx b/apps/frontend/src/components/media/media.component.tsx index 74938f18..7d7605dd 100644 --- a/apps/frontend/src/components/media/media.component.tsx +++ b/apps/frontend/src/components/media/media.component.tsx @@ -257,9 +257,8 @@ export const MediaBox: FC<{ const addToUpload = useCallback(async (e: ChangeEvent) => { const files = Array.from(e.target.files).slice(0, 5); - for (const file of files) { - uppy.addFile(file); - } + // @ts-ignore + uppy.addFiles(files); }, []); const dragAndDrop = useCallback( @@ -335,8 +334,15 @@ export const MediaBox: FC<{ > {!isLoading && !!data?.results?.length && (
- {t('select_or_upload_pictures_max_5', 'Select or upload pictures (maximum 5 at a time).')}{'\n'} - {t('you_can_drag_drop_pictures', 'You can also drag & drop pictures.')} + {t( + 'select_or_upload_pictures_max_5', + 'Select or upload pictures (maximum 5 at a time).' + )} + {'\n'} + {t( + 'you_can_drag_drop_pictures', + 'You can also drag & drop pictures.' + )}
)}
- {t('you_dont_have_any_media_yet', "You don't have any media yet")} + {t( + 'you_dont_have_any_media_yet', + "You don't have any media yet" + )}
- {t('select_or_upload_pictures_max_5', 'Select or upload pictures (maximum 5 at a time).')} {'\n'} - {t('you_can_drag_drop_pictures', 'You can also drag & drop pictures.')} + {t( + 'select_or_upload_pictures_max_5', + 'Select or upload pictures (maximum 5 at a time).' + )}{' '} + {'\n'} + {t( + 'you_can_drag_drop_pictures', + 'You can also drag & drop pictures.' + )}
{btn}
@@ -616,7 +632,6 @@ export const MultiMediaComponent: FC<{ } }, [changeMedia, t]); - return ( <>
diff --git a/apps/frontend/src/components/public-api/public.component.tsx b/apps/frontend/src/components/public-api/public.component.tsx index 99728f96..570342bc 100644 --- a/apps/frontend/src/components/public-api/public.component.tsx +++ b/apps/frontend/src/components/public-api/public.component.tsx @@ -9,7 +9,7 @@ import { useVariables } from '@gitroom/react/helpers/variable.context'; import { useT } from '@gitroom/react/translation/get.transation.service.client'; export const PublicComponent = () => { const user = useUser(); - const { backendUrl } = useVariables(); + const { backendUrl, frontEndUrl } = useVariables(); const toaster = useToaster(); const [reveal, setReveal] = useState(false); const [reveal2, setReveal2] = useState(false); @@ -28,91 +28,111 @@ export const PublicComponent = () => { return null; } return ( -
-

{t('public_api', 'Public API')}

-
- {t( - 'use_postiz_api_to_integrate_with_your_tools', - 'Use Postiz API to integrate with your tools.' - )} -
- +
+
+

{t('public_api', 'Public API')}

+
-
-
- {reveal ? ( - user.publicApi - ) : ( - <> -
{user.publicApi.slice(0, -5)}
-
{user.publicApi.slice(-5)}
- + 'use_postiz_api_to_integrate_with_your_tools', + 'Use Postiz API to integrate with your tools.' )} +
+ + {t( + 'read_how_to_use_it_over_the_documentation', + 'Read how to use it over the documentation.' + )} + + +
+ {t('check_n8n', 'Check out our N8N custom node for Postiz.')} +
-
- {!reveal ? ( - - ) : ( - - )} +
+
+
+ {reveal ? ( + user.publicApi + ) : ( + <> +
{user.publicApi.slice(0, -5)}
+
{user.publicApi.slice(-5)}
+ + )} +
+
+ {!reveal ? ( + + ) : ( + + )} +
+
-

{t('mcp', 'MCP')}

-
- {t( - 'connect_your_mcp_client_to_postiz_to_schedule_your_posts_faster', - 'Connect Postiz MCP server to your client (Http streaming) to schedule your posts faster.' - )} -
-
-
- {reveal2 ? ( - `${backendUrl}/mcp/` + user.publicApi - ) : ( - <> -
- {(`${backendUrl}/mcp/` + user.publicApi).slice(0, -5)} -
-
- {(`${backendUrl}/mcp/` + user.publicApi).slice(-5)} -
- +
+

{t('mcp', 'MCP')}

+
+ {t( + 'connect_your_mcp_client_to_postiz_to_schedule_your_posts_faster', + 'Connect Postiz MCP server to your client (Http streaming) to schedule your posts faster.' )}
-
- {!reveal2 ? ( - - ) : ( - - )} +
+
+ {reveal2 ? ( + `${backendUrl}/mcp/` + user.publicApi + ) : ( + <> +
+ {(`${backendUrl}/mcp/` + user.publicApi).slice(0, -5)} +
+
{(`${backendUrl}/mcp/` + user.publicApi).slice(-5)}
+ + )} +
+
+ {!reveal2 ? ( + + ) : ( + + )} +
+
+
+ +
+

Building your Postiz payload

+
+ Sending a POST request to /posts might feel a bit overwhelming as many + platforms have different requirements.{'\n'} + We have created an easy way to build your Postiz payload to schedule + posts. {'\n'} + You can use the Postiz wizard, and schedule a post with our UI, after + you added all your text and settings, the wizard will generate the + payload for you.{'\n'} +
+
+