Merge remote-tracking branch 'origin/release/7.2' into dev

pull/5334/head
Oliver Günther 7 years ago
commit 3b7032e03d
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 2
      Gemfile
  2. 3
      Gemfile.lock
  3. 2
      app/assets/javascripts/colors.js
  4. 1
      app/helpers/application_helper.rb
  5. 2
      app/models/queries/operators/casted_greater_or_equal.rb
  6. 6
      app/views/layouts/base.html.erb
  7. 5
      app/views/wiki/show.html.erb
  8. 4
      frontend/app/components/wp-display/field-types/wp-display-formattable-field.module.ts
  9. 7
      frontend/app/components/wp-edit-form/display-field-renderer.ts
  10. 15
      frontend/app/components/wp-edit/wp-edit-field/wp-edit-field.directive.ts
  11. 16
      frontend/app/components/wp-table/timeline/cells/wp-timeline-cell-mouse-handler.ts
  12. 2
      script/ci_setup.sh

@ -124,6 +124,8 @@ gem 'prawn-table', '~> 0.2.2'
gem 'cells-rails', '~> 0.0.6'
gem 'cells-erb', '~> 0.0.8'
gem 'meta-tags', '~> 2.4.1'
group :production do
# we use dalli as standard memcache client
# requires memcached 1.4+

@ -346,6 +346,8 @@ GEM
nokogiri (>= 1.5.9)
mail (2.6.6)
mime-types (>= 1.16, < 4)
meta-tags (2.4.1)
actionpack (>= 3.2.0, < 5.2)
method_source (0.8.2)
mime-types (2.99.3)
mini_portile2 (2.2.0)
@ -660,6 +662,7 @@ DEPENDENCIES
launchy (~> 2.4.3)
letter_opener
livingstyleguide (~> 2.0.1)
meta-tags (~> 2.4.1)
multi_json (~> 1.12.1)
mysql2 (~> 0.4.4)
net-ldap (~> 0.16.0)

