Skip to content

feat: simplify admin create-workspace form#1733

Merged
rohanchkrabrty merged 2 commits into
mainfrom
feat-admin-new-workspace
Jul 6, 2026
Merged

feat: simplify admin create-workspace form#1733
rohanchkrabrty merged 2 commits into
mainfrom
feat-admin-new-workspace

Conversation

@rohanchkrabrty

Copy link
Copy Markdown
Contributor

Summary

  • Removed the workspace size and industry fields from the admin create-organization form, so metadata now only carries country.
  • Renamed the owner field to owner email and enforce proper email validation via zod.
  • Disabled native browser validation (noValidate) so all errors surface through the form's inline error messages.
  • Tightened the workspace URL rule to ^[a-zA-Z0-9_-]{3,50}$ with min/max length checks.
  • Auto-generate the URL slug from the title (debounced) until the user manually edits it, tracked via RHF dirtyFields; extracted generateSlug/randomSuffix into admin/utils/helper.

@rohanchkrabrty rohanchkrabrty self-assigned this Jul 3, 2026
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jul 6, 2026 9:53am

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Organization creation now auto-generates a cleaner URL slug from the organization name and adds a short random suffix for uniqueness.
    • The organization setup form has been simplified to focus on the most important details.
  • Bug Fixes

    • Improved validation and error handling for organization URLs.
    • Updated the URL field placeholder to use terminology-aware wording.

Walkthrough

Adds generateSlug and randomSuffix helper functions, uses them to auto-generate a debounced URL slug from the title field in the admin organization create form, simplifies that form's Zod schema and submission payload by removing several fields, and updates a client-side URL placeholder string.

Changes

Organization Create Form Simplification and Slug Generation

Layer / File(s) Summary
Slug generation utilities
web/sdk/admin/utils/helper.ts
Adds generateSlug(title) to normalize a string into a URL-safe slug and randomSuffix(length) to generate a random alphanumeric suffix.
Simplified schema and props
web/sdk/admin/views/organizations/list/create.tsx
Rewrites orgCreateSchema to validate only avatar, title, name, orgOwnerEmail, country; removes the organizationTypes prop.
Debounced title-to-slug generation
web/sdk/admin/views/organizations/list/create.tsx
Reworks form defaults and adds debounced slug generation from title with a memoized random suffix, unmount cleanup, and a handleTitleChange handler that respects a dirty name field.
Submission payload and simplified form UI
web/sdk/admin/views/organizations/list/create.tsx
Updates onSubmit/onError to send a reduced payload matching the new schema, adds noValidate to the form, wires title/orgOwnerEmail via register, and removes size/industry fields leaving only country.

Client Organization URL Placeholder

Layer / File(s) Summary
Terminology-based URL placeholder
web/sdk/client/views/create-organization/create-organization-view.tsx
Replaces the hard-coded "raystack.org/" placeholder with a useTerminology()-driven label.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • raystack/frontier#1664: Both PRs modify the same organization create form file, including its Zod schema, AlreadyExists error handling, and payload/field wiring.

Suggested reviewers: Shreyag02, rsbh, paanSinghCoder, rohilsurana

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

coveralls commented Jul 3, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28783085235

Coverage remained the same at 44.865%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 37608
Covered Lines: 16873
Line Coverage: 44.87%
Coverage Strength: 12.49 hits per line

💛 - Coveralls

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0643e36b-fbf7-4dce-afb3-30c970a2fd00

📥 Commits

Reviewing files that changed from the base of the PR and between f46911c and 052ee51.

📒 Files selected for processing (3)
  • web/sdk/admin/utils/helper.ts
  • web/sdk/admin/views/organizations/list/create.tsx
  • web/sdk/client/views/create-organization/create-organization-view.tsx

Comment thread web/sdk/admin/utils/helper.ts
Comment thread web/sdk/admin/views/organizations/list/create.tsx
@rohanchkrabrty rohanchkrabrty enabled auto-merge (squash) July 6, 2026 09:53
@rohanchkrabrty rohanchkrabrty merged commit 7384a11 into main Jul 6, 2026
8 checks passed
@rohanchkrabrty rohanchkrabrty deleted the feat-admin-new-workspace branch July 6, 2026 10:03
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.

3 participants