diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 03:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 03:07:48 +0300 |
commit | 2349eabc1a473bfb70555f0ce6d3d808cecb181d (patch) | |
tree | 0dae6a2a6810f2198eed42b7f9566ebf9c292468 /app | |
parent | 134fe182008dc13a16f12d723aa73771efb1a6a2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/monitoring/components/dashboard.vue | 4 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/embed.vue | 15 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/panel_type.vue | 7 | ||||
-rw-r--r-- | app/assets/javascripts/pages/snippets/show/index.js | 12 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests/diffs_controller.rb | 1 | ||||
-rw-r--r-- | app/mailers/emails/profile.rb | 2 | ||||
-rw-r--r-- | app/models/ci/legacy_stage.rb | 1 | ||||
-rw-r--r-- | app/models/merge_request.rb | 4 | ||||
-rw-r--r-- | app/models/personal_access_token.rb | 2 | ||||
-rw-r--r-- | app/presenters/ci/legacy_stage_presenter.rb | 31 | ||||
-rw-r--r-- | app/views/admin/application_settings/_account_and_limit.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/stage/_stage.html.haml | 6 | ||||
-rw-r--r-- | app/views/shared/_personal_access_tokens_form.html.haml | 3 | ||||
-rw-r--r-- | app/views/snippets/show.html.haml | 17 |
14 files changed, 73 insertions, 35 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index 9e376a52702..fb6f5dc73b8 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -18,8 +18,6 @@ import Icon from '~/vue_shared/components/icon.vue'; import { getParameterValues, mergeUrlParams, redirectTo } from '~/lib/utils/url_utility'; import invalidUrl from '~/lib/utils/invalid_url'; import DateTimePicker from './date_time_picker/date_time_picker.vue'; -import MonitorTimeSeriesChart from './charts/time_series.vue'; -import MonitorSingleStatChart from './charts/single_stat.vue'; import GraphGroup from './graph_group.vue'; import EmptyState from './empty_state.vue'; import TrackEventDirective from '~/vue_shared/directives/track_event'; @@ -28,8 +26,6 @@ import { getTimeDiff, isValidDate, getAddMetricTrackingOptions } from '../utils' export default { components: { VueDraggable, - MonitorTimeSeriesChart, - MonitorSingleStatChart, PanelType, GraphGroup, EmptyState, diff --git a/app/assets/javascripts/monitoring/components/embed.vue b/app/assets/javascripts/monitoring/components/embed.vue index 581b2093d44..a5c933a0071 100644 --- a/app/assets/javascripts/monitoring/components/embed.vue +++ b/app/assets/javascripts/monitoring/components/embed.vue @@ -1,8 +1,8 @@ <script> import { mapActions, mapState } from 'vuex'; import { getParameterValues, removeParams } from '~/lib/utils/url_utility'; +import PanelType from 'ee_else_ce/monitoring/components/panel_type.vue'; import GraphGroup from './graph_group.vue'; -import MonitorTimeSeriesChart from './charts/time_series.vue'; import { sidebarAnimationDuration } from '../constants'; import { getTimeDiff } from '../utils'; @@ -11,7 +11,7 @@ let sidebarMutationObserver; export default { components: { GraphGroup, - MonitorTimeSeriesChart, + PanelType, }, props: { dashboardUrl: { @@ -92,16 +92,13 @@ export default { <template> <div class="metrics-embed" :class="{ 'd-inline-flex col-lg-6 p-0': isSingleChart }"> <div v-if="charts.length" class="row w-100 m-n2 pb-4"> - <monitor-time-series-chart - v-for="graphData in charts" - :key="graphData.title" + <panel-type + v-for="(graphData, graphIndex) in charts" + :key="`panel-type-${graphIndex}`" class="w-100" + clipboard-text="" :graph-data="graphData" - :container-width="elWidth" :group-id="dashboardUrl" - :project-path="null" - :show-border="true" - :single-embed="isSingleChart" /> </div> </div> diff --git a/app/assets/javascripts/monitoring/components/panel_type.vue b/app/assets/javascripts/monitoring/components/panel_type.vue index fab1dd0f981..080fe6f2b4b 100644 --- a/app/assets/javascripts/monitoring/components/panel_type.vue +++ b/app/assets/javascripts/monitoring/components/panel_type.vue @@ -47,6 +47,11 @@ export default { required: false, default: '', }, + groupId: { + type: String, + required: false, + default: 'panel-type-chart', + }, }, computed: { ...mapState('monitoringDashboard', ['deploymentData', 'projectPath']), @@ -117,7 +122,7 @@ export default { :deployment-data="deploymentData" :project-path="projectPath" :thresholds="getGraphAlertValues(graphData.metrics)" - group-id="panel-type-chart" + :group-id="groupId" > <div class="d-flex align-items-center"> <alert-widget diff --git a/app/assets/javascripts/pages/snippets/show/index.js b/app/assets/javascripts/pages/snippets/show/index.js index 5efcc901fde..26936110402 100644 --- a/app/assets/javascripts/pages/snippets/show/index.js +++ b/app/assets/javascripts/pages/snippets/show/index.js @@ -5,11 +5,9 @@ import initNotes from '~/init_notes'; import snippetEmbed from '~/snippet/snippet_embed'; document.addEventListener('DOMContentLoaded', () => { - if (!gon.features.snippetsVue) { - new LineHighlighter(); // eslint-disable-line no-new - new BlobViewer(); // eslint-disable-line no-new - initNotes(); - new ZenMode(); // eslint-disable-line no-new - snippetEmbed(); - } + new LineHighlighter(); // eslint-disable-line no-new + new BlobViewer(); // eslint-disable-line no-new + initNotes(); + new ZenMode(); // eslint-disable-line no-new + snippetEmbed(); }); diff --git a/app/controllers/projects/merge_requests/diffs_controller.rb b/app/controllers/projects/merge_requests/diffs_controller.rb index 42f9c0522a3..5d458a229f2 100644 --- a/app/controllers/projects/merge_requests/diffs_controller.rb +++ b/app/controllers/projects/merge_requests/diffs_controller.rb @@ -28,6 +28,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic positions = @merge_request.note_positions_for_paths(diffs.diff_file_paths, current_user) diffs.unfold_diff_files(positions.unfoldable) + diffs.write_cache options = { merge_request: @merge_request, diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index 2ea1aea1f51..c368e6c8ac7 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -34,3 +34,5 @@ module Emails # rubocop: enable CodeReuse/ActiveRecord end end + +Emails::Profile.prepend_if_ee('EE::Emails::Profile') diff --git a/app/models/ci/legacy_stage.rb b/app/models/ci/legacy_stage.rb index 2fd369c9aff..0a67a652e22 100644 --- a/app/models/ci/legacy_stage.rb +++ b/app/models/ci/legacy_stage.rb @@ -5,6 +5,7 @@ module Ci # We should migrate this object to actual database record in the future class LegacyStage include StaticModel + include Presentable attr_reader :pipeline, :name diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 780bbe75485..f4dfd9128fa 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -27,8 +27,6 @@ class MergeRequest < ApplicationRecord SORTING_PREFERENCE_FIELD = :merge_requests_sort - prepend_if_ee('::EE::MergeRequest') # rubocop: disable Cop/InjectEnterpriseEditionModule - belongs_to :target_project, class_name: "Project" belongs_to :source_project, class_name: "Project" belongs_to :merge_user, class_name: "User" @@ -1531,3 +1529,5 @@ class MergeRequest < ApplicationRecord Gitlab::EtagCaching::Store.new.touch(key) end end + +MergeRequest.prepend_if_ee('::EE::MergeRequest') diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb index 7ae431eaad7..770fc2b5c8f 100644 --- a/app/models/personal_access_token.rb +++ b/app/models/personal_access_token.rb @@ -70,3 +70,5 @@ class PersonalAccessToken < ApplicationRecord "gitlab:personal_access_token:#{user_id}" end end + +PersonalAccessToken.prepend_if_ee('EE::PersonalAccessToken') diff --git a/app/presenters/ci/legacy_stage_presenter.rb b/app/presenters/ci/legacy_stage_presenter.rb new file mode 100644 index 00000000000..2a60b1280da --- /dev/null +++ b/app/presenters/ci/legacy_stage_presenter.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Ci + class LegacyStagePresenter < Gitlab::View::Presenter::Delegated + presents :legacy_stage + + def latest_ordered_statuses + preload_statuses(legacy_stage.statuses.latest_ordered) + end + + def retried_ordered_statuses + preload_statuses(legacy_stage.statuses.retried_ordered) + end + + private + + def preload_statuses(statuses) + statuses.tap do |statuses| + # rubocop: disable CodeReuse/ActiveRecord + ActiveRecord::Associations::Preloader.new.preload(preloadable_statuses(statuses), :tags) + # rubocop: enable CodeReuse/ActiveRecord + end + end + + def preloadable_statuses(statuses) + statuses.reject do |status| + status.instance_of?(::GenericCommitStatus) || status.instance_of?(::Ci::Bridge) + end + end + end +end diff --git a/app/views/admin/application_settings/_account_and_limit.html.haml b/app/views/admin/application_settings/_account_and_limit.html.haml index 4358365504a..6b95c0f40c5 100644 --- a/app/views/admin/application_settings/_account_and_limit.html.haml +++ b/app/views/admin/application_settings/_account_and_limit.html.haml @@ -23,6 +23,9 @@ = f.label :session_expire_delay, _('Session duration (minutes)'), class: 'label-light' = f.number_field :session_expire_delay, class: 'form-control' %span.form-text.text-muted#session_expire_delay_help_block= _('GitLab restart is required to apply changes') + + = render_if_exists 'admin/application_settings/personal_access_token_expiration_policy', form: f + .form-group = f.label :user_oauth_applications, _('User OAuth applications'), class: 'label-bold' .form-check diff --git a/app/views/projects/stage/_stage.html.haml b/app/views/projects/stage/_stage.html.haml index f93994bebe3..387c8fb3234 100644 --- a/app/views/projects/stage/_stage.html.haml +++ b/app/views/projects/stage/_stage.html.haml @@ -1,3 +1,5 @@ +- stage = stage.present(current_user: current_user) + %tr %th{ colspan: 10 } %strong @@ -6,8 +8,8 @@ = ci_icon_for_status(stage.status) = stage.name.titleize -= render stage.statuses.latest_ordered, stage: false, ref: false, pipeline_link: false, allow_retry: true -= render stage.statuses.retried_ordered, stage: false, ref: false, pipeline_link: false, retried: true += render stage.latest_ordered_statuses, stage: false, ref: false, pipeline_link: false, allow_retry: true += render stage.retried_ordered_statuses, stage: false, ref: false, pipeline_link: false, retried: true %tr %td{ colspan: 10 } diff --git a/app/views/shared/_personal_access_tokens_form.html.haml b/app/views/shared/_personal_access_tokens_form.html.haml index ca0b473addf..16f8a692635 100644 --- a/app/views/shared/_personal_access_tokens_form.html.haml +++ b/app/views/shared/_personal_access_tokens_form.html.haml @@ -18,6 +18,9 @@ .form-group.col-md-6 = f.label :expires_at, _('Expires at'), class: 'label-bold' .input-icon-wrapper + + = render_if_exists 'personal_access_tokens/callout_max_personal_access_token_lifetime' + = f.text_field :expires_at, class: "datepicker form-control", placeholder: 'YYYY-MM-DD' .form-group diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index c77b05e3ea8..36b4e00e8d5 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -4,16 +4,13 @@ - breadcrumb_title @snippet.to_reference - page_title "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets") -- if Feature.enabled?(:snippets_vue) - #js-snippet-view{ 'data-qa-selector': 'snippet_view' } -- else - = render 'shared/snippets/header' += render 'shared/snippets/header' - .personal-snippets - %article.file-holder.snippet-file-content - = render 'shared/snippets/blob' +.personal-snippets + %article.file-holder.snippet-file-content + = render 'shared/snippets/blob' - .row-content-block.top-block.content-component-block - = render 'award_emoji/awards_block', awardable: @snippet, inline: true + .row-content-block.top-block.content-component-block + = render 'award_emoji/awards_block', awardable: @snippet, inline: true - #notes.limited-width-notes= render "shared/notes/notes_with_form", :autocomplete => false + #notes.limited-width-notes= render "shared/notes/notes_with_form", :autocomplete => false |