Skip to content

Commit d2b9b14

Browse files
feat: Deprecate extra; users must pass it via showWidget() in future Impler versions
1 parent d3629eb commit d2b9b14

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

apps/queue-manager/src/consumers/send-bubble-data.consumer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class SendBubbleDataConsumer extends BaseConsumer {
202202
const emailContents = this.emailService.getEmailContent({
203203
type: 'ERROR_SENDING_BUBBLE_DATA',
204204
data: {
205-
error: JSON.stringify(data.error, null, 2).replace(/\\+"/g, '"'),
205+
error: JSON.stringify(data.error, null, 2)?.replace(/\\+"/g, '"') ?? 'Error while sending data to Bubble',
206206
importName,
207207
time: data.callDate.toString(),
208208
bubbleAppUrl: bubbleData.bubbleAppUrl,

apps/web/pages/imports/[id].tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ function ImportDetails() {
5656
accessToken: profileInfo?.accessToken,
5757
onUploadComplete: onSpreadsheetImported,
5858
authHeaderValue: webhookConfig.authHeaderValue || '',
59-
extra: webhookConfig.extra || '',
6059
appearance: {
6160
widget: {
6261
backgroundColor: '#1c1917',
@@ -97,7 +96,9 @@ function ImportDetails() {
9796
onConfigSubmit={(config: { authHeaderValue?: string; extra?: string }) => {
9897
setWebhookConfig(config);
9998
modals.closeAll();
100-
showWidget();
99+
showWidget({
100+
extra: config.extra || '',
101+
});
101102
setTimeout(() => {}, 100);
102103
}}
103104
/>

packages/client/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ export interface IUseImplerProps {
223223
* In future versions, the `primaryColor` property will be moved under `appearance` object.
224224
*/
225225
primaryColor?: string;
226+
/**
227+
* @deprecated Use the `extra` parameter in `showWidget()` instead.
228+
* Example: `showWidget({ extra: { your: 'data' } })`
229+
* In future versions, the `extra` property will be removed and `showWidget({ extra: { your: 'data' } })` will be the only way to pass extra data.
230+
*/
226231
extra?: string | Record<string, any>;
227232
config?: WidgetConfig;
228233
appearance?: AppearanceConfig;

packages/react/src/hooks/useImpler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function useImpler({
99
authHeaderValue,
1010
title,
1111
texts,
12-
extra,
12+
extra: defaultExtra,
1313
config,
1414
maxRecords,
1515
appearance,
@@ -85,7 +85,8 @@ export function useImpler({
8585
sampleFile,
8686
schema,
8787
output,
88-
}: Pick<IShowWidgetProps, 'colorScheme' | 'data' | 'schema' | 'output' | 'sampleFile'> = {}) => {
88+
extra = defaultExtra,
89+
}: Pick<IShowWidgetProps, 'colorScheme' | 'data' | 'schema' | 'output' | 'sampleFile' | 'extra'> = {}) => {
8990
if (window.impler && isImplerInitiated) {
9091
const payload: IShowWidgetProps & { uuid: string; host: string } = {
9192
uuid,

0 commit comments

Comments
 (0)