@ -44,7 +44,7 @@
}
func = function () {
let previewColor = '';
var previewColor = '';
if(input.val() && input.val().length > 0) {
previewColor = input.val();

@ -420,7 +420,6 @@ module ApplicationHelper
if args.empty?
title << h(@project.name) if @project
title += @html_title if @html_title
title << h(Setting.app_title)
else
@html_title ||= []
@html_title += args

@ -34,7 +34,7 @@ module Queries::Operators
def self.sql_for_field(values, db_table, db_field)
"#{db_table}.#{db_field} != '' " +
"AND CAST(#{db_table}.#{db_field} AS decimal(60,4)) <= #{values.first.to_f}"
"AND CAST(#{db_table}.#{db_field} AS decimal(60,4)) >= #{values.first.to_f}"
end
end
end

@ -30,10 +30,10 @@ See doc/COPYRIGHT.rdoc for more details.
<html xmlns="http://www.w3.org/1999/xhtml" lang="<%= I18n.locale.to_s %>" xml:lang="<%= I18n.locale.to_s %>" class="<%= 'in_modal' unless show_decoration %>">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><%= html_title %></title>
<meta name="viewport" content="width=device-width">
<meta name="description" content="<%= OpenProject::Info.app_name %>" />
<meta name="keywords" content="issue,bug,type" />
<%= display_meta_tags site: Setting.app_title, title: html_title %>
<meta name="app_base_path" content="<%= OpenProject::Configuration['rails_relative_url_root'] || '' %>" />
<base href="<%= OpenProject::Configuration['rails_relative_url_root'] || '' %>/" />
<% if @project %>

@ -33,6 +33,11 @@ See doc/COPYRIGHT.rdoc for more details.
<% else %>
<% title = h(@page.title) %>
<% end %>
<%# Set meta tags %>
<% title "#{t(:project_module_wiki)} | #{title}" %>
<% description strip_tags(format_text(@content, :text)) %>
<%= toolbar title: title, html: {class: '-with-dropdown'} do %>
<% if @editable %>
<% if User.current.allowed_to? :edit_wiki_pages, @project %>

@ -66,6 +66,10 @@ export class FormattableDisplayField extends DisplayField {
// Escape the given HTML string from the backend, which contains escaped Angular expressions.
// Since formattable fields are only binded to but never evaluated, we can safely remove these expressions.
protected unescape(html:string) {
if (html) {
return this.ExpressionService.unescape(html);
} else {
return '';
}
}
}

@ -99,7 +99,12 @@ export class DisplayFieldRenderer {
let labelContent = this.getLabelContent(field);
if (field.isFormattable && !field.isEmpty()) {
titleContent = angular.element(labelContent).text();
try {
titleContent = _.escape(angular.element(`<div>${labelContent}</div>`).text());
} catch(e) {
console.error("Failed to parse formattable labelContent");
titleContent = "Label for " + field.displayName;
}
} else {
titleContent = labelContent;

@ -126,8 +126,19 @@ export class WorkPackageEditFieldController {
}
public handleUserActivate(evt:JQueryEventObject|null) {
let positionOffset = 0;
if (evt) {
// Skip activation if the user clicked on a link
const target = jQuery(evt.target);
if (target.closest('a', this.displayContainer[0]).length > 0) {
return true;
}
// Get the position where the user clicked.
const positionOffset = evt ? ClickPositionMapper.getPosition(evt) : 0;
positionOffset = ClickPositionMapper.getPosition(evt);
}
this.activate()
.then((handler) => {
@ -135,6 +146,8 @@ export class WorkPackageEditFieldController {
const input = handler.element.find('input');
ClickPositionMapper.setPosition(input, positionOffset);
});
return false;
}
public get displayContainer() {

@ -94,7 +94,7 @@ export function registerWorkPackageMouseHandler(this: void,
// add/remove css class while drag'n'drop is active
const classNameActiveDrag = 'active-drag';
bar.classList.add(classNameActiveDrag);
jBody.on('mouseup', () => bar.classList.remove(classNameActiveDrag));
jBody.on('mouseup.timelinecell', () => bar.classList.remove(classNameActiveDrag));
workPackageTimeline.disableViewParamsCalculation = true;
mouseDownStartDay = getCursorOffsetInDaysFromLeft(renderInfo, ev);
@ -108,9 +108,9 @@ export function registerWorkPackageMouseHandler(this: void,
// Determine what attributes of the work package should be changed
const direction = renderer.onMouseDown(ev, null, renderInfo, labels, bar);
jBody.on('mousemove', createMouseMoveFn(direction));
jBody.on('keyup', keyPressFn);
jBody.on('mouseup', () => deactivate(false));
jBody.on('mousemove.timelinecell', createMouseMoveFn(direction));
jBody.on('keyup.timelinecell', keyPressFn);
jBody.on('mouseup.timelinecell', () => deactivate(false));
}
function createMouseMoveFn(direction:'left' | 'right' | 'both' | 'create' | 'dragright') {
@ -186,7 +186,7 @@ export function registerWorkPackageMouseHandler(this: void,
deactivate(false);
};
jBody.on('keyup', keyPressFn);
jBody.on('keyup.timelinecell', keyPressFn);
};
}
@ -199,11 +199,9 @@ export function registerWorkPackageMouseHandler(this: void,
cell.onmouseup = _.noop;
bar.style.pointerEvents = 'auto';
jBody.off('mouseup');
jBody.off('mousemove');
jBody.off('keyup');
workPackageTimeline.resetCursor();
jBody.off('.timelinecell');
workPackageTimeline.resetCursor();
mouseDownStartDay = null;
dateStates = {};

@ -55,13 +55,13 @@ if [ $1 != 'npm' ]; then
run "bundle exec rake db:migrate"
fi
if [ $1 != 'specs' ] && [ $1 != 'spec_legacy' ]; then
# We need npm 4.0 for a bugfix in cross-platform shrinkwrap
# https://github.com/npm/npm/issues/14042
run "npm install npm@4.0"
run "for i in {1..3}; do npm install && break || sleep 15; done"
if [ $1 != 'specs' ] && [ $1 != 'spec_legacy' ]; then
run "bundle exec rake assets:precompile"
else
# fake result of npm/asset run

Loading…
Cancel
Save