Commit Graph

84 Commits (b08bdf7e0d4580dc62f51afa9de1e32082963fe7)

Author SHA1 Message Date
Michael Telatynski f1534fda79
Improve types (#11239) 2023-07-12 15:56:51 +01:00
Michael Telatynski ab972ddea9
PosthogAnalytics unwatch settings on logout (#11207)
* PosthogAnalytics unwatch settings on logout

* Tidy
2023-07-10 15:01:59 +00:00
Michael Telatynski cfd48b36aa
Enable strictPropertyInitialization (#11203) 2023-07-07 14:46:12 +01:00
Michael Telatynski 21ffc50f1e
Pass around MatrixClients instead of using MatrixClientPeg (#10984)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-06-01 14:43:24 +01:00
Michael Telatynski e4610e4672
Posthog properly handle Analytics ID changing from under us (#10702)
* Posthog properly handle Analytics ID changing from under us

* Update tests
2023-04-26 08:03:35 +00:00
Michael Telatynski 145a5a8a8d
Conform more code to strict null checking (#10153)
* Conform more code to strict null checking

* Conform more code to strict null checking

* Iterate

* Iterate
2023-02-15 13:36:22 +00:00
Michael Telatynski 61a63e47f4
Comply with noImplicitAny (#9940)
* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
2023-02-13 11:39:16 +00:00
Michael Telatynski 030b7e90bf
Enable `@typescript-eslint/explicit-function-return-type` in /src (#9788)
* Enable `@typescript-eslint/explicit-member-accessibility` on /src

* Prettier

* Enable `@typescript-eslint/explicit-function-return-type` in /src

* Fix types

* tsc strict fixes

* Delint

* Fix test

* Fix bad merge
2023-01-12 13:25:14 +00:00
Timo ce75d3381f
Pass analyticsID to the elementCall iFrame (#9637)
Co-authored-by: Robin <robin@robin.town>
Co-authored-by: Timo K <timok@element.io>
2022-12-22 12:09:57 +00:00
Michael Telatynski f1e8e7f140
Enable `@typescript-eslint/explicit-member-accessibility` on /src (#9785)
* Enable `@typescript-eslint/explicit-member-accessibility` on /src

* Prettier
2022-12-16 12:29:59 +00:00
Michael Weimann 526645c791
Apply prettier formatting 2022-12-12 12:24:14 +01:00
renovate[bot] c3809d3afa
Update all non-major dependencies (#9674)
* Typescript updates

* Update @types/node

* Fix more types

* Update all non-major dependencies

* Remove spurious cast

* Remove unused dependency rrweb-snapshot

* Update all non-major dependencies

* Iterate PR

* Update yarn.lock

* Remove stale dev dep

* Resolve

* Pin back axe-core for now, it is a bit too strict

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-07 00:36:23 +00:00
Michael Telatynski 28ecdc0cb4
Send layout analytics as WebLayout (#9482) 2022-11-04 09:10:37 +00:00
Michael Telatynski 8036985204
Update matrix-analytics-events to @matrix-org/analytics-events (#8778)
* Update matrix-analytics-events to @matrix-org/analytics-events

* Update install-deps.sh

* Update layered.sh

* Update BeaconMarker-test.tsx.snap

* Update BeaconStatus-test.tsx.snap
2022-06-07 20:08:36 +01:00
Germain 1ed68a718f
Add new user signup event tracking in PostHog (#8412) 2022-04-28 11:46:02 +01:00
Kerry a8d65ab5c5
Include /test in tsc config, fix rest of issues (#8119)
* fix ts issue in PosthogAnalytics test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix remaining ts issues

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tsconfig change

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use sdkconfig patch instead of put

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-23 10:27:28 +00:00
Travis Ralston fce36ec826
Delete groups (legacy communities system) (#8027)
* Remove deprecated feature_communities_v2_prototypes

* Update _components

* i18n

* delint

* Cut out a bit more dead code

* Carve into legacy components

* Carve into mostly the room list code

* Carve into instances of "groupId"

* Carve out more of what comes up with "groups"

* Carve out some settings

* ignore related groups state

* Remove instances of spacesEnabled

* Fix some obvious issues

* Remove now-unused css

* Fix variable naming for legacy components

* Update i18n

* Misc cleanup from manual review

* Update snapshot for changed flag

* Appease linters

* rethemedex

* Remove now-unused AddressPickerDialog

* Make ConfirmUserActionDialog's member a required prop

* Remove useless override from RightPanelStore

* Remove extraneous CSS

* Update i18n

* Demo: "Communities are now Spaces" landing page

* Restore linkify for group IDs

* Demo: Dialog on click for communities->spaces notice

* i18n for demos

* i18n post-merge

* Update copy

* Appease the linter

* Post-merge cleanup

* Re-add spaces_learn_more_url to the new SdkConfig place

* Round 1 of post-merge fixes

* i18n

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-22 23:07:37 +00:00
Travis Ralston d8a939df5d
Use & enforce snake_case naming convention on config.json settings (#8062)
* Document and support the established naming convention for config opts

This change:
* Rename `ConfigOptions` to `IConfigOptions` to match code convention/style, plus move it to a dedicated file
* Update comments and surrounding documentation
* Define every single documented option (from element-web's config.md)
* Enable a linter to enforce the convention
* Invent a translation layer for a different change to use
* No attempt to fix build errors from doing this (at this stage)

* Add demo of lint rule in action

* Fix all obvious instances of SdkConfig case conflicts

* Fix tests to use SdkConfig directly

* Add docs to make unset() calling safer

* Appease the linter

* Update documentation to match snake_case_config

* Fix more instances of square brackets off SdkConfig
2022-03-18 10:12:36 -06:00
Michael Telatynski 75e41b4c1c
Basic threads analytics into Posthog MVP (#7871) 2022-02-28 14:11:14 +00:00
Michael Telatynski 87ca70edb1
Switch to web-specific screens and $pageview event (#7777) 2022-02-10 14:38:31 +00:00
Michael Telatynski 91ccbe4395
Add way to track posthog user properties and send numSpaces (#7716) 2022-02-09 09:21:56 +00:00
Aaron Raimist 2e8a93834b Auto fix
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-12-09 09:10:23 +00:00
James Salter 43f264ccfc
Integrate analytics stubs (#7186)
* Add matrix-analytics-events as a dependency
* Make IEvent look like a stub definition
* Update pageview tracking to track screens, using a hypothetical definition of a screen event
* Remove distinction between pseudo and anon tracking, will need to rework it considering stubs
2021-12-06 21:43:42 +11:00
James Salter 5219b6be80
Analytics opt in for posthog (#6936)
* Add a new flag pseudonymousAnalyticsOptIn replacing analyticsOptIn, stored at account level, so people only need to opt in once.

* Show a toast in login to users that have analyticsOptIn set but not yet pseudonymousAnalyticsOptIn prompting them confirm the new method is okay. Update the copy of the existing opt-in toast. Don't notify users that previously opted out.

* Update the copy in settings

* Add a new learn more dialog

* Support a new config flag analyticsOwner which is used in these toasts when explaining which entity the data is sent to ("Help improve %(analyticsOwner)"). If unset, display brand. This allows deployments whose brand differs from the receiver of the analytics to explain the situation to their users (e.g. AcmeCorp badges their app, but explains the data is sent to Element, not them)

* The new opt-in and flags are only used when posthog is configured; prior to that there are no changes to UX or tracking behaviour.
2021-12-06 09:39:33 +11:00
James Salter 8b6778e1d3
Pass advanced_disable_decide to stop posthog contacting its decide endpoint (#7149) 2021-11-18 09:01:32 +11:00
Dariusz Niemczyk 2d1d42b90e
Globally replace all console.logs via codemod (#6827)
This commit replaces all the `console.log` to `logger.log` via an automated script.
Related: vector-im/element-web#18425
2021-09-21 09:48:09 -06:00
James Salter 73f9e48c11 Fix comment 2021-09-15 14:17:52 +01:00
James Salter 93321d96f0 lint 2021-09-15 14:10:15 +01:00
James Salter 8f1204c32e Update comment reflecting tracking scheme via analytics ID 2021-09-15 13:00:59 +01:00
James Salter 76c782c64c Remove all room data from tracking
Always redact room fragments entirely; remove room utils
2021-09-15 12:58:26 +01:00
James Salter 48fbbf2f44 Fix import, convert event type to constant 2021-09-15 09:48:48 +01:00
James Salter c2192a78bc More lint 2021-09-14 18:16:48 +01:00
James Salter 6c1dea09e8 lint 2021-09-14 17:46:56 +01:00
James Salter 7344a177e3 Fix tests, swallow errors 2021-09-14 17:35:32 +01:00
James Salter a43f5507a3 Use a UUID instead of hashed user ID for tracking
Generate a UUID and save it to account data for cross device tracking.
2021-09-14 15:30:42 +01:00
James Salter dc7aad1abf Revert "Revert "Add support for Posthog Analytics under a labs flag""
This reverts commit c5ea253181.
2021-08-03 11:55:02 +01:00
James Salter c5ea253181
Revert "Add support for Posthog Analytics under a labs flag" 2021-08-03 07:30:02 +01:00
James Salter 2cee2b5fd6 Update comment 2021-08-02 12:26:18 +01:00
James Salter 4755a81403 Disable analytics when user hasn't opted in or out 2021-08-02 12:23:42 +01:00
James Salter ce11e6c981
Update src/PosthogAnalytics.ts
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2021-08-02 11:45:49 +01:00
James Salter cd2bc79b6b Remove comment 2021-07-29 14:43:19 +01:00
James Salter a1ffd240e1 Use .instance pattern 2021-07-29 14:40:18 +01:00
James Salter 07eaee25d2 Default properties to {} to avoid passing it superfluously for events with no properties 2021-07-28 17:54:35 +01:00
James Salter 7b4a7711b2 Declare return types for all public methods, even void ones 2021-07-28 17:20:22 +01:00
James Salter 0a951501b2 lint 2021-07-28 17:04:18 +01:00
James Salter e5d36e9a81 Use arrow function instead of bind 2021-07-28 17:02:26 +01:00
James Salter b1bd5f57a4 Document IEvent.properties, fix IWelcomeScreenLoad
IEvent.properties is a placeholder that needs to be overriden by extenders for type validation to take place.

IWelcomeScreenLoad should have had properties declared for it. Because it didn't, a faulty call using it was possible.
2021-07-28 16:43:13 +01:00
James Salter 13ef819ba6 isEnabled returns a boolean 2021-07-28 16:42:56 +01:00
James Salter ce80e5a463 Remove superfluous unused argument 2021-07-28 14:44:28 +01:00
James Salter 279871ce01 Add types 2021-07-28 14:44:16 +01:00