Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2019-01-02 12:58:27 +0300
committerKushal Pandya <kushalspandya@gmail.com>2019-01-02 12:58:27 +0300
commitbb444211872cd4a367e6e31da20d5aa05ded8d6b (patch)
tree1560ce91653b7f3568d8e950094f81bcb327d647
parentdab5eaf8da36e1094dbd10691acce119d6d77233 (diff)
parent86b6053867383594a6a2a4eeaaf59529aa3c19fc (diff)
Merge branch '55755-user-activity-is-stuck-loading-when-there-is-none' into 'master'
Resolve "User activity is stuck loading when there is none" Closes #55755 See merge request gitlab-org/gitlab-ce!24063
-rw-r--r--app/assets/javascripts/pages/users/user_overview_block.js15
-rw-r--r--app/views/events/_events.html.haml5
-rw-r--r--changelogs/unreleased/55755-user-activity-is-stuck-loading-when-there-is-none.yml5
-rw-r--r--locale/gitlab.pot3
-rw-r--r--spec/features/users/overview_spec.rb3
5 files changed, 24 insertions, 7 deletions
diff --git a/app/assets/javascripts/pages/users/user_overview_block.js b/app/assets/javascripts/pages/users/user_overview_block.js
index eec2b5ca8e5..e9ecec717d6 100644
--- a/app/assets/javascripts/pages/users/user_overview_block.js
+++ b/app/assets/javascripts/pages/users/user_overview_block.js
@@ -29,18 +29,21 @@ export default class UserOverviewBlock {
render(data) {
const { html, count } = data;
- const contentList = document.querySelector(`${this.container} .overview-content-list`);
+ const containerEl = document.querySelector(this.container);
+ const contentList = containerEl.querySelector('.overview-content-list');
contentList.innerHTML += html;
- const loadingEl = document.querySelector(`${this.container} .loading`);
+ const loadingEl = containerEl.querySelector('.loading');
if (count && count > 0) {
- document.querySelector(`${this.container} .js-view-all`).classList.remove('hide');
+ containerEl.querySelector('.js-view-all').classList.remove('hide');
} else {
- document
- .querySelector(`${this.container} .nothing-here-block`)
- .classList.add('text-left', 'p-0');
+ const nothingHereBlock = containerEl.querySelector('.nothing-here-block');
+
+ if (nothingHereBlock) {
+ nothingHereBlock.classList.add('text-left', 'p-0');
+ }
}
loadingEl.classList.add('hide');
diff --git a/app/views/events/_events.html.haml b/app/views/events/_events.html.haml
index 68c19df092d..6ae4c334f7f 100644
--- a/app/views/events/_events.html.haml
+++ b/app/views/events/_events.html.haml
@@ -1 +1,4 @@
-= render partial: 'events/event', collection: @events
+- if @events.present?
+ = render partial: 'events/event', collection: @events
+- else
+ .nothing-here-block= _("No activities found")
diff --git a/changelogs/unreleased/55755-user-activity-is-stuck-loading-when-there-is-none.yml b/changelogs/unreleased/55755-user-activity-is-stuck-loading-when-there-is-none.yml
new file mode 100644
index 00000000000..5362a781281
--- /dev/null
+++ b/changelogs/unreleased/55755-user-activity-is-stuck-loading-when-there-is-none.yml
@@ -0,0 +1,5 @@
+---
+title: Hide spinner on empty activites list on user profile overview
+merge_request: 24063
+author:
+type: other
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 88eff3b6645..67be52d8810 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -4416,6 +4416,9 @@ msgstr ""
msgid "No"
msgstr ""
+msgid "No activities found"
+msgstr ""
+
msgid "No assignee"
msgstr ""
diff --git a/spec/features/users/overview_spec.rb b/spec/features/users/overview_spec.rb
index 873de85708a..8748230fa0c 100644
--- a/spec/features/users/overview_spec.rb
+++ b/spec/features/users/overview_spec.rb
@@ -33,6 +33,8 @@ describe 'Overview tab on a user profile', :js do
it 'does not show any entries in the list of activities' do
page.within('.activities-block') do
+ expect(page).to have_selector('.loading', visible: false)
+ expect(page).to have_content('No activities found')
expect(page).not_to have_selector('.event-item')
end
end
@@ -93,6 +95,7 @@ describe 'Overview tab on a user profile', :js do
it 'it shows an empty project list with an info message' do
page.within('.projects-block') do
+ expect(page).to have_selector('.loading', visible: false)
expect(page).to have_content('No projects found')
expect(page).not_to have_selector('.project-row')
end