-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
feat: supabase auth #4112
Draft
mariojsnunes
wants to merge
48
commits into
master
Choose a base branch
from
feat/supabase-auth
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: supabase auth #4112
Changes from 44 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
e02543f
chore: add tenant_id to cypress environment
mariojsnunes 1d508aa
chore: seed database
mariojsnunes 4df42f0
wip questions
mariojsnunes e3d8b6a
wip questions
mariojsnunes eb170c5
Merge branch 'master' into feat/questions-supabase
mariojsnunes 69912aa
feat: questions supabase
mariojsnunes ee6c71d
fix: discussions with supabase questions
mariojsnunes e58c5f8
fix: notifications with supabase questions;
mariojsnunes 09139cd
feat: image public url and transforms
mariojsnunes 9790968
fix: questions list
mariojsnunes 0469958
merge
mariojsnunes c8c306a
feat: added sort by comments
mariojsnunes f42a0a3
fix import
mariojsnunes d73ce48
questions migration script
mariojsnunes 758b146
Merge branch 'master' into feat/questions-supabase
mariojsnunes cee0ed1
merge
mariojsnunes 9a5f00a
remove guidance for files
mariojsnunes 3b78489
remove question store
mariojsnunes 27037b2
remove question store
mariojsnunes 35390e5
feat: duplicate question validation and error message
mariojsnunes 43ae242
fix: spec for file category guidance
mariojsnunes a9cfe8f
Merge branch 'chore/comments-v2-tests' into feat/questions-supabase
mariojsnunes 9beeb20
chore: updated cypress tests with supabase
mariojsnunes 476f89c
chore: update migration script;
mariojsnunes f71fc3d
fix
mariojsnunes c08417e
remove unique check
mariojsnunes 2491f44
chore: fix tests to work with supabase;
mariojsnunes 56e8293
fix: edit question submit button
mariojsnunes be11d96
fix
mariojsnunes f38567c
fix: library category
mariojsnunes f6f1b09
wip
mariojsnunes 41a53b3
wip
mariojsnunes c5c2815
Merge branch 'master' into feat/supabase-auth
mariojsnunes cbefe2e
wip
mariojsnunes f50d31d
merge
mariojsnunes 627506b
rollback
mariojsnunes c24af0d
clean
mariojsnunes a2a33be
updated apis to use supabase auth;
mariojsnunes 7ac6a95
merge
mariojsnunes 375cbd1
email change
mariojsnunes d9c0d7a
change password
mariojsnunes 9c568ca
auth work
mariojsnunes 653fec6
cleanup
mariojsnunes be79325
firebase auth
mariojsnunes 14c8ae0
chore: quick lint
benfurber fd030f3
feat: add ReturnPathLink for consistent auth flows
benfurber 5459631
fix: ReturnPathLink actually going somewhere
benfurber 84f24f4
feat: add login redirect back to previous page
benfurber 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
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { useCallback, useEffect, useState } from 'react' | ||
import { useCallback, useContext, useEffect, useState } from 'react' | ||
import { Link, useSearchParams } from '@remix-run/react' | ||
import debounce from 'debounce' | ||
import { CategoryVerticalList, SearchField, Select } from 'oa-components' | ||
|
@@ -11,13 +11,15 @@ import { | |
import { Button, Flex } from 'theme-ui' | ||
|
||
import { ListHeader } from '../common/Layout/ListHeader' | ||
import { SessionContext } from '../common/SessionContext' | ||
import { headings, listing } from './labels' | ||
import { QuestionSortOptions } from './QuestionSortOptions' | ||
|
||
import type { Category } from 'oa-shared' | ||
import type { QuestionSortOption } from './QuestionSortOptions' | ||
|
||
export const QuestionListHeader = () => { | ||
const session = useContext(SessionContext) | ||
const [categories, setCategories] = useState<Category[]>([]) | ||
const [searchString, setSearchString] = useState<string>('') | ||
|
||
|
@@ -79,14 +81,26 @@ export const QuestionListHeader = () => { | |
const actionComponents = ( | ||
<UserAction | ||
loggedIn={ | ||
<Link to="/questions/create"> | ||
<Link | ||
to={ | ||
session?.id | ||
? '/questions/create' | ||
: '/sign-in?returnUrl=' + encodeURIComponent(location.pathname) | ||
} | ||
> | ||
<Button type="button" data-cy="create-question" variant="primary"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change isn't needed, the user only gets this component if they're logged in. |
||
{listing.create} | ||
</Button> | ||
</Link> | ||
} | ||
loggedOut={ | ||
<Link to="/sign-up"> | ||
<Link | ||
to={ | ||
session?.id | ||
? '/questions/create' | ||
: '/sign-up?returnUrl=' + encodeURIComponent(location.pathname) | ||
} | ||
> | ||
<Button type="button" data-cy="sign-up" variant="primary"> | ||
{listing.join} | ||
</Button> | ||
|
This file contains 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realising this should use the UserAction. I can do that quickly if you like?