diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-09 18:07:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-09 18:07:52 +0000 |
commit | 6c15c18fa455502bf0b80316390eefde40d42a8a (patch) | |
tree | b42af022a747fd580a09f36b0e60a9f53ed7b25c /app | |
parent | 263f926c770163788f78af03ab69689c94f57360 (diff) | |
download | gitlab-ce-6c15c18fa455502bf0b80316390eefde40d42a8a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/lib/utils/datetime_utility.js | 10 | ||||
-rw-r--r-- | app/assets/stylesheets/snippets.scss | 9 | ||||
-rw-r--r-- | app/mailers/emails/projects.rb | 2 | ||||
-rw-r--r-- | app/mailers/notify.rb | 4 | ||||
-rw-r--r-- | app/models/ci/job_artifact.rb | 2 | ||||
-rw-r--r-- | app/services/issuable/clone/attributes_rewriter.rb | 15 | ||||
-rw-r--r-- | app/workers/concerns/worker_attributes.rb (renamed from app/models/concerns/worker_attributes.rb) | 0 |
7 files changed, 35 insertions, 7 deletions
diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index 0ffb31b323b..fd9a13be18b 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -555,6 +555,16 @@ export const calculateRemainingMilliseconds = endDate => { export const getDateInPast = (date, daysInPast) => new Date(newDate(date).setDate(date.getDate() - daysInPast)); +/** + * Adds a given number of days to a given date and returns the new date. + * + * @param {Date} date the date that we will add days to + * @param {Number} daysInFuture number of days that are added to a given date + * @returns {Date} Date in future as Date object + */ +export const getDateInFuture = (date, daysInFuture) => + new Date(newDate(date).setDate(date.getDate() + daysInFuture)); + /* * Appending T00:00:00 makes JS assume local time and prevents it from shifting the date * to match the user's time zone. We want to display the date in server time for now, to diff --git a/app/assets/stylesheets/snippets.scss b/app/assets/stylesheets/snippets.scss index bd777c66b56..dcdb195518c 100644 --- a/app/assets/stylesheets/snippets.scss +++ b/app/assets/stylesheets/snippets.scss @@ -48,9 +48,6 @@ padding: 10px; border: 0; border-radius: 0; - font-family: $monospace-font; - font-size: $code-font-size; - line-height: $code-line-height; margin: 0; overflow: auto; overflow-y: hidden; @@ -58,6 +55,12 @@ word-wrap: normal; border-left: $border-style; } + + code { + font-family: $monospace-font; + font-size: $code-font-size; + line-height: $code-line-height; + } } .line-numbers { diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb index 6274879ee99..5c957437039 100644 --- a/app/mailers/emails/projects.rb +++ b/app/mailers/emails/projects.rb @@ -51,7 +51,7 @@ module Emails add_project_headers headers['X-GitLab-Author'] = @message.author_username - mail(from: sender(@message.author_id, @message.send_from_committer_email?), + mail(from: sender(@message.author_id, send_from_user_email: @message.send_from_committer_email?), reply_to: @message.reply_to, subject: @message.subject) end diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index c7cfefeec9b..92939136de2 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -59,11 +59,11 @@ class Notify < BaseMailer # Return an email address that displays the name of the sender. # Only the displayed name changes; the actual email address is always the same. - def sender(sender_id, send_from_user_email = false) + def sender(sender_id, send_from_user_email: false, sender_name: nil) return unless sender = User.find(sender_id) address = default_sender_address - address.display_name = sender.name + address.display_name = sender_name.presence || sender.name if send_from_user_email && can_send_from_user_email?(sender) address.address = sender.email diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index 9e5aa6691df..72be53c7af0 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -23,7 +23,7 @@ module Ci container_scanning: 'gl-container-scanning-report.json', dast: 'gl-dast-report.json', license_management: 'gl-license-management-report.json', - license_scanning: 'gl-license-management-report.json', + license_scanning: 'gl-license-scanning-report.json', performance: 'performance.json', metrics: 'metrics.txt' }.freeze diff --git a/app/services/issuable/clone/attributes_rewriter.rb b/app/services/issuable/clone/attributes_rewriter.rb index 1f5d83917cc..334e50c0be5 100644 --- a/app/services/issuable/clone/attributes_rewriter.rb +++ b/app/services/issuable/clone/attributes_rewriter.rb @@ -18,6 +18,7 @@ module Issuable new_entity.update(update_attributes) copy_resource_label_events + copy_resource_weight_events end private @@ -60,6 +61,20 @@ module Issuable end end + def copy_resource_weight_events + return unless original_entity.respond_to?(:resource_weight_events) + + original_entity.resource_weight_events.find_in_batches do |batch| + events = batch.map do |event| + event.attributes + .except('id', 'reference', 'reference_html') + .merge('issue_id' => new_entity.id) + end + + Gitlab::Database.bulk_insert(ResourceWeightEvent.table_name, events) + end + end + def entity_key new_entity.class.name.parameterize('_').foreign_key end diff --git a/app/models/concerns/worker_attributes.rb b/app/workers/concerns/worker_attributes.rb index 506215ca9ed..506215ca9ed 100644 --- a/app/models/concerns/worker_attributes.rb +++ b/app/workers/concerns/worker_attributes.rb |