-
Notifications
You must be signed in to change notification settings - Fork 44
feat: session page revamp #1486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
66f576d
chore: use apsara v1 in sdk
rohanchkrabrty b6b1082
feat: general page revamp
rohanchkrabrty fd07c82
feat: preferences page revamp
rohanchkrabrty 09f6f1b
feat: profile page revamp
rohanchkrabrty ff4680f
feat: sessions page revamp
rohanchkrabrty f00670c
feat: fix logout redirect
rohanchkrabrty 38a6015
Merge branch 'main' into feat-profile-revamp
rohanchkrabrty 89cd5ba
Merge branch 'feat-profile-revamp' into feat-sessions-revamp
rohanchkrabrty c8dc7f3
Merge branch 'main' into feat-sessions-revamp
rohanchkrabrty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { SessionsView } from '@raystack/frontier/react'; | ||
|
|
||
| export default function Sessions() { | ||
| return <SessionsView onLogout={() => { | ||
| window.location.href = '/login'; | ||
| }} />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
web/sdk/react/views-new/sessions/components/revoke-session-confirm-dialog.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { AlertDialog, Button } from '@raystack/apsara-v1'; | ||
|
|
||
| interface RevokeSessionConfirmDialogProps { | ||
| open: boolean; | ||
| onOpenChange: (isOpen: boolean) => void; | ||
| onConfirm: () => void; | ||
| isLoading?: boolean; | ||
| isCurrentSession?: boolean; | ||
| } | ||
|
|
||
| export const RevokeSessionConfirmDialog = ({ | ||
| open, | ||
| onOpenChange, | ||
| onConfirm, | ||
| isLoading = false, | ||
| isCurrentSession = false | ||
| }: RevokeSessionConfirmDialogProps) => { | ||
| const handleConfirm = () => { | ||
| onConfirm(); | ||
| }; | ||
|
|
||
| return ( | ||
| <AlertDialog open={open} onOpenChange={onOpenChange}> | ||
| <AlertDialog.Content width={400} showCloseButton={false}> | ||
| <AlertDialog.Body> | ||
| <AlertDialog.Title> | ||
| {isCurrentSession ? 'Log out' : 'Revoke'} | ||
| </AlertDialog.Title> | ||
| <AlertDialog.Description> | ||
| Are you sure you want to {isCurrentSession ? 'log out' : 'revoke'} of this session? This action cannot be undone. | ||
rohanchkrabrty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </AlertDialog.Description> | ||
| </AlertDialog.Body> | ||
| <AlertDialog.Footer justify="end" gap={5}> | ||
| <Button | ||
| variant="outline" | ||
| color="neutral" | ||
| onClick={() => onOpenChange(false)} | ||
| disabled={isLoading} | ||
| data-test-id="frontier-sdk-cancel-final-revoke-dialog" | ||
| > | ||
| Cancel | ||
| </Button> | ||
| <Button | ||
| variant="solid" | ||
| color="danger" | ||
| onClick={handleConfirm} | ||
| disabled={isLoading} | ||
| loading={isLoading} | ||
| loaderText={isCurrentSession ? 'Signing out...' : 'Revoking...'} | ||
| data-test-id="frontier-sdk-confirm-final-revoke-dialog" | ||
| > | ||
| {isCurrentSession ? 'Log out' : 'Revoke'} | ||
| </Button> | ||
| </AlertDialog.Footer> | ||
| </AlertDialog.Content> | ||
| </AlertDialog> | ||
| ); | ||
| }; | ||
12 changes: 12 additions & 0 deletions
12
web/sdk/react/views-new/sessions/components/revoke-session-dialog.module.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| .detailRow { | ||
| padding: var(--rs-space-5) 0; | ||
| border-bottom: 0.5px solid var(--rs-color-border-base-primary); | ||
| } | ||
| .detailRow:last-child { | ||
| border-bottom: none; | ||
| } | ||
|
|
||
| .detailLabel { | ||
| width: 120px; | ||
rohanchkrabrty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| flex-shrink: 0; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.