Skip to content

Commit

Permalink
feat(surveys): preact surveys components (#964)
Browse files Browse the repository at this point in the history
* setup wip

* support new components in tests and add event listeners

* multiple choice and multiple question surveys

* connect multiple questions surveys and type fixes

* convert feedback widget

* working open choice option

* clean up unit tests

* fix confirmation box close

* missing lock file?

* fix test

* test

* test flakey test

* change order of capture wait

* test

* cypress leaving too quickly

* flakey test

* final fix??

* clean up useRef code

* add todos and address rating question type comments

* remove unused auto-text-color class

* collapse else ifs

* singular display state for surveys

* fix display status state

* fix test

* test

* this one test....

* fix: TSconfig to allow file structure for surveys (#1001)

* Refactor

* Fix

* fix?

* fix?

* option 2

* refactor and fixes

---------

Co-authored-by: Neil Kakkar <[email protected]>
Co-authored-by: Li Yi <[email protected]>

* fix check mark color on white backgrounds

* test

* fix weird cached state test

* fix open ended answer submit bug

* split up the survey shown and dismissed event test

* feat(surveys): render surveys preview method (#1020)

* Refactor

* Fix

* fix?

* fix?

* option 2

* refactor and fixes

* wip

* only export preview render

* read only mode for preview

* fix import

* add question index preview state

* refactor auto text color

* remove right css for preview

* border radius fix

* remove comments

* move render into loader-surveys

* add test and undo optional param

* type fixes

---------

Co-authored-by: Ben White <[email protected]>
Co-authored-by: Neil Kakkar <[email protected]>

---------

Co-authored-by: Ben White <[email protected]>
Co-authored-by: Neil Kakkar <[email protected]>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent fcf204a commit d47bbc9
Show file tree
Hide file tree
Showing 21 changed files with 2,228 additions and 1,790 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[
"@babel/transform-react-jsx",
{
"pragma": "Preact.h",
"pragmaFrag": "Preact.Fragment"
"runtime": "automatic",
"importSource": "preact"
}
]
]
Expand Down
700 changes: 573 additions & 127 deletions cypress/e2e/surveys.cy.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"babel-eslint": "10.1.0",
"babel-jest": "^26.6.3",
"cypress": "13.6.3",
"cypress-localstorage-commands": "^2.2.5",
"eslint": "8.56.0",
"eslint-config-posthog-js": "link:eslint-rules",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -80,6 +81,7 @@
"msw": "^1.2.1",
"node-fetch": "^2.6.11",
"posthog-js": "link:",
"preact-render-to-string": "^6.3.1",
"prettier": "^2.7.1",
"rollup": "^4.9.6",
"rollup-plugin-dts": "^6.1.0",
Expand Down
29 changes: 28 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export default [
preact: 'preact',
},
},
{
file: 'dist/surveys.esm.js',
format: 'es',
sourcemap: true,
},
],
plugins: [...plugins],
},
Expand Down
Loading

0 comments on commit d47bbc9

Please sign in to comment.