Skip to content

Commit b12ebbf

Browse files
authored
⬆️(frontend) update widget logic to latest version (#649)
The new widget loader consume `window._lasuite_widget` property to know which widget to load. The previous version was using `window._stmsg_header`. /!\ Update NEXT_PUBLIC_LAGAUFRE_WIDGET_PATH and NEXT_PUBLIC_FEEDBACK_WIDGET_PATH to target the new widget version before deploying this commit.
1 parent 3cd2fd1 commit b12ebbf

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/frontend/src/features/ui/components/feedback-button/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ export const SurveyButton = ({ iconOnly = false, ...props }: SurveyButtonProps)
4040
// Initialize the widget array if it doesn't exist
4141
if (typeof window !== "undefined" && widgetPath) {
4242
// eslint-disable-next-line @typescript-eslint/no-explicit-any
43-
(window as any)._stmsg_widget = (window as any)._stmsg_widget || [];
43+
(window as any)._lasuite_widget = (window as any)._lasuite_widget || [];
4444

4545
// Construct script URLs from the base path
4646
const feedbackScript = `${widgetPath}feedback.js`;
4747

4848
// Push the widget configuration
4949
// eslint-disable-next-line @typescript-eslint/no-explicit-any
50-
(window as any)._stmsg_widget.push([
50+
(window as any)._lasuite_widget.push([
5151
"feedback",
5252
"init",
5353
{

src/frontend/src/features/ui/components/feedback-widget/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ export function FeedbackWidget({
3030
// Initialize the widget array if it doesn't exist
3131
if (typeof window !== "undefined" && widgetPath) {
3232
// eslint-disable-next-line @typescript-eslint/no-explicit-any
33-
(window as any)._stmsg_widget = (window as any)._stmsg_widget || [];
34-
33+
(window as any)._lasuite_widget = (window as any)._lasuite_widget || [];
34+
3535
// Construct script URLs from the base path
3636
const loaderScript = `${widgetPath}loader.js`;
3737
const feedbackScript = `${widgetPath}feedback.js`;
38-
38+
3939
// Push the widget configuration
4040
// eslint-disable-next-line @typescript-eslint/no-explicit-any
41-
(window as any)._stmsg_widget.push([
41+
(window as any)._lasuite_widget.push([
4242
"loader",
4343
"init",
4444
{

src/frontend/src/features/ui/components/lagaufre/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const LagaufreButton = () => {
2020
if (typeof window == "undefined" || !widgetPath || !apiUrl) return;
2121

2222
// eslint-disable-next-line @typescript-eslint/no-explicit-any
23-
(window as any)._stmsg_widget = (window as any)._stmsg_widget || [];
23+
(window as any)._lasuite_widget = (window as any)._lasuite_widget || [];
2424

2525
// Construct script URLs from the base path
2626
const feedbackScript = `${widgetPath}lagaufre.js`;
@@ -48,7 +48,7 @@ export const LagaufreButton = () => {
4848

4949
// Initialize the widget
5050
// eslint-disable-next-line @typescript-eslint/no-explicit-any
51-
(window as any)._stmsg_widget.push([
51+
(window as any)._lasuite_widget.push([
5252
"lagaufre",
5353
"init",
5454
{
@@ -68,7 +68,7 @@ export const LagaufreButton = () => {
6868
if (!isWidgetInitialized) return;
6969

7070
// eslint-disable-next-line @typescript-eslint/no-explicit-any
71-
(window as any)._stmsg_widget.push([
71+
(window as any)._lasuite_widget.push([
7272
"lagaufre",
7373
"toggle"
7474
]);

0 commit comments

Comments
 (0)