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
c8074e70
Commit
c8074e70
authored
Aug 29, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
36547c01
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
31 deletions
+22
-31
index.ts
pages/api/account/api-keys/index.ts
+2
-2
index.ts
pages/api/account/custom-abis/index.ts
+2
-2
index.ts
pages/api/account/private-tags/address/index.ts
+2
-2
index.ts
pages/api/account/private-tags/transaction/index.ts
+2
-2
index.ts
pages/api/account/public-tags/index.ts
+2
-2
DeletePublicTagModal.tsx
ui/publicTags/DeletePublicTagModal.tsx
+11
-20
PublicTagsForm.tsx
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
+1
-1
No files found.
pages/api/account/api-keys/index.ts
View file @
c8074e70
import
type
{
ApiKeys
}
from
'
types/api/account
'
;
import
type
{
ApiKeys
,
ApiKeyErrors
}
from
'
types/api/account
'
;
import
handler
from
'
lib/api/handler
'
;
import
handler
from
'
lib/api/handler
'
;
const
apiKeysHandler
=
handler
<
ApiKeys
>
(()
=>
'
/account/v1/user/api_keys
'
,
[
'
GET
'
,
'
POST
'
]);
const
apiKeysHandler
=
handler
<
ApiKeys
,
ApiKeyErrors
>
(()
=>
'
/account/v1/user/api_keys
'
,
[
'
GET
'
,
'
POST
'
]);
export
default
apiKeysHandler
;
export
default
apiKeysHandler
;
pages/api/account/custom-abis/index.ts
View file @
c8074e70
import
type
{
CustomAbis
}
from
'
types/api/account
'
;
import
type
{
CustomAbis
,
CustomAbiErrors
}
from
'
types/api/account
'
;
import
handler
from
'
lib/api/handler
'
;
import
handler
from
'
lib/api/handler
'
;
const
customAbiHandler
=
handler
<
CustomAbis
>
(()
=>
'
/account/v1/user/custom_abis
'
,
[
'
GET
'
,
'
POST
'
]);
const
customAbiHandler
=
handler
<
CustomAbis
,
CustomAbiErrors
>
(()
=>
'
/account/v1/user/custom_abis
'
,
[
'
GET
'
,
'
POST
'
]);
export
default
customAbiHandler
;
export
default
customAbiHandler
;
pages/api/account/private-tags/address/index.ts
View file @
c8074e70
import
type
{
AddressTags
}
from
'
types/api/account
'
;
import
type
{
AddressTags
,
AddressTagErrors
}
from
'
types/api/account
'
;
import
handler
from
'
lib/api/handler
'
;
import
handler
from
'
lib/api/handler
'
;
const
addressHandler
=
handler
<
AddressTags
>
(()
=>
'
/account/v1/user/tags/address
'
,
[
'
GET
'
,
'
POST
'
]);
const
addressHandler
=
handler
<
AddressTags
,
AddressTagErrors
>
(()
=>
'
/account/v1/user/tags/address
'
,
[
'
GET
'
,
'
POST
'
]);
export
default
addressHandler
;
export
default
addressHandler
;
pages/api/account/private-tags/transaction/index.ts
View file @
c8074e70
import
type
{
TransactionTags
}
from
'
types/api/account
'
;
import
type
{
TransactionTags
,
TransactionTagErrors
}
from
'
types/api/account
'
;
import
handler
from
'
lib/api/handler
'
;
import
handler
from
'
lib/api/handler
'
;
const
transactionHandler
=
handler
<
TransactionTags
>
(()
=>
'
/account/v1/user/tags/transaction
'
,
[
'
GET
'
,
'
POST
'
]);
const
transactionHandler
=
handler
<
TransactionTags
,
TransactionTagErrors
>
(()
=>
'
/account/v1/user/tags/transaction
'
,
[
'
GET
'
,
'
POST
'
]);
export
default
transactionHandler
;
export
default
transactionHandler
;
pages/api/account/public-tags/index.ts
View file @
c8074e70
import
type
{
PublicTags
}
from
'
types/api/account
'
;
import
type
{
PublicTags
,
PublicTagErrors
}
from
'
types/api/account
'
;
import
handler
from
'
lib/api/handler
'
;
import
handler
from
'
lib/api/handler
'
;
const
publicKeysHandler
=
handler
<
PublicTags
>
(()
=>
'
/account/v1/user/public_tags
'
,
[
'
GET
'
,
'
POST
'
]);
const
publicKeysHandler
=
handler
<
PublicTags
,
PublicTagErrors
>
(()
=>
'
/account/v1/user/public_tags
'
,
[
'
GET
'
,
'
POST
'
]);
export
default
publicKeysHandler
;
export
default
publicKeysHandler
;
ui/publicTags/DeletePublicTagModal.tsx
View file @
c8074e70
import
{
Flex
,
Text
,
FormControl
,
FormLabel
,
Textarea
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Text
,
FormControl
,
FormLabel
,
Textarea
}
from
'
@chakra-ui/react
'
;
import
{
use
Mutation
,
use
QueryClient
}
from
'
@tanstack/react-query
'
;
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
type
{
PublicTags
,
PublicTag
}
from
'
types/api/account
'
;
import
type
{
PublicTags
,
PublicTag
}
from
'
types/api/account
'
;
import
fetch
from
'
lib/client/fetch
'
;
import
DeleteModal
from
'
ui/shared/DeleteModal
'
;
import
DeleteModal
from
'
ui/shared/DeleteModal
'
;
type
Props
=
{
type
Props
=
{
...
@@ -22,27 +23,17 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
...
@@ -22,27 +23,17 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
const
queryClient
=
useQueryClient
();
const
queryClient
=
useQueryClient
();
const
deleteApiKey
=
(
reason
:
string
)
=>
{
const
deleteApiKey
=
useCallback
((
)
=>
{
const
body
=
JSON
.
stringify
({
remove_reason
:
reason
});
const
body
=
JSON
.
stringify
({
remove_reason
:
reason
});
return
fetch
(
`/api/account/public-tags/
${
data
.
id
}
`
,
{
method
:
'
DELETE
'
,
body
});
return
fetch
(
`/api/account/public-tags/
${
data
.
id
}
`
,
{
method
:
'
DELETE
'
,
body
});
};
}
,
[
data
,
reason
])
;
const
mutation
=
useMutation
(
deleteApiKey
,
{
const
onSuccess
=
useCallback
(
async
()
=>
{
onSuccess
:
async
()
=>
{
queryClient
.
setQueryData
([
'
public-tags
'
],
(
prevData
:
PublicTags
|
undefined
)
=>
{
return
prevData
?.
filter
((
item
)
=>
item
.
id
!==
data
.
id
);
});
onClose
();
},
// eslint-disable-next-line no-console
onError
:
console
.
error
,
});
const
onDelete
=
useCallback
(()
=>
{
mutation
.
mutate
(
reason
);
onDeleteSuccess
();
onDeleteSuccess
();
},
[
reason
,
mutation
,
onDeleteSuccess
]);
queryClient
.
setQueryData
([
'
public-tags
'
],
(
prevData
:
PublicTags
|
undefined
)
=>
{
return
prevData
?.
filter
((
item
)
=>
item
.
id
!==
data
.
id
);
});
},
[
queryClient
,
data
,
onDeleteSuccess
]);
const
onFieldChange
=
useCallback
((
event
:
ChangeEvent
<
HTMLTextAreaElement
>
)
=>
{
const
onFieldChange
=
useCallback
((
event
:
ChangeEvent
<
HTMLTextAreaElement
>
)
=>
{
setReason
(
event
.
currentTarget
.
value
);
setReason
(
event
.
currentTarget
.
value
);
...
@@ -101,10 +92,10 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
...
@@ -101,10 +92,10 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
<
DeleteModal
<
DeleteModal
isOpen=
{
isOpen
}
isOpen=
{
isOpen
}
onClose=
{
onClose
}
onClose=
{
onClose
}
onDelete=
{
onDelete
}
title=
"Request to remove a public tag"
title=
"Request to remove a public tag"
renderContent=
{
renderContent
}
renderContent=
{
renderContent
}
pending=
{
mutation
.
isLoading
}
mutationFn=
{
deleteApiKey
}
onSuccess=
{
onSuccess
}
/>
/>
);
);
};
};
...
...
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
View file @
c8074e70
...
@@ -150,7 +150,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
...
@@ -150,7 +150,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
return
(
return
(
<
Box
width=
{
`calc(100% - ${ ADDRESS_INPUT_BUTTONS_WIDTH }px)`
}
maxWidth=
"844px"
>
<
Box
width=
{
`calc(100% - ${ ADDRESS_INPUT_BUTTONS_WIDTH }px)`
}
maxWidth=
"844px"
>
{
isAlertVisible
&&
<
FormSubmitAlert
/
>
}
{
isAlertVisible
&&
<
Box
mb=
{
4
}
><
FormSubmitAlert
/></
Box
>
}
<
Text
size=
"sm"
variant=
"secondary"
paddingBottom=
{
5
}
>
Company info
</
Text
>
<
Text
size=
"sm"
variant=
"secondary"
paddingBottom=
{
5
}
>
Company info
</
Text
>
<
Grid
templateColumns=
"1fr 1fr"
rowGap=
{
4
}
columnGap=
{
5
}
>
<
Grid
templateColumns=
"1fr 1fr"
rowGap=
{
4
}
columnGap=
{
5
}
>
<
GridItem
>
<
GridItem
>
...
...
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