Skip to content

Add configurable default project fallback for blank timesheet assignments#20

Open
jaromil wants to merge 8 commits into
masterfrom
default-project
Open

Add configurable default project fallback for blank timesheet assignments#20
jaromil wants to merge 8 commits into
masterfrom
default-project

Conversation

@jaromil

@jaromil jaromil commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

  • add agiladmin.default-project config normalization and startup validation
  • bill positive hours from blank assignment project cells to the configured default project
  • thread config-aware parsing through reports, recent project discovery, and upload diff flows
  • add browser coverage for the default-project fallback and document the setting

Testing

  • clj -M:test
  • npm run test:e2e

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for a configurable agiladmin.default-project that is used as a fallback when timesheet assignment project cells are blank, and threads that config-aware parsing through upload/preview, diffs, project/person reporting, and recent-project discovery.

Changes:

  • Add config schema support + normalization for agiladmin.default-project, plus startup validation that the configured project can be loaded from budgets.path.
  • Apply the default-project fallback in monthly hours parsing, and switch relevant flows to use a config-aware monthly loader.
  • Add/extend Clojure tests and Playwright coverage, and document the new setting.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/e2e/timesheet-upload.spec.js Adds browser test asserting blank project column assignments fall back to the configured default project.
test/agiladmin/view_timesheet_test.clj Verifies upload preview + diff both use the config-aware loader.
test/agiladmin/view_project_test.clj Updates arities and asserts config is passed into project monthly loading.
test/agiladmin/view_person_test.clj Ensures personnel page data uses the config-aware monthly loader.
test/agiladmin/ring_test.clj Ensures ring init validates default-project before side effects.
test/agiladmin/core_test.clj Adds unit tests for effective-project and default-project fallback behavior.
test/agiladmin/config_test.clj Adds tests for default-project normalization and validation failures.
src/agiladmin/view_timesheet.clj Uses config-aware loader for uploaded timesheet preview and diff.
src/agiladmin/view_project.clj Passes config into project monthly hours loading.
src/agiladmin/view_person.clj Uses config-aware loader when building personnel page hours dataset.
src/agiladmin/ring.clj Fails fast on config load failures; validates default-project before further initialization.
src/agiladmin/core.clj Introduces effective-project, configurable monthly loader, and updates recent-project discovery + project-hours loading.
src/agiladmin/config.clj Adds schema, normalization, accessor, and validation for default-project.
scripts/e2e/start-agiladmin.mjs Sets default-project in e2e config and generates an “unassigned” fixture for coverage.
scripts/e2e/generate-manager-fixture.clj Supports blanking a specified project column across all workbook sheets.
README.md Documents default-project behavior and startup validation.
doc/agiladmin.pocketbase.yaml Documents default-project in the PocketBase example config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/agiladmin/core.clj
Comment on lines +135 to +145
entry (if (and (not (nil? hours))
(> hours 0.0)
(not (f/failed? project))
(not (nil? project))
(cond-fn info))
{:month month
:name (:name timesheet)
:project (upper-case project)
:task (if-not (blank? task) (upper-case task) "") ;; uppercase all tasks
:tag (if-not (blank? tag) (upper-case tag) "") ;; uppercase all tags
:hours hours} nil)]
Comment thread src/agiladmin/core.clj
Comment on lines +146 to +148
;; check for errors
(map #(when (f/failed? %) (log/error (f/message %)))
[proj task tag project])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants