diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-05 18:09:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-05 18:09:43 +0000 |
commit | 38ceebb9b3a541f8530b379d5b5ab5e13ffc58ed (patch) | |
tree | 7a0494f677459f96e6deda30da4069b7c038eca4 /app | |
parent | 0d09054d162458364ce3fc431506c182e2a5fa4f (diff) | |
download | gitlab-ce-38ceebb9b3a541f8530b379d5b5ab5e13ffc58ed.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/alert_management/components/alert_details.vue | 22 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/url_utility.js | 25 | ||||
-rw-r--r-- | app/models/ci/build.rb | 3 | ||||
-rw-r--r-- | app/models/concerns/update_project_statistics.rb | 14 | ||||
-rw-r--r-- | app/views/admin/application_settings/general.html.haml | 4 |
5 files changed, 43 insertions, 25 deletions
diff --git a/app/assets/javascripts/alert_management/components/alert_details.vue b/app/assets/javascripts/alert_management/components/alert_details.vue index 3f86f7e78e8..21622d8f750 100644 --- a/app/assets/javascripts/alert_management/components/alert_details.vue +++ b/app/assets/javascripts/alert_management/components/alert_details.vue @@ -1,13 +1,20 @@ <script> -import { GlTabs, GlTab } from '@gitlab/ui'; +import { GlNewDropdown, GlNewDropdownItem, GlTabs, GlTab } from '@gitlab/ui'; import { s__ } from '~/locale'; export default { + statuses: { + triggered: s__('AlertManagement|Triggered'), + acknowledged: s__('AlertManagement|Acknowledged'), + resolved: s__('AlertManagement|Resolved'), + }, i18n: { fullAlertDetailsTitle: s__('AlertManagement|Full Alert Details'), overviewTitle: s__('AlertManagement|Overview'), }, components: { + GlNewDropdown, + GlNewDropdownItem, GlTab, GlTabs, }, @@ -15,7 +22,18 @@ export default { </script> <template> <div> - <div class="d-flex justify-content-between"> + <div class="d-flex justify-content-between border-bottom pb-2 pt-1"> + <gl-new-dropdown class="align-self-center" right> + <gl-new-dropdown-item + v-for="(label, field) in $options.statuses" + :key="field" + data-testid="statusDropdownItem" + class="align-middle" + >{{ label }} + </gl-new-dropdown-item> + </gl-new-dropdown> + </div> + <div class="d-flex"> <gl-tabs> <gl-tab data-testid="overviewTab" :title="$options.i18n.overviewTitle"> <ul class="pl-3"> diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js index a495d2040d3..0f84e715ff7 100644 --- a/app/assets/javascripts/lib/utils/url_utility.js +++ b/app/assets/javascripts/lib/utils/url_utility.js @@ -63,15 +63,22 @@ export function getParameterValues(sParam, url = window.location) { }, []); } -// @param {Object} params - url keys and value to merge -// @param {String} url +/** + * Merges a URL to a set of params replacing value for + * those already present. + * + * Also removes `null` param values from the resulting URL. + * + * @param {Object} params - url keys and value to merge + * @param {String} url + */ export function mergeUrlParams(params, url) { const re = /^([^?#]*)(\?[^#]*)?(.*)/; const merged = {}; - const urlparts = url.match(re); + const [, fullpath, query, fragment] = url.match(re); - if (urlparts[2]) { - urlparts[2] + if (query) { + query .substr(1) .split('&') .forEach(part => { @@ -84,11 +91,15 @@ export function mergeUrlParams(params, url) { Object.assign(merged, params); - const query = Object.keys(merged) + const newQuery = Object.keys(merged) + .filter(key => merged[key] !== null) .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(merged[key])}`) .join('&'); - return `${urlparts[1]}?${query}${urlparts[3]}`; + if (newQuery) { + return `${fullpath}?${newQuery}${fragment}`; + } + return `${fullpath}${fragment}`; } /** diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index bfa6fc7c17e..abf75a21404 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -486,8 +486,7 @@ module Ci end def requires_resource? - Feature.enabled?(:ci_resource_group, project, default_enabled: true) && - self.resource_group_id.present? + self.resource_group_id.present? end def has_environment? diff --git a/app/models/concerns/update_project_statistics.rb b/app/models/concerns/update_project_statistics.rb index a84fb1cf56d..6cf012680d8 100644 --- a/app/models/concerns/update_project_statistics.rb +++ b/app/models/concerns/update_project_statistics.rb @@ -68,21 +68,11 @@ module UpdateProjectStatistics def schedule_update_project_statistic(delta) return if delta.zero? + return if project.nil? - if Feature.enabled?(:update_project_statistics_after_commit, default_enabled: true) - # Update ProjectStatistics after the transaction - run_after_commit do - ProjectStatistics.increment_statistic( - project_id, self.class.project_statistics_name, delta) - end - else - # Use legacy-way to update within transaction + run_after_commit do ProjectStatistics.increment_statistic( project_id, self.class.project_statistics_name, delta) - end - - run_after_commit do - next if project.nil? Namespaces::ScheduleAggregationWorker.perform_async( project.namespace_id) diff --git a/app/views/admin/application_settings/general.html.haml b/app/views/admin/application_settings/general.html.haml index bebda385886..fd3f04fefd1 100644 --- a/app/views/admin/application_settings/general.html.haml +++ b/app/views/admin/application_settings/general.html.haml @@ -98,9 +98,9 @@ .form-check = f.check_box :web_ide_clientside_preview_enabled, class: 'form-check-input' = f.label :web_ide_clientside_preview_enabled, class: 'form-check-label' do - = s_('IDE|Client side evaluation') + = s_('IDE|Live Preview') %span.form-text.text-muted - = s_('IDE|Allow live previews of JavaScript projects in the Web IDE using CodeSandbox client side evaluation.') + = s_('IDE|Allow live previews of JavaScript projects in the Web IDE using CodeSandbox Live Preview.') = f.submit _('Save changes'), class: "btn btn-success" |