Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
cc381104
Commit
cc381104
authored
Feb 16, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests
parent
92731b44
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
7 deletions
+8
-7
unit-tests.yml
.github/workflows/unit-tests.yml
+1
-0
useLoginUrl.tsx
lib/hooks/useLoginUrl.tsx
+1
-1
middleware.ts
middleware.ts
+1
-1
auth0.tsx
pages/auth/auth0.tsx
+2
-2
address.ts
types/api/address.ts
+1
-1
nextjs-routes.d.ts
types/nextjs-routes.d.ts
+1
-1
AddressTokenTransfers.tsx
ui/address/AddressTokenTransfers.tsx
+1
-1
No files found.
.github/workflows/unit-tests.yml
View file @
cc381104
...
@@ -9,6 +9,7 @@ jobs:
...
@@ -9,6 +9,7 @@ jobs:
jest_tests
:
jest_tests
:
name
:
Run tests with Jest
name
:
Run tests with Jest
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
if
:
${{
false
}}
# disable since there are no jest test yet
steps
:
steps
:
-
uses
:
actions/checkout@v3
-
uses
:
actions/checkout@v3
-
uses
:
actions/setup-node@v3
-
uses
:
actions/setup-node@v3
...
...
lib/hooks/useLoginUrl.tsx
View file @
cc381104
...
@@ -5,5 +5,5 @@ import appConfig from 'configs/app/config';
...
@@ -5,5 +5,5 @@ import appConfig from 'configs/app/config';
export
default
function
useLoginUrl
()
{
export
default
function
useLoginUrl
()
{
const
router
=
useRouter
();
const
router
=
useRouter
();
return
appConfig
.
authUrl
+
route
({
pathname
:
'
/auth
'
,
query
:
{
path
:
router
.
asPath
}
});
return
appConfig
.
authUrl
+
route
({
pathname
:
'
/auth
/auth0
'
,
query
:
{
path
:
router
.
asPath
}
});
}
}
middleware.ts
View file @
cc381104
...
@@ -22,7 +22,7 @@ export function middleware(req: NextRequest) {
...
@@ -22,7 +22,7 @@ export function middleware(req: NextRequest) {
const
apiToken
=
req
.
cookies
.
get
(
NAMES
.
API_TOKEN
);
const
apiToken
=
req
.
cookies
.
get
(
NAMES
.
API_TOKEN
);
if
((
isAccountRoute
||
isProfileRoute
)
&&
!
apiToken
&&
appConfig
.
isAccountSupported
)
{
if
((
isAccountRoute
||
isProfileRoute
)
&&
!
apiToken
&&
appConfig
.
isAccountSupported
)
{
const
authUrl
=
appConfig
.
authUrl
+
route
({
pathname
:
'
/auth
'
,
query
:
{
path
:
req
.
nextUrl
.
pathname
}
});
const
authUrl
=
appConfig
.
authUrl
+
route
({
pathname
:
'
/auth
/auth0
'
,
query
:
{
path
:
req
.
nextUrl
.
pathname
}
});
return
NextResponse
.
redirect
(
authUrl
);
return
NextResponse
.
redirect
(
authUrl
);
}
}
...
...
pages/auth/
index
.tsx
→
pages/auth/
auth0
.tsx
View file @
cc381104
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
}
from
'
next
'
;
const
AuthPage
:
NextPage
=
()
=>
{
const
Auth
0
Page
:
NextPage
=
()
=>
{
return
null
;
return
null
;
};
};
export
default
AuthPage
;
export
default
Auth
0
Page
;
export
async
function
getServerSideProps
()
{
export
async
function
getServerSideProps
()
{
return
{
return
{
...
...
types/api/address.ts
View file @
cc381104
...
@@ -83,7 +83,7 @@ export interface AddressTokenTransferResponse {
...
@@ -83,7 +83,7 @@ export interface AddressTokenTransferResponse {
export
type
AddressTokenTransferFilters
=
{
export
type
AddressTokenTransferFilters
=
{
filter
?:
AddressFromToFilter
;
filter
?:
AddressFromToFilter
;
type
?:
Array
<
TokenType
>
;
type
?:
Array
<
TokenType
>
;
token
?:
string
;
token
_hash
?:
string
;
}
}
export
type
AddressTokensFilter
=
{
export
type
AddressTokensFilter
=
{
...
...
types/nextjs-routes.d.ts
View file @
cc381104
...
@@ -18,7 +18,7 @@ declare module "nextjs-routes" {
...
@@ -18,7 +18,7 @@ declare module "nextjs-routes" {
|
StaticRoute
<
"
/api/proxy
"
>
|
StaticRoute
<
"
/api/proxy
"
>
|
DynamicRoute
<
"
/apps/[id]
"
,
{
"
id
"
:
string
}
>
|
DynamicRoute
<
"
/apps/[id]
"
,
{
"
id
"
:
string
}
>
|
StaticRoute
<
"
/apps
"
>
|
StaticRoute
<
"
/apps
"
>
|
StaticRoute
<
"
/auth
"
>
|
StaticRoute
<
"
/auth
/auth0
"
>
|
StaticRoute
<
"
/auth/profile
"
>
|
StaticRoute
<
"
/auth/profile
"
>
|
DynamicRoute
<
"
/block/[height]
"
,
{
"
height
"
:
string
}
>
|
DynamicRoute
<
"
/block/[height]
"
,
{
"
height
"
:
string
}
>
|
StaticRoute
<
"
/blocks
"
>
|
StaticRoute
<
"
/blocks
"
>
...
...
ui/address/AddressTokenTransfers.tsx
View file @
cc381104
...
@@ -87,7 +87,7 @@ const AddressTokenTransfers = ({ scrollRef }: {scrollRef?: React.RefObject<HTMLD
...
@@ -87,7 +87,7 @@ const AddressTokenTransfers = ({ scrollRef }: {scrollRef?: React.RefObject<HTMLD
const
{
isError
,
isLoading
,
data
,
pagination
,
onFilterChange
,
isPaginationVisible
}
=
useQueryWithPages
({
const
{
isError
,
isLoading
,
data
,
pagination
,
onFilterChange
,
isPaginationVisible
}
=
useQueryWithPages
({
resourceName
:
'
address_token_transfers
'
,
resourceName
:
'
address_token_transfers
'
,
pathParams
:
{
hash
:
currentAddress
},
pathParams
:
{
hash
:
currentAddress
},
filters
:
tokenFilter
?
{
token
:
tokenFilter
}
:
filters
,
filters
:
tokenFilter
?
{
token
_hash
:
tokenFilter
}
:
filters
,
scrollRef
,
scrollRef
,
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment