Skip to content

Admin dashboard v2#389

Merged
nathanielrindlaub merged 3 commits into
mainfrom
admin-dashboard-v2
Mar 31, 2026
Merged

Admin dashboard v2#389
nathanielrindlaub merged 3 commits into
mainfrom
admin-dashboard-v2

Conversation

@nathanielrindlaub
Copy link
Copy Markdown
Member

Add created field to Projects + admin dashboard project editing support

Summary

Adds a created timestamp field to Project documents and extends updateProject to support editing timezone and availableMLModels for superusers, in support of an admin dashboard v2.


Changes

New Project.created field

  • Added created: Date to the Mongoose ProjectSchema with default: Date.now, so all new projects automatically record their creation timestamp.
  • Exposed created: Date! on the Project GraphQL type.

updateProject improvements

  • Added protection for the default_project — it can no longer be edited via this mutation.
  • Superuser-only: timezone and availableMLModels can now be set via UpdateProjectInput, but only by superusers. Non-superusers receive a ForbiddenError.
  • Additive-only availableMLModels: incoming model IDs are merged (union) with the existing array — models can only be added, never removed, to prevent unexpected downstream consequences. New model IDs are validated against the database before being accepted.

Backfill migration

  • Added backfill-project-created operation to operations.js that derives each existing project's created date from the ObjectId timestamp of its default "All images" view. Falls back to new Date() (with a warning) if no such view is found.

⚠️ Pre-deploy requirement: The backfill-project-created migration must be run against each environment before this deploy. Until it runs, existing project documents lack created, and any save() on those documents will fail Mongoose's required validation.

@nathanielrindlaub nathanielrindlaub merged commit 24c23d5 into main Mar 31, 2026
3 checks passed
@nathanielrindlaub nathanielrindlaub deleted the admin-dashboard-v2 branch March 31, 2026 00:40
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.

1 participant