Repository navigation
Slug for resources - #58
Conversation
Introduces a new 'slug' field for resources, enabling stable and human-readable URLs. This change includes: - Client-side auto-suggestion of slugs based on the resource name, which stops updating once manually edited. - Client-side and server-side validation for slug format (lowercase, numbers, single hyphens, max 120 characters). - Server-side enforcement of slug uniqueness within a team and within a location, including inactive resources, to prevent conflicts. - Updates to the API and data models to persist the slug.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Resource slug contract and editor client/src/features/resources/models/SaveResourceRequest.ts, client/src/features/resources/ResourceEditor.tsx, client/src/test/routes/(authenticated)/teams.resources.test.tsx |
The resource request includes a slug. The editor suggests a slug during creation, validates it, and includes it in save requests. Client tests cover suggestions, custom slugs, edits, and invalid values. |
Resource slug validation and persistence server/Models/Resources/SaveResourceRequest.cs, server/Services/TeamResourceService.cs, tests/server.tests/Controllers/TeamResourcesControllerTests.cs |
The service validates and trims slugs, checks for duplicates within teams and shared locations, and stores slugs on create and update. Server tests cover validation, conflicts, and updates. |
Space Slug Requests
| Layer / File(s) | Summary |
|---|---|
Required space slugs server/Models/Spaces/SaveSpaceRequest.cs, server/Controllers/AdminSpacesController.cs, tests/server.tests/Controllers/AdminSpacesControllerTests.cs |
Space requests require an explicit slug. The controller no longer generates a slug from the space name. Tests cover missing and blank slugs, explicit values, and updates. |
Package Version Display
| Layer / File(s) | Summary |
|---|---|
Version in the footer client/package.json, client/src/shared/GeometricFooter.tsx |
The package version changes to 1.0.0. The footer displays that version with the copyright notice. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Possibly related PRs
- ucdavis/booking#49: Introduced the resource management API and editor that this pull request updates to require and handle explicit slugs.
Suggested reviewers: cydoval
Merge Risk: 
Minimal · up to cda8e
-
The explicit slug changes have no identified merge-blocking issue; merge after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 39 functions across 10 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
This change removes server-side automatic slug generation for spaces and resources. Clients must now explicitly provide a valid slug during creation and update, simplifying server-side logic and standardizing slug management. Additionally, the client application's version is now displayed in the page footer.
|
@CodeRabbit full review |
✅ Action performed
|
Introduces a new 'slug' field for resources, enabling stable and human-readable URLs.
This change includes:
Summary by CodeRabbit