@bigbinary/neeto-thank-you-frontend 2.1.44 → 2.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,14 @@
1
1
  [![BuildStatus](https://neeto-engineering.neetoci.com/badges/neeto-thank-you-nano/workflows/branch.svg)](https://neeto-engineering.neetoci.com/projects/neeto-thank-you-nano)
2
2
 
3
- # neeto-thank-you-nano
3
+ # neeto-thank-you-nano
4
4
 
5
5
  The `neeto-thank-you-nano` manages the "Thank You" configuration page across
6
6
  neeto applications. The nano exports the `@bigbinary/neeto-thank-you-frontend`
7
7
  NPM package and `neeto-thank-you-engine` Rails engine for development.
8
8
 
9
+ The nano also supports multiple thank you pages per entity, allowing you to
10
+ configure and display different thank you pages as needed.
11
+
9
12
  # Contents
10
13
 
11
14
  1. [Development with Host Application](#development-with-host-application)
@@ -66,8 +69,9 @@ You can learn more about the setup and usage here:
66
69
 
67
70
  The package exports two components: `ConfigureThankYou` and `ShowThankYou`.
68
71
 
69
- The package also exports two hooks: `useShowThankYouPage` and
70
- `useShowThankYouConfiguration`
72
+ The package also exports several hooks for managing thank you configurations,
73
+ including `useFetchThankYouConfigurations` which can be used to retrieve
74
+ multiple thank you configurations for an entity.
71
75
 
72
76
  ### Installation
73
77
 
@@ -92,6 +96,7 @@ application.
92
96
 
93
97
  ##### Props
94
98
 
99
+ - `id` - ID of the specific thank you configuration
95
100
  - `breadcrumbs` - Set the header component's breadcrumbs
96
101
  - `socialHandles` - Set the URLs for sharing to social media
97
102
  - `isPublished` - Boolean to manage pointer events in the "Thank You" page
@@ -164,6 +169,7 @@ const App = () => {
164
169
  <ConfigureThankYou
165
170
  blockNavigation
166
171
  hasImageUploader
172
+ id
167
173
  breadcrumbs={breadcrumbs}
168
174
  entityId={entityId}
169
175
  publicLinkId={publicLinkId}
@@ -283,13 +289,14 @@ const { data: { thankYouConfiguration } = {} } = useShowThankYouPage({
283
289
  });
284
290
  ```
285
291
 
286
- #### `useShowThankYouConfiguration` ([source code](https://github.com/bigbinary/neeto-thank-you-nano/blob/fd519090a7b0ce63db912bdf795872bbdb6f9194/app/javascript/src/hooks/reactQuery/useThankYouConfigurationApi.js#L6))
292
+ #### `useShowThankYouConfiguration` ([source code](https://github.com/bigbinary/neeto-thank-you-nano/blob/5183a59e3a3f097e58498ed27395c4d35067e8d1/app/javascript/src/hooks/reactQuery/useThankYouConfigurationApi.js#L27))
287
293
 
288
294
  This hook is used to fetch the thank you configuration of the entity.
289
295
 
290
296
  ##### Props
291
297
 
292
298
  - `entityId` - ID of the entity to load the thank you configuration
299
+ - `id` - ID of the specific thank you configuration to fetch
293
300
 
294
301
  ##### Return value
295
302
 
@@ -305,7 +312,104 @@ import { useShowThankYouConfiguration } from "@bigbinary/neeto-thank-you-fronten
305
312
  const {
306
313
  isLoading: isThankYouActionLoading,
307
314
  data: { thankYouConfiguration } = {},
308
- } = useShowThankYouConfiguration({ entityId });
315
+ } = useShowThankYouConfiguration({
316
+ entityId,
317
+ id,
318
+ });
319
+ ```
320
+
321
+ #### `useFetchThankYouConfigurations` ([source code](https://github.com/bigbinary/neeto-thank-you-nano/blob/5183a59e3a3f097e58498ed27395c4d35067e8d1/app/javascript/src/hooks/reactQuery/useThankYouConfigurationApi.js#L7))
322
+
323
+ This hook is used to fetch multiple thank you configurations for an entity.
324
+
325
+ ##### Props
326
+
327
+ - `entityId` - ID of the entity to load the thank you configurations
328
+ - `filters` - Optional filters to apply when fetching configurations
329
+ - `options` - Optional React Query options
330
+
331
+ ##### Return value
332
+
333
+ Returns the `data` object which includes the `thankYouConfigurations` array
334
+ containing all thank you configurations for the entity, and an `isLoading`
335
+ boolean.
336
+
337
+ ##### Usage
338
+
339
+ ```js
340
+ import { useFetchThankYouConfigurations } from "@bigbinary/neeto-thank-you-frontend";
341
+
342
+ const { isLoading, data: { thankYouConfigurations } = {} } =
343
+ useFetchThankYouConfigurations(entityId, filters, options);
344
+ ```
345
+
346
+ #### `useCreateThankYouConfiguration` ([source code](https://github.com/bigbinary/neeto-thank-you-nano/blob/5183a59e3a3f097e58498ed27395c4d35067e8d1/app/javascript/src/hooks/reactQuery/useThankYouConfigurationApi.js#L18))
347
+
348
+ This hook is used to create a new thank you configuration for an entity.
349
+
350
+ ##### Props
351
+
352
+ - `entityId` - ID of the entity to create the thank you configuration for
353
+ - `options` - Optional React Query mutation options
354
+
355
+ ##### Return value
356
+
357
+ Returns a mutation function and mutation state including `isPending` and `error`
358
+ properties.
359
+
360
+ ##### Usage
361
+
362
+ ```js
363
+ import { useCreateThankYouConfiguration } from "@bigbinary/neeto-thank-you-frontend";
364
+
365
+ const { mutate: createConfiguration, isPending } =
366
+ useCreateThankYouConfiguration(entityId);
367
+ ```
368
+
369
+ #### `useUpdateThankYouConfiguration` ([source code](https://github.com/bigbinary/neeto-thank-you-nano/blob/5183a59e3a3f097e58498ed27395c4d35067e8d1/app/javascript/src/hooks/reactQuery/useThankYouConfigurationApi.js#L34))
370
+
371
+ This hook is used to update an existing thank you configuration.
372
+
373
+ ##### Props
374
+
375
+ - `id` - ID of the thank you configuration to update
376
+ - `options` - Optional React Query mutation options
377
+
378
+ ##### Return value
379
+
380
+ Returns a mutation function and mutation state including `isPending` and `error`
381
+ properties.
382
+
383
+ ##### Usage
384
+
385
+ ```js
386
+ import { useUpdateThankYouConfiguration } from "@bigbinary/neeto-thank-you-frontend";
387
+
388
+ const { mutate: updateConfiguration, isPending } =
389
+ useUpdateThankYouConfiguration(configurationId);
390
+ ```
391
+
392
+ #### `useDeleteThankYouConfiguration` ([source code](https://github.com/bigbinary/neeto-thank-you-nano/blob/5183a59e3a3f097e58498ed27395c4d35067e8d1/app/javascript/src/hooks/reactQuery/useThankYouConfigurationApi.js#L44))
393
+
394
+ This hook is used to delete a thank you configuration.
395
+
396
+ ##### Props
397
+
398
+ - `entityId` - ID of the entity that owns the thank you configuration
399
+ - `options` - Optional React Query mutation options
400
+
401
+ ##### Return value
402
+
403
+ Returns a mutation function and mutation state including `isPending` and `error`
404
+ properties.
405
+
406
+ ##### Usage
407
+
408
+ ```js
409
+ import { useDeleteThankYouConfiguration } from "@bigbinary/neeto-thank-you-frontend";
410
+
411
+ const { mutate: deleteConfiguration, isPending } =
412
+ useDeleteThankYouConfiguration(entityId);
309
413
  ```
310
414
 
311
415
  # Instructions for Publishing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-thank-you-frontend",
3
- "version": "2.1.44",
3
+ "version": "2.1.45",
4
4
  "description": "A repo acts as the source of truth for the new nano's structure, configs, data etc.",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://github.com/bigbinary/neeto-thank-you-nano",
@@ -58,15 +58,15 @@
58
58
  "@babel/preset-typescript": "7.26.0",
59
59
  "@babel/runtime": "7.26.10",
60
60
  "@bigbinary/babel-preset-neeto": "^1.0.3",
61
- "@bigbinary/eslint-plugin-neeto": "1.6.2",
61
+ "@bigbinary/eslint-plugin-neeto": "1.6.3",
62
62
  "@bigbinary/neeto-cist": "1.0.17",
63
- "@bigbinary/neeto-commons-frontend": "4.13.39",
64
- "@bigbinary/neeto-editor": "1.47.7",
65
- "@bigbinary/neeto-filters-frontend": "4.3.19",
66
- "@bigbinary/neeto-icons": "1.20.47",
63
+ "@bigbinary/neeto-commons-frontend": "4.13.43",
64
+ "@bigbinary/neeto-editor": "1.47.16",
65
+ "@bigbinary/neeto-filters-frontend": "4.3.21",
66
+ "@bigbinary/neeto-icons": "1.20.49",
67
67
  "@bigbinary/neeto-image-uploader-frontend": "2.3.18",
68
- "@bigbinary/neeto-molecules": "3.16.49",
69
- "@bigbinary/neetoui": "8.3.6",
68
+ "@bigbinary/neeto-molecules": "3.16.63",
69
+ "@bigbinary/neetoui": "8.3.9",
70
70
  "@emotion/is-prop-valid": "1.2.0",
71
71
  "@faker-js/faker": "8.2.0",
72
72
  "@honeybadger-io/js": "6.10.1",
@@ -138,8 +138,8 @@
138
138
  "process": "^0.11.10",
139
139
  "qs": "^6.11.2",
140
140
  "ramda": "0.29.0",
141
- "react": "18.2.0",
142
- "react-dom": "18.2.0",
141
+ "react": "18.3.1",
142
+ "react-dom": "18.3.1",
143
143
  "react-helmet": "^6.1.0",
144
144
  "react-i18next": "12.3.1",
145
145
  "react-router-dom": "5.3.3",
@@ -166,20 +166,20 @@
166
166
  "webpack": "5.76.0",
167
167
  "webpack-assets-manifest": "^5.1.0",
168
168
  "webpack-cli": "4.10.0",
169
- "webpack-dev-server": "^4.15.0",
169
+ "webpack-dev-server": "^5.2.1",
170
170
  "yup": "0.32.11",
171
171
  "zustand": "4.4.2"
172
172
  },
173
173
  "peerDependencies": {
174
174
  "@babel/runtime": "7.26.10",
175
175
  "@bigbinary/neeto-cist": "1.0.17",
176
- "@bigbinary/neeto-commons-frontend": "4.13.39",
177
- "@bigbinary/neeto-editor": "1.47.7",
178
- "@bigbinary/neeto-filters-frontend": "4.3.19",
179
- "@bigbinary/neeto-icons": "1.20.47",
176
+ "@bigbinary/neeto-commons-frontend": "4.13.43",
177
+ "@bigbinary/neeto-editor": "1.47.16",
178
+ "@bigbinary/neeto-filters-frontend": "4.3.21",
179
+ "@bigbinary/neeto-icons": "1.20.49",
180
180
  "@bigbinary/neeto-image-uploader-frontend": "2.3.18",
181
- "@bigbinary/neeto-molecules": "3.16.49",
182
- "@bigbinary/neetoui": "8.3.6",
181
+ "@bigbinary/neeto-molecules": "3.16.63",
182
+ "@bigbinary/neetoui": "8.3.9",
183
183
  "@honeybadger-io/js": "6.10.1",
184
184
  "@honeybadger-io/react": "6.1.25",
185
185
  "@tailwindcss/container-queries": "^0.1.1",
@@ -200,8 +200,8 @@
200
200
  "path-browserify": "^1.0.1",
201
201
  "qs": "^6.11.2",
202
202
  "ramda": "0.29.0",
203
- "react": "18.2.0",
204
- "react-dom": "18.2.0",
203
+ "react": "18.3.1",
204
+ "react-dom": "18.3.1",
205
205
  "react-helmet": "^6.1.0",
206
206
  "react-i18next": "12.3.1",
207
207
  "react-router-dom": "5.3.3",
@@ -220,7 +220,9 @@
220
220
  "resolutions": {
221
221
  "postcss": "^8",
222
222
  "wrap-ansi": "7.0.0",
223
- "string-width": "4.1.0"
223
+ "string-width": "4.1.0",
224
+ "react": "18.3.1",
225
+ "react-dom": "18.3.1"
224
226
  },
225
227
  "engines": {
226
228
  "node": ">=22.13",
@@ -13,6 +13,7 @@ type SocialHandle = {
13
13
  };
14
14
 
15
15
  interface ConfigureThankYouProps {
16
+ id?: string;
16
17
  breadcrumbs: Breadcrumb[];
17
18
  socialHandles?: SocialHandle[];
18
19
  entityId: string;