Commit Graph

2190 Commits

Author SHA1 Message Date
Cenk Kücük
b1ade191eb
remove healthcheck for custom.plausible.io (#3364) 2023-09-22 15:42:29 +02:00
Marko Saric
2c9c1590e4
Adding a note about WordPress plugin (#3358)
* Adding a note about WP plugin

* Make it pretty

* Add component for link in new tab

* Adjust link styling for dark mode

* Update Subscription.free (for testing purposes)

* More natural interface for syled_link

* Use <.styled_link> helper in change_domain.html.heex

* Mix format

* Fix warning

* Fix credo warning

---------

Co-authored-by: Uku Taht <uku.taht@gmail.com>
2023-09-21 12:55:56 +02:00
ruslandoga
c3910ae201
log mailer errors (#3336)
* log mailer errors

* update sentry to fix logger metadata bug

* update changelog
2023-09-21 13:06:28 +03:00
Uku Taht
be1a679933
Dogfooding improvements (#3290)
* Simplify tracking script template

* Track dashboard pages with anonymized URLs

* Track embedded dashboards as domain embed. + base_domain

* Add dogfood page ids for dashboard settings

* Add tracking to invitation form

* Start tracking register-via-invitation flow with custom event

* Remove leftover code

* Track logged-in status

* Add verified routes

* Inline dogfood routes

* Path -> Url

* Mix format

* Remove verified routes

* Inline dogfood_path
2023-09-21 13:05:50 +03:00
hq1
8c605865b6
Enforce goals unique (#3343)
* Enforce goals unique

* Remove unnecessary alias

* Skip tests that can no longer run anymore

To run, make sure the migration from
priv/repo/migrations/20230914071245_goals_unique.exs
is rolled back.

* Use separate transactions for the migration

* Update priv/repo/migrations/20230914071245_goals_unique.exs

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2023-09-21 10:00:24 +02:00
hq1
542385feab
Data Migration: rewrite funnels that contain duplicate goals (#3361)
* Add `RewriteFunnelDupes` data fix

To rewrite funnels referencing goals whose names
are the same. This enables us to enforce all goals
within the site unique later on.

* Credo

* Update priv/data_migrations/FunnelDupeGoals/sql/list-funnels-with-dupe-goal-ids.sql.eex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Revert unrelated changes

* Remove dead code

* Update lib/plausible/data_migration/rewrite_funnel_dupes.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Update lib/plausible/data_migration/rewrite_funnel_dupes.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2023-09-21 09:08:43 +02:00
Cenk Kücük
1a9dd0de90
Update Workflow Concurrency (#3359)
Ensures that only one workflow is running per branch at a time.

If you are working on a branch and push several commits in succession, any workflows in progress will be cancelled and only the last one will run.
2023-09-20 14:06:04 +02:00
Marko Saric
7bf16639b8
Open docs links in new window (#3360)
* Some fixes

* Open link in new window

* open in new window

* Open in new window
2023-09-20 11:50:50 +02:00
hq1
a5bac43981
[migration] Data fix: rewrite goals for which event_name and page_path both exist (#3357)
* Rewrite goals for which both event_name and page_path exist.

This might've happened due to the old form only hiding form
fields from the viewport, allowing to submit both values in
certain cases when switching tabs. The tabs behaviour has
been changed as of #3293 but no proper constraints existed.

* Add new check constraint to the goals schema

* Use NOT VALID option for adding the CHECK constraint

* Skip wrapping migration in a single transaction
2023-09-18 11:47:49 +02:00
hq1
8c077513ac
Fix Add Property button font weight (#3356) 2023-09-18 10:32:02 +02:00
dependabot[bot]
9601d81501
Bump docker/setup-buildx-action from 2 to 3 (#3354)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-18 09:58:42 +02:00
dependabot[bot]
3ef93d4c41
Bump docker/metadata-action from 4 to 5 (#3353)
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-18 09:57:05 +02:00
dependabot[bot]
a901333c2c
Bump docker/build-push-action from 4 to 5 (#3352)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-18 09:54:46 +02:00
dependabot[bot]
c0bd78724d
Bump docker/login-action from 2 to 3 (#3355)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-18 09:54:04 +02:00
dependabot[bot]
3464d2c890
Bump docker/setup-qemu-action from 2 to 3 (#3351)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-18 09:53:19 +02:00
dependabot[bot]
ce4c9fced5
Bump actions/checkout from 3 to 4 (#3338)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-14 14:13:34 +02:00
hq1
a9bfaed70f
Get rid of the funnels flag completely (#3341) 2023-09-13 15:54:09 +02:00
hq1
43be271836
Funnel Settings UI tweaks (to match Custom Props/Goals) (#3323)
* Add hint to creatable ComboBoxes without suggestions available

* Load external resources once in funnel settings

* Load external resources once in goal settings

* Make Custom Props Settings UI match Goal Settings

* Remove unnecessary goals query

This should be done only once in the live view

* Remove funnels feature flag

* fixup

* Make the modal scrollable

* By default, focus first suggestion for creatables

* Update StaticSearch

So it's capable of casting custom data structures
into weighted items. Missing tests added.

* Add Search + modal to funnel settings

* Add sample props to seeds

* Load all suggestions asynchronously, unless `Mix.env == :test`

* ComboBox: Fix inconsistent suggestions

We require "Create ..." element to be only focused
when there are no suggestions available.
This causes some issues, depending on the state,
the least focusable index might be either 0 ("Create...")
or 1. This patch addresses all the quirks with focus.

* Fix ComboBox max results message

So that AlpineJS doesn't think it's a focusable
option.

* Keep the state up to date when changing props

* Add hint to creatable ComboBoxes without suggestions available

* Load external resources once in funnel settings

* Load external resources once in goal settings

* Make Custom Props Settings UI match Goal Settings

* Remove unnecessary goals query

This should be done only once in the live view

* Remove funnels feature flag

* fixup

* Make the modal scrollable

* By default, focus first suggestion for creatables

* Add sample props to seeds

* Load all suggestions asynchronously, unless `Mix.env == :test`

* ComboBox: Fix inconsistent suggestions

We require "Create ..." element to be only focused
when there are no suggestions available.
This causes some issues, depending on the state,
the least focusable index might be either 0 ("Create...")
or 1. This patch addresses all the quirks with focus.

* Fix ComboBox max results message

So that AlpineJS doesn't think it's a focusable
option.

* Keep the state up to date when changing props

* Fixup site_id

* Fix typo

* fixup
2023-09-13 15:07:04 +02:00
hq1
0822bc61df
Props Settings UI to match Goals Settings (#3322)
* Add hint to creatable ComboBoxes without suggestions available

* Load external resources once in funnel settings

* Load external resources once in goal settings

* Make Custom Props Settings UI match Goal Settings

* Remove unnecessary goals query

This should be done only once in the live view

* Remove funnels feature flag

* fixup

* Make the modal scrollable

* By default, focus first suggestion for creatables

* Add sample props to seeds

* Load all suggestions asynchronously, unless `Mix.env == :test`

* ComboBox: Fix inconsistent suggestions

We require "Create ..." element to be only focused
when there are no suggestions available.
This causes some issues, depending on the state,
the least focusable index might be either 0 ("Create...")
or 1. This patch addresses all the quirks with focus.

* Fix ComboBox max results message

So that AlpineJS doesn't think it's a focusable
option.

* Keep the state up to date when changing props

* Update seeds with sensible prop names

* Make escape work for closing combobox suggestions

Co-authored-by: Uku Taht <Uku.taht@gmail.com>

* Revert "Make escape work for closing combobox suggestions"

This reverts commit 306866d2a1.

@ukutaht unfortunately this makes it impossible to select
an suggestion.

* Revert "Revert "Make escape work for closing combobox suggestions""

This reverts commit 4844857812.

* Make ESC great again

* Improve readability

---------

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
2023-09-13 14:55:29 +02:00
Uku Taht
7cb2c6bfa3
Allow admins to initiate ownership transfer from the CRM (#3340)
* Allow admins to initiate ownership transfer from the CRM

* Add stronger assertion for bulk invite action

* Fix compile warning

* Move bulk transfer logic to Sites module

* Replaces unused variables with _

* Add typespec for `bulk_transfer_ownership`

* Extract from keywordlist options instead of matching

* Fix and extend bulk transfer tests

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2023-09-12 16:24:28 +03:00
Adrian Gruntkowski
27a11fc5b7
Filter out empty entries when listing stats for UTM props (#3339)
* Filter out empty entries when listing stats for UTM props

* Update test fixtures removing noref entries in UTM CSV stat exports

* Update external API tests to account for lack of noref records for UTM stats

* Filter out entries with empty UTM props from imported GA stats

* Remove unreachable GA utm_source dim clause in imported stats logic
2023-09-12 09:11:50 +02:00
Vini Brasil
9b029c1558
Improve ownership transfers (#3326)
* Move inline functions to module

* Extend invite/4 for ownership transfers

* Verify inviter has sufficient permissions

* Ensure ownership transfers don't count as team member

This commit changes the team member usage query to exclude ownership
transfer invitations. Previously, when an ownership transfer was
pending, the team member usage was incremented.

* Draw attention to payment notice when transferring ownership

* Remove duplicate mail sending from membership_controller

---------

Co-authored-by: Uku Taht <uku.taht@gmail.com>
2023-09-12 10:06:24 +03:00
Cenk Kücük
45ed56b4d5
Add monitoring for ingest.plausible.io (#3334)
* Add monitoring for ingest.plausible.io

* fix deprecation warning

* fmt
2023-09-11 16:36:08 +02:00
Vini Brasil
e30ba8b27f
Silence undefined plan Sentry log for trials (#3332) 2023-09-07 16:37:21 +02:00
Uku Taht
275335071b
Update Tailwind to latest v3.3.3 (#3320)
* Update Tailwind to latest v3.3.3

* Upgrade autoprefixer and postcss

* Move tailwindcss plugins to devDependencies

* Remove unused tailwind rules

* Remove obsolete 'transform' rules

Ref: https://tailwindcss.com/docs/upgrade-guide#automatic-transforms-and-filters

* Use the current yellow, update gray to slate

* Move webpack to devdependencies

* Go more minimal with package.json changes

* Update autoprefixer version

* Update postcss version

* Adjust dark style colors

* Use proper node version is asdf config
2023-09-07 11:23:19 -03:00
hq1
ae0019afe5
Render keybinding hints in the range picker (#3325)
* Render keybinding hints in the range picker

There was a regression in #3321 - some keybinding
hints stopped appearing due to exact string matching.

* Switch casing
2023-09-05 15:20:56 +02:00
hq1
29d0f82182
Apply unified capitalization to buttons and titles (#3321) 2023-09-05 09:43:01 -03:00
hq1
5ff8526844
Fix custom domain showing up for the wrong reason (#3324) 2023-09-05 14:40:43 +02:00
hq1
a1be27eea6
s/superadmin/super_admin (#3318)
* s/superadmin/super_admin

* Add test
2023-09-05 09:17:39 +02:00
hq1
46f1149e3b
s/superuser/superadmin (#3317) 2023-09-04 18:25:08 +02:00
hq1
b2df714bdb
Bugfix: ComboBox navigation with creatable on top (#3316)
* Bugfix: ComboBox navigation with creatable on top

* !fixup

* !fixup

* !fixup

* !fixup
2023-09-04 14:56:31 +02:00
Vini Brasil
d22c011aa3
Implement limits for team members (#3305)
* Refactor MembershipController.invite_member/2

This commit refactors the controller action used for creating new
invitations. It moves the code to Plausible.Sites.invite/4 and replaces
`ifs` and `cases` with `with`.

* Add team_member_limit to plan definition

* Create usage and limits functions for team members

* Apply team member limit when inviting new users

* Add team members to Usage & Limits section

* Change invite function to receive email address instead of %User{}

* Wrap invite function in a DB transaction

* Remove unnecessary joins from team member usage query

* Replace UNION ALL with UNION to remove duplicates
2023-09-04 09:55:07 -03:00
hq1
b3ff695797
Improve goal settings UX (#3293)
* Add Heroicons dependency

* Add name_of/1 html helper

Currently with Floki there's no way to query for
`[name=foo[some]]` selector

* Update changelog

* Make goal deletion possible with only goal id

* Remove stale goal controllers

* Improve ComboBox component

- make sure the list options are always of the parent input width
- allow passing a suggestion function instead of a module

* Stale fixup

* Update routes

* Use the new goals route in funnel settings

* Use a function in the funnel combo

* Use function in the props combo

* Remove old goals form

* Implement new goal settings

* Update moduledoc

* Fix revenue switch in dark mode

* Connect live socket on goal settings page

* Fixup

* Use Heroicons.trash icon

* Tweak goals search input

* Remove unused alias

* Fix search/button alignment

* Fix backspace icon alignment

* Delegate :superadmin check to get_for_user/3

I'll do props settings separately, it's work in progress
in a branch on top of this one already. cc @ukutaht

* Rename socket assigns

* Fixup to 5c9f58e

* Fixup

* Render ComboBox suggestions asynchronously

This commit:
  - prevents redundant work by checking the socket connection
  - allows passing no options to the ComboBox component,
    so that when combined with the `async` option, the options
    are asynchronously initialized post-render
  - allows updating the suggestions asynchronously with the
    `async` option set to `true` - helpful in case of DB
    queries used for suggestions

* Update tests

* Throttle comboboxes

* Update tests

* Dim the search input

* Use debounce=200 in ComboBox component

* Move creatable option to the top

* Ensure there's always a leading slash for goals

* Test pageview goals with leading / missing

* Make the modal scrollable on small viewports
2023-09-04 13:44:22 +02:00
dependabot[bot]
f740cc899f
Bump eslint-plugin-playwright from 0.15.3 to 0.16.0 in /tracker (#3312)
Bumps [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright) from 0.15.3 to 0.16.0.
- [Release notes](https://github.com/playwright-community/eslint-plugin-playwright/releases)
- [Changelog](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/CHANGELOG.md)
- [Commits](https://github.com/playwright-community/eslint-plugin-playwright/compare/v0.15.3...v0.16.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-playwright
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 09:13:05 -03:00
Marko Saric
b0d99c5935
Update weekly_report.mjml.eex (#3313) 2023-09-01 09:12:42 -03:00
dependabot[bot]
691f4d36a5
Bump eslint from 8.46.0 to 8.48.0 in /tracker (#3302)
Bumps [eslint](https://github.com/eslint/eslint) from 8.46.0 to 8.48.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.46.0...v8.48.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-31 11:15:02 -03:00
RobertJoonas
5ba21c04fe
Remove Props FF (#3242)
* stop returning prop_names from /conversions

* remove the old prop-breakdown API route and CSV export

* remove allowed_event_props from CRM

* remove DeprecatedConversions

* remove props FF

* update changelog
2023-08-31 11:14:54 -03:00
Vini Brasil
43a926bdb3
Create new sandbox plans based on V4 (#3308) 2023-08-30 15:41:55 +01:00
Cenk Kücük
4ae0c68397
verify tls connection to clickhouse and postgres (#3254) 2023-08-30 14:34:19 +02:00
hq1
93a7cd5d49
Connect to live socket only on specific pages (#3292)
* Connect to live socket only on specific pages

And disable the "server blip" message on non-dev
environments. It's non actionable to our customers.

* Simplify meta tags rendering
2023-08-28 10:03:06 +02:00
dependabot[bot]
dbc3b91a4b
Bump @playwright/test from 1.37.0 to 1.37.1 in /tracker (#3275)
Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.37.0 to 1.37.1.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.37.0...v1.37.1)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-24 14:23:25 -03:00
Vini Brasil
5d9d05c1f6
Usage & Limits section (#3291)
* Update user_settings template to HEEX

* Move site_limit function to Billing.Quota

* Create Billing.Quota.site_usage function

* Move monthly_pageview_limit function to Billing.Quota

* Create Billing.Quota.monthly_pageview_usage function

* Add "Usage & Limits" section to user settings page

* Apply suggestions from code review
2023-08-24 14:22:49 -03:00
Uku Taht
8c870f7c6b Increase sampling test delta to reduce flakyness 2023-08-22 14:06:20 +03:00
Uku Taht
ab4eb75109
Inflate sampled results in Stats.Funnel.funnel/3 (#3270)
* Inflate sampled results in Stats.Funnel.funnel/3

* Add test for sampling

* Update test/plausible/funnels_test.exs

Co-authored-by: hq1 <hq@mtod.org>

* Ignore unused binding

* Use bang version of hash function

---------

Co-authored-by: hq1 <hq@mtod.org>
2023-08-22 12:33:48 +02:00
hq1
df19fad046
Set SECURE_COOKIE=false for local dev (#3289)
Safari won't allow to set it even for localhost
2023-08-22 10:17:01 +03:00
Uku Taht
da3d4366f6
Add login link to 404 page (#3288)
* Add login link to 404 page

* Fix 404 test

* Fix another test
2023-08-22 08:45:38 +02:00
hq1
b9fb6fd1a7
Revert "Revert "Reconfigure session cookie (#3274)" (#3284)" (#3285)
This reverts commit 65f7b4c5cc.
2023-08-22 08:18:08 +02:00
Uku Taht
cc60f1c942
Add new priority email template (#3283)
* Add new priority email template?

* Allow priority email to be sent with not layout

* Use priority email template for priority transactional emails

* Test for postmark message stream
2023-08-21 13:21:20 -03:00
ruslandoga
98d6bf3a4f
fix changelog (#3280)
* fix changelog

* use correct issue link
2023-08-21 10:22:35 -03:00
hq1
65f7b4c5cc
Revert "Reconfigure session cookie (#3274)" (#3284)
This reverts commit 63fabcbb5f.
2023-08-21 10:22:05 -03:00