Commit graph

602 commits

Author SHA1 Message Date
Kailash Nadh
ca97ea6a1b Fix clone campaign by fetching campaign body on clone. 2025-04-18 15:34:18 +05:30
Kailash Nadh
7a60161d7c Add visual editor Cypress tests. 2025-04-18 15:34:18 +05:30
Kailash Nadh
4e8d44f3cd Fix broken visual template cloning on the templates UI. 2025-04-18 15:34:18 +05:30
Kailash Nadh
77ea97e001 Add format/content type selection to campaign creation UI. 2025-04-18 15:34:18 +05:30
Kailash Nadh
3611f8f65a Fix visual editor change event/init/import sequences. 2025-04-18 15:34:18 +05:30
Kailash Nadh
17f9b3c6cd Stop fetching bodies for all campaigns and explicitly fetch for visual campaign import. 2025-04-18 15:34:18 +05:30
Kailash Nadh
b458698719 Fix DB state issues in visual campaign cloning. 2025-04-18 15:34:18 +05:30
Kailash Nadh
2c72293a06 Refactor 'media upload' integration in campaign visual editor. 2025-04-18 15:34:18 +05:30
Kailash Nadh
fe565ef27c Add Ctrl+S campaign save shortcut and add Ctrl+S and F9 to richtext editor. 2025-04-18 15:34:18 +05:30
Kailash Nadh
77ad76feb7 Update tsx formatting in email-builder. 2025-04-18 15:34:18 +05:30
Kailash Nadh
c60d5217bd Add support for converting all types to visual editor blocks. 2025-04-18 15:34:18 +05:30
Kailash Nadh
fb6fd26cd7 Fix incorrect template states in DB in campaign creation and broken preview. 2025-04-18 15:34:18 +05:30
Kailash Nadh
8f1f3dc896 Move email-builder src from / to /frontend. 2025-04-18 15:34:18 +05:30
Kailash Nadh
6f4bcddfe3 Refactor and simplify state management in campaign editor.
- Simplify and fix content conversion between formats.
- Fix state management issues.
- Rename `Apply` to `Import` on the visual template UI.
2025-04-18 15:34:18 +05:30
Kailash Nadh
ab6477ae2d Change visual editor UI language. 2025-04-18 15:34:18 +05:30
Kailash Nadh
dc4383da8e Fix compatibility issues with master.
- Fix merge conflicts.
- Simply logic in campaign preview handler.
- Remove redundant `GetCampaignForPreviewWithTemplate()` and switch to the old
  query that optionally takes a template.
