Commit ab6d5d82 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 44e28e7d d867bfec
<script> <script>
import { GlModal } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as createFlash } from '~/flash'; import { deprecatedCreateFlash as createFlash } from '~/flash';
import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue';
import { redirectTo } from '~/lib/utils/url_utility'; import { redirectTo } from '~/lib/utils/url_utility';
import { s__ } from '~/locale'; import { __, s__ } from '~/locale';
export default { export default {
components: { components: {
GlModal: DeprecatedModal2, GlModal,
}, },
props: { props: {
url: { url: {
...@@ -36,17 +36,24 @@ export default { ...@@ -36,17 +36,24 @@ export default {
}); });
}, },
}, },
primaryAction: {
text: s__('AdminArea|Stop jobs'),
attributes: [{ variant: 'danger' }],
},
cancelAction: {
text: __('Cancel'),
},
}; };
</script> </script>
<template> <template>
<gl-modal <gl-modal
id="stop-jobs-modal" modal-id="stop-jobs-modal"
:header-title-text="s__('AdminArea|Stop all jobs?')" :action-primary="$options.primaryAction"
:footer-primary-button-text="s__('AdminArea|Stop jobs')" :action-cancel="$options.cancelAction"
footer-primary-button-variant="danger" @primary="onSubmit"
@submit="onSubmit"
> >
<template #modal-title>{{ s__('AdminArea|Stop all jobs?') }}</template>
{{ text }} {{ text }}
</gl-modal> </gl-modal>
</template> </template>
...@@ -5,19 +5,24 @@ import stopJobsModal from './components/stop_jobs_modal.vue'; ...@@ -5,19 +5,24 @@ import stopJobsModal from './components/stop_jobs_modal.vue';
Vue.use(Translate); Vue.use(Translate);
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const stopJobsButton = document.getElementById('stop-jobs-button'); const buttonId = 'js-stop-jobs-button';
const modalId = 'stop-jobs-modal';
const stopJobsButton = document.getElementById(buttonId);
if (stopJobsButton) { if (stopJobsButton) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el: '#stop-jobs-modal', el: `#js-${modalId}`,
components: { components: {
stopJobsModal, stopJobsModal,
}, },
mounted() { mounted() {
stopJobsButton.classList.remove('disabled'); stopJobsButton.classList.remove('disabled');
stopJobsButton.addEventListener('click', () => {
this.$root.$emit('bv::show::modal', modalId, `#${buttonId}`);
});
}, },
render(createElement) { render(createElement) {
return createElement('stop-jobs-modal', { return createElement(modalId, {
props: { props: {
url: stopJobsButton.dataset.url, url: stopJobsButton.dataset.url,
}, },
......
...@@ -6,11 +6,9 @@ ...@@ -6,11 +6,9 @@
= render "shared/builds/tabs", build_path_proc: build_path_proc, all_builds: @all_builds, scope: @scope = render "shared/builds/tabs", build_path_proc: build_path_proc, all_builds: @all_builds, scope: @scope
- if @all_builds.running_or_pending.any? - if @all_builds.running_or_pending.any?
#stop-jobs-modal #js-stop-jobs-modal
.nav-controls .nav-controls
%button#stop-jobs-button.btn.gl-button.btn-danger{ data: { toggle: 'modal', %button#js-stop-jobs-button.btn.gl-button.btn-danger{ data: { url: cancel_all_admin_jobs_path } }
target: '#stop-jobs-modal',
url: cancel_all_admin_jobs_path } }
= s_('AdminArea|Stop all jobs') = s_('AdminArea|Stop all jobs')
.row-content-block.second-block .row-content-block.second-block
......
- return unless @project.forked? && can?(current_user, :remove_fork_project, @project)
.sub-section
%h4.danger-title= _('Remove fork relationship')
%p= remove_fork_project_description_message(@project)
= form_for @project, url: remove_fork_project_path(@project), method: :delete, remote: true, html: { class: 'transfer-project' } do |f|
%p
%strong= _('Once removed, the fork relationship cannot be restored and you will no longer be able to send merge requests to the source.')
= button_to _('Remove fork relationship'), '#', class: "gl-button btn btn-danger js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_warning_message(@project) }
- return unless can?(current_user, :change_namespace, @project)
.sub-section
%h4.danger-title= _('Transfer project')
= form_for @project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } do |f|
.form-group
= label_tag :new_namespace_id, nil, class: 'label-bold' do
%span= _('Select a new namespace')
.form-group
= select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2'
%ul
%li= _("Be careful. Changing the project's namespace can have unintended side effects.")
%li= _('You can only transfer the project to namespaces you manage.')
%li= _('You will need to update your local repositories to point to the new location.')
%li= _('Project visibility level will be changed to match namespace rules when transferring to a group.')
= f.submit 'Transfer project', class: "gl-button btn btn-danger js-confirm-danger qa-transfer-button", data: { "confirm-danger-message" => transfer_project_message(@project) }
...@@ -93,31 +93,9 @@ ...@@ -93,31 +93,9 @@
%li= _('Your deployment services will be broken, you will need to manually fix the services after renaming.') %li= _('Your deployment services will be broken, you will need to manually fix the services after renaming.')
= f.submit _('Change path'), class: "btn btn-warning qa-change-path-button" = f.submit _('Change path'), class: "btn btn-warning qa-change-path-button"
- if can?(current_user, :change_namespace, @project) = render 'transfer', project: @project
.sub-section
%h4.danger-title= _('Transfer project')
= form_for @project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } do |f|
.form-group
= label_tag :new_namespace_id, nil, class: 'label-bold' do
%span= _('Select a new namespace')
.form-group
= select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2'
%ul
%li= _("Be careful. Changing the project's namespace can have unintended side effects.")
%li= _('You can only transfer the project to namespaces you manage.')
%li= _('You will need to update your local repositories to point to the new location.')
%li= _('Project visibility level will be changed to match namespace rules when transferring to a group.')
= f.submit 'Transfer project', class: "gl-button btn btn-danger js-confirm-danger qa-transfer-button", data: { "confirm-danger-message" => transfer_project_message(@project) }
- if @project.forked? && can?(current_user, :remove_fork_project, @project)
.sub-section
%h4.danger-title= _('Remove fork relationship')
%p= remove_fork_project_description_message(@project)
= form_for @project, url: remove_fork_project_path(@project), method: :delete, remote: true, html: { class: 'transfer-project' } do |f| = render 'remove_fork', project: @project
%p
%strong= _('Once removed, the fork relationship cannot be restored and you will no longer be able to send merge requests to the source.')
= button_to _('Remove fork relationship'), '#', class: "gl-button btn btn-danger js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_warning_message(@project) }
= render 'remove', project: @project = render 'remove', project: @project
......
---
title: Update stop all jobs modal to latest modal
merge_request: 46157
author:
type: changed
...@@ -76,7 +76,7 @@ to activate it in the GitLab instance. You can also click on the **Sign-in page* ...@@ -76,7 +76,7 @@ to activate it in the GitLab instance. You can also click on the **Sign-in page*
to review the saved appearance settings: to review the saved appearance settings:
NOTE: **Note:** NOTE: **Note:**
You can add also add a [customized help message](settings/help_page.md) below the sign in message. You can add also add a [customized help message](settings/help_page.md) below the sign in message or add [a Sign in text message](settings/sign_in_restrictions.md#sign-in-information).
## New project pages ## New project pages
......
...@@ -26,6 +26,7 @@ The following analytics features are available at the group level: ...@@ -26,6 +26,7 @@ The following analytics features are available at the group level:
- [Insights](../group/insights/index.md). **(ULTIMATE)** - [Insights](../group/insights/index.md). **(ULTIMATE)**
- [Issue](../group/issues_analytics/index.md). **(PREMIUM)** - [Issue](../group/issues_analytics/index.md). **(PREMIUM)**
- [Productivity](productivity_analytics.md) **(PREMIUM)** - [Productivity](productivity_analytics.md) **(PREMIUM)**
- [Repositories](../group/repositories_analytics/index.md) **(PREMIUM)**
- [Value Stream](value_stream_analytics.md). **(PREMIUM)** - [Value Stream](value_stream_analytics.md). **(PREMIUM)**
## Project-level analytics ## Project-level analytics
......
...@@ -149,6 +149,9 @@ Amazon Elastic Kubernetes Service (EKS) at the project, group, or instance level ...@@ -149,6 +149,9 @@ Amazon Elastic Kubernetes Service (EKS) at the project, group, or instance level
- [Amazon EKS](add_eks_clusters.md#new-eks-cluster). - [Amazon EKS](add_eks_clusters.md#new-eks-cluster).
- [Google GKE](add_gke_clusters.md#creating-the-cluster-on-gke). - [Google GKE](add_gke_clusters.md#creating-the-cluster-on-gke).
After creating a cluster, you can install runners for it as described in
[GitLab Managed Apps](../../clusters/applications.md).
## Add existing cluster ## Add existing cluster
If you have an existing Kubernetes cluster, you can add it to a project, group, If you have an existing Kubernetes cluster, you can add it to a project, group,
...@@ -158,6 +161,9 @@ Kubernetes integration isn't supported for arm64 clusters. See the issue ...@@ -158,6 +161,9 @@ Kubernetes integration isn't supported for arm64 clusters. See the issue
[Helm Tiller fails to install on arm64 cluster](https://gitlab.com/gitlab-org/gitlab/-/issues/29838) [Helm Tiller fails to install on arm64 cluster](https://gitlab.com/gitlab-org/gitlab/-/issues/29838)
for details. for details.
After adding an existing cluster, you can install runners for it as described in
[GitLab Managed Apps](../../clusters/applications.md).
### Existing Kubernetes cluster ### Existing Kubernetes cluster
To add a Kubernetes cluster to your project, group, or instance: To add a Kubernetes cluster to your project, group, or instance:
......
...@@ -11,6 +11,9 @@ module QA ...@@ -11,6 +11,9 @@ module QA
view 'app/views/projects/edit.html.haml' do view 'app/views/projects/edit.html.haml' do
element :project_path_field element :project_path_field
element :change_path_button element :change_path_button
end
view 'app/views/projects/_transfer.html.haml' do
element :transfer_button element :transfer_button
end end
......
...@@ -12,7 +12,7 @@ RSpec.describe 'Admin Builds' do ...@@ -12,7 +12,7 @@ RSpec.describe 'Admin Builds' do
context 'All tab' do context 'All tab' do
context 'when have jobs' do context 'when have jobs' do
it 'shows all jobs' do it 'shows all jobs', :js do
create(:ci_build, pipeline: pipeline, status: :pending) create(:ci_build, pipeline: pipeline, status: :pending)
create(:ci_build, pipeline: pipeline, status: :running) create(:ci_build, pipeline: pipeline, status: :running)
create(:ci_build, pipeline: pipeline, status: :success) create(:ci_build, pipeline: pipeline, status: :success)
...@@ -24,6 +24,10 @@ RSpec.describe 'Admin Builds' do ...@@ -24,6 +24,10 @@ RSpec.describe 'Admin Builds' do
expect(page).to have_selector('.row-content-block', text: 'All jobs') expect(page).to have_selector('.row-content-block', text: 'All jobs')
expect(page.all('.build-link').size).to eq(4) expect(page.all('.build-link').size).to eq(4)
expect(page).to have_button 'Stop all jobs' expect(page).to have_button 'Stop all jobs'
click_button 'Stop all jobs'
expect(page).to have_button 'Stop jobs'
expect(page).to have_content 'Stop all jobs?'
end end
end end
......
...@@ -866,10 +866,10 @@ ...@@ -866,10 +866,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.174.0.tgz#954b4d908a6188a2fcc45f00f748beeb23f054b0" resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.174.0.tgz#954b4d908a6188a2fcc45f00f748beeb23f054b0"
integrity sha512-CgnZvO2miZkWxANhFdaK+2S4qRgkrMRE3vh3Xxwc+hIV9ki9KavlAAez9MNIs0Um/SJ1UpfmqKoM/dMyZX7K/w== integrity sha512-CgnZvO2miZkWxANhFdaK+2S4qRgkrMRE3vh3Xxwc+hIV9ki9KavlAAez9MNIs0Um/SJ1UpfmqKoM/dMyZX7K/w==
"@gitlab/ui@21.38.0": "@gitlab/ui@21.41.0":
version "21.38.0" version "21.41.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-21.38.0.tgz#ff67908cdb4cb5efb84138842a181640d75b1524" resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-21.41.0.tgz#185f5a534d6cd038f48588f432a25576d08c5780"
integrity sha512-T1Bvts25s+OS+v5/z6rL24whjGjO8b4KOBZy1+bp3UcQFLC/+gwJAimtiCsILPojlf7WJAPDK1KqJiDciy8gWg== integrity sha512-Jl0OcEMQ+GKB9wTnZH9rU6YmL3rVDMHkEZc7Sa5QvNvP6A1Se/UEKbzhLi9rdyAoKpvrm3++tYg3ZJklIRZIsg==
dependencies: dependencies:
"@babel/standalone" "^7.0.0" "@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.3.0" "@gitlab/vue-toasted" "^1.3.0"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment