Repository navigation
Reporting section schedule #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DinuniWork
wants to merge
60
commits into
development
Choose a base branch
from
reporting-section-schedule
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
0482baf
fix: ensure task status dropdown options are displayed in the correct…
DinuniWork 0be6cf8
feat: add reporting schedules API endpoints
DinuniWork c617e91
feat: enhance email functionality and add analytics reporting jobs
DinuniWork f569d40
feat: add scheduling functionality for reports
DinuniWork 421cf56
feat: enhance reporting components with scheduling capabilities
DinuniWork 702440f
feat: enhance reporting analytics with new scheduling features
DinuniWork 4981520
feat: update localization for scheduling features in reporting analytics
DinuniWork 68c8f3c
feat: integrate SESv2 for enhanced email functionality
DinuniWork fe6c528
feat: enhance reporting analytics with chart integration in exports
DinuniWork f969321
feat: enhance ScheduleReportModal layout for improved user experience
DinuniWork 773a350
refactor: streamline TimePicker component in ScheduleReportModal
DinuniWork a83ab78
refactor: improve ScheduledReportsHubPanel loading behavior
DinuniWork cbdf208
feat: add aria labels for row actions in reporting analytics
DinuniWork e93c16e
feat: enhance reporting analytics with multi-chart support in exports
DinuniWork 6f9ba39
feat: enhance analytics reporting with improved database connection h…
DinuniWork 3f42e01
feat: enhance project health reporting with date range filters
DinuniWork 040a914
feat: add date range filters to planned vs actual tasks reporting
DinuniWork b561b64
feat: implement date range filtering in planned vs actual milestones …
DinuniWork 95981a0
feat: add date range filtering to budget tracking analytics
DinuniWork a6d62b5
feat: enhance analytics schedules with new listing functionality
DinuniWork 9d713a8
feat: add timezone support to analytics schedule exports and filters
DinuniWork a931862
feat: enhance PDF export with a fixed header table and improved layout
DinuniWork 5ce688c
feat: enhance scheduled reports functionality with filter management
DinuniWork 7a06ae2
feat: integrate chartsheet for native Excel chart support in exports
DinuniWork 2309bdb
feat: enhance email reports with time range information
DinuniWork a6b1ced
feat: enhance project health analytics with explicit project tracking
DinuniWork 99ceb23
Merge branch 'development' into reporting-section-schedule
DinuniWork d68761d
feat: update untranslated locales with additional language support
DinuniWork dc6c0c9
Merge branch 'reporting-section-schedule' of https://github.com/Workl…
DinuniWork a5e09a6
feat: enhance reporting analytics with scheduling features
DinuniWork 329dd5f
feat: update localization for reporting analytics and enhance schedul…
DinuniWork eccbe12
feat: enhance analytics scheduling with multi-format support
DinuniWork c5955c3
feat: enhance PDF generation in analytics reports with new options
DinuniWork 004e5e3
fix: update PDF generation styles and structure for improved layout
DinuniWork 8dcd044
Merge branch 'development' of https://github.com/Worklenz/worklenz in…
DinuniWork e6c6bbd
chore: update google-auth-library to version 11.3.4 and adjust PDF ge…
DinuniWork 88aea81
feat: enhance reporting components with new action icons and styles
DinuniWork d9e0f57
feat: enhance Project Health reporting with side-by-side chart rendering
DinuniWork 16ca432
feat: improve Project Health Donut Chart export functionality
DinuniWork ae75716
feat: enhance Project Health Donut Chart styling for exports
DinuniWork 0c13ef8
feat: improve chart rendering and PDF export quality in Project Healt…
DinuniWork ede53a4
refactor: remove exportedOn parameter from PDF header components
DinuniWork addc7eb
feat: enhance PDF reporting with filter details and chart titles
DinuniWork e788a60
feat: enhance reporting analytics with table cell color support
DinuniWork e7e8eaf
feat: enhance reporting analytics with variance days formatting
DinuniWork a634a6e
feat: update localization for reporting analytics in multiple languages
DinuniWork e1c9e8f
feat: enhance analytics report scheduling with HTML email formatting …
DinuniWork d378de2
feat: enhance reporting analytics with chart hints and legends for PD…
DinuniWork ebbd323
Merge branch 'development' of https://github.com/Worklenz/worklenz in…
DinuniWork ff9d795
Repair reports hub merge and translations
chamikaJ febbf67
Resolve committed backend lockfile conflict
chamikaJ 16a1718
Fix analytics export and schedule review findings
chamikaJ d1ed181
Repair backend lockfile dependency resolution
chamikaJ e37369f
feat: enhance AllReportsPage with improved navigation and accessibility
DinuniWork e32b645
Restore unrelated dependency versions
chamikaJ 3671552
Merge branch 'reporting-section-schedule' of https://github.com/Workl…
DinuniWork 7be9af7
Merge branch 'reporting-section-schedule' of https://github.com/Workl…
DinuniWork c47abef
Fix merge conflicts in AllReportsPage.tsx by removing redundant code …
DinuniWork 7e757bb
feat: implement finance schedule access control
DinuniWork 50f7465
refactor: update schedule access control logic
DinuniWork File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
worklenz-backend/database/pg-migrations/1794300000000_create_analytics_report_schedules.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| "use strict"; | ||
|
|
||
| /** @type {import('node-pg-migrate').ColumnDefinitions | undefined} */ | ||
| exports.shorthands = undefined; | ||
|
|
||
| /** | ||
| * Recurring email schedules for analytics reports. | ||
| * Frequency fields mirror task_recurring_schedules (SCHEDULE_TYPE + day/interval | ||
| * columns). send_time is report-specific (recurring tasks have no time-of-day). | ||
| * | ||
| * @param {import('node-pg-migrate').MigrationBuilder} pgm | ||
| */ | ||
| exports.up = async (pgm) => { | ||
| pgm.sql(` | ||
| CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | ||
|
|
||
| DO $$ | ||
| BEGIN | ||
| IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'schedule_type') THEN | ||
| CREATE TYPE SCHEDULE_TYPE AS ENUM ( | ||
| 'daily', | ||
| 'weekly', | ||
| 'yearly', | ||
| 'monthly', | ||
| 'every_x_days', | ||
| 'every_x_weeks', | ||
| 'every_x_months' | ||
| ); | ||
| END IF; | ||
| END | ||
| $$; | ||
|
|
||
| CREATE TABLE IF NOT EXISTS analytics_report_schedules ( | ||
| id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), | ||
| team_id UUID NOT NULL REFERENCES teams(id) ON DELETE CASCADE, | ||
| owner_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, | ||
| report_kind VARCHAR(64) NOT NULL, | ||
| report_name VARCHAR(120) NOT NULL, | ||
| template_id UUID REFERENCES analytics_report_templates(id) ON DELETE CASCADE, | ||
|
|
||
| -- Recurrence (same shape as task_recurring_schedules) | ||
| schedule_type SCHEDULE_TYPE NOT NULL DEFAULT 'weekly'::SCHEDULE_TYPE, | ||
| days_of_week INTEGER[], | ||
| day_of_month INTEGER, | ||
| date_of_month INTEGER, | ||
| week_of_month INTEGER, | ||
| interval_days INTEGER, | ||
| interval_weeks INTEGER, | ||
| interval_months INTEGER, | ||
|
|
||
| -- Report schedules send at a clock time; recurring tasks do not | ||
| send_time TIME NOT NULL DEFAULT '08:00', | ||
| timezone VARCHAR(64) NOT NULL DEFAULT 'UTC', | ||
|
|
||
| recipients TEXT[] NOT NULL DEFAULT '{}', | ||
| format VARCHAR(16) NOT NULL DEFAULT 'PDF', | ||
| message TEXT, | ||
| filters_json JSONB NOT NULL DEFAULT '{}'::jsonb, | ||
|
|
||
| paused BOOLEAN NOT NULL DEFAULT FALSE, | ||
| last_sent_at TIMESTAMPTZ, | ||
| next_send_at TIMESTAMPTZ, | ||
|
|
||
| created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
|
||
| CONSTRAINT analytics_report_schedules_format_chk | ||
| CHECK (format IN ('PDF', 'CSV', 'Excel')), | ||
| CONSTRAINT analytics_report_schedules_recipients_chk | ||
| CHECK (cardinality(recipients) >= 1) | ||
| ); | ||
|
|
||
| COMMENT ON TABLE analytics_report_schedules IS | ||
| 'Email cadence for analytics reports. filters_json is fixed at save; export uses live data at send_time.'; | ||
| COMMENT ON COLUMN analytics_report_schedules.filters_json IS | ||
| 'Filter snapshot from the report page when the schedule was saved.'; | ||
| COMMENT ON COLUMN analytics_report_schedules.send_time IS | ||
| 'Local clock time in timezone when the live export should be emailed.'; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS idx_analytics_report_schedules_owner_kind_builtin | ||
| ON analytics_report_schedules(owner_id, report_kind) | ||
| WHERE template_id IS NULL; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS idx_analytics_report_schedules_owner_template | ||
| ON analytics_report_schedules(owner_id, template_id) | ||
| WHERE template_id IS NOT NULL; | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_analytics_report_schedules_team | ||
| ON analytics_report_schedules(team_id); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_analytics_report_schedules_due | ||
| ON analytics_report_schedules(next_send_at) | ||
| WHERE paused IS FALSE; | ||
| `); | ||
| }; | ||
|
|
||
| /** @param {import('node-pg-migrate').MigrationBuilder} pgm */ | ||
| exports.down = async (pgm) => { | ||
| pgm.sql(` | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_due; | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_team; | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_owner_template; | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_owner_kind_builtin; | ||
| DROP TABLE IF EXISTS analytics_report_schedules; | ||
| `); | ||
| }; |
58 changes: 58 additions & 0 deletions
58
...backend/database/pg-migrations/1794400000000_allow_multiple_analytics_report_schedules.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| "use strict"; | ||
|
|
||
| /** @type {import('node-pg-migrate').ColumnDefinitions | undefined} */ | ||
| exports.shorthands = undefined; | ||
|
|
||
| /** | ||
| * Allow multiple email schedules per report kind / template. | ||
| * Previously unique on (owner_id, report_kind) and (owner_id, template_id) | ||
| * limited each user to one schedule per report. | ||
| * | ||
| * @param {import('node-pg-migrate').MigrationBuilder} pgm | ||
| */ | ||
| exports.up = async (pgm) => { | ||
| pgm.sql(` | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_owner_kind_builtin; | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_owner_template; | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_analytics_report_schedules_owner_kind | ||
| ON analytics_report_schedules(owner_id, report_kind); | ||
|
|
||
| CREATE INDEX IF NOT EXISTS idx_analytics_report_schedules_owner_template | ||
| ON analytics_report_schedules(owner_id, template_id) | ||
| WHERE template_id IS NOT NULL; | ||
| `); | ||
| }; | ||
|
|
||
| /** @param {import('node-pg-migrate').MigrationBuilder} pgm */ | ||
| exports.down = async (pgm) => { | ||
| pgm.sql(` | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_owner_template; | ||
| DROP INDEX IF EXISTS idx_analytics_report_schedules_owner_kind; | ||
|
|
||
| -- Recreate prior uniqueness (keeps the earliest row per owner/kind or template). | ||
| DELETE FROM analytics_report_schedules a | ||
| USING analytics_report_schedules b | ||
| WHERE a.owner_id = b.owner_id | ||
| AND a.template_id IS NULL | ||
| AND b.template_id IS NULL | ||
| AND a.report_kind = b.report_kind | ||
| AND a.created_at > b.created_at; | ||
|
|
||
| DELETE FROM analytics_report_schedules a | ||
| USING analytics_report_schedules b | ||
| WHERE a.owner_id = b.owner_id | ||
| AND a.template_id IS NOT NULL | ||
| AND b.template_id IS NOT NULL | ||
| AND a.template_id = b.template_id | ||
| AND a.created_at > b.created_at; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS idx_analytics_report_schedules_owner_kind_builtin | ||
| ON analytics_report_schedules(owner_id, report_kind) | ||
| WHERE template_id IS NULL; | ||
|
|
||
| CREATE UNIQUE INDEX IF NOT EXISTS idx_analytics_report_schedules_owner_template | ||
| ON analytics_report_schedules(owner_id, template_id) | ||
| WHERE template_id IS NOT NULL; | ||
| `); | ||
| }; | ||
64 changes: 64 additions & 0 deletions
64
worklenz-backend/database/pg-migrations/1794500000000_analytics_report_schedule_formats.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| "use strict"; | ||
|
|
||
| /** @type {import('node-pg-migrate').ColumnDefinitions | undefined} */ | ||
| exports.shorthands = undefined; | ||
|
|
||
| /** | ||
| * Allow multiple export formats per analytics report schedule. | ||
| * Migrates `format` VARCHAR → `formats` TEXT[]. | ||
| * | ||
| * @param {import('node-pg-migrate').MigrationBuilder} pgm | ||
| */ | ||
| exports.up = async (pgm) => { | ||
| pgm.sql(` | ||
| ALTER TABLE analytics_report_schedules | ||
| ADD COLUMN IF NOT EXISTS formats TEXT[]; | ||
|
|
||
| UPDATE analytics_report_schedules | ||
| SET formats = ARRAY[format]::TEXT[] | ||
| WHERE formats IS NULL; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| ALTER COLUMN formats SET DEFAULT ARRAY['PDF']::TEXT[], | ||
| ALTER COLUMN formats SET NOT NULL; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| DROP CONSTRAINT IF EXISTS analytics_report_schedules_format_chk; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| DROP COLUMN IF EXISTS format; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| ADD CONSTRAINT analytics_report_schedules_formats_chk | ||
| CHECK ( | ||
| cardinality(formats) >= 1 | ||
| AND formats <@ ARRAY['PDF', 'CSV', 'Excel']::TEXT[] | ||
| ); | ||
| `); | ||
| }; | ||
|
|
||
| /** @param {import('node-pg-migrate').MigrationBuilder} pgm */ | ||
| exports.down = async (pgm) => { | ||
| pgm.sql(` | ||
| ALTER TABLE analytics_report_schedules | ||
| ADD COLUMN IF NOT EXISTS format VARCHAR(16); | ||
|
|
||
| UPDATE analytics_report_schedules | ||
| SET format = COALESCE(formats[1], 'PDF') | ||
| WHERE format IS NULL; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| ALTER COLUMN format SET DEFAULT 'PDF', | ||
| ALTER COLUMN format SET NOT NULL; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| DROP CONSTRAINT IF EXISTS analytics_report_schedules_formats_chk; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| DROP COLUMN IF EXISTS formats; | ||
|
|
||
| ALTER TABLE analytics_report_schedules | ||
| ADD CONSTRAINT analytics_report_schedules_format_chk | ||
| CHECK (format IN ('PDF', 'CSV', 'Excel')); | ||
| `); | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Removing schedule uniqueness without a per-owner cap lets one member enqueue unbounded recurring export and email work
The migration removes schedule uniqueness and no per-owner cap is added, so one member can queue unlimited recurring exports and emails.
Enforce a per-owner/per-team schedule cap under a lock, rate-limit schedule creation, and give the cron a per-tenant fair-share budget.
AI prompt