From baaaf4e95979c128779c735a59cc4e0ecade0bf9 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 18 Apr 2017 17:49:21 +0100 Subject: Destroy tooltip in async buttons and tooltips --- app/assets/javascripts/environments/components/environment_actions.js | 2 ++ app/assets/javascripts/environments/components/environment_rollback.js | 2 ++ app/assets/javascripts/environments/components/environment_stop.js | 2 ++ app/assets/javascripts/vue_pipelines_index/components/async_button.vue | 2 ++ .../javascripts/vue_pipelines_index/components/pipelines_actions.js | 2 ++ 5 files changed, 10 insertions(+) diff --git a/app/assets/javascripts/environments/components/environment_actions.js b/app/assets/javascripts/environments/components/environment_actions.js index 1418e8d86ee..c199c7abcac 100644 --- a/app/assets/javascripts/environments/components/environment_actions.js +++ b/app/assets/javascripts/environments/components/environment_actions.js @@ -35,6 +35,8 @@ export default { onClickAction(endpoint) { this.isLoading = true; + $('.has-tooltip').tooltip('destroy'); + this.service.postAction(endpoint) .then(() => { this.isLoading = false; diff --git a/app/assets/javascripts/environments/components/environment_rollback.js b/app/assets/javascripts/environments/components/environment_rollback.js index baa15d9e5b5..7f3c4b78a51 100644 --- a/app/assets/javascripts/environments/components/environment_rollback.js +++ b/app/assets/javascripts/environments/components/environment_rollback.js @@ -36,6 +36,8 @@ export default { onClick() { this.isLoading = true; + $('.has-tooltip').tooltip('destroy'); + this.service.postAction(this.retryUrl) .then(() => { this.isLoading = false; diff --git a/app/assets/javascripts/environments/components/environment_stop.js b/app/assets/javascripts/environments/components/environment_stop.js index 47102692024..949de9a9604 100644 --- a/app/assets/javascripts/environments/components/environment_stop.js +++ b/app/assets/javascripts/environments/components/environment_stop.js @@ -36,6 +36,8 @@ export default { if (confirm('Are you sure you want to stop this environment?')) { this.isLoading = true; + $('.has-tooltip').tooltip('destroy'); + this.service.postAction(this.retryUrl) .then(() => { this.isLoading = false; diff --git a/app/assets/javascripts/vue_pipelines_index/components/async_button.vue b/app/assets/javascripts/vue_pipelines_index/components/async_button.vue index 11da6e908b7..fb1f8a9e2a3 100644 --- a/app/assets/javascripts/vue_pipelines_index/components/async_button.vue +++ b/app/assets/javascripts/vue_pipelines_index/components/async_button.vue @@ -65,6 +65,8 @@ export default { makeRequest() { this.isLoading = true; + $('.has-tooltip').tooltip('destroy'); + this.service.postAction(this.endpoint) .then(() => { this.isLoading = false; diff --git a/app/assets/javascripts/vue_pipelines_index/components/pipelines_actions.js b/app/assets/javascripts/vue_pipelines_index/components/pipelines_actions.js index 12d80768646..74396d8249b 100644 --- a/app/assets/javascripts/vue_pipelines_index/components/pipelines_actions.js +++ b/app/assets/javascripts/vue_pipelines_index/components/pipelines_actions.js @@ -28,6 +28,8 @@ export default { onClickAction(endpoint) { this.isLoading = true; + $('.has-tooltip').tooltip('destroy'); + this.service.postAction(endpoint) .then(() => { this.isLoading = false; -- cgit v1.2.1 From 97fd50262e2cacced7c8274285d7d0f0c4c407ed Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 19 Apr 2017 09:05:48 +0100 Subject: Fixed project & group icons not being clickable Closes #31073 --- app/assets/stylesheets/pages/projects.scss | 4 ++++ app/views/shared/groups/_group.html.haml | 3 ++- app/views/shared/projects/_project.html.haml | 9 +++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index a9e2a034790..28a8f9cb335 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -596,6 +596,10 @@ pre.light-well { .avatar-container { align-self: flex-start; + + > a { + width: 100%; + } } .project-details { diff --git a/app/views/shared/groups/_group.html.haml b/app/views/shared/groups/_group.html.haml index 09f946f1d88..b361ec86ced 100644 --- a/app/views/shared/groups/_group.html.haml +++ b/app/views/shared/groups/_group.html.haml @@ -27,7 +27,8 @@ = visibility_level_icon(group.visibility_level, fw: false) .avatar-container.s40 - = image_tag group_icon(group), class: "avatar s40 hidden-xs" + = link_to group do + = image_tag group_icon(group), class: "avatar s40 hidden-xs" .title = link_to group_name, group, class: 'group-name' diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index 761f0b606b5..c3b40433c9a 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -12,10 +12,11 @@ = cache(cache_key) do - if avatar .avatar-container.s40 - - if use_creator_avatar - = image_tag avatar_icon(project.creator.email, 40), class: "avatar s40", alt:'' - - else - = project_icon(project, alt: '', class: 'avatar project-avatar s40') + = link_to project_path(project), class: dom_class(project) do + - if use_creator_avatar + = image_tag avatar_icon(project.creator.email, 40), class: "avatar s40", alt:'' + - else + = project_icon(project, alt: '', class: 'avatar project-avatar s40') .project-details %h3.prepend-top-0.append-bottom-0 = link_to project_path(project), class: dom_class(project) do -- cgit v1.2.1 From 8752b99f88f631d0e63c4795b89d3eec50b21274 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 19 Apr 2017 10:50:06 +0100 Subject: Only destroy the component's tooltip --- .../environments/components/environment_actions.js | 2 +- .../environments/components/environment_rollback.js | 2 +- .../environments/components/environment_stop.js | 2 +- .../vue_pipelines_index/components/async_button.vue | 16 ++++++++++------ .../vue_pipelines_index/components/pipelines_actions.js | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/environments/components/environment_actions.js b/app/assets/javascripts/environments/components/environment_actions.js index c199c7abcac..1f325d66e87 100644 --- a/app/assets/javascripts/environments/components/environment_actions.js +++ b/app/assets/javascripts/environments/components/environment_actions.js @@ -35,7 +35,7 @@ export default { onClickAction(endpoint) { this.isLoading = true; - $('.has-tooltip').tooltip('destroy'); + $(this.$el.querySelector('.has-tooltip')).tooltip('destroy'); this.service.postAction(endpoint) .then(() => { diff --git a/app/assets/javascripts/environments/components/environment_rollback.js b/app/assets/javascripts/environments/components/environment_rollback.js index 7f3c4b78a51..7cbfb651525 100644 --- a/app/assets/javascripts/environments/components/environment_rollback.js +++ b/app/assets/javascripts/environments/components/environment_rollback.js @@ -36,7 +36,7 @@ export default { onClick() { this.isLoading = true; - $('.has-tooltip').tooltip('destroy'); + $(this.$el).tooltip('destroy'); this.service.postAction(this.retryUrl) .then(() => { diff --git a/app/assets/javascripts/environments/components/environment_stop.js b/app/assets/javascripts/environments/components/environment_stop.js index 949de9a9604..9e5465c1785 100644 --- a/app/assets/javascripts/environments/components/environment_stop.js +++ b/app/assets/javascripts/environments/components/environment_stop.js @@ -36,7 +36,7 @@ export default { if (confirm('Are you sure you want to stop this environment?')) { this.isLoading = true; - $('.has-tooltip').tooltip('destroy'); + $(this.$el).tooltip('destroy'); this.service.postAction(this.retryUrl) .then(() => { diff --git a/app/assets/javascripts/vue_pipelines_index/components/async_button.vue b/app/assets/javascripts/vue_pipelines_index/components/async_button.vue index fb1f8a9e2a3..bc42586a770 100644 --- a/app/assets/javascripts/vue_pipelines_index/components/async_button.vue +++ b/app/assets/javascripts/vue_pipelines_index/components/async_button.vue @@ -54,7 +54,7 @@ export default { }, methods: { - onClick() { + onClick(e) { if (this.confirmActionMessage && confirm(this.confirmActionMessage)) { this.makeRequest(); } else if (!this.confirmActionMessage) { @@ -65,7 +65,7 @@ export default { makeRequest() { this.isLoading = true; - $('.has-tooltip').tooltip('destroy'); + $(this.$el).tooltip('destroy'); this.service.postAction(this.endpoint) .then(() => { @@ -90,9 +90,13 @@ export default { :aria-label="title" data-container="body" data-placement="top" - :disabled="isLoading" - > - - + :disabled="isLoading"> +