Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
figma-icon-automation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
lift.hurley
figma-icon-automation
Commits
de596869
Commit
de596869
authored
Jun 11, 2020
by
leadream
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add webhook tip
parent
14570562
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
15 deletions
+43
-15
ui.html
dist/ui.html
+13
-5
ui.js
dist/ui.js
+13
-5
Updator.tsx
src/components/Updator.tsx
+17
-5
No files found.
dist/ui.html
View file @
de596869
This diff is collapsed.
Click to expand it.
dist/ui.js
View file @
de596869
This diff is collapsed.
Click to expand it.
src/components/Updator.tsx
View file @
de596869
...
...
@@ -26,6 +26,7 @@ export default class Settings extends React.Component<Props> {
currentVersionTip
:
''
,
resultTip
:
''
,
prUrl
:
''
,
isSending
:
false
,
webhookData
:
null
}
getVersion
=
async
(
githubData
)
=>
{
...
...
@@ -108,9 +109,6 @@ export default class Settings extends React.Component<Props> {
await
this
.
changeVersion
(
branchName
)
const
{
html_url
}
=
await
this
.
createCommitAndPR
(
branchName
)
const
{
version
,
message
,
webhookData
}
=
this
.
state
webhookData
&&
sendNotification
(
webhookData
,
html_url
,
version
,
message
)
this
.
setState
({
version
:
''
,
message
:
''
,
...
...
@@ -118,6 +116,13 @@ export default class Settings extends React.Component<Props> {
resultTip
:
'Pushing successfully! You can now go to Github and merge this PR. Then your icons will be published to NPM automatically.'
,
prUrl
:
html_url
})
const
{
version
,
message
,
webhookData
}
=
this
.
state
if
(
webhookData
)
{
this
.
setState
({
isSending
:
true
})
await
sendNotification
(
webhookData
,
html_url
,
version
,
message
)
this
.
setState
({
isSending
:
false
})
}
})
}
onCancel
=
()
=>
{
...
...
@@ -130,7 +135,10 @@ export default class Settings extends React.Component<Props> {
}
render
()
{
const
{
visible
,
webhookData
}
=
this
.
props
const
{
isPushing
,
version
,
message
,
versionTip
,
messageTip
,
currentVersionTip
,
resultTip
,
prUrl
}
=
this
.
state
const
{
isPushing
,
version
,
message
,
versionTip
,
messageTip
,
currentVersionTip
,
resultTip
,
prUrl
,
webhookData
:
whd
,
isSending
}
=
this
.
state
return
(
<
div
className=
{
'updator '
+
(
!
visible
?
'hide'
:
''
)
}
>
<
div
className=
"form-item"
>
...
...
@@ -146,10 +154,14 @@ export default class Settings extends React.Component<Props> {
resultTip
&&
<
div
className=
"type type--pos-medium-bold alert alert-success"
>
<
h3
>
Congratulations!
</
h3
>
{
resultTip
}
{
resultTip
}
<
br
/>
Click
<
a
href=
{
prUrl
}
target=
"_blank"
>
here
</
a
>
to open the PR link.
</
div
>
}
{
whd
&&
isSending
&&
<
p
className=
"type type--pos-medium-normal"
>
Sending notification, please wait for a minute……
</
p
>
}
</
div
>
<
div
className=
{
'form-item '
+
(
resultTip
?
'hide'
:
''
)
}
>
<
input
...
...
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