Skip to content

Slug for resources - #58

Merged
jSylvestre merged 2 commits into
mainfrom
JCS/ResourceSlug
Oct 27, 2026
Merged

jSylvestre merged 2 commits into
mainfrom
JCS/ResourceSlug

Conversation

@jSylvestre

@jSylvestre jSylvestre commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

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.

Summary by CodeRabbit

  • New Features
    • Resource creation and editing now include a required, editable slug. New resources receive a suggested slug based on their name, and existing resources retain their saved slug unless changed.
    • Slugs are validated for format and length, and duplicate slugs are rejected across resources in the same team or location.
    • The app version is now displayed beneath the copyright notice.

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.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7937d486-af78-4ab3-b859-2ad07bfc00dd
Commits

Reviewing files that changed from the base of the PR and between 3dc776a and cda8eca.

Files ignored due to path filters: 1
  • client/package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 11
  • client/package.json
  • client/src/features/resources/ResourceEditor.tsx
  • client/src/features/resources/models/SaveResourceRequest.ts
  • client/src/shared/GeometricFooter.tsx
  • client/src/test/routes/(authenticated)/teams.resources.test.tsx
  • server/Controllers/AdminSpacesController.cs
  • server/Models/Resources/SaveResourceRequest.cs
  • server/Models/Spaces/SaveSpaceRequest.cs
  • server/Services/TeamResourceService.cs
  • tests/server.tests/Controllers/AdminSpacesControllerTests.cs
  • tests/server.tests/Controllers/TeamResourcesControllerTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Resource creation and editing now use explicit slugs, with client-side suggestions and validation and server-side validation, uniqueness checks, and persistence. Space requests also require explicit slugs. The package version changed to 1.0.0 and now appears in the footer.

Changes: Resource Slug Flow

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: Low

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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 survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: adding slugs for resources.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full 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.

Base automatically changed from JCS/Dependabpt20261027c to main October 27, 2026 21:10
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.
@jSylvestre

Copy link
Copy Markdown
Member Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@jSylvestre
jSylvestre merged commit ff0d229 into main Oct 27, 2026
4 checks passed
@jSylvestre
jSylvestre deleted the JCS/ResourceSlug branch October 27, 2026 22:15
@coderabbitai coderabbitai Bot mentioned this pull request Nov 3, 2026
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