Skip to content

Update Octicons to v10 #12240

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

Merged
merged 20 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions build/generate-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function exit(err) {
}

async function processFile(file, {prefix = ''} = {}) {
const name = `${prefix}${parse(file).name}`;
let name = parse(file).name;
if (prefix) name = `${prefix}-${name}`;
if (prefix === 'octicon') name = name.replace(/-[0-9]+$/, ''); // chop of '-16' on octicons

const svgo = new Svgo({
plugins: [
Expand Down Expand Up @@ -50,8 +52,8 @@ async function main() {
await mkdir(outputDir);
} catch {}

for (const file of glob('../node_modules/@primer/octicons/build/svg/*.svg')) {
await processFile(file, {prefix: 'octicon-'});
for (const file of glob('../node_modules/@primer/octicons/build/svg/*-16.svg')) {
await processFile(file, {prefix: 'octicon'});
}

for (const file of glob('../web_src/svg/*.svg')) {
Expand Down
2 changes: 1 addition & 1 deletion integrations/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestViewRepoWithSymlinks(t *testing.T) {
})
assert.Equal(t, len(items), 5)
assert.Equal(t, items[0], "a: svg octicon-file-directory")
assert.Equal(t, items[1], "link_b: svg octicon-file-symlink-directory")
assert.Equal(t, items[1], "link_b: svg octicon-file-submodule")
assert.Equal(t, items[2], "link_d: svg octicon-file-symlink-file")
assert.Equal(t, items[3], "link_hi: svg octicon-file-symlink-file")
assert.Equal(t, items[4], "link_link: svg octicon-file-symlink-file")
Expand Down
4 changes: 2 additions & 2 deletions models/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ func (rt ReviewType) Icon() string {
case ReviewTypeApprove:
return "check"
case ReviewTypeReject:
return "request-changes"
return "diff"
case ReviewTypeComment:
return "comment"
case ReviewTypeRequest:
return "primitive-dot"
return "dot-fill"
default:
return "comment"
}
Expand Down
4 changes: 2 additions & 2 deletions models/review_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ func TestReview_LoadCodeComments(t *testing.T) {

func TestReviewType_Icon(t *testing.T) {
assert.Equal(t, "check", ReviewTypeApprove.Icon())
assert.Equal(t, "request-changes", ReviewTypeReject.Icon())
assert.Equal(t, "diff", ReviewTypeReject.Icon())
assert.Equal(t, "comment", ReviewTypeComment.Icon())
assert.Equal(t, "comment", ReviewTypeUnknown.Icon())
assert.Equal(t, "primitive-dot", ReviewTypeRequest.Icon())
assert.Equal(t, "dot-fill", ReviewTypeRequest.Icon())
assert.Equal(t, "comment", ReviewType(6).Icon())
}

Expand Down
2 changes: 1 addition & 1 deletion modules/base/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func EntryIcon(entry *git.TreeEntry) string {
return "file-symlink-file"
}
if te.IsDir() {
return "file-symlink-directory"
return "file-submodule"
}
return "file-symlink-file"
case entry.IsDir():
Expand Down
2 changes: 1 addition & 1 deletion modules/templates/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ func ActionIcon(opType models.ActionType) string {
case models.ActionApprovePullRequest:
return "check"
case models.ActionRejectPullRequest:
return "request-changes"
return "diff"
default:
return "question"
}
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@babel/plugin-transform-runtime": "7.10.4",
"@babel/preset-env": "7.10.4",
"@babel/runtime": "7.10.4",
"@primer/octicons": "9.6.0",
"@primer/octicons": "10.0.0",
"babel-loader": "8.1.0",
"clipboard": "2.0.6",
"core-js": "3.6.5",
Expand Down
2 changes: 1 addition & 1 deletion public/img/svg/octicon-alert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-archive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-arrow-both.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/img/svg/octicon-arrow-small-down.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/img/svg/octicon-arrow-small-left.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/img/svg/octicon-arrow-small-right.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/img/svg/octicon-arrow-small-up.svg

This file was deleted.

2 changes: 1 addition & 1 deletion public/img/svg/octicon-arrow-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-beaker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-bell-slash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-bold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-book.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-bookmark-slash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-briefcase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-broadcast.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-browser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-check-circle-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-check-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/svg/octicon-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading