You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: elements/feedback/src/main.js
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,27 @@ import { styleEOX } from "./style.eox";
4
4
import"./feedback-button.js";
5
5
6
6
/**
7
-
* The `eox-feedback` element provides a modal dialog for collecting user feedback. It supports screenshot capture, customizable endpoint, and flexible styling.
8
-
* The feedback modal (`<eox-feedback></eox-feedback>`) can be included in the DOM directly or via a floating button (`<eox-feedback-button></eox-feedback-button>`), which can be positioned in any corner of the viewport.
7
+
* The `eox-feedback` element provides a modal dialog for collecting user feedback.
8
+
* It supports screenshot capture, customizable endpoint, and flexible styling.
9
+
* The feedback modal (`<eox-feedback></eox-feedback>`) can be included in the DOM
10
+
* directly or via a floating button (`<eox-feedback-button></eox-feedback-button>`),
11
+
* which can be positioned in any corner of the viewport.
12
+
*
13
+
* On submit, the element sends a `POST` request with `FormData` to the configured
14
+
* `endpoint`. The payload includes the feedback message (or custom form fields when
15
+
* using a `schema`), the current page URL, the browser's user agent, and optionally
16
+
* a screenshot file. This makes it straightforward to connect to any backend — for
17
+
* example a service that creates issues in a Git platform (GitLab, GitHub, …), sends
18
+
* notifications, or stores feedback in a database.
19
+
*
20
+
* The backend only needs to accept a `multipart/form-data` POST request, extract the
21
+
* fields and the optional file attachment, and then forward them to whatever system
22
+
* you use for tracking or processing feedback. Because all authentication and API
23
+
* tokens live on the server side, the browser never sees sensitive credentials.
24
+
* Typical backend responsibilities include input sanitization, CORS configuration to
25
+
* restrict which origins may submit feedback, and mapping the received fields into the
26
+
* format expected by the target system (e.g. composing an issue title and body, or
0 commit comments