From d2142ba3c35613c8c4c444ca8a909792b4b9238b Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 23 Jun 2023 00:05:52 +0200 Subject: [PATCH] Update octicons and use `octicon-file-directory-symlink` (#25453) Make use of the [new octicon](https://github.com/primer/octicons/issues/945) that indicates a symlink to a directory: Screenshot 2023-06-22 at 22 50 57 --- modules/base/tool.go | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- public/img/svg/octicon-copilot-error.svg | 2 +- public/img/svg/octicon-copilot-warning.svg | 2 +- public/img/svg/octicon-file-directory-symlink.svg | 1 + tests/integration/repo_test.go | 2 +- web_src/css/repo.css | 3 ++- 8 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 public/img/svg/octicon-file-directory-symlink.svg diff --git a/modules/base/tool.go b/modules/base/tool.go index 13b07c043e..004781835a 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -210,7 +210,7 @@ func EntryIcon(entry *git.TreeEntry) string { return "file-symlink-file" } if te.IsDir() { - return "file-submodule" + return "file-directory-symlink" } return "file-symlink-file" case entry.IsDir(): diff --git a/package-lock.json b/package-lock.json index 43846cf4a0..11638d4d7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@github/relative-time-element": "4.3.0", "@github/text-expander-element": "2.5.0", "@mcaptcha/vanilla-glue": "0.1.0-alpha-3", - "@primer/octicons": "19.3.0", + "@primer/octicons": "19.4.0", "@webcomponents/custom-elements": "1.6.0", "add-asset-webpack-plugin": "2.0.1", "ansi_up": "5.2.1", @@ -1235,9 +1235,9 @@ } }, "node_modules/@primer/octicons": { - "version": "19.3.0", - "resolved": "https://registry.npmjs.org/@primer/octicons/-/octicons-19.3.0.tgz", - "integrity": "sha512-hyIo54VPC3VI7ZyAgosiJcbhxq1gZLbBspZwN9cg1uImRd2E8T9JST3kGeezezJYPjG367FuF7p1L+gmLmeESw==", + "version": "19.4.0", + "resolved": "https://registry.npmjs.org/@primer/octicons/-/octicons-19.4.0.tgz", + "integrity": "sha512-92eXALm3ucZkzqpJmJbC+fR9ldiuNd4W4s2MZQNQIBahpg14emJ+I9fdHqCummFlfgyohLzXn++7rz0NlkqAJA==", "dependencies": { "object-assign": "^4.1.1" } diff --git a/package.json b/package.json index dd2eff7195..fd68c1d341 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@github/relative-time-element": "4.3.0", "@github/text-expander-element": "2.5.0", "@mcaptcha/vanilla-glue": "0.1.0-alpha-3", - "@primer/octicons": "19.3.0", + "@primer/octicons": "19.4.0", "@webcomponents/custom-elements": "1.6.0", "add-asset-webpack-plugin": "2.0.1", "ansi_up": "5.2.1", diff --git a/public/img/svg/octicon-copilot-error.svg b/public/img/svg/octicon-copilot-error.svg index a0e2232f73..caaf0d5ec3 100644 --- a/public/img/svg/octicon-copilot-error.svg +++ b/public/img/svg/octicon-copilot-error.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/public/img/svg/octicon-copilot-warning.svg b/public/img/svg/octicon-copilot-warning.svg index a9d856384d..ce95645204 100644 --- a/public/img/svg/octicon-copilot-warning.svg +++ b/public/img/svg/octicon-copilot-warning.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/public/img/svg/octicon-file-directory-symlink.svg b/public/img/svg/octicon-file-directory-symlink.svg new file mode 100644 index 0000000000..ddc2e3fd67 --- /dev/null +++ b/public/img/svg/octicon-file-directory-symlink.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/integration/repo_test.go b/tests/integration/repo_test.go index 840a43b5eb..2fb1a37d31 100644 --- a/tests/integration/repo_test.go +++ b/tests/integration/repo_test.go @@ -170,7 +170,7 @@ func TestViewRepoWithSymlinks(t *testing.T) { }) assert.Len(t, items, 5) assert.Equal(t, "a: svg octicon-file-directory-fill", items[0]) - assert.Equal(t, "link_b: svg octicon-file-submodule", items[1]) + assert.Equal(t, "link_b: svg octicon-file-directory-symlink", items[1]) assert.Equal(t, "link_d: svg octicon-file-symlink-file", items[2]) assert.Equal(t, "link_hi: svg octicon-file-symlink-file", items[3]) assert.Equal(t, "link_link: svg octicon-file-symlink-file", items[4]) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 6a0083b02e..13fd9d1f22 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -281,7 +281,8 @@ } .repository.file.list #repo-files-table tbody .svg.octicon-file, -.repository.file.list #repo-files-table tbody .svg.octicon-file-symlink-file { +.repository.file.list #repo-files-table tbody .svg.octicon-file-symlink-file, +.repository.file.list #repo-files-table tbody .svg.octicon-file-directory-symlink { color: var(--color-secondary-dark-7); }