From b742ff96fc9e844c9dc17b6b7a7f62b3497594ba Mon Sep 17 00:00:00 2001 From: Ahmad Sherif Date: Fri, 7 Apr 2017 14:26:56 +0200 Subject: Improve gitaly_address error message Closes gitaly#174 --- lib/gitlab/gitaly_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index bcdf1b1faa8..c69676a1dac 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -15,7 +15,7 @@ module Gitlab end unless URI(address).scheme.in?(%w(tcp unix)) - raise "Unsupported Gitaly address: #{address.inspect}" + raise "Unsupported Gitaly address: #{address.inspect} does not use URL scheme 'tcp' or 'unix'" end @addresses[name] = address -- cgit v1.2.1 From e809aafdb8da3067f6c4e481378b8404ae700264 Mon Sep 17 00:00:00 2001 From: "Sean Packham (GitLab)" Date: Wed, 12 Apr 2017 13:34:03 +0000 Subject: Remove link to topics --- doc/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/README.md b/doc/README.md index b6790b4d008..7703c64e152 100644 --- a/doc/README.md +++ b/doc/README.md @@ -6,10 +6,6 @@ All technical content published by GitLab lives in the documentation, including: - [User docs](#user-documentation): general documentation dedicated to regular users of GitLab - [Admin docs](#administrator-documentation): general documentation dedicated to administrators of GitLab instances - [Contributor docs](#contributor-documentation): general documentation on how to develop and contribute to GitLab -- [Topics](topics/index.md): pages organized per topic, gathering all the - resources already published by GitLab related to a specific subject, including - general docs, [technical articles](development/writing_documentation.md#technical-articles), - blog posts and video tutorials. - [GitLab University](university/README.md): guides to learn Git and GitLab through courses and videos. -- cgit v1.2.1 From 4dda6fcdf3432fd32b83e55f3d99c46068c39904 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 12 Apr 2017 14:56:54 -0500 Subject: Add docs for recent searches/search history See - https://gitlab.com/gitlab-org/gitlab-ce/issues/27262 - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10324 --- doc/user/search/img/search_history.gif | Bin 0 -> 265970 bytes doc/user/search/index.md | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 doc/user/search/img/search_history.gif diff --git a/doc/user/search/img/search_history.gif b/doc/user/search/img/search_history.gif new file mode 100644 index 00000000000..4cfa48ee0ab Binary files /dev/null and b/doc/user/search/img/search_history.gif differ diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 9d1ca1adcb2..6a5a19d5548 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -40,6 +40,12 @@ The same process is valid for merge requests. Navigate to your project's **Merge and click **Search or filter results...**. Merge requests can be filtered by author, assignee, milestone, and label. +### Search History + +You can view past recent searches by clicking on the icon with little clock with a counter-clockwise arrow surrounding it (left of the main search input). Clicking on a search entry, will submit and search that query. + +![search history](img/search_history.gif) + ### Shortcut You'll also find a shortcut on the search field on the top-right of the project's dashboard to -- cgit v1.2.1 From 7c414844520c26afc02adf6bfc7228e63f0094b8 Mon Sep 17 00:00:00 2001 From: Victor Wu Date: Wed, 12 Apr 2017 20:14:44 +0000 Subject: Update index.md --- doc/user/search/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 6a5a19d5548..7f15c177138 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -42,7 +42,7 @@ milestone, and label. ### Search History -You can view past recent searches by clicking on the icon with little clock with a counter-clockwise arrow surrounding it (left of the main search input). Clicking on a search entry, will submit and search that query. +You can view past recent searches by clicking on the icon with little clock with a counter-clockwise arrow surrounding it (left of the main search input). Clicking on a search entry, will submit and search that query. This is available in issues, merge requests, and issue boards. The searches are stored locally in your browser. ![search history](img/search_history.gif) -- cgit v1.2.1 From e114d114e254fe74081011cd63b96909b76864ce Mon Sep 17 00:00:00 2001 From: Victor Wu Date: Wed, 12 Apr 2017 20:17:57 +0000 Subject: Change heading --- doc/user/search/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 7f15c177138..990640a313f 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -40,7 +40,7 @@ The same process is valid for merge requests. Navigate to your project's **Merge and click **Search or filter results...**. Merge requests can be filtered by author, assignee, milestone, and label. -### Search History +## Search History You can view past recent searches by clicking on the icon with little clock with a counter-clockwise arrow surrounding it (left of the main search input). Clicking on a search entry, will submit and search that query. This is available in issues, merge requests, and issue boards. The searches are stored locally in your browser. -- cgit v1.2.1 From 92bc8a9a74f7dc44d1e45455dc4bc5e2250f4b16 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 12 Apr 2017 16:23:28 -0500 Subject: Update phrasing via @jschatz1 comments --- doc/user/search/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 990640a313f..61850e38fce 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -42,7 +42,7 @@ milestone, and label. ## Search History -You can view past recent searches by clicking on the icon with little clock with a counter-clockwise arrow surrounding it (left of the main search input). Clicking on a search entry, will submit and search that query. This is available in issues, merge requests, and issue boards. The searches are stored locally in your browser. +You can view recent searches by clicking on the little arrow-clock icon, which is to the left of the search input. Click the search entry to run that search again. This feature is available for issues, merge requests, and issue boards. Searches are stored locally in your browser. ![search history](img/search_history.gif) -- cgit v1.2.1 From deb56f21cb5fc7ef9292d4307bc1618af0c1cb29 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Thu, 13 Apr 2017 11:09:20 +0100 Subject: [ci skip] Use favicon full path --- .../images/ci_favicons/favicon_status_canceled.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_created.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_failed.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_manual.ico | Bin 0 -> 5430 bytes .../images/ci_favicons/favicon_status_not_found.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_pending.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_running.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_skipped.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_success.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/favicon_status_warning.ico | Bin 0 -> 5430 bytes app/assets/images/ci_favicons/icon_status_canceled.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_created.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_failed.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_manual.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_not_found.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_pending.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_running.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_skipped.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_success.ico | Bin 5430 -> 0 bytes app/assets/images/ci_favicons/icon_status_warning.ico | Bin 5430 -> 0 bytes app/assets/javascripts/lib/utils/common_utils.js | 8 ++++---- app/helpers/ci_status_helper.rb | 4 ++++ app/serializers/status_entity.rb | 9 ++++++++- 23 files changed, 16 insertions(+), 5 deletions(-) create mode 100755 app/assets/images/ci_favicons/favicon_status_canceled.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_created.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_failed.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_manual.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_not_found.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_pending.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_running.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_skipped.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_success.ico create mode 100755 app/assets/images/ci_favicons/favicon_status_warning.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_canceled.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_created.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_failed.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_manual.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_not_found.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_pending.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_running.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_skipped.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_success.ico delete mode 100755 app/assets/images/ci_favicons/icon_status_warning.ico diff --git a/app/assets/images/ci_favicons/favicon_status_canceled.ico b/app/assets/images/ci_favicons/favicon_status_canceled.ico new file mode 100755 index 00000000000..5a19458f2a2 Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_canceled.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_created.ico b/app/assets/images/ci_favicons/favicon_status_created.ico new file mode 100755 index 00000000000..4dca9640cb3 Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_created.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_failed.ico b/app/assets/images/ci_favicons/favicon_status_failed.ico new file mode 100755 index 00000000000..c961ff9a69b Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_failed.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_manual.ico b/app/assets/images/ci_favicons/favicon_status_manual.ico new file mode 100755 index 00000000000..5fbbc99ea7c Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_manual.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_not_found.ico b/app/assets/images/ci_favicons/favicon_status_not_found.ico new file mode 100755 index 00000000000..21afa9c72e6 Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_not_found.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_pending.ico b/app/assets/images/ci_favicons/favicon_status_pending.ico new file mode 100755 index 00000000000..8be32dab85a Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_pending.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_running.ico b/app/assets/images/ci_favicons/favicon_status_running.ico new file mode 100755 index 00000000000..f328ff1a5ed Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_running.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_skipped.ico b/app/assets/images/ci_favicons/favicon_status_skipped.ico new file mode 100755 index 00000000000..b4394e1b4af Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_skipped.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_success.ico b/app/assets/images/ci_favicons/favicon_status_success.ico new file mode 100755 index 00000000000..4f436c95242 Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_success.ico differ diff --git a/app/assets/images/ci_favicons/favicon_status_warning.ico b/app/assets/images/ci_favicons/favicon_status_warning.ico new file mode 100755 index 00000000000..805cc20cdec Binary files /dev/null and b/app/assets/images/ci_favicons/favicon_status_warning.ico differ diff --git a/app/assets/images/ci_favicons/icon_status_canceled.ico b/app/assets/images/ci_favicons/icon_status_canceled.ico deleted file mode 100755 index 5a19458f2a2..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_canceled.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_created.ico b/app/assets/images/ci_favicons/icon_status_created.ico deleted file mode 100755 index 4dca9640cb3..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_created.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_failed.ico b/app/assets/images/ci_favicons/icon_status_failed.ico deleted file mode 100755 index c961ff9a69b..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_failed.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_manual.ico b/app/assets/images/ci_favicons/icon_status_manual.ico deleted file mode 100755 index 5fbbc99ea7c..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_manual.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_not_found.ico b/app/assets/images/ci_favicons/icon_status_not_found.ico deleted file mode 100755 index 21afa9c72e6..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_not_found.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_pending.ico b/app/assets/images/ci_favicons/icon_status_pending.ico deleted file mode 100755 index 8be32dab85a..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_pending.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_running.ico b/app/assets/images/ci_favicons/icon_status_running.ico deleted file mode 100755 index f328ff1a5ed..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_running.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_skipped.ico b/app/assets/images/ci_favicons/icon_status_skipped.ico deleted file mode 100755 index b4394e1b4af..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_skipped.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_success.ico b/app/assets/images/ci_favicons/icon_status_success.ico deleted file mode 100755 index 4f436c95242..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_success.ico and /dev/null differ diff --git a/app/assets/images/ci_favicons/icon_status_warning.ico b/app/assets/images/ci_favicons/icon_status_warning.ico deleted file mode 100755 index 805cc20cdec..00000000000 Binary files a/app/assets/images/ci_favicons/icon_status_warning.ico and /dev/null differ diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index e1e6ca25446..5c7baf0a69b 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -364,9 +364,9 @@ }); }; - w.gl.utils.setFavicon = (iconName) => { - if (faviconEl && iconName) { - faviconEl.setAttribute('href', `/assets/${iconName}.ico`); + w.gl.utils.setFavicon = (faviconPath) => { + if (faviconEl && faviconPath) { + faviconEl.setAttribute('href', faviconPath); } }; @@ -382,7 +382,7 @@ dataType: 'json', success: function(data) { if (data && data.icon) { - gl.utils.setFavicon(`ci_favicons/${data.icon}`); + gl.utils.setFavicon(data.favicon); } else { gl.utils.resetFavicon(); } diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 2de9e0de310..b05662bc33d 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -121,4 +121,8 @@ module CiStatusHelper status.respond_to?(:label) && status.respond_to?(:icon) end + + def ci_status_favicon_path(favicon_name) + ActionController::Base.helpers.image_path(File.join('ci_favicons', "#{favicon_name}.ico")) + end end diff --git a/app/serializers/status_entity.rb b/app/serializers/status_entity.rb index dfd9d1584a1..8aa894f9fee 100644 --- a/app/serializers/status_entity.rb +++ b/app/serializers/status_entity.rb @@ -1,8 +1,15 @@ class StatusEntity < Grape::Entity include RequestAwareEntity + include CiStatusHelper - expose :icon, :favicon, :text, :label, :group + format_with(:status_favicon_path) do |favicon_name| + ci_status_favicon_path(favicon_name) + end + + expose :icon, :text, :label, :group expose :has_details?, as: :has_details expose :details_path + + expose :favicon, format_with: :status_favicon_path end -- cgit v1.2.1 From c0af1fc4be9df47656d1859de18e18a85c1080a5 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Thu, 13 Apr 2017 12:14:31 +0100 Subject: Remove helper --- app/helpers/ci_status_helper.rb | 4 ---- app/serializers/status_entity.rb | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index b05662bc33d..2de9e0de310 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -121,8 +121,4 @@ module CiStatusHelper status.respond_to?(:label) && status.respond_to?(:icon) end - - def ci_status_favicon_path(favicon_name) - ActionController::Base.helpers.image_path(File.join('ci_favicons', "#{favicon_name}.ico")) - end end diff --git a/app/serializers/status_entity.rb b/app/serializers/status_entity.rb index 8aa894f9fee..6862730d9d2 100644 --- a/app/serializers/status_entity.rb +++ b/app/serializers/status_entity.rb @@ -1,6 +1,5 @@ class StatusEntity < Grape::Entity include RequestAwareEntity - include CiStatusHelper format_with(:status_favicon_path) do |favicon_name| ci_status_favicon_path(favicon_name) @@ -11,5 +10,7 @@ class StatusEntity < Grape::Entity expose :has_details?, as: :has_details expose :details_path - expose :favicon, format_with: :status_favicon_path + expose :favicon do |status| + ActionController::Base.helpers.image_path(File.join('ci_favicons', "#{status.favicon}.ico")) + end end -- cgit v1.2.1 From b24cb9985682bc52f299ba2fe2bc5cfbf41fafaf Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Thu, 13 Apr 2017 12:50:03 +0100 Subject: Updated specs --- app/assets/javascripts/lib/utils/common_utils.js | 2 +- spec/controllers/projects/builds_controller_spec.rb | 2 +- spec/controllers/projects/merge_requests_controller_spec.rb | 2 +- spec/controllers/projects/pipelines_controller_spec.rb | 2 +- spec/javascripts/lib/utils/common_utils_spec.js | 13 ++++++------- spec/serializers/build_serializer_spec.rb | 2 +- spec/serializers/pipeline_serializer_spec.rb | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index 5c7baf0a69b..e3d14f716a3 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -381,7 +381,7 @@ url: pageUrl, dataType: 'json', success: function(data) { - if (data && data.icon) { + if (data && data.favicon) { gl.utils.setFavicon(data.favicon); } else { gl.utils.resetFavicon(); diff --git a/spec/controllers/projects/builds_controller_spec.rb b/spec/controllers/projects/builds_controller_spec.rb index 13208d21918..07f3a3d0062 100644 --- a/spec/controllers/projects/builds_controller_spec.rb +++ b/spec/controllers/projects/builds_controller_spec.rb @@ -60,7 +60,7 @@ describe Projects::BuildsController do expect(json_response['text']).to eq status.text expect(json_response['label']).to eq status.label expect(json_response['icon']).to eq status.icon - expect(json_response['favicon']).to eq status.favicon + expect(json_response['favicon']).to match status.favicon end end end diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index 1739d40ab88..49e94574f57 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -1208,7 +1208,7 @@ describe Projects::MergeRequestsController do expect(json_response['text']).to eq status.text expect(json_response['label']).to eq status.label expect(json_response['icon']).to eq status.icon - expect(json_response['favicon']).to eq status.favicon + expect(json_response['favicon']).to match status.favicon end end diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index d8f9bfd0d37..f64daff42ec 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -86,7 +86,7 @@ describe Projects::PipelinesController do expect(json_response['text']).to eq status.text expect(json_response['label']).to eq status.label expect(json_response['icon']).to eq status.icon - expect(json_response['favicon']).to eq status.favicon + expect(json_response['favicon']).to match status.favicon end end end diff --git a/spec/javascripts/lib/utils/common_utils_spec.js b/spec/javascripts/lib/utils/common_utils_spec.js index 03f3c206f44..56aabc16382 100644 --- a/spec/javascripts/lib/utils/common_utils_spec.js +++ b/spec/javascripts/lib/utils/common_utils_spec.js @@ -313,7 +313,7 @@ require('~/lib/utils/common_utils'); describe('gl.utils.setFavicon', () => { it('should set page favicon to provided favicon', () => { - const faviconName = 'custom_favicon'; + const faviconPath = '//custom_favicon'; const fakeLink = { setAttribute() {}, }; @@ -321,9 +321,9 @@ require('~/lib/utils/common_utils'); spyOn(window.document, 'getElementById').and.callFake(() => fakeLink); spyOn(fakeLink, 'setAttribute').and.callFake((attr, val) => { expect(attr).toEqual('href'); - expect(val.indexOf('/assets/custom_favicon.ico') > -1).toBe(true); + expect(val.indexOf(faviconPath) > -1).toBe(true); }); - gl.utils.setFavicon(faviconName); + gl.utils.setFavicon(faviconPath); }); }); @@ -345,13 +345,12 @@ require('~/lib/utils/common_utils'); describe('gl.utils.setCiStatusFavicon', () => { it('should set page favicon to CI status favicon based on provided status', () => { const BUILD_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/builds/1/status.json`; - const FAVICON_PATH = 'ci_favicons/'; - const FAVICON = 'icon_status_success'; + const FAVICON_PATH = '//icon_status_success'; const spySetFavicon = spyOn(gl.utils, 'setFavicon').and.stub(); const spyResetFavicon = spyOn(gl.utils, 'resetFavicon').and.stub(); spyOn($, 'ajax').and.callFake(function (options) { - options.success({ icon: FAVICON }); - expect(spySetFavicon).toHaveBeenCalledWith(FAVICON_PATH + FAVICON); + options.success({ favicon: FAVICON_PATH }); + expect(spySetFavicon).toHaveBeenCalledWith(FAVICON_PATH); options.success(); expect(spyResetFavicon).toHaveBeenCalled(); options.error(); diff --git a/spec/serializers/build_serializer_spec.rb b/spec/serializers/build_serializer_spec.rb index 3cc791bca50..ebb70466a73 100644 --- a/spec/serializers/build_serializer_spec.rb +++ b/spec/serializers/build_serializer_spec.rb @@ -38,7 +38,7 @@ describe BuildSerializer do expect(subject[:text]).to eq(status.text) expect(subject[:label]).to eq(status.label) expect(subject[:icon]).to eq(status.icon) - expect(subject[:favicon]).to eq(status.favicon) + expect(subject[:favicon]).to match status.favicon end end end diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index f6249ab4664..238dfa50013 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -144,7 +144,7 @@ describe PipelineSerializer do expect(subject[:text]).to eq(status.text) expect(subject[:label]).to eq(status.label) expect(subject[:icon]).to eq(status.icon) - expect(subject[:favicon]).to eq(status.favicon) + expect(subject[:favicon]).to match status.favicon end end end -- cgit v1.2.1 From cce27d3aef6bb6a6a41260745fa1a14b82d97fbb Mon Sep 17 00:00:00 2001 From: Victor Wu Date: Thu, 13 Apr 2017 15:27:28 +0000 Subject: Remove issue boards from recent searches --- doc/user/search/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 61850e38fce..45f443819ec 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -42,7 +42,7 @@ milestone, and label. ## Search History -You can view recent searches by clicking on the little arrow-clock icon, which is to the left of the search input. Click the search entry to run that search again. This feature is available for issues, merge requests, and issue boards. Searches are stored locally in your browser. +You can view recent searches by clicking on the little arrow-clock icon, which is to the left of the search input. Click the search entry to run that search again. This feature is available for issues and merge requests. Searches are stored locally in your browser. ![search history](img/search_history.gif) -- cgit v1.2.1 From 32a387a72c3d0085890001571e1a3bfd74ef07eb Mon Sep 17 00:00:00 2001 From: tauriedavis Date: Thu, 16 Mar 2017 15:46:56 -0700 Subject: 29595 Customize experience callout design --- app/assets/stylesheets/pages/profile.scss | 59 +++++++++++++++++----- app/views/shared/_user_callout.html.haml | 19 ++++--- .../29595-customize-experience-callout.yml | 4 ++ 3 files changed, 60 insertions(+), 22 deletions(-) create mode 100644 changelogs/unreleased/29595-customize-experience-callout.yml diff --git a/app/assets/stylesheets/pages/profile.scss b/app/assets/stylesheets/pages/profile.scss index 8c6dd392865..a8dad58b1d3 100644 --- a/app/assets/stylesheets/pages/profile.scss +++ b/app/assets/stylesheets/pages/profile.scss @@ -289,8 +289,12 @@ table.u2f-registrations { margin: 0 auto; .bordered-box { - border: 1px solid $border-color; + border: 1px solid $blue-300; border-radius: $border-radius-default; + background-color: lighten($blue-50, 3%); + position: relative; + display: flex; + justify-content: center; } .landing { @@ -298,28 +302,59 @@ table.u2f-registrations { margin-bottom: $gl-padding; .close { - margin-right: 20px; - } + position: absolute; + right: 20px; + opacity: 1; + + .dismiss-icon { + float: right; + cursor: pointer; + color: $blue-300; + } - .dismiss-icon { - float: right; - cursor: pointer; - color: $cycle-analytics-dismiss-icon-color; + &:hover { + background-color: transparent; + border: 0; + + .dismiss-icon { + color: $blue-400; + } + } } .svg-container { - text-align: center; + margin-right: 30px; + display: inline-block; svg { - width: 136px; - height: 136px; + height: 110px; + vertical-align: top; } } + + .user-callout-copy { + display: inline-block; + vertical-align: top; + } } @media(max-width: $screen-xs-max) { - .inner-content { - padding-left: 30px; + text-align: center; + + .bordered-box { + display: block; + } + + .landing { + .svg-container, + .user-callout-copy { + margin: 0; + display: block; + + svg { + height: 75px; + } + } } } } diff --git a/app/views/shared/_user_callout.html.haml b/app/views/shared/_user_callout.html.haml index 8f1293adcb1..108643f2f6f 100644 --- a/app/views/shared/_user_callout.html.haml +++ b/app/views/shared/_user_callout.html.haml @@ -1,14 +1,13 @@ .user-callout .bordered-box.landing.content-block - %button.btn.btn-default.close.js-close-callout{ type: 'button', + %button.btn.btn-default.close.close-user-callout{ type: 'button', 'aria-label' => 'Dismiss customize experience box' } = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') - .row - .col-sm-3.col-xs-12.svg-container - = custom_icon('icon_customization') - .col-sm-8.col-xs-12.inner-content - %h4 - Customize your experience - %p - Change syntax themes, default project pages, and more in preferences. - = link_to 'Check it out', profile_preferences_path, class: 'btn btn-default js-close-callout' + .svg-container + = custom_icon('icon_customization') + .user-callout-copy + %h4 + Customize your experience + %p + Change syntax themes, default project pages, and more in preferences. + = link_to 'Check it out', profile_preferences_path, class: 'btn btn-primary user-callout-btn' diff --git a/changelogs/unreleased/29595-customize-experience-callout.yml b/changelogs/unreleased/29595-customize-experience-callout.yml new file mode 100644 index 00000000000..ec8393142c6 --- /dev/null +++ b/changelogs/unreleased/29595-customize-experience-callout.yml @@ -0,0 +1,4 @@ +--- +title: 29595 Update callout design +merge_request: +author: -- cgit v1.2.1 From d04a017ad63660543c3890a49e80547abac0332a Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Thu, 13 Apr 2017 16:43:07 -0500 Subject: Fixed tests --- app/views/shared/_user_callout.html.haml | 4 ++-- spec/javascripts/user_callout_spec.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_user_callout.html.haml b/app/views/shared/_user_callout.html.haml index 108643f2f6f..8308baa7829 100644 --- a/app/views/shared/_user_callout.html.haml +++ b/app/views/shared/_user_callout.html.haml @@ -1,6 +1,6 @@ .user-callout .bordered-box.landing.content-block - %button.btn.btn-default.close.close-user-callout{ type: 'button', + %button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss customize experience box' } = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') .svg-container @@ -10,4 +10,4 @@ Customize your experience %p Change syntax themes, default project pages, and more in preferences. - = link_to 'Check it out', profile_preferences_path, class: 'btn btn-primary user-callout-btn' + = link_to 'Check it out', profile_preferences_path, class: 'btn btn-primary js-close-callout' diff --git a/spec/javascripts/user_callout_spec.js b/spec/javascripts/user_callout_spec.js index c0375ebc61c..28d0c7dcd99 100644 --- a/spec/javascripts/user_callout_spec.js +++ b/spec/javascripts/user_callout_spec.js @@ -14,7 +14,6 @@ describe('UserCallout', function () { this.userCallout = new UserCallout(); this.closeButton = $('.js-close-callout.close'); this.userCalloutBtn = $('.js-close-callout:not(.close)'); - this.userCalloutContainer = $('.user-callout'); }); it('hides when user clicks on the dismiss-icon', (done) => { -- cgit v1.2.1 From fb20dcf8e67992cada346ff3718e078cdf5359e8 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Fri, 14 Apr 2017 11:34:50 +0100 Subject: Remove unneeded format block --- app/serializers/status_entity.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/serializers/status_entity.rb b/app/serializers/status_entity.rb index 6862730d9d2..944472f3e51 100644 --- a/app/serializers/status_entity.rb +++ b/app/serializers/status_entity.rb @@ -1,10 +1,6 @@ class StatusEntity < Grape::Entity include RequestAwareEntity - format_with(:status_favicon_path) do |favicon_name| - ci_status_favicon_path(favicon_name) - end - expose :icon, :text, :label, :group expose :has_details?, as: :has_details -- cgit v1.2.1 From e7c9aa6030312efac89de1c5a4afae35ef47f330 Mon Sep 17 00:00:00 2001 From: tauriedavis Date: Thu, 16 Mar 2017 15:46:56 -0700 Subject: 29595 Customize experience callout design --- app/assets/stylesheets/pages/profile.scss | 59 +++++++++++++++++----- app/views/shared/_user_callout.html.haml | 19 ++++--- .../29595-customize-experience-callout.yml | 4 ++ 3 files changed, 60 insertions(+), 22 deletions(-) create mode 100644 changelogs/unreleased/29595-customize-experience-callout.yml diff --git a/app/assets/stylesheets/pages/profile.scss b/app/assets/stylesheets/pages/profile.scss index 8c6dd392865..a8dad58b1d3 100644 --- a/app/assets/stylesheets/pages/profile.scss +++ b/app/assets/stylesheets/pages/profile.scss @@ -289,8 +289,12 @@ table.u2f-registrations { margin: 0 auto; .bordered-box { - border: 1px solid $border-color; + border: 1px solid $blue-300; border-radius: $border-radius-default; + background-color: lighten($blue-50, 3%); + position: relative; + display: flex; + justify-content: center; } .landing { @@ -298,28 +302,59 @@ table.u2f-registrations { margin-bottom: $gl-padding; .close { - margin-right: 20px; - } + position: absolute; + right: 20px; + opacity: 1; + + .dismiss-icon { + float: right; + cursor: pointer; + color: $blue-300; + } - .dismiss-icon { - float: right; - cursor: pointer; - color: $cycle-analytics-dismiss-icon-color; + &:hover { + background-color: transparent; + border: 0; + + .dismiss-icon { + color: $blue-400; + } + } } .svg-container { - text-align: center; + margin-right: 30px; + display: inline-block; svg { - width: 136px; - height: 136px; + height: 110px; + vertical-align: top; } } + + .user-callout-copy { + display: inline-block; + vertical-align: top; + } } @media(max-width: $screen-xs-max) { - .inner-content { - padding-left: 30px; + text-align: center; + + .bordered-box { + display: block; + } + + .landing { + .svg-container, + .user-callout-copy { + margin: 0; + display: block; + + svg { + height: 75px; + } + } } } } diff --git a/app/views/shared/_user_callout.html.haml b/app/views/shared/_user_callout.html.haml index 8f1293adcb1..108643f2f6f 100644 --- a/app/views/shared/_user_callout.html.haml +++ b/app/views/shared/_user_callout.html.haml @@ -1,14 +1,13 @@ .user-callout .bordered-box.landing.content-block - %button.btn.btn-default.close.js-close-callout{ type: 'button', + %button.btn.btn-default.close.close-user-callout{ type: 'button', 'aria-label' => 'Dismiss customize experience box' } = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') - .row - .col-sm-3.col-xs-12.svg-container - = custom_icon('icon_customization') - .col-sm-8.col-xs-12.inner-content - %h4 - Customize your experience - %p - Change syntax themes, default project pages, and more in preferences. - = link_to 'Check it out', profile_preferences_path, class: 'btn btn-default js-close-callout' + .svg-container + = custom_icon('icon_customization') + .user-callout-copy + %h4 + Customize your experience + %p + Change syntax themes, default project pages, and more in preferences. + = link_to 'Check it out', profile_preferences_path, class: 'btn btn-primary user-callout-btn' diff --git a/changelogs/unreleased/29595-customize-experience-callout.yml b/changelogs/unreleased/29595-customize-experience-callout.yml new file mode 100644 index 00000000000..ec8393142c6 --- /dev/null +++ b/changelogs/unreleased/29595-customize-experience-callout.yml @@ -0,0 +1,4 @@ +--- +title: 29595 Update callout design +merge_request: +author: -- cgit v1.2.1 From 6c055805ea9b0ffeb56d4bc0bb87f16a139167ad Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Thu, 13 Apr 2017 16:43:07 -0500 Subject: Fixed tests --- app/views/shared/_user_callout.html.haml | 4 ++-- spec/javascripts/user_callout_spec.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_user_callout.html.haml b/app/views/shared/_user_callout.html.haml index 108643f2f6f..8308baa7829 100644 --- a/app/views/shared/_user_callout.html.haml +++ b/app/views/shared/_user_callout.html.haml @@ -1,6 +1,6 @@ .user-callout .bordered-box.landing.content-block - %button.btn.btn-default.close.close-user-callout{ type: 'button', + %button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss customize experience box' } = icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true') .svg-container @@ -10,4 +10,4 @@ Customize your experience %p Change syntax themes, default project pages, and more in preferences. - = link_to 'Check it out', profile_preferences_path, class: 'btn btn-primary user-callout-btn' + = link_to 'Check it out', profile_preferences_path, class: 'btn btn-primary js-close-callout' diff --git a/spec/javascripts/user_callout_spec.js b/spec/javascripts/user_callout_spec.js index c0375ebc61c..28d0c7dcd99 100644 --- a/spec/javascripts/user_callout_spec.js +++ b/spec/javascripts/user_callout_spec.js @@ -14,7 +14,6 @@ describe('UserCallout', function () { this.userCallout = new UserCallout(); this.closeButton = $('.js-close-callout.close'); this.userCalloutBtn = $('.js-close-callout:not(.close)'); - this.userCalloutContainer = $('.user-callout'); }); it('hides when user clicks on the dismiss-icon', (done) => { -- cgit v1.2.1 From 3545af219b84845b075534ae5f9255f27cf92b89 Mon Sep 17 00:00:00 2001 From: tauriedavis Date: Fri, 14 Apr 2017 14:33:56 -0700 Subject: Remove lighten blue and add blue-25 for background --- app/assets/stylesheets/pages/profile.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pages/profile.scss b/app/assets/stylesheets/pages/profile.scss index a8dad58b1d3..fe084eb9397 100644 --- a/app/assets/stylesheets/pages/profile.scss +++ b/app/assets/stylesheets/pages/profile.scss @@ -291,7 +291,7 @@ table.u2f-registrations { .bordered-box { border: 1px solid $blue-300; border-radius: $border-radius-default; - background-color: lighten($blue-50, 3%); + background-color: $blue-25; position: relative; display: flex; justify-content: center; -- cgit v1.2.1 From b544d8fade02ca826a55b8300e0a4c18fccbec01 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Mon, 17 Apr 2017 13:18:40 +0100 Subject: Review changes, used eq instead of match --- spec/controllers/projects/builds_controller_spec.rb | 2 +- spec/controllers/projects/merge_requests_controller_spec.rb | 2 +- spec/controllers/projects/pipelines_controller_spec.rb | 2 +- spec/serializers/build_serializer_spec.rb | 2 +- spec/serializers/pipeline_serializer_spec.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/controllers/projects/builds_controller_spec.rb b/spec/controllers/projects/builds_controller_spec.rb index 07f3a3d0062..faf3770f5e9 100644 --- a/spec/controllers/projects/builds_controller_spec.rb +++ b/spec/controllers/projects/builds_controller_spec.rb @@ -60,7 +60,7 @@ describe Projects::BuildsController do expect(json_response['text']).to eq status.text expect(json_response['label']).to eq status.label expect(json_response['icon']).to eq status.icon - expect(json_response['favicon']).to match status.favicon + expect(json_response['favicon']).to eq "/assets/ci_favicons/#{status.favicon}.ico" end end end diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index 49e94574f57..cc393bd24f2 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -1208,7 +1208,7 @@ describe Projects::MergeRequestsController do expect(json_response['text']).to eq status.text expect(json_response['label']).to eq status.label expect(json_response['icon']).to eq status.icon - expect(json_response['favicon']).to match status.favicon + expect(json_response['favicon']).to eq "/assets/ci_favicons/#{status.favicon}.ico" end end diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index f64daff42ec..d9192177a06 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -86,7 +86,7 @@ describe Projects::PipelinesController do expect(json_response['text']).to eq status.text expect(json_response['label']).to eq status.label expect(json_response['icon']).to eq status.icon - expect(json_response['favicon']).to match status.favicon + expect(json_response['favicon']).to eq "/assets/ci_favicons/#{status.favicon}.ico" end end end diff --git a/spec/serializers/build_serializer_spec.rb b/spec/serializers/build_serializer_spec.rb index ebb70466a73..7f1abecfafe 100644 --- a/spec/serializers/build_serializer_spec.rb +++ b/spec/serializers/build_serializer_spec.rb @@ -38,7 +38,7 @@ describe BuildSerializer do expect(subject[:text]).to eq(status.text) expect(subject[:label]).to eq(status.label) expect(subject[:icon]).to eq(status.icon) - expect(subject[:favicon]).to match status.favicon + expect(subject[:favicon]).to eq("/assets/ci_favicons/#{status.favicon}.ico") end end end diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index 238dfa50013..ecde45a6d44 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -144,7 +144,7 @@ describe PipelineSerializer do expect(subject[:text]).to eq(status.text) expect(subject[:label]).to eq(status.label) expect(subject[:icon]).to eq(status.icon) - expect(subject[:favicon]).to match status.favicon + expect(subject[:favicon]).to eq("/assets/ci_favicons/#{status.favicon}.ico") end end end -- cgit v1.2.1 From b67bb566b33ab58fe3ebe81930506835cee8df3d Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 18 Apr 2017 12:27:10 +0000 Subject: Improves support for long build traces: --- app/assets/javascripts/build.js | 24 ++-- app/assets/javascripts/lib/utils/constants.js | 2 + app/assets/javascripts/lib/utils/number_utils.js | 12 +- app/assets/stylesheets/pages/builds.scss | 13 ++- app/views/projects/builds/show.html.haml | 10 +- lib/gitlab/ci/trace/stream.rb | 2 +- spec/javascripts/build_spec.js | 131 ++++++++++++++++++---- spec/javascripts/lib/utils/number_utility_spec.js | 9 +- 8 files changed, 163 insertions(+), 40 deletions(-) create mode 100644 app/assets/javascripts/lib/utils/constants.js diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 0aad95c2fe3..97f279e4be4 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -2,6 +2,8 @@ consistent-return, prefer-rest-params */ /* global Breakpoints */ +import { bytesToKiB } from './lib/utils/number_utils'; + const bind = function (fn, me) { return function () { return fn.apply(me, arguments); }; }; const AUTO_SCROLL_OFFSET = 75; const DOWN_BUILD_TRACE = '#down-build-trace'; @@ -20,6 +22,7 @@ window.Build = (function () { this.state = this.options.logState; this.buildStage = this.options.buildStage; this.$document = $(document); + this.logBytes = 0; this.updateDropdown = bind(this.updateDropdown, this); @@ -98,15 +101,22 @@ window.Build = (function () { if (log.append) { $buildContainer.append(log.html); + this.logBytes += log.size; } else { $buildContainer.html(log.html); - if (log.truncated) { - $('.js-truncated-info-size').html(` ${log.size} `); - this.$truncatedInfo.removeClass('hidden'); - this.initAffixTruncatedInfo(); - } else { - this.$truncatedInfo.addClass('hidden'); - } + this.logBytes = log.size; + } + + // if the incremental sum of logBytes we received is less than the total + // we need to show a message warning the user about that. + if (this.logBytes < log.total) { + // size is in bytes, we need to calculate KiB + const size = bytesToKiB(this.logBytes); + $('.js-truncated-info-size').html(`${size}`); + this.$truncatedInfo.removeClass('hidden'); + this.initAffixTruncatedInfo(); + } else { + this.$truncatedInfo.addClass('hidden'); } this.checkAutoscroll(); diff --git a/app/assets/javascripts/lib/utils/constants.js b/app/assets/javascripts/lib/utils/constants.js new file mode 100644 index 00000000000..1e96c7ab5cd --- /dev/null +++ b/app/assets/javascripts/lib/utils/constants.js @@ -0,0 +1,2 @@ +/* eslint-disable import/prefer-default-export */ +export const BYTES_IN_KIB = 1024; diff --git a/app/assets/javascripts/lib/utils/number_utils.js b/app/assets/javascripts/lib/utils/number_utils.js index e2bf69ee52e..f1b07408671 100644 --- a/app/assets/javascripts/lib/utils/number_utils.js +++ b/app/assets/javascripts/lib/utils/number_utils.js @@ -1,4 +1,4 @@ -/* eslint-disable import/prefer-default-export */ +import { BYTES_IN_KIB } from './constants'; /** * Function that allows a number with an X amount of decimals @@ -32,3 +32,13 @@ export function formatRelevantDigits(number) { } return formattedNumber; } + +/** + * Utility function that calculates KiB of the given bytes. + * + * @param {Number} number bytes + * @return {Number} KiB + */ +export function bytesToKiB(number) { + return number / BYTES_IN_KIB; +} diff --git a/app/assets/stylesheets/pages/builds.scss b/app/assets/stylesheets/pages/builds.scss index 144adbcdaef..411f1c4442b 100644 --- a/app/assets/stylesheets/pages/builds.scss +++ b/app/assets/stylesheets/pages/builds.scss @@ -61,8 +61,9 @@ .truncated-info { text-align: center; border-bottom: 1px solid; - background-color: $black-transparent; + background-color: $black; height: 45px; + padding: 15px; &.affix { top: 0; @@ -87,6 +88,16 @@ right: 5px; left: 5px; } + + .truncated-info-size { + margin: 0 5px; + } + + .raw-link { + color: inherit; + margin-left: 5px; + text-decoration: underline; + } } } diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 0faad57a312..7cb2ec83cc7 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -71,11 +71,11 @@ = custom_icon('scroll_down_hover_active') #up-build-trace %pre.build-trace#build-trace - .js-truncated-info.truncated-info.hidden - %span< - Showing last - %span.js-truncated-info-size>< - KiB of log + .js-truncated-info.truncated-info.hidden< + Showing last + %span.js-truncated-info-size.truncated-info-size>< + KiB of log - + %a.js-raw-link.raw-link{ :href => raw_namespace_project_build_path(@project.namespace, @project, @build) }>< Complete Raw %code.bash.js-build-output .build-loader-animation.js-build-refresh diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb index 68b14c7c04c..fa462cbe095 100644 --- a/lib/gitlab/ci/trace/stream.rb +++ b/lib/gitlab/ci/trace/stream.rb @@ -4,7 +4,7 @@ module Gitlab # This was inspired from: http://stackoverflow.com/a/10219411/1520132 class Stream BUFFER_SIZE = 4096 - LIMIT_SIZE = 50.kilobytes + LIMIT_SIZE = 500.kilobytes attr_reader :stream diff --git a/spec/javascripts/build_spec.js b/spec/javascripts/build_spec.js index 7174bf1e041..8ec96bdb583 100644 --- a/spec/javascripts/build_spec.js +++ b/spec/javascripts/build_spec.js @@ -1,11 +1,11 @@ /* eslint-disable no-new */ /* global Build */ - -require('~/lib/utils/datetime_utility'); -require('~/lib/utils/url_utility'); -require('~/build'); -require('~/breakpoints'); -require('vendor/jquery.nicescroll'); +import { bytesToKiB } from '~/lib/utils/number_utils'; +import '~/lib/utils/datetime_utility'; +import '~/lib/utils/url_utility'; +import '~/build'; +import '~/breakpoints'; +import 'vendor/jquery.nicescroll'; describe('Build', () => { const BUILD_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/builds/1`; @@ -144,24 +144,6 @@ describe('Build', () => { expect($('#build-trace .js-build-output').text()).toMatch(/Different/); }); - it('shows information about truncated log', () => { - jasmine.clock().tick(4001); - const [{ success }] = $.ajax.calls.argsFor(0); - - success.call($, { - html: 'Update', - status: 'success', - append: false, - truncated: true, - size: '50', - }); - - expect( - $('#build-trace .js-truncated-info').text().trim(), - ).toContain('Showing last 50 KiB of log'); - expect($('#build-trace .js-truncated-info-size').text()).toMatch('50'); - }); - it('reloads the page when the build is done', () => { spyOn(gl.utils, 'visitUrl'); @@ -176,6 +158,107 @@ describe('Build', () => { expect(gl.utils.visitUrl).toHaveBeenCalledWith(BUILD_URL); }); + + describe('truncated information', () => { + describe('when size is less than total', () => { + it('shows information about truncated log', () => { + jasmine.clock().tick(4001); + const [{ success }] = $.ajax.calls.argsFor(0); + + success.call($, { + html: 'Update', + status: 'success', + append: false, + size: 50, + total: 100, + }); + + expect(document.querySelector('.js-truncated-info').classList).not.toContain('hidden'); + }); + + it('shows the size in KiB', () => { + jasmine.clock().tick(4001); + const [{ success }] = $.ajax.calls.argsFor(0); + const size = 50; + + success.call($, { + html: 'Update', + status: 'success', + append: false, + size, + total: 100, + }); + + expect( + document.querySelector('.js-truncated-info-size').textContent.trim(), + ).toEqual(`${bytesToKiB(size)}`); + }); + + it('shows incremented size', () => { + jasmine.clock().tick(4001); + let args = $.ajax.calls.argsFor(0)[0]; + args.success.call($, { + html: 'Update', + status: 'success', + append: false, + size: 50, + total: 100, + }); + + expect( + document.querySelector('.js-truncated-info-size').textContent.trim(), + ).toEqual(`${bytesToKiB(50)}`); + + jasmine.clock().tick(4001); + args = $.ajax.calls.argsFor(2)[0]; + args.success.call($, { + html: 'Update', + status: 'success', + append: true, + size: 10, + total: 100, + }); + + expect( + document.querySelector('.js-truncated-info-size').textContent.trim(), + ).toEqual(`${bytesToKiB(60)}`); + }); + + it('renders the raw link', () => { + jasmine.clock().tick(4001); + const [{ success }] = $.ajax.calls.argsFor(0); + + success.call($, { + html: 'Update', + status: 'success', + append: false, + size: 50, + total: 100, + }); + + expect( + document.querySelector('.js-raw-link').textContent.trim(), + ).toContain('Complete Raw'); + }); + }); + + describe('when size is equal than total', () => { + it('does not show the trunctated information', () => { + jasmine.clock().tick(4001); + const [{ success }] = $.ajax.calls.argsFor(0); + + success.call($, { + html: 'Update', + status: 'success', + append: false, + size: 100, + total: 100, + }); + + expect(document.querySelector('.js-truncated-info').classList).toContain('hidden'); + }); + }); + }); }); }); }); diff --git a/spec/javascripts/lib/utils/number_utility_spec.js b/spec/javascripts/lib/utils/number_utility_spec.js index 5fde8be9123..90b12c9f115 100644 --- a/spec/javascripts/lib/utils/number_utility_spec.js +++ b/spec/javascripts/lib/utils/number_utility_spec.js @@ -1,4 +1,4 @@ -import { formatRelevantDigits } from '~/lib/utils/number_utils'; +import { formatRelevantDigits, bytesToKiB } from '~/lib/utils/number_utils'; describe('Number Utils', () => { describe('formatRelevantDigits', () => { @@ -38,4 +38,11 @@ describe('Number Utils', () => { expect(leftFromDecimal.length).toBe(3); }); }); + + describe('bytesToKiB', () => { + it('calculates KiB for the given bytes', () => { + expect(bytesToKiB(1024)).toEqual(1); + expect(bytesToKiB(1000)).toEqual(0.9765625); + }); + }); }); -- cgit v1.2.1 From 1194d904dd6f92230e178c2252fbe44c8d8b0832 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 18 Apr 2017 14:06:27 +0100 Subject: Disable initialization table pipeline for new merge request form Closes #31052 --- app/views/projects/merge_requests/_new_submit.html.haml | 2 +- app/views/projects/merge_requests/show/_pipelines.html.haml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 03069804c86..da79ca2ee75 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -46,7 +46,7 @@ -# This tab is always loaded via AJAX - if @pipelines.any? #pipelines.pipelines.tab-pane - = render 'projects/merge_requests/show/pipelines', endpoint: url_for(params.merge(format: :json)) + = render 'projects/merge_requests/show/pipelines', endpoint: url_for(params.merge(format: :json)), disable_initialization: true .mr-loading-status = spinner diff --git a/app/views/projects/merge_requests/show/_pipelines.html.haml b/app/views/projects/merge_requests/show/_pipelines.html.haml index de4aa255bbd..2f1dbe87619 100644 --- a/app/views/projects/merge_requests/show/_pipelines.html.haml +++ b/app/views/projects/merge_requests/show/_pipelines.html.haml @@ -1,3 +1,4 @@ - endpoint_path = local_assigns[:endpoint] || pipelines_namespace_project_merge_request_path(@project.namespace, @project, @merge_request, format: :json) +- disable_initialization = local_assigns.fetch(:disable_initialization, false) -= render 'projects/commit/pipelines_list', endpoint: endpoint_path += render 'projects/commit/pipelines_list', endpoint: endpoint_path, disable_initialization: disable_initialization -- cgit v1.2.1 From 7696191e330337ab5fac207bf24aa13d211a0ded Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Tue, 18 Apr 2017 10:50:04 +0100 Subject: disables test settings on chat notification services when repository is empty --- .../project_services/chat_notification_service.rb | 2 +- ...settings-on-services-when-repository-is-empty.yml | 4 ++++ .../chat_notification_service_spec.rb | 20 +++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/31009-disable-test-settings-on-services-when-repository-is-empty.yml diff --git a/app/models/project_services/chat_notification_service.rb b/app/models/project_services/chat_notification_service.rb index fa782c6fbb7..f2dfb87dbda 100644 --- a/app/models/project_services/chat_notification_service.rb +++ b/app/models/project_services/chat_notification_service.rb @@ -22,7 +22,7 @@ class ChatNotificationService < Service end def can_test? - valid? + super && valid? end def self.supported_events diff --git a/changelogs/unreleased/31009-disable-test-settings-on-services-when-repository-is-empty.yml b/changelogs/unreleased/31009-disable-test-settings-on-services-when-repository-is-empty.yml new file mode 100644 index 00000000000..6e43a032f20 --- /dev/null +++ b/changelogs/unreleased/31009-disable-test-settings-on-services-when-repository-is-empty.yml @@ -0,0 +1,4 @@ +--- +title: Disable test settings on chat notification services when repository is empty +merge_request: 10759 +author: diff --git a/spec/models/project_services/chat_notification_service_spec.rb b/spec/models/project_services/chat_notification_service_spec.rb index c98e7ee14fd..592c90cda36 100644 --- a/spec/models/project_services/chat_notification_service_spec.rb +++ b/spec/models/project_services/chat_notification_service_spec.rb @@ -1,11 +1,29 @@ require 'spec_helper' describe ChatNotificationService, models: true do - describe "Associations" do + describe 'Associations' do before do allow(subject).to receive(:activated?).and_return(true) end it { is_expected.to validate_presence_of :webhook } end + + describe '#can_test?' do + context 'with empty repository' do + it 'returns false' do + subject.project = create(:empty_project, :empty_repo) + + expect(subject.can_test?).to be false + end + end + + context 'with repository' do + it 'returns true' do + subject.project = create(:project) + + expect(subject.can_test?).to be true + end + end + end end -- cgit v1.2.1 From ab529cddac543c2052f7347d22e87f9a6ed04182 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Thu, 13 Apr 2017 16:20:04 +0100 Subject: Refactor group search out of global search --- app/services/search/global_service.rb | 11 +++----- app/services/search/group_service.rb | 18 +++++++++++++ app/services/search_service.rb | 2 ++ spec/services/search/global_service_spec.rb | 21 --------------- spec/services/search/group_service_spec.rb | 40 +++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 28 deletions(-) create mode 100644 app/services/search/group_service.rb create mode 100644 spec/services/search/group_service_spec.rb diff --git a/app/services/search/global_service.rb b/app/services/search/global_service.rb index 8409b592b72..ff188102b62 100644 --- a/app/services/search/global_service.rb +++ b/app/services/search/global_service.rb @@ -7,16 +7,13 @@ module Search end def execute - group = Group.find_by(id: params[:group_id]) if params[:group_id].present? - projects = ProjectsFinder.new(current_user: current_user).execute - - if group - projects = projects.inside_path(group.full_path) - end - Gitlab::SearchResults.new(current_user, projects, params[:search]) end + def projects + @projects ||= ProjectsFinder.new(current_user: current_user).execute + end + def scope @scope ||= begin allowed_scopes = %w[issues merge_requests milestones] diff --git a/app/services/search/group_service.rb b/app/services/search/group_service.rb new file mode 100644 index 00000000000..29478e3251f --- /dev/null +++ b/app/services/search/group_service.rb @@ -0,0 +1,18 @@ +module Search + class GroupService < Search::GlobalService + attr_accessor :group + + def initialize(user, group, params) + super(user, params) + + @group = group + end + + def projects + return Project.none unless group + return @projects if defined? @projects + + @projects = super.inside_path(group.full_path) + end + end +end diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 8d46a8dab3e..22736c71725 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -54,6 +54,8 @@ class SearchService Search::ProjectService.new(project, current_user, params) elsif show_snippets? Search::SnippetService.new(current_user, params) + elsif group + Search::GroupService.new(current_user, group, params) else Search::GlobalService.new(current_user, params) end diff --git a/spec/services/search/global_service_spec.rb b/spec/services/search/global_service_spec.rb index 2531607acad..cbf4f56213d 100644 --- a/spec/services/search/global_service_spec.rb +++ b/spec/services/search/global_service_spec.rb @@ -40,27 +40,6 @@ describe Search::GlobalService, services: true do expect(results.objects('projects')).to match_array [found_project] end - - context 'nested group' do - let!(:nested_group) { create(:group, :nested) } - let!(:project) { create(:empty_project, namespace: nested_group) } - - before do - project.add_master(user) - end - - it 'returns result from nested group' do - results = Search::GlobalService.new(user, search: project.path).execute - - expect(results.objects('projects')).to match_array [project] - end - - it 'returns result from descendants when search inside group' do - results = Search::GlobalService.new(user, search: project.path, group_id: nested_group.parent).execute - - expect(results.objects('projects')).to match_array [project] - end - end end end end diff --git a/spec/services/search/group_service_spec.rb b/spec/services/search/group_service_spec.rb new file mode 100644 index 00000000000..38f264f6e7b --- /dev/null +++ b/spec/services/search/group_service_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe Search::GroupService, services: true do + shared_examples_for 'group search' do + context 'finding projects by name' do + let(:user) { create(:user) } + let(:term) { "Project Name" } + let(:nested_group) { create(:group, :nested) } + + # These projects shouldn't be found + let!(:outside_project) { create(:empty_project, :public, name: "Outside #{term}") } + let!(:private_project) { create(:empty_project, :private, namespace: nested_group, name: "Private #{term}" )} + let!(:other_project) { create(:empty_project, :public, namespace: nested_group, name: term.reverse) } + + # These projects should be found + let!(:project1) { create(:empty_project, :internal, namespace: nested_group, name: "Inner #{term} 1") } + let!(:project2) { create(:empty_project, :internal, namespace: nested_group, name: "Inner #{term} 2") } + let!(:project3) { create(:empty_project, :internal, namespace: nested_group.parent, name: "Outer #{term}") } + + let(:results) { Search::GroupService.new(user, search_group, search: term).execute } + subject { results.objects('projects') } + + context 'in parent group' do + let(:search_group) { nested_group.parent } + + it { is_expected.to match_array([project1, project2, project3]) } + end + + context 'in subgroup' do + let(:search_group) { nested_group } + + it { is_expected.to match_array([project1, project2]) } + end + end + end + + describe 'basic search' do + include_examples 'group search' + end +end -- cgit v1.2.1 From 4622ae1ae480b85cade8191af30be9b2d0d63b70 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Tue, 18 Apr 2017 18:30:05 +0000 Subject: Resolve "Mini pipeline graph + status badge, when updating in real time don't change color and svg icon" --- app/assets/javascripts/ci_status_icons.js | 34 +++++++++++ .../vue_pipelines_index/components/stage.js | 28 ++------- spec/javascripts/ci_status_icon_spec.js | 44 +++++++++++++++ spec/javascripts/vue_pipelines_index/stage_spec.js | 66 ++++++++++++++++++++++ 4 files changed, 149 insertions(+), 23 deletions(-) create mode 100644 app/assets/javascripts/ci_status_icons.js create mode 100644 spec/javascripts/ci_status_icon_spec.js create mode 100644 spec/javascripts/vue_pipelines_index/stage_spec.js diff --git a/app/assets/javascripts/ci_status_icons.js b/app/assets/javascripts/ci_status_icons.js new file mode 100644 index 00000000000..f16616873b2 --- /dev/null +++ b/app/assets/javascripts/ci_status_icons.js @@ -0,0 +1,34 @@ +import CANCELED_SVG from 'icons/_icon_status_canceled_borderless.svg'; +import CREATED_SVG from 'icons/_icon_status_created_borderless.svg'; +import FAILED_SVG from 'icons/_icon_status_failed_borderless.svg'; +import MANUAL_SVG from 'icons/_icon_status_manual_borderless.svg'; +import PENDING_SVG from 'icons/_icon_status_pending_borderless.svg'; +import RUNNING_SVG from 'icons/_icon_status_running_borderless.svg'; +import SKIPPED_SVG from 'icons/_icon_status_skipped_borderless.svg'; +import SUCCESS_SVG from 'icons/_icon_status_success_borderless.svg'; +import WARNING_SVG from 'icons/_icon_status_warning_borderless.svg'; + +const StatusIconEntityMap = { + icon_status_canceled: CANCELED_SVG, + icon_status_created: CREATED_SVG, + icon_status_failed: FAILED_SVG, + icon_status_manual: MANUAL_SVG, + icon_status_pending: PENDING_SVG, + icon_status_running: RUNNING_SVG, + icon_status_skipped: SKIPPED_SVG, + icon_status_success: SUCCESS_SVG, + icon_status_warning: WARNING_SVG, +}; + +export { + CANCELED_SVG, + CREATED_SVG, + FAILED_SVG, + MANUAL_SVG, + PENDING_SVG, + RUNNING_SVG, + SKIPPED_SVG, + SUCCESS_SVG, + WARNING_SVG, + StatusIconEntityMap as default, +}; diff --git a/app/assets/javascripts/vue_pipelines_index/components/stage.js b/app/assets/javascripts/vue_pipelines_index/components/stage.js index a2c29002707..b8cc3630611 100644 --- a/app/assets/javascripts/vue_pipelines_index/components/stage.js +++ b/app/assets/javascripts/vue_pipelines_index/components/stage.js @@ -1,32 +1,11 @@ /* global Flash */ -import canceledSvg from 'icons/_icon_status_canceled_borderless.svg'; -import createdSvg from 'icons/_icon_status_created_borderless.svg'; -import failedSvg from 'icons/_icon_status_failed_borderless.svg'; -import manualSvg from 'icons/_icon_status_manual_borderless.svg'; -import pendingSvg from 'icons/_icon_status_pending_borderless.svg'; -import runningSvg from 'icons/_icon_status_running_borderless.svg'; -import skippedSvg from 'icons/_icon_status_skipped_borderless.svg'; -import successSvg from 'icons/_icon_status_success_borderless.svg'; -import warningSvg from 'icons/_icon_status_warning_borderless.svg'; +import StatusIconEntityMap from '../../ci_status_icons'; export default { data() { - const svgsDictionary = { - icon_status_canceled: canceledSvg, - icon_status_created: createdSvg, - icon_status_failed: failedSvg, - icon_status_manual: manualSvg, - icon_status_pending: pendingSvg, - icon_status_running: runningSvg, - icon_status_skipped: skippedSvg, - icon_status_success: successSvg, - icon_status_warning: warningSvg, - }; - return { builds: '', spinner: '', - svg: svgsDictionary[this.stage.status.icon], }; }, @@ -89,6 +68,9 @@ export default { triggerButtonClass() { return `mini-pipeline-graph-dropdown-toggle has-tooltip js-builds-dropdown-button ci-status-icon-${this.stage.status.group}`; }, + svgHTML() { + return StatusIconEntityMap[this.stage.status.icon]; + }, }, template: `
@@ -100,7 +82,7 @@ export default { data-toggle="dropdown" type="button" :aria-label="stage.title"> - +