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
6e118f27
Commit
6e118f27
authored
Feb 19, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review fixes
parent
ab2f498c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
53 deletions
+52
-53
ContractCode.pw.tsx
ui/address/contract/ContractCode.pw.tsx
+48
-45
ContractSecurityAudits.tsx
ui/address/contract/ContractSecurityAudits.tsx
+4
-6
AuditSubmitterEmail.tsx
...ct/contractSubmitAuditForm/fields/AuditSubmitterEmail.tsx
+0
-1
AuditSubmitterName.tsx
...act/contractSubmitAuditForm/fields/AuditSubmitterName.tsx
+0
-1
No files found.
ui/address/contract/ContractCode.pw.tsx
View file @
6e118f27
...
@@ -234,50 +234,53 @@ test('non verified', async({ mount, page }) => {
...
@@ -234,50 +234,53 @@ test('non verified', async({ mount, page }) => {
await
expect
(
component
).
toHaveScreenshot
();
await
expect
(
component
).
toHaveScreenshot
();
});
});
const
withAuditsTest
=
test
.
extend
({
test
.
describe
(
'
with audits feature
'
,
()
=>
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
context
:
contextWithEnvs
(
configs
.
UIEnvs
.
hasContractAuditReports
)
as
any
,
const
withAuditsTest
=
test
.
extend
({
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
context
:
contextWithEnvs
(
configs
.
UIEnvs
.
hasContractAuditReports
)
as
any
,
withAuditsTest
(
'
with audits feature, no audits
'
,
async
({
mount
,
page
})
=>
{
});
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
withAuditsTest
(
'
no audits
'
,
async
({
mount
,
page
})
=>
{
body
:
JSON
.
stringify
(
contractMock
.
verified
),
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
}));
status
:
200
,
await
page
.
route
(
CONTRACT_AUDITS_API_URL
,
(
route
)
=>
route
.
fulfill
({
body
:
JSON
.
stringify
(
contractMock
.
verified
),
status
:
200
,
}));
body
:
JSON
.
stringify
({
items
:
[]
}),
await
page
.
route
(
CONTRACT_AUDITS_API_URL
,
(
route
)
=>
route
.
fulfill
({
}));
status
:
200
,
await
page
.
route
(
'
https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/**
'
,
(
route
)
=>
route
.
abort
());
body
:
JSON
.
stringify
({
items
:
[]
}),
}));
const
component
=
await
mount
(
await
page
.
route
(
'
https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/**
'
,
(
route
)
=>
route
.
abort
());
<
TestApp
>
<
ContractCode
addressHash=
{
addressHash
}
noSocket
/>
const
component
=
await
mount
(
</
TestApp
>,
<
TestApp
>
{
hooksConfig
},
<
ContractCode
addressHash=
{
addressHash
}
noSocket
/>
);
</
TestApp
>,
{
hooksConfig
},
await
expect
(
component
).
toHaveScreenshot
();
);
});
await
expect
(
component
).
toHaveScreenshot
();
withAuditsTest
(
'
with audits feature, has audits
'
,
async
({
mount
,
page
})
=>
{
});
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
withAuditsTest
(
'
has audits
'
,
async
({
mount
,
page
})
=>
{
body
:
JSON
.
stringify
(
contractMock
.
verified
),
await
page
.
route
(
CONTRACT_API_URL
,
(
route
)
=>
route
.
fulfill
({
}));
status
:
200
,
await
page
.
route
(
CONTRACT_AUDITS_API_URL
,
(
route
)
=>
route
.
fulfill
({
body
:
JSON
.
stringify
(
contractMock
.
verified
),
status
:
200
,
}));
body
:
JSON
.
stringify
(
contractAudits
),
await
page
.
route
(
CONTRACT_AUDITS_API_URL
,
(
route
)
=>
route
.
fulfill
({
}));
status
:
200
,
body
:
JSON
.
stringify
(
contractAudits
),
await
page
.
route
(
'
https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/**
'
,
(
route
)
=>
route
.
abort
());
}));
const
component
=
await
mount
(
await
page
.
route
(
'
https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/**
'
,
(
route
)
=>
route
.
abort
());
<
TestApp
>
<
ContractCode
addressHash=
{
addressHash
}
noSocket
/>
const
component
=
await
mount
(
</
TestApp
>,
<
TestApp
>
{
hooksConfig
},
<
ContractCode
addressHash=
{
addressHash
}
noSocket
/>
);
</
TestApp
>,
{
hooksConfig
},
);
await
expect
(
component
).
toHaveScreenshot
();
await
expect
(
component
).
toHaveScreenshot
();
});
});
});
ui/address/contract/ContractSecurityAudits.tsx
View file @
6e118f27
import
{
Box
,
Button
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
SmartContractSecurityAuditSubmission
}
from
'
types/api/contract
'
;
import
type
{
SmartContractSecurityAuditSubmission
}
from
'
types/api/contract
'
;
...
@@ -61,11 +61,9 @@ const ContractSecurityAudits = ({ addressHash }: Props) => {
...
@@ -61,11 +61,9 @@ const ContractSecurityAudits = ({ addressHash }: Props) => {
mt=
{
2
}
mt=
{
2
}
>
>
{
data
.
items
.
map
(
item
=>
(
{
data
.
items
.
map
(
item
=>
(
<
Skeleton
isLoaded=
{
!
isPlaceholderData
}
key=
{
item
.
audit_company_name
+
item
.
audit_publish_date
}
>
<
LinkExternal
href=
{
item
.
audit_report_url
}
key=
{
item
.
audit_company_name
+
item
.
audit_publish_date
}
isLoading=
{
isPlaceholderData
}
>
<
LinkExternal
href=
{
item
.
audit_report_url
}
>
{
`${ item.audit_company_name }, ${ dayjs(item.audit_publish_date).format('MMM DD, YYYY') }`
}
{
`${ item.audit_company_name }, ${ dayjs(item.audit_publish_date).format('MMM DD, YYYY') }`
}
</
LinkExternal
>
</
LinkExternal
>
</
Skeleton
>
))
}
))
}
</
ContainerWithScrollY
>
</
ContainerWithScrollY
>
</
Box
>
</
Box
>
...
...
ui/address/contract/contractSubmitAuditForm/fields/AuditSubmitterEmail.tsx
View file @
6e118f27
...
@@ -20,7 +20,6 @@ const AuditSubmitterEmail = ({ control }: Props) => {
...
@@ -20,7 +20,6 @@ const AuditSubmitterEmail = ({ control }: Props) => {
{
...
field
}
{
...
field
}
required
required
isInvalid=
{
Boolean
(
fieldState
.
error
)
}
isInvalid=
{
Boolean
(
fieldState
.
error
)
}
autoComplete=
"off"
/>
/>
<
InputPlaceholder
text=
"Submitter email"
error=
{
fieldState
.
error
}
/>
<
InputPlaceholder
text=
"Submitter email"
error=
{
fieldState
.
error
}
/>
</
FormControl
>
</
FormControl
>
...
...
ui/address/contract/contractSubmitAuditForm/fields/AuditSubmitterName.tsx
View file @
6e118f27
...
@@ -19,7 +19,6 @@ const AuditSubmitterName = ({ control }: Props) => {
...
@@ -19,7 +19,6 @@ const AuditSubmitterName = ({ control }: Props) => {
{
...
field
}
{
...
field
}
required
required
isInvalid=
{
Boolean
(
fieldState
.
error
)
}
isInvalid=
{
Boolean
(
fieldState
.
error
)
}
autoComplete=
"off"
/>
/>
<
InputPlaceholder
text=
"Submitter name"
error=
{
fieldState
.
error
}
/>
<
InputPlaceholder
text=
"Submitter name"
error=
{
fieldState
.
error
}
/>
</
FormControl
>
</
FormControl
>
...
...
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