- Fix Vue linting issues.
2025-04-18 15:34:18 +05:30
Vivek R
13898b2ea0 fix: remove unnecessary hack for visual-template overflow styling 2025-04-18 15:34:18 +05:30
Vivek R
7987dde092 fix: move visual-editor to iframe so that CSS styles are isolated 2025-04-18 15:34:18 +05:30
Vivek R
a7b2e6f7db fix: hide scroll if templates modal is active
this is to make sure it doesn't flicker when adding blocks in
visual-editor
2025-04-18 15:34:18 +05:30
Vivek R
a3c5a7001a feat: integrate media selector to visual editor and remove sample templates 2025-04-18 15:34:18 +05:30
Vivek R
19d4d4c9d5 feat: update visual template selection flow in campaigns 2025-04-18 15:34:18 +05:30
Vivek R
5cb58558bd fix: minor visual editor fixes 2025-04-18 15:34:18 +05:30
Vivek R
acd9c4b8e0 fix: visual template preview 2025-04-18 15:34:18 +05:30
Vivek R
cc5d69ddc2 fix: update yarn lock 2025-04-18 15:34:18 +05:30
Vivek R
352442ac47 feat: inject email-builder instead of loading it as ES module 2025-04-18 15:34:18 +05:30
Vivek R
72af88f730 feat: integrate with campaigns 2025-04-18 15:34:18 +05:30
Vivek R
c7ce685a10 refactor: richtext editor to standalone component 2025-04-18 15:34:18 +05:30
Vivek R
d05d04ccc0 refactor: Editor.vue component 2025-04-18 15:34:18 +05:30
Vivek R
9ecde931c1 feat: visual editor integration 2025-04-18 15:34:18 +05:30
Kailash Nadh
b44ea0c336 Merge branch 'fix-sql-search' 2025-04-18 15:33:41 +05:30
dependabot[bot]
fca8d6de25
Bump vite from 5.4.17 to 5.4.18 in /frontend (#2416)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.17 to 5.4.18.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.18/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.18/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.18
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-18 15:19:33 +05:30
Kailash Nadh
4b805f885b Fix broken subscribers:sql_query permission.
This permission was never checked for and had an unintended consequence of
allowing a non-superadmin user to execute arbitrary queries (expected), but
getting a superadmin session by joining the `sessions` table.

This patch:
- Introduces a table allowlist that uses the Postgres query plan (JSON)
  and validate the referenced tables against the allowed ones on arbitrary
  queries issued to the various `/subscribers` APIs.
- Explicitly adds the missing `subscribers:sql_query` permission check to all
  handlers that accept `query`.
- Introduces a new `search` parameter on all handlers that accept `query`.
  This parameter is an interface over the default name/email substring search
  instead of relying on `query`.
2025-04-18 14:15:47 +05:30
Pierre Neillo
5971bc4a5c
Fix Raw CSV example on import UI (#2392)
Signed-off-by: Pierre Neillo <pierre.neillo@free.fr>
2025-04-14 13:08:14 +05:30
dependabot[bot]
b3e6b09929
Bump vite from 5.4.15 to 5.4.17 in /frontend (#2391)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.15 to 5.4.17.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.17/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.17/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.17
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-06 15:33:41 +05:30
Kailash Nadh
e6d3aad0a1 Add ability to wait and healthcheck for backend app in Cypress settings tests. 2025-04-06 13:40:44 +05:30
Kailash Nadh
007f4de850 Fix a number of cosmetic inconsistenies across handlers and functions.
- Make the beginning of handlers consistent with uniform variable declaration
  and grouping.
- Add missing comments.
- Fix staticcheck/vet warnings and idiom issues.
2025-04-05 13:41:31 +05:30
Kailash Nadh
17998fbff5 Refactor user auth models and permission checks.
- Move user models from `/models` to `internal/auth`.
- Move and refactor various permission check functions into `User.()`
- Refactor awkward `get, manage bool` function args into `Get|Manage` bitflags.
2025-04-05 00:19:27 +05:30
Kailash Nadh
a271bf54d5 Introduce per-campaign filter permissions. Closes #2325.
This patch introduces new `campaigns:get_all` and `campaigns:manage_all`
permissions which alter the behaviour of the the old `campaigns:get` and
`campaigns:manage` permissions. This is a subtle breaking behavioural change.

Old:

- `campaigns:get` -> View all campaigns irrespective of a user's list
  permissions.
- `campaigns:manage` -> Manage all campaigns irrespective of a user's list
  permissions.

New:

- `campaigns:get_all` -> View all campaigns irrespective of a user's list
  permissions.
- `campaigns:manage_all` -> Manage all campaigns irrespective of a user's list
  permissions.
- `campaigns:get` -> View only the campaigns that have at least one list to
  which which a user has get or manage access.
- `campaigns:manage` -> Manage only the campaigns that have at list one list
  to which a user has get or manage access.

In addition, this patch refactors and cleans up certain permission related
logic and functions.
2025-03-31 16:39:42 +05:30
Kailash Nadh
a5f8b28cb1 Fix inconsistent behaviour in campaign scheduling on the UI.
- Fix status/button state management issues when `Send at` was toggled
  under various scenarios.
- Allow paused campaigns to be edited and turned into scheduled campaigns.
- Add Cypress UI tests for unscheduling.
2025-03-31 13:00:51 +05:30
Kailash Nadh
fbc27ae4b2 Refactor UI time diff display function to prefix '-' on past dates. 2025-03-31 12:56:43 +05:30
Kailash Nadh
b18c7ad0fb Fix incorrect loading spinner on the Lists UI. Closes #1822. 2025-03-30 10:53:54 +05:30
dependabot[bot]
d1c964da4f
Bump vite from 5.4.12 to 5.4.15 in /frontend (#2379)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.12 to 5.4.15.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.15/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.15/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-30 00:18:23 +05:30
Kailash Nadh
b8f50eafa3 Add support for domain allowlists in addition to blocklists. Closes #2230.
This patch introduces a new `Domain allowlist` input in Settings -> Privacy UI
as a new tab alongside domain `Domain blocklist`. If any domains are entered
here, then only subscriptions/imports/additions of e-mails from those particular
domains are accepted. blocklist is mutually exclusive with allowlist when there
are values in the allowlist.
2025-03-29 23:31:34 +05:30
Kailash Nadh
0be7a79dac Fix broken log rendering on importer UI. 2025-03-29 13:10:46 +05:30
dependabot[bot]
bc5b817554
Bump axios from 1.7.9 to 1.8.2 in /frontend (#2347)
Bumps [axios](https://github.com/axios/axios) from 1.7.9 to 1.8.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.9...v1.8.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 22:24:32 +05:30
dependabot[bot]
8dc5bc295c
Bump prismjs from 1.29.0 to 1.30.0 in /frontend (#2345)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.29.0...v1.30.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 10:53:59 +05:30
Kailash Nadh
2defef3857 Refactor SMTP name to always have email- prefix for consistency. 2025-02-14 18:38:47 +05:30
lcd1232
d055cc5311
Add support for selecting SMTP per campaign (#2290)
This patch adds a new optional `name` field to SMTP server config on the UI.
When a name is given to an SMTP server, it's initialized as a standalone messenger
which shows up as a sub-group item under the main "email" messenger
on the campaign page.

Co-authored-by: Kailash Nadh <kailash@nadh.in>
2025-02-11 22:41:45 +05:30
Sávio Ribeiro
2f5ab4c619
Display filename and milliseconds in timestamp on the logs admin UI (#2280) 2025-02-06 11:14:24 +05:30
dependabot[bot]
ad162c259a
Bump vite from 5.4.11 to 5.4.12 in /frontend (#2268)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-05 22:05:56 +05:30