Add configurable default project fallback for blank timesheet assignments#20
Open
jaromil wants to merge 8 commits into
Open
Add configurable default project fallback for blank timesheet assignments#20jaromil wants to merge 8 commits into
jaromil wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
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 frombudgets.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 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 on lines
+146
to
+148
| ;; check for errors | ||
| (map #(when (f/failed? %) (log/error (f/message %))) | ||
| [proj task tag project]) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
agiladmin.default-projectconfig normalization and startup validationTesting
clj -M:testnpm run test:e2e