diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-17 03:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-17 03:09:19 +0300 |
commit | 668e319631855d6d9396a203ded1fa5bcb986f1f (patch) | |
tree | 1cf0af29731df8b276a29fa82a5f419da6d06d18 /app | |
parent | 44e10d208a967d496b4602732b421c704f09201a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/commit/pipelines/pipelines_bundle.js | 28 | ||||
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 41 | ||||
-rw-r--r-- | app/assets/javascripts/projects/compare/components/revision_dropdown.vue | 4 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/notes.scss | 8 | ||||
-rw-r--r-- | app/models/clusters/agent.rb | 1 | ||||
-rw-r--r-- | app/views/admin/hooks/_form.html.haml | 15 | ||||
-rw-r--r-- | app/views/shared/web_hooks/_form.html.haml | 40 |
7 files changed, 67 insertions, 70 deletions
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_bundle.js b/app/assets/javascripts/commit/pipelines/pipelines_bundle.js index 24033634aad..920ffde3e32 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_bundle.js +++ b/app/assets/javascripts/commit/pipelines/pipelines_bundle.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import commitPipelinesTable from './pipelines_table.vue'; +import CommitPipelinesTable from './pipelines_table.vue'; /** * Used in: @@ -8,14 +8,6 @@ import commitPipelinesTable from './pipelines_table.vue'; * - Merge Request details View > Pipelines Tab > Pipelines Table (projects:merge_requests:show) * - New Merge Request View > Pipelines Tab > Pipelines Table (projects:merge_requests:creations:new) */ - -const CommitPipelinesTable = Vue.extend(commitPipelinesTable); - -// export for use in merge_request_tabs.js (TODO: remove this hack when we understand how to load -// vue.js in merge_request_tabs.js) -window.gl = window.gl || {}; -window.gl.CommitPipelinesTable = CommitPipelinesTable; - export default () => { const pipelineTableViewEl = document.querySelector('#commit-pipeline-table-view'); @@ -34,13 +26,17 @@ export default () => { }); if (pipelineTableViewEl.dataset.disableInitialization === undefined) { - const table = new CommitPipelinesTable({ - propsData: { - endpoint: pipelineTableViewEl.dataset.endpoint, - helpPagePath: pipelineTableViewEl.dataset.helpPagePath, - emptyStateSvgPath: pipelineTableViewEl.dataset.emptyStateSvgPath, - errorStateSvgPath: pipelineTableViewEl.dataset.errorStateSvgPath, - autoDevopsHelpPath: pipelineTableViewEl.dataset.helpAutoDevopsPath, + const table = new Vue({ + render(createElement) { + return createElement(CommitPipelinesTable, { + props: { + endpoint: pipelineTableViewEl.dataset.endpoint, + helpPagePath: pipelineTableViewEl.dataset.helpPagePath, + emptyStateSvgPath: pipelineTableViewEl.dataset.emptyStateSvgPath, + errorStateSvgPath: pipelineTableViewEl.dataset.errorStateSvgPath, + autoDevopsHelpPath: pipelineTableViewEl.dataset.helpAutoDevopsPath, + }, + }); }, }).$mount(); pipelineTableViewEl.appendChild(table.$el); diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 251f1e0515a..4dab796d8a4 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -1,8 +1,9 @@ /* eslint-disable no-new, class-methods-use-this */ - import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import $ from 'jquery'; import Cookies from 'js-cookie'; +import Vue from 'vue'; +import CommitPipelinesTable from '~/commit/pipelines/pipelines_table.vue'; import createEventHub from '~/helpers/event_hub_factory'; import initAddContextCommitsTriggers from './add_context_commits_modal'; import BlobForkSuggestion from './blob/blob_fork_suggestion'; @@ -350,26 +351,30 @@ export default class MergeRequestTabs { mountPipelinesView() { const pipelineTableViewEl = document.querySelector('#commit-pipeline-table-view'); - const { CommitPipelinesTable, mrWidgetData } = gl; - - this.commitPipelinesTable = new CommitPipelinesTable({ - propsData: { - endpoint: pipelineTableViewEl.dataset.endpoint, - helpPagePath: pipelineTableViewEl.dataset.helpPagePath, - emptyStateSvgPath: pipelineTableViewEl.dataset.emptyStateSvgPath, - errorStateSvgPath: pipelineTableViewEl.dataset.errorStateSvgPath, - autoDevopsHelpPath: pipelineTableViewEl.dataset.helpAutoDevopsPath, - canCreatePipelineInTargetProject: Boolean( - mrWidgetData?.can_create_pipeline_in_target_project, - ), - sourceProjectFullPath: mrWidgetData?.source_project_full_path || '', - targetProjectFullPath: mrWidgetData?.target_project_full_path || '', - projectId: pipelineTableViewEl.dataset.projectId, - mergeRequestId: mrWidgetData ? mrWidgetData.iid : null, - }, + const { mrWidgetData } = gl; + + this.commitPipelinesTable = new Vue({ provide: { targetProjectFullPath: mrWidgetData?.target_project_full_path || '', }, + render(createElement) { + return createElement(CommitPipelinesTable, { + props: { + endpoint: pipelineTableViewEl.dataset.endpoint, + helpPagePath: pipelineTableViewEl.dataset.helpPagePath, + emptyStateSvgPath: pipelineTableViewEl.dataset.emptyStateSvgPath, + errorStateSvgPath: pipelineTableViewEl.dataset.errorStateSvgPath, + autoDevopsHelpPath: pipelineTableViewEl.dataset.helpAutoDevopsPath, + canCreatePipelineInTargetProject: Boolean( + mrWidgetData?.can_create_pipeline_in_target_project, + ), + sourceProjectFullPath: mrWidgetData?.source_project_full_path || '', + targetProjectFullPath: mrWidgetData?.target_project_full_path || '', + projectId: pipelineTableViewEl.dataset.projectId, + mergeRequestId: mrWidgetData ? mrWidgetData.iid : null, + }, + }); + }, }).$mount(); // $mount(el) replaces the el with the new rendered component. We need it in order to mount diff --git a/app/assets/javascripts/projects/compare/components/revision_dropdown.vue b/app/assets/javascripts/projects/compare/components/revision_dropdown.vue index a5e2c986b12..13d80b5ae0b 100644 --- a/app/assets/javascripts/projects/compare/components/revision_dropdown.vue +++ b/app/assets/javascripts/projects/compare/components/revision_dropdown.vue @@ -65,8 +65,8 @@ export default { return axios .get(endpoint) .then(({ data }) => { - this.branches = data.Branches; - this.tags = data.Tags; + this.branches = data.Branches || []; + this.tags = data.Tags || []; }) .catch(() => { createFlash({ diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index 121ee1e635c..190bdcb1efd 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -907,14 +907,6 @@ $system-note-svg-size: 16px; .discussion-filter-container { .dropdown-menu { margin-bottom: $gl-padding-4; - - @include media-breakpoint-down(md) { - margin-left: $btn-side-margin + $contextual-sidebar-collapsed-width; - } - - @include media-breakpoint-down(xs) { - margin-left: $btn-side-margin; - } } } diff --git a/app/models/clusters/agent.rb b/app/models/clusters/agent.rb index c58a3bab1a9..c5b9dddb1da 100644 --- a/app/models/clusters/agent.rb +++ b/app/models/clusters/agent.rb @@ -4,6 +4,7 @@ module Clusters class Agent < ApplicationRecord self.table_name = 'cluster_agents' + belongs_to :created_by_user, class_name: 'User', optional: true belongs_to :project, class_name: '::Project' # Otherwise, it will load ::Clusters::Project has_many :agent_tokens, class_name: 'Clusters::AgentToken' diff --git a/app/views/admin/hooks/_form.html.haml b/app/views/admin/hooks/_form.html.haml index ecaf7b9b38c..459df5c8d85 100644 --- a/app/views/admin/hooks/_form.html.haml +++ b/app/views/admin/hooks/_form.html.haml @@ -3,29 +3,30 @@ .form-group = form.label :url, _('URL'), class: 'label-bold' = form.text_field :url, class: 'form-control gl-form-input' + %p.form-text.text-muted= _('URL must be percent-encoded if neccessary.') .form-group - = form.label :token, _('Secret Token'), class: 'label-bold' + = form.label :token, _('Secret token'), class: 'label-bold' = form.text_field :token, class: 'form-control gl-form-input' - %p.form-text.text-muted= _('Use this token to validate received payloads') + %p.form-text.text-muted= _('Use this token to validate received payloads.') .form-group = form.label :url, _('Trigger'), class: 'label-bold' - .form-text.text-secondary.gl-mb-5= _('System hook will be triggered on set of events like creating project or adding ssh key. But you can also enable extra triggers like Push events.') + .form-text.text-secondary.gl-mb-5= _('System hooks are triggered on sets of events like creating a project or adding an SSH key. You can also enable extra triggers, such as push events.') %fieldset.form-group.form-check = form.check_box :repository_update_events, class: 'form-check-input' = form.label :repository_update_events, _('Repository update events'), class: 'label-bold form-check-label' - .text-secondary= _('This URL will be triggered when repository is updated') + .text-secondary= _('URL is triggered when repository is updated') %fieldset.form-group.form-check = form.check_box :push_events, class: 'form-check-input' = form.label :push_events, _('Push events'), class: 'label-bold form-check-label' - .text-secondary= _('This URL will be triggered for each branch updated to the repository') + .text-secondary= _('URL is triggered for each branch updated to the repository') %fieldset.form-group.form-check = form.check_box :tag_push_events, class: 'form-check-input' = form.label :tag_push_events, _('Tag push events'), class: 'label-bold form-check-label' - .text-secondary= _('This URL will be triggered when a new tag is pushed to the repository') + .text-secondary= _('URL is triggered when a new tag is pushed to the repository') %fieldset.form-group.form-check = form.check_box :merge_requests_events, class: 'form-check-input' = form.label :merge_requests_events, _('Merge request events'), class: 'label-bold form-check-label' - .text-secondary= _('This URL will be triggered when a merge request is created/updated/merged') + .text-secondary= _('URL is triggered when a merge request is created, updated, or merged') .form-group = form.label :enable_ssl_verification, _('SSL verification'), class: 'label-bold checkbox' .form-check diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index f3d9b9cfe27..ad84ce1d343 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -3,11 +3,13 @@ .form-group = form.label :url, s_('Webhooks|URL'), class: 'label-bold' = form.text_field :url, class: 'form-control gl-form-input', placeholder: 'http://example.com/trigger-ci.json' + %p.form-text.text-muted + = s_('Webhooks|URL must be percent-encoded if neccessary.') .form-group - = form.label :token, s_('Webhooks|Secret Token'), class: 'label-bold' + = form.label :token, s_('Webhooks|Secret token'), class: 'label-bold' = form.text_field :token, class: 'form-control gl-form-input', placeholder: '' %p.form-text.text-muted - = s_('Webhooks|Use this token to validate received payloads. It will be sent with the request in the X-Gitlab-Token HTTP header.') + = s_('Webhooks|Use this token to validate received payloads. It is sent with the request in the X-Gitlab-Token HTTP header.') .form-group = form.label :url, s_('Webhooks|Trigger'), class: 'label-bold' %ul.list-unstyled.gl-ml-6 @@ -17,37 +19,37 @@ %strong= s_('Webhooks|Push events') = form.text_field :push_events_branch_filter, class: 'form-control gl-form-input', placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered by a push to the repository') + = s_('Webhooks|URL is triggered by a push to the repository') %li = form.check_box :tag_push_events, class: 'form-check-input' = form.label :tag_push_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Tag push events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when a new tag is pushed to the repository') + = s_('Webhooks|URL is triggered when a new tag is pushed to the repository') %li = form.check_box :note_events, class: 'form-check-input' = form.label :note_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Comments') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when someone adds a comment') + = s_('Webhooks|URL is triggered when someone adds a comment') %li = form.check_box :confidential_note_events, class: 'form-check-input' = form.label :confidential_note_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Confidential Comments') + %strong= s_('Webhooks|Confidential comments') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when someone adds a comment on a confidential issue') + = s_('Webhooks|URL is triggered when someone adds a comment on a confidential issue') %li = form.check_box :issues_events, class: 'form-check-input' = form.label :issues_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Issues events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when an issue is created/updated/merged') + = s_('Webhooks|URL is triggered when an issue is created, updated, or merged') %li = form.check_box :confidential_issues_events, class: 'form-check-input' = form.label :confidential_issues_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Confidential Issues events') + %strong= s_('Webhooks|Confidential issues events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when a confidential issue is created/updated/merged') + = s_('Webhooks|URL is triggered when a confidential issue is created, updated, or merged') - if @group = render_if_exists 'groups/hooks/member_events', form: form = render_if_exists 'groups/hooks/subgroup_events', form: form @@ -56,43 +58,43 @@ = form.label :merge_requests_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Merge request events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when a merge request is created/updated/merged') + = s_('Webhooks|URL is triggered when a merge request is created, updated, or merged') %li = form.check_box :job_events, class: 'form-check-input' = form.label :job_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Job events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when the job status changes') + = s_('Webhooks|URL is triggered when the job status changes') %li = form.check_box :pipeline_events, class: 'form-check-input' = form.label :pipeline_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Pipeline events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when the pipeline status changes') + = s_('Webhooks|URL is triggered when the pipeline status changes') %li = form.check_box :wiki_page_events, class: 'form-check-input' = form.label :wiki_page_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Wiki Page events') + %strong= s_('Webhooks|Wiki page events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL will be triggered when a wiki page is created/updated') + = s_('Webhooks|URL is triggered when a wiki page is created or updated') %li = form.check_box :deployment_events, class: 'form-check-input' = form.label :deployment_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Deployment events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL is triggered when a deployment starts, finishes, fails, or is canceled') + = s_('Webhooks|URL is triggered when a deployment starts, finishes, fails, or is canceled') %li = form.check_box :feature_flag_events, class: 'form-check-input' = form.label :feature_flag_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Feature Flag events') + %strong= s_('Webhooks|Feature flag events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL is triggered when a feature flag is turned on or off') + = s_('Webhooks|URL is triggered when a feature flag is turned on or off') %li = form.check_box :releases_events, class: 'form-check-input' = form.label :releases_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Releases events') %p.text-muted.gl-ml-1 - = s_('Webhooks|This URL is triggered when a release is created/updated') + = s_('Webhooks|URL is triggered when a release is created or updated') .form-group = form.label :enable_ssl_verification, s_('Webhooks|SSL verification'), class: 'label-bold checkbox' .form-check |