improvement(invite): aligned styling#2669
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryAligned invite page styling with the rest of the auth flow by adopting Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant InvitePage
participant API
participant ErrorHandler
participant StatusCard
User->>InvitePage: Visit /invite/[id]
alt Error in URL params
InvitePage->>ErrorHandler: Parse error reason
ErrorHandler->>StatusCard: Display error state
StatusCard->>User: Show error with actions
else Valid invite ID
InvitePage->>API: Fetch workspace invitation
alt Workspace invite found
API-->>InvitePage: Workspace invite data
InvitePage->>StatusCard: Display workspace invite
else Workspace 404
InvitePage->>API: Fetch organization invitation
alt Organization invite found
API-->>InvitePage: Organization invite data
InvitePage->>API: Check active organization
alt Already in organization
InvitePage->>ErrorHandler: already-in-organization
ErrorHandler->>StatusCard: Show "leave org first" error
else Not in organization
InvitePage->>StatusCard: Display org invite details
User->>InvitePage: Accept invitation
InvitePage->>API: POST /accept-invite
alt Success
API-->>InvitePage: Success response
InvitePage->>StatusCard: Show success state
else API Error
API-->>InvitePage: Error response
InvitePage->>ErrorHandler: Parse API error
ErrorHandler->>StatusCard: Show contextual error
end
end
else Organization invite error
API-->>InvitePage: Error response
InvitePage->>ErrorHandler: Parse error (status + message)
ErrorHandler->>StatusCard: Show error with retry/auth options
end
else Workspace invite error (non-404)
API-->>InvitePage: Error response
InvitePage->>ErrorHandler: Parse error with status code
ErrorHandler->>StatusCard: Show error with actions
end
end
Note over ErrorHandler: parseApiError checks:<br/>1. Message patterns (specific first)<br/>2. HTTP status codes<br/>3. Returns error code
Note over StatusCard: Renders based on error.code:<br/>- requiresAuth → show sign-in<br/>- canRetry → show retry button<br/>- already-in-org → show leave org action
|
apps/sim/app/invite/[id]/invite.tsx
Outdated
| code: InviteErrorCode | ||
| message: string | ||
| requiresAuth?: boolean | ||
| requiresSignup?: boolean |
There was a problem hiding this comment.
style: requiresSignup is defined but never used in the error handling logic
| requiresSignup?: boolean | |
| requiresAuth?: boolean |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/invite/[id]/invite.tsx
Line: 34:34
Comment:
**style:** `requiresSignup` is defined but never used in the error handling logic
```suggestion
requiresAuth?: boolean
```
How can I resolve this? If you propose a fix, please make it concise.
apps/sim/app/invite/[id]/invite.tsx
Outdated
| if (errorMessage.includes('already a member')) return 'already-member' | ||
| if (errorMessage.includes('already a member of an organization')) return 'already-in-organization' |
There was a problem hiding this comment.
logic: check for 'already a member of an organization' will never execute because 'already a member' on line 154 matches first
| if (errorMessage.includes('already a member')) return 'already-member' | |
| if (errorMessage.includes('already a member of an organization')) return 'already-in-organization' | |
| if (errorMessage.includes('already a member of an organization')) return 'already-in-organization' | |
| if (errorMessage.includes('already a member')) return 'already-member' |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/invite/[id]/invite.tsx
Line: 154:155
Comment:
**logic:** check for `'already a member of an organization'` will never execute because `'already a member'` on line 154 matches first
```suggestion
if (errorMessage.includes('already a member of an organization')) return 'already-in-organization'
if (errorMessage.includes('already a member')) return 'already-member'
```
How can I resolve this? If you propose a fix, please make it concise.|
@greptile |
…ext menu (#2672) * feat(logs-context-menu): consolidated logs utils and types, added logs record context menu (#2659) * feat(email): welcome email; improvement(emails): ui/ux (#2658) * feat(email): welcome email; improvement(emails): ui/ux * improvement(emails): links, accounts, preview * refactor(emails): file structure and wrapper components * added envvar for personal emails sent, added isHosted gate * fixed failing tests, added env mock * fix: removed comment --------- Co-authored-by: waleed <walif6@gmail.com> * fix(logging): hitl + trigger dev crash protection (#2664) * hitl gaps * deal with trigger worker crashes * cleanup import strcuture * feat(imap): added support for imap trigger (#2663) * feat(tools): added support for imap trigger * feat(imap): added parity, tested * ack PR comments * final cleanup * feat(i18n): update translations (#2665) Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com> * fix(grain): updated grain trigger to auto-establish trigger (#2666) Co-authored-by: aadamgough <adam@sim.ai> * feat(admin): routes to manage deployments (#2667) * feat(admin): routes to manage deployments * fix naming fo deployed by * feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date (#2668) * feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date * removed unused params, cleaned up redundant utils * improvement(invite): aligned styling (#2669) * improvement(invite): aligned with rest of app * fix(invite): error handling * fix: addressed comments --------- Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: aadamgough <adam@sim.ai>
* improvement(invite): aligned with rest of app * fix(invite): error handling * fix: addressed comments
* improvement(invite): aligned with rest of app * fix(invite): error handling * fix: addressed comments
Summary
Aligned invite page styling and added better error handling.
Type of Change
Testing
Solo.
Checklist