From 1a41db76a9bd084345104c0489a6abbac1b5fddb Mon Sep 17 00:00:00 2001 From: Inga Mai Date: Thu, 20 Dec 2018 11:11:08 +0100 Subject: [PATCH 01/15] Wp table header now sticky for all browsers --- app/assets/stylesheets/content/_table.sass | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/content/_table.sass b/app/assets/stylesheets/content/_table.sass index 3f154adc5a..d67bda2d8d 100644 --- a/app/assets/stylesheets/content/_table.sass +++ b/app/assets/stylesheets/content/_table.sass @@ -192,12 +192,11 @@ table.generic-table margin: 0 -// Enable sticky headers in chrome -html.-supports-sticky-headers - thead.-sticky th - position: sticky - top: 0 - background: white +// Enable sticky headers +thead.-sticky th + position: sticky + top: 0 + background: white .generic-table--footer-outer From 9404923fe069d9e000a938952081ac592ff5db51 Mon Sep 17 00:00:00 2001 From: Inga Mai Date: Thu, 20 Dec 2018 16:14:17 +0100 Subject: [PATCH 02/15] Class '-supports-sticky-headers' removed --- frontend/src/app/globals/browser-specific-flags.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/frontend/src/app/globals/browser-specific-flags.ts b/frontend/src/app/globals/browser-specific-flags.ts index df528c5060..9b6a91f168 100644 --- a/frontend/src/app/globals/browser-specific-flags.ts +++ b/frontend/src/app/globals/browser-specific-flags.ts @@ -29,10 +29,6 @@ jQuery(function() { const doc = document.documentElement!; - if (bowser.chrome && bowser.version >= '58' || bowser.firefox && bowser.version >= '59') { - doc.classList.add('-supports-sticky-headers'); - } - if (bowser.chrome) { doc.classList.add('-browser-chrome'); } @@ -61,4 +57,3 @@ jQuery(function() { doc.classList.add('-browser-mobile'); } }); - From afd75926dac510aad641b777ac87c6a2c840c49f Mon Sep 17 00:00:00 2001 From: Inga Mai Date: Mon, 7 Jan 2019 11:02:31 +0100 Subject: [PATCH 03/15] Workaround for sticky header in safari --- .../content/work_packages/timelines/_timelines_header.sass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass b/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass index e688399971..0783ea92e4 100644 --- a/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass +++ b/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass @@ -1,4 +1,7 @@ -.wp-table-timeline--header +// In Safari custom elements have width and height 0 per default +// That is why position: sticky in its children won't work +wp-timeline-header + display: block height: $generic-table--header-height width: 100% position: sticky @@ -39,4 +42,3 @@ font-weight: bold font-size: 11px height: 15px - From 9fb8073177cd7f1f16cc741fa2f7d30cf98fe3fe Mon Sep 17 00:00:00 2001 From: Inga Mai Date: Tue, 8 Jan 2019 09:42:43 +0100 Subject: [PATCH 04/15] Correct flickering border of timeline header --- .../content/work_packages/timelines/_timelines_header.sass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass b/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass index 0783ea92e4..703f58a689 100644 --- a/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass +++ b/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass @@ -24,7 +24,7 @@ wp-timeline-header white-space: nowrap &.-top-border - border-top: 1px solid $timeline--header-border-color + outline: 1px solid $timeline--header-border-color .wp-timeline--header-day-element height: 12px @@ -33,7 +33,6 @@ wp-timeline-header .wp-timeline--header-middle-element border-top: 1px solid $timeline--header-border-color - border-bottom: 1px solid $timeline--header-border-color padding-top: 5px height: 20px From 060bb27089281515435090547fe254808b44d7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 8 Jan 2019 10:45:34 +0100 Subject: [PATCH 05/15] [29353] Unescape DATABASE_URL password before backup https://community.openproject.com/wp/29353 [ci skip] --- packaging/scripts/backup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging/scripts/backup b/packaging/scripts/backup index f445d94cb6..6452de3c0e 100755 --- a/packaging/scripts/backup +++ b/packaging/scripts/backup @@ -25,10 +25,11 @@ dump_mysql() { ruby -ruri -rcgi -e ' uri = URI(ENV["DATABASE_URL"]) + password = CGI.unescape(uri.password || "") params = CGI.parse(uri.query || "") config=< Date: Tue, 8 Jan 2019 15:44:59 +0100 Subject: [PATCH 06/15] Fix ckeditor toolbar position --- app/assets/stylesheets/content/editor/_ckeditor.sass | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/assets/stylesheets/content/editor/_ckeditor.sass b/app/assets/stylesheets/content/editor/_ckeditor.sass index bec57d15b2..d09a0167ff 100644 --- a/app/assets/stylesheets/content/editor/_ckeditor.sass +++ b/app/assets/stylesheets/content/editor/_ckeditor.sass @@ -59,3 +59,12 @@ .ck.ck-block-toolbar-button transform: translateX( -15px ) z-index: 1000 !important + + +// Override fixed position of toolbar +// Otherwise the toolbar will 'disappear' behind the topmenu +.ck.ck-sticky-panel__placeholder + height: 0 !important + +.ck.ck-sticky-panel__content + position: unset !important From 638d58981134fb3f4b1c79ed7893534588e9144f Mon Sep 17 00:00:00 2001 From: Inga Mai Date: Mon, 7 Jan 2019 16:52:07 +0100 Subject: [PATCH 07/15] Avoid attribute linebreak on wp split view; flex schema adapted --- .../content/_attributes_key_value.sass | 15 ++++++--------- .../work_packages/single_view/_single_view.sass | 6 ++---- .../stylesheets/layout/work_packages/_mobile.sass | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/content/_attributes_key_value.sass b/app/assets/stylesheets/content/_attributes_key_value.sass index 9173a7d7ef..778e8fb7dd 100644 --- a/app/assets/stylesheets/content/_attributes_key_value.sass +++ b/app/assets/stylesheets/content/_attributes_key_value.sass @@ -27,19 +27,17 @@ //++ .attributes-key-value - @include grid-block - @include grid-layout(2) - @include grid-visible-overflow + display: flex + flex-wrap: wrap font-size: 0.875rem line-height: 1.6 .attributes-key-value--key @extend .form--label - @include grid-size(4) - @include text-shortener display: flex + flex: 1 0 35% margin-bottom: 0.1875rem - padding: 0.375rem 0 !important + padding: 0.375rem 0 font-weight: bold align-self: center // Ensure that the text is shortened while the help icon will be displayed @@ -48,12 +46,11 @@ flex: 0 1 auto .attributes-key-value--value-container - @include grid-content(8) - @include grid-visible-overflow display: flex + flex: 1 0 65% margin-bottom: 0.1875rem - padding: 0 !important align-self: center + overflow: hidden &.not-editable padding: 6px diff --git a/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass b/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass index b16745b81a..28212bf933 100644 --- a/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass +++ b/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass @@ -194,11 +194,9 @@ i // (b) ugly content wrap (e.g. in the label) // These values are what matches best at the moment. So be careful when changing them. .attributes-key-value--key - flex: 0 0 45% - max-width: 45% + flex: 1 0 45% .attributes-key-value--value-container - flex: 0 0 55% - max-width: 55% + flex: 1 0 55% // Implement two column layout for WP full screen view @media screen and (min-width: 92rem), print diff --git a/app/assets/stylesheets/layout/work_packages/_mobile.sass b/app/assets/stylesheets/layout/work_packages/_mobile.sass index 7466099da2..b001eab46d 100644 --- a/app/assets/stylesheets/layout/work_packages/_mobile.sass +++ b/app/assets/stylesheets/layout/work_packages/_mobile.sass @@ -86,7 +86,6 @@ .attributes-key-value--key, .attributes-key-value--value-container - @include grid-size(6) font-size: 1rem margin-bottom: 20px @@ -97,6 +96,7 @@ border: none .attributes-key-value--key + flex-basis: 30% !important padding: 0 !important .work-packages--panel-inner > .attributes-group:first-child From 9b3b573a95a6322667e5d83ccc2231c2368bb3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 9 Jan 2019 08:53:49 +0100 Subject: [PATCH 08/15] Output format.any [ci skip] --- app/controllers/messages_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index c5f317aad5..7b6f038970 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -152,9 +152,8 @@ class MessagesController < ApplicationController content << text.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" respond_to do |format| - format.json do - render json: { subject: subject, content: content } - end + format.json { render json: { subject: subject, content: content } } + format.any { head :not_acceptable } end end end From 8d51fd5f92fd5b7a8c2d5119acbffd54cedc7917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 9 Jan 2019 08:59:28 +0100 Subject: [PATCH 09/15] Fix empty mail hitting find_by_mail with regex [ci skip] --- app/controllers/account_controller.rb | 2 +- app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index a1a67afb7e..77a5037d8b 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -93,7 +93,7 @@ class AccountController < ApplicationController render template: 'account/password_recovery' elsif request.post? mail = params[:mail] - user = User.find_by_mail(mail) + user = User.find_by_mail(mail) if mail.present? # Ensure the same request is sent regardless of which email is entered # to avoid detecability of mails diff --git a/app/models/user.rb b/app/models/user.rb index d1d39c8bda..c7d2519c1e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -759,7 +759,7 @@ class User < Principal def self.mail_regexp(mail) separators = Regexp.escape(Setting.mail_suffix_separators) recipient, domain = mail.split('@').map { |part| Regexp.escape(part) } - skip_suffix_check = Setting.mail_suffix_separators.empty? || recipient.match?(/.+[#{separators}].+/) + skip_suffix_check = recipient.nil? || Setting.mail_suffix_separators.empty? || recipient.match?(/.+[#{separators}].+/) regexp = "#{recipient}([#{separators}][^@]+)*@#{domain}" [skip_suffix_check, regexp] From 52e88daadb2b545a29fa65666ce8b4a0b65955a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 9 Jan 2019 09:03:56 +0100 Subject: [PATCH 10/15] Redirect to correct controller https://sentry.openproject.com/share/issue/ea1e3470aef946db8c4b518dc9ec21e3/ --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 646d27fd9a..5206578617 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -648,7 +648,7 @@ class ApplicationController < ActionController::Base self.logged_user = nil flash[:warning] = I18n.t('notice_forced_logout', ttl_time: Setting.session_ttl) - redirect_to(controller: 'account', action: 'login', back_url: login_back_url) + redirect_to(controller: '/account', action: 'login', back_url: login_back_url) end session[:updated_at] = Time.now end From d4b20e6feb4ae9f56cda58f7a107599e6fb30e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 9 Jan 2019 09:07:11 +0100 Subject: [PATCH 11/15] Fix check on new CF values [ci skip] --- app/models/enumeration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index 391f1f8801..703839343e 100644 --- a/app/models/enumeration.rb +++ b/app/models/enumeration.rb @@ -141,7 +141,7 @@ class Enumeration < ActiveRecord::Base # Does the +new+ Hash have the same custom values as the previous Enumeration? def self.same_custom_values?(new, previous) previous.custom_field_values.each do |custom_value| - if custom_value.value != new['custom_field_values'][custom_value.custom_field_id.to_s] + if new && custom_value.value != new['custom_field_values'][custom_value.custom_field_id.to_s] return false end end From f0bbce375255a8299e63da6a3f0f14441a00ead5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 9 Jan 2019 09:08:34 +0100 Subject: [PATCH 12/15] Allow nil value on attachment when it got destroyed in the meantime [ci skip] --- app/workers/extract_fulltext_job.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/workers/extract_fulltext_job.rb b/app/workers/extract_fulltext_job.rb index 2cdac62eda..c7b2eda2aa 100644 --- a/app/workers/extract_fulltext_job.rb +++ b/app/workers/extract_fulltext_job.rb @@ -62,7 +62,7 @@ class ExtractFulltextJob < ApplicationJob end rescue => e Rails.logger.error( - "Failed to extract plaintext from file #{@attachment.id} (On domain #{Setting.host_name}): #{e}: #{e.message}" + "Failed to extract plaintext from file #{@attachment&.id} (On domain #{Setting.host_name}): #{e}: #{e.message}" ) end end @@ -83,7 +83,7 @@ class ExtractFulltextJob < ApplicationJob end def remote_file? - !@attachment.file.is_a?(LocalFileUploader) + !@attachment&.file.is_a?(LocalFileUploader) end def delete_file? From 9e754ef80462756a66afbf2c9ec940b5d81abe00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 9 Jan 2019 09:12:36 +0100 Subject: [PATCH 13/15] Fix author_id "me" value for cost report [ci skip] --- .../reporting/app/models/cost_query/filter/assigned_to_id.rb | 4 ++++ modules/reporting/app/models/cost_query/filter/author_id.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/reporting/app/models/cost_query/filter/assigned_to_id.rb b/modules/reporting/app/models/cost_query/filter/assigned_to_id.rb index 6a27cd4372..4be8c7f9ce 100644 --- a/modules/reporting/app/models/cost_query/filter/assigned_to_id.rb +++ b/modules/reporting/app/models/cost_query/filter/assigned_to_id.rb @@ -25,4 +25,8 @@ class CostQuery::Filter::AssignedToId < CostQuery::Filter::UserId def self.label WorkPackage.human_attribute_name(:assigned_to) end + + def self.available_values(*) + CostQuery::Filter::UserId.available_values + end end diff --git a/modules/reporting/app/models/cost_query/filter/author_id.rb b/modules/reporting/app/models/cost_query/filter/author_id.rb index dca1ca051d..92a461267e 100644 --- a/modules/reporting/app/models/cost_query/filter/author_id.rb +++ b/modules/reporting/app/models/cost_query/filter/author_id.rb @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #++ -class CostQuery::Filter::AuthorId < Report::Filter::Base +class CostQuery::Filter::AuthorId < CostQuery::Filter::UserId join_table WorkPackage applies_for :label_work_package_attributes From 95177be1cb0f6f6772d202033d7f7138f8a1c48b Mon Sep 17 00:00:00 2001 From: Inga Mai Date: Wed, 9 Jan 2019 10:24:57 +0100 Subject: [PATCH 14/15] Revert "Correct flickering border of timeline header" for this is an independent problem This reverts commit 9fb8073177cd7f1f16cc741fa2f7d30cf98fe3fe. --- .../content/work_packages/timelines/_timelines_header.sass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass b/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass index 703f58a689..0783ea92e4 100644 --- a/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass +++ b/app/assets/stylesheets/content/work_packages/timelines/_timelines_header.sass @@ -24,7 +24,7 @@ wp-timeline-header white-space: nowrap &.-top-border - outline: 1px solid $timeline--header-border-color + border-top: 1px solid $timeline--header-border-color .wp-timeline--header-day-element height: 12px @@ -33,6 +33,7 @@ wp-timeline-header .wp-timeline--header-middle-element border-top: 1px solid $timeline--header-border-color + border-bottom: 1px solid $timeline--header-border-color padding-top: 5px height: 20px From 91e884d41c861de8de1ecbebd81a2871c877be75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 9 Jan 2019 14:06:27 +0100 Subject: [PATCH 15/15] [29334] Fix alias name for group sorting https://community.openproject.com/wp/29334 --- app/cells/members/table_cell.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/cells/members/table_cell.rb b/app/cells/members/table_cell.rb index b0c10f4ffa..e6f35b2a71 100644 --- a/app/cells/members/table_cell.rb +++ b/app/cells/members/table_cell.rb @@ -38,7 +38,7 @@ module Members end def fix_groups_order(sort_clause) - sort_clause.gsub /groups/, "groups.group_name" + sort_clause.gsub /groups/, "groupalias.group_name" end def fix_roles_order(sort_clause)