freemium-survey-components 2.0.484 → 2.0.486

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.
@@ -0,0 +1,19 @@
1
+ # Alerts Configuration
2
+
3
+ No alerting is configured for this repo, and none is expected to be — it has no runtime to alert
4
+ on (see [Monitoring → Overview](monitoring.md)).
5
+
6
+ The only automated notification wired up in this repo is a best-effort Slack post on successful
7
+ npm publish, defined in `.github/workflows/automated-version-bump.yml` (`Notify Slack channel`
8
+ step): it posts to `SLACK_WEBHOOK_URL` (if configured as a repo secret) announcing the package
9
+ name, version, and release URL after a version-bump PR is merged and published. This step runs
10
+ with `continue-on-error: true` — a missing webhook or a failed post does not fail the workflow and
11
+ nobody is alerted if it silently fails.
12
+
13
+ If GitHub Actions failure notifications matter to this team (e.g. a failed `publish-after-merge`
14
+ job), they come from GitHub's own workflow-failure notification settings for the repo/org, not from
15
+ anything configured inside this codebase.
16
+
17
+ > [UNVERIFIED] Whether org-level GitHub Actions failure notifications (email/Slack) are configured
18
+ > for this repo outside of the workflow file itself was not checked — that would live in GitHub
19
+ > org/repo notification settings, not in source control.
@@ -0,0 +1,73 @@
1
+ # How to Debug
2
+
3
+ ## 1. Enable the library's built-in debug logging
4
+
5
+ `src/utils.tsx`'s `appLogger` gates every internal `console.log` call behind a `localStorage` flag
6
+ read by `getFreshSurveyDebug` (`src/constants.ts`: `FRESH_SURVEY_DEBUG = 'fsc:debug'`). In the
7
+ browser console, on the page rendering the survey:
8
+
9
+ ```js
10
+ localStorage.setItem('fsc:debug', JSON.stringify({ log: true }));
11
+ // then reload the page
12
+ ```
13
+
14
+ This turns on `appLogger('Survey', {...})`, `appLogger('Card', {...})`,
15
+ `appLogger('Standard', {...})`, `appLogger('Widget', {...})`, and per-`useEffect` logging inside
16
+ `useCardSurvey`/`useStandardSurvey` — each call logs the component name and the full current
17
+ props/state (survey, answers, active block/index, rendered blocks). This is the fastest way to see
18
+ exactly what the navigation engine believes the current state is.
19
+
20
+ `src/types.ts`'s `FreshSurveyDebugType` defines sibling debug flags used by other SurveyServ
21
+ frontends under the same `localStorage` mechanism (`fwa:debug` for the admin app, `mfe:debug` for
22
+ the microfrontend, `spw:debug` for the public widget, `spp:debug` for the public page, `fui:debug`
23
+ for `freemium-ui`) — if you're debugging an issue that spans this library and its host, check
24
+ whether the host has its own equivalent flag.
25
+
26
+ > **Security note:** this logs the *full* current props/state, including `answers.formValues` —
27
+ > real survey respondent data (which may include names, emails, free-text answers, or other PII).
28
+ > Only enable `fsc:debug` in non-production environments. If you must reproduce against production
29
+ > data, redact identifying fields before sharing the console output, and clear the `fsc:debug` key
30
+ > from `localStorage` afterward (it persists across page reloads and sessions until removed).
31
+
32
+ ## 2. Reproduce in Storybook first
33
+
34
+ Before debugging inside a consumer app, try to reproduce with the same survey shape in Storybook
35
+ (`npm run storybook`) using a story under `src/stories/` or `src/survey/*.stories.tsx`, adapting
36
+ `src/mocks/index.ts`'s `MOCK_SURVEY` to match the reported shape. If it reproduces in Storybook,
37
+ the bug is in this repo; if it doesn't, the bug is likely in the consumer's integration (see
38
+ [Support](support.md)).
39
+
40
+ ## 3. Isolate: navigation/branching vs. rendering vs. validation
41
+
42
+ - **Wrong question shown next / survey ends too early or too late** → the bug is almost certainly
43
+ in `src/survey/utils/logics.ts` (`getNextLogicalBlock`, `fetchNextBlockIndex`,
44
+ `getNextBlockIndex`, `evaluateConditions`). Log the survey's `blocks`/`dependent_blocks`/
45
+ `display_logic` and the current `answers.formValues` (via `fsc:debug`) and trace which branch of
46
+ `evaluateConditions` should fire for the given operator/answer.
47
+ - **A question renders with the wrong widget or missing data** → check the `switch` in
48
+ `src/survey/question.tsx` for that `question_type`, and the corresponding component under
49
+ `src/components/`.
50
+ - **A "Next"/"Submit"/"Skip" button is missing, disabled, or in the wrong state** → check
51
+ `canDisplayButton`/`canDisableButton` (`logics.ts`) for that `ActionButtonTypes` case — these
52
+ functions are shared across all three layouts, so also check whether `surveyStyle`/`isWidget`/
53
+ `isMobile` branches inside the specific case are gating on the wrong condition for your layout.
54
+ - **A field won't let the user proceed / shows a validation error incorrectly** → check the
55
+ relevant `*Validator` function in `logics.ts` (`dateValidator`, `formValidator`,
56
+ `textboxValidator`, `contactformValidator`, `fileUploadQnValidator`) and the corresponding
57
+ `ValidatingQuestions` error bucket.
58
+
59
+ ## 4. Check for the known sharp edges first
60
+
61
+ Before deep-diving, rule out the documented gotchas in
62
+ [Deep Dive → Failure modes & sharp edges](../architecture/deep-dive.md#6-failure-modes--sharp-edges) —
63
+ in particular: `null` vs `undefined` in `answers.formValues` (skip vs. unanswered), the
64
+ `survey.updated_at`-keyed caching in `useSurvey`, and README examples that no longer match the
65
+ current prop shapes.
66
+
67
+ ## 5. There is no server-side log to check
68
+
69
+ Because this library never makes a network call itself, there is no backend log, trace, or APM
70
+ entry to correlate against — everything observable happens in the consumer's browser. If the
71
+ report includes a network-layer symptom (e.g. `onFileUpload` failing), the failure is inside the
72
+ callback the **host** implemented, not inside this library's call site — confirm the host's
73
+ implementation of `onFileUpload`/`onSubmit` before assuming a library bug.
@@ -0,0 +1,26 @@
1
+ # Monitoring — Overview
2
+
3
+ `freemium-survey-components` is a build-time-consumed UI component library, not a running
4
+ service. There is no deployed process, endpoint, container, or pod for this repo to monitor — it
5
+ has no uptime, no request rate, no dashboards of its own.
6
+
7
+ What actually needs watching lives elsewhere:
8
+
9
+ - **Runtime errors and rendering issues** surface inside the four consuming applications
10
+ (`survey-public-widget`, `survey-public-page`, `freshsurvey-web-admin-app`,
11
+ `survey-admin-microfrontend`) — their own frontend error monitoring / RUM tooling is where a bug
12
+ in this library would actually be observed in production. See
13
+ [How to Debug](how-to-debug.md) for how to correlate an issue back to this repo.
14
+ - **Build/publish health** is observable via GitHub Actions runs on
15
+ `.github/workflows/automated-version-bump.yml` (version-bump PR creation and the
16
+ publish-after-merge job) — a failed `npm publish` or `npm run build` step there is the closest
17
+ thing this repo has to an "incident."
18
+ - **Bundle size** (`lib/index.esm.js` / `lib/index.cjs.js` ~839 KB gzipped JS, `lib/bundle.css`
19
+ ~42 KB gzipped as of this writing) is not tracked automatically in CI today — see
20
+ [Deep Dive → Failure modes](../architecture/deep-dive.md#6-failure-modes--sharp-edges). If this
21
+ is added in the future, this page should be updated to describe it.
22
+ - **Storybook/Chromatic** (`npm run chromatic`) provides visual-regression signal at PR time, not
23
+ runtime monitoring — see [Getting Started](../getting-started.md).
24
+
25
+ There is no APM, log aggregation, or metrics pipeline configured in this repo, and none is
26
+ expected for a library with this shape.
@@ -0,0 +1,22 @@
1
+ # Recent Issues
2
+
3
+ This page tracks recent notable fixes merged to this repo, as a quick "have we seen this before"
4
+ reference. Source: `git log` on `main`. Update this list as new notable fixes land — do not let it
5
+ grow unbounded; keep roughly the last 10–15 entries and drop the oldest.
6
+
7
+ | Ticket | Summary |
8
+ | ------------------------ | --------------------------------------------------------------------------------------------------- |
9
+ | FSURVEY-8673 | Added `enableAnalytics` flag to `ProductConfigType`. |
10
+ | FSURVEY-8628 | Renamed the thank-you header CSS class to `fsc-thankyou-footer`. |
11
+ | FSURVEY-8568 | Fixed the `RESOLUTION` question and thank-you card rendering together and ignoring other questions. |
12
+ | FSURVEY-8425 | Fixed Facebook-channel-preview button alignment and a NUMBER-variant issue with a minimum of 0. |
13
+ | FSURVEY-8425 (follow-up) | Fixed MCQ rendering issues in the survey. |
14
+ | FSURVEY-8546 | Hid the widget footer when it would render no visible content. |
15
+ | MISC | Onboarded this repo to the Prism software catalog (`catalog-info.yaml`, `techdocs-ref: dir:.`). |
16
+
17
+ For anything not covered here, search closed PRs/issues on `freshdesk/freemium-survey-components`
18
+ by `FSURVEY-` ticket prefix, or search Confluence space `SP` for
19
+ "freemium-survey-components" (engineering briefs, roadmap docs) — see
20
+ [Deep Dive → Failure modes & sharp edges](../architecture/deep-dive.md#6-failure-modes--sharp-edges)
21
+ for the known, still-open structural issues (no test coverage, no PR CI gate, undeclared `lodash`
22
+ dependency, inconsistent HTML sanitization) that are more "known risk" than "recent issue."
@@ -0,0 +1,44 @@
1
+ # SOP (Standard Operating Procedures)
2
+
3
+ There is no running service to operate, restart, scale, or fail over — see
4
+ [Monitoring → Overview](monitoring.md). The procedures below cover the two situations that
5
+ actually recur for a published component library: cutting a release, and reacting to a broken
6
+ release.
7
+
8
+ ## Cutting a release
9
+
10
+ Follow [Getting Started → Versioning & npm publish flow](../getting-started.md#versioning--npm-publish-flow):
11
+ trigger `automated-version-bump.yml` via `workflow_dispatch`, choose the version bump type, review
12
+ and merge the generated PR, then confirm the `publish-after-merge` job succeeded (npm publish + git
13
+ tag + GitHub Release).
14
+
15
+ Before triggering a release:
16
+
17
+ - Run `npm run build` locally and confirm it succeeds (CI does not run this for you on the
18
+ version-bump PR — see [Deep Dive → Failure modes](../architecture/deep-dive.md#6-failure-modes--sharp-edges)).
19
+ - Run `npm run test-storybook` against a running/built Storybook and confirm no unexpected
20
+ snapshot diffs.
21
+ - If the change affects a `PUBLIC` export's shape (see
22
+ [Deep Dive → Contracts & interfaces](../architecture/deep-dive.md#2-contracts--interfaces)),
23
+ choose `minor` or `major` accordingly, not `patch`, and note the breaking change in the PR.
24
+
25
+ ## Reacting to a broken release (bad version published to npm)
26
+
27
+ 1. **Do not attempt to unpublish** — npm restricts unpublishing versions with existing downloads;
28
+ treat forward-fixing as the default path.
29
+ 2. Trigger `automated-version-bump.yml` again with `version_type: patch` for a fix once the
30
+ regression is corrected on `main`.
31
+ 3. Notify the four consuming repos (`survey-public-widget`, `survey-public-page`,
32
+ `freshsurvey-web-admin-app`, `survey-admin-microfrontend`) if any of them auto-upgrade or are
33
+ about to release against the bad version — see
34
+ [Deep Dive → Dependencies & coupling](../architecture/deep-dive.md#3-dependencies--coupling)
35
+ for why version skew across consumers means impact isn't uniform or immediate.
36
+ 4. If the break is severe enough that consumers must pin away from it, communicate the last-known-good
37
+ version explicitly (e.g. in the incident thread / PR) since there is no automated deprecation
38
+ tooling wired into this repo's publish workflow.
39
+
40
+ ## Rolling back a merged-but-bad PR on `main`
41
+
42
+ Standard git revert-and-release: revert the offending commit(s) on `main`, then follow "Cutting a
43
+ release" above for a `patch` release containing the revert. There is no separate rollback
44
+ mechanism for a published npm package beyond publishing a new (higher) version.
@@ -0,0 +1,39 @@
1
+ # Support — Overview
2
+
3
+ **Owning team:** `platforms/plat-maise-surveyserv` (system: `platforms/surveyserv`).
4
+
5
+ Because this library has no runtime of its own, "support" for it means one of two things:
6
+
7
+ 1. **A consumer app hits a bug that traces back to this library** (rendering, navigation/branching,
8
+ validation, or a question-type widget behaving incorrectly). Start with
9
+ [How to Debug](how-to-debug.md) to confirm the bug is actually in this repo and not in how a
10
+ consumer is calling `Survey`/`WebInAppSurvey`/`ChannelPreview`, then file/fix it here.
11
+ 2. **A consumer needs a change to the public contract** (new question type, new prop, new exported
12
+ component) — see [Deep Dive → Change guidance](../architecture/deep-dive.md#7-change-guidance)
13
+ for what has to change together, and [Deep Dive → Contracts & interfaces](../architecture/deep-dive.md#2-contracts--interfaces)
14
+ for what's safe to change without a version bump vs. what's a breaking change for the four
15
+ dependent repos.
16
+
17
+ ## Where to raise things
18
+
19
+ - **Bugs / feature requests against this repo:** GitHub issues on
20
+ `freshdesk/freemium-survey-components` (see `bugs.url` in `package.json`), or a PR directly using
21
+ this repo's `.github/pull_request_template.md`.
22
+ - **"Is this library or my integration?"** — reproduce against a Storybook story first
23
+ (`npm run storybook`); if the same survey/question renders correctly in Storybook with the same
24
+ props but not in your app, the issue is very likely in how the consumer is calling the component
25
+ (prop shape, missing `onSubmit`/`callback()` invocation, CSS variable collision — see
26
+ [Deep Dive → Dependencies & coupling → Hidden coupling](../architecture/deep-dive.md#3-dependencies--coupling)),
27
+ not in this library.
28
+ - **Freshrelease tracking:** ticket IDs referenced in commit/PR titles in this repo follow the
29
+ `FSURVEY-xxxx` pattern (see recent `git log` history and `.github/pull_request_template.md`'s
30
+ Ticket Reference section).
31
+
32
+ ## What good bug reports include
33
+
34
+ - The exact `SurveyType` (or a minimal reproducing subset) and `answers` payload passed in.
35
+ - Which top-level component was used (`Survey` vs `WebInAppSurvey` vs `ChannelPreview`) and
36
+ `surveyStyle`/`surveyType`.
37
+ - Console output with `fsc:debug` logging enabled — see [How to Debug](how-to-debug.md).
38
+ - The installed `freemium-survey-components` version (`npm ls freemium-survey-components` in the
39
+ consumer repo).
package/lib/bundle.css CHANGED
@@ -3283,7 +3283,7 @@ div.surveyserv-widget-container.compact-container-style .fsc-radio-group button.
3283
3283
  .surveyserv-widget-container .question-container.thankyou .text,
3284
3284
  .freemium-survey-components .question-container.thankyou .text {
3285
3285
  text-align: center;
3286
- white-space: pre-wrap;
3286
+ white-space: normal;
3287
3287
  font-weight: 500;
3288
3288
  font-size: var(--message-font-size, var(--fsc-font-size));
3289
3289
  word-break: break-word;