Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 65be724

Browse files
Merge branch 'release/8.1' into stable/8
2 parents 37dbaa0 + a16eb19 commit 65be724

File tree

341 files changed

+10294
-6109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

341 files changed

+10294
-6109
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ gem 'sprockets', '~> 3.7.0'
161161
# also, better than thin since we can control worker concurrency.
162162
gem 'unicorn'
163163

164-
gem 'nokogiri', '~> 1.8.4'
164+
gem 'nokogiri', '~> 1.8.5'
165165

166166
# carrierwave 0.11.3 should allow to use fog-aws without the rest of the
167167
# fog dependency chain. We only need aws here, so we can avoid it

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ GEM
361361
netrc (0.11.0)
362362
newrelic_rpm (4.5.0.337)
363363
nio4r (2.3.0)
364-
nokogiri (1.8.4)
364+
nokogiri (1.8.5)
365365
mini_portile2 (~> 2.3.0)
366366
nokogumbo (1.5.0)
367367
nokogiri
@@ -670,7 +670,7 @@ DEPENDENCIES
670670
mysql2 (~> 0.5.0)
671671
net-ldap (~> 0.16.0)
672672
newrelic_rpm
673-
nokogiri (~> 1.8.4)
673+
nokogiri (~> 1.8.5)
674674
oj (~> 3.5.0)
675675
okcomputer (~> 1.16.0)
676676
omniauth!

app/assets/javascripts/application.js.erb

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
//= require danger_zone_validation
5050
//= require flash_messages
5151

52+
//= require_tree ./onboarding
53+
54+
5255
function checkAll(selector, checked) {
5356
jQuery('#' + selector + ' input:checkbox').not(':disabled').each(function() {
5457
this.checked = checked;
@@ -241,20 +244,6 @@ jQuery(document).ready(function($) {
241244
addClickEventToAllErrorMessages();
242245
});
243246

244-
// file table thumbnails
245-
jQuery("table a.has-thumb").hover(function() {
246-
jQuery(this).removeAttr("title").toggleClass("active");
247-
248-
// grab the image dimensions to position it properly
249-
var thumbImg = $(this).find("img");
250-
var thumbImgLeft = -(thumbImg.outerWidth() );
251-
var thumbImgTop = -(thumbImg.height() / 2 );
252-
thumbImg.css({top: thumbImgTop, left: thumbImgLeft}).show();
253-
254-
}, function() {
255-
jQuery(this).toggleClass("active").find("img").hide();
256-
});
257-
258247
// show/hide the files table
259248
jQuery(".attachments h4").click(function() {
260249
jQuery(this).toggleClass("closed").next().slideToggle(animationRate);

app/assets/javascripts/members_form.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ function hideAddMemberForm() {
6767
}
6868

6969
jQuery(document).ready(function($) {
70-
$("#tab-content-members").submit('#members_add_form', function () {
71-
var error = $('.errorExplanation, .flash');
72-
if (error) {
73-
error.remove();
74-
}
75-
});
76-
7770
// Show/Hide content when page is loaded
7871
if (window.OpenProject.guardedLocalStorage("showFilter") === "true") {
7972
showFilter(filter = findFilter());
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
(function ($) {
2+
$(function() {
3+
window.scrumBacklogsTourSteps = [
4+
{
5+
'next #content-wrapper': I18n.t('js.onboarding.steps.backlogs_overview'),
6+
'showSkip': false,
7+
'containerClass': '-dark -hidden-arrow'
8+
},
9+
{
10+
'event_type': 'next',
11+
'selector': '#sprint_backlogs_container .backlog .menu-trigger',
12+
'description': I18n.t('js.onboarding.steps.backlogs_task_board_arrow'),
13+
'showSkip': false,
14+
onNext: function () {
15+
$('#sprint_backlogs_container .backlog .menu-trigger')[0].click();
16+
}
17+
},
18+
{
19+
'event_type': 'next',
20+
'selector': '#sprint_backlogs_container .backlog .menu .items',
21+
'description': I18n.t('js.onboarding.steps.backlogs_task_board_select'),
22+
'showSkip': false,
23+
'containerClass': '-dark',
24+
onNext: function () {
25+
$('#sprint_backlogs_container .backlog .show_task_board')[0].click();
26+
}
27+
}
28+
];
29+
30+
window.scrumTaskBoardTourSteps = [
31+
{
32+
'next #content-wrapper': I18n.t('js.onboarding.steps.backlogs_task_board'),
33+
'showSkip': false,
34+
'containerClass': '-dark -hidden-arrow'
35+
},
36+
{
37+
'next #main-menu-work-packages-wrapper': I18n.t('js.onboarding.steps.wp_toggler'),
38+
'showSkip': false,
39+
onNext: function () {
40+
$('#main-menu-work-packages')[0].click();
41+
}
42+
},
43+
];
44+
});
45+
}(jQuery))
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
(function ($) {
2+
$(function() {
3+
window.homescreenOnboardingTourSteps = [
4+
{
5+
'next #top-menu': I18n.t('js.onboarding.steps.welcome'),
6+
'skipButton': {className: 'enjoyhint_btn-transparent'},
7+
'containerClass': '-hidden-arrow'
8+
},
9+
{
10+
'description': I18n.t('js.onboarding.steps.project_selection'),
11+
'selector': '.widget-box.welcome',
12+
'event': 'custom',
13+
'showSkip': false,
14+
'containerClass': '-dark -hidden-arrow',
15+
'containerClass': '-dark -hidden-arrow',
16+
'clickable': true,
17+
onBeforeStart: function () {
18+
// Handle the correct project selection and redirection
19+
// This will be removed once the project selection is implemented
20+
jQuery(".widget-box.welcome a:contains(" + scrumDemoProjectName + ")").click(function () {
21+
tutorialInstance.trigger('next');
22+
window.location = this.href + '/backlogs/?start_scrum_onboarding_tour=true';
23+
});
24+
jQuery(".widget-box.welcome a:contains(" + demoProjectName + ")").click(function () {
25+
tutorialInstance.trigger('next');
26+
window.location = this.href + '/work_packages/?start_onboarding_tour=true';
27+
});
28+
// Disable clicks on other links
29+
$('.widget-box.welcome a').addClass('-disabled').bind('click', preventClickHandler);
30+
}
31+
}
32+
];
33+
});
34+
}(jQuery))
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
(function ($) {
2+
$(function() {
3+
// ------------------------------- Global -------------------------------
4+
window.tutorialInstance;
5+
window.preventClickHandler = function (e) {
6+
e.preventDefault();
7+
e.stopPropagation();
8+
};
9+
window.waitForElement = function(element, container, execFunction) {
10+
// Wait for the element to be ready
11+
var observer = new MutationObserver(function (mutations, observerInstance) {
12+
if ($(element).length) {
13+
observerInstance.disconnect(); // stop observing
14+
execFunction();
15+
return;
16+
}
17+
});
18+
observer.observe($(container)[0], {
19+
childList: true,
20+
subtree: true
21+
});
22+
};
23+
window.demoProjectName = 'Demo project';
24+
window.scrumDemoProjectName = 'Scrum project';
25+
26+
var storageKey = 'openProject-onboardingTour';
27+
var currentTourPart = sessionStorage.getItem(storageKey);
28+
var url = new URL(window.location.href);
29+
30+
// ------------------------------- Initial start -------------------------------
31+
// Do not show the tutorial on mobile or when the demo data has been deleted
32+
if(!(bowser.mobile || bowser.ios || bowser.android) && $('meta[name=demo_projects_available]').attr('content') == "true") {
33+
34+
// Start after the intro modal (language selection)
35+
// This has to be changed once the project selection is implemented
36+
if (url.searchParams.get("first_time_user") && demoProjectsLinks().length == 2) {
37+
currentTourPart = '';
38+
sessionStorage.setItem(storageKey, 'readyToStart');
39+
40+
// Start automatically when the language selection is closed
41+
$('.op-modal--modal-close-button').click(function () {
42+
homescreenTour();
43+
});
44+
}
45+
46+
// ------------------------------- Tutorial Homescreen page -------------------------------
47+
if (currentTourPart === "readyToStart") {
48+
homescreenTour();
49+
}
50+
51+
// ------------------------------- Tutorial WP page -------------------------------
52+
if (currentTourPart === "startWpTour" || url.searchParams.get("start_onboarding_tour")) {
53+
workPackageTour();
54+
}
55+
56+
// ------------------------------- Tutorial Backlogs page -------------------------------
57+
if (url.searchParams.get("start_scrum_onboarding_tour")) {
58+
if ($('.backlogs-menu-item').length > 0) {
59+
backlogsTour();
60+
}
61+
}
62+
63+
// ------------------------------- Tutorial Task Board page -------------------------------
64+
if (currentTourPart === "startTaskBoardTour") {
65+
taskboardTour();
66+
}
67+
}
68+
69+
function demoProjectsLinks() {
70+
demoProjects = [];
71+
demoProjectsLink = jQuery(".widget-box.welcome a:contains(" + demoProjectName + ")");
72+
scrumDemoProjectsLink = jQuery(".widget-box.welcome a:contains(" + scrumDemoProjectName + ")");
73+
if (demoProjectsLink.length) demoProjects.push(demoProjectsLink);
74+
if (scrumDemoProjectsLink.length) demoProjects.push(scrumDemoProjectsLink);
75+
76+
return demoProjects;
77+
}
78+
79+
function initializeTour(storageValue, disabledElements, projectSelection) {
80+
tutorialInstance = new EnjoyHint({
81+
onStart: function () {
82+
$('#content-wrapper, #menu-sidebar').addClass('-hidden-overflow');
83+
},
84+
onEnd: function () {
85+
sessionStorage.setItem(storageKey, storageValue);
86+
$('#content-wrapper, #menu-sidebar').removeClass('-hidden-overflow');
87+
},
88+
onSkip: function () {
89+
sessionStorage.setItem(storageKey, 'skipped');
90+
if (disabledElements) jQuery(disabledElements).removeClass('-disabled').unbind('click', preventClickHandler);
91+
if (projectSelection) $.each(demoProjectsLinks(), function(i, e) { $(e).off('click')});
92+
$('#content-wrapper, #menu-sidebar').removeClass('-hidden-overflow');
93+
}
94+
});
95+
}
96+
97+
function startTour(steps) {
98+
tutorialInstance.set(steps);
99+
tutorialInstance.run();
100+
}
101+
102+
function homescreenTour() {
103+
initializeTour('startProjectTour', '.widget-box--blocks--buttons a', true);
104+
startTour(homescreenOnboardingTourSteps);
105+
}
106+
107+
function backlogsTour() {
108+
initializeTour('startTaskBoardTour');
109+
startTour(scrumBacklogsTourSteps);
110+
}
111+
112+
function taskboardTour() {
113+
initializeTour('startWpTour');
114+
startTour(scrumTaskBoardTourSteps);
115+
}
116+
117+
function workPackageTour() {
118+
initializeTour('wpFinished');
119+
120+
waitForElement('.work-package--results-tbody', '.work-packages-split-view--tabletimeline-side', function() {
121+
startTour(wpOnboardingTourSteps);
122+
});
123+
}
124+
});
125+
}(jQuery));
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
(function ($) {
2+
$(function() {
3+
window.wpOnboardingTourSteps = [
4+
{
5+
'next .wp-table--row': I18n.t('js.onboarding.steps.wp_list'),
6+
'showSkip': false,
7+
onNext: function () {
8+
$(".wp-table--cell-span.id a ")[0].click();
9+
}
10+
},
11+
{
12+
'next .work-packages-full-view--split-left': I18n.t('js.onboarding.steps.wp_full_view'),
13+
'showSkip': false,
14+
'containerClass': '-dark -hidden-arrow'
15+
},
16+
{
17+
'next .work-packages-list-view-button': I18n.t('js.onboarding.steps.wp_back_button'),
18+
'showSkip': false,
19+
onNext: function () {
20+
$('.work-packages-list-view-button')[0].click();
21+
}
22+
},
23+
{
24+
'next .add-work-package': I18n.t('js.onboarding.steps.wp_create_button'),
25+
'showSkip': false,
26+
'shape': 'circle'
27+
},
28+
{
29+
'next .timeline-toolbar--button': I18n.t('js.onboarding.steps.wp_timeline_button'),
30+
'showSkip': false,
31+
'shape': 'circle',
32+
onNext: function () {
33+
$('.timeline-toolbar--button')[0].click();
34+
}
35+
},
36+
{
37+
'next .work-packages-tabletimeline--timeline-side': I18n.t('js.onboarding.steps.wp_timeline'),
38+
'showSkip': false,
39+
'containerClass': '-dark -hidden-arrow'
40+
},
41+
{
42+
'next .main-menu--arrow-left-to-project': I18n.t('js.onboarding.steps.sidebar_arrow'),
43+
'showSkip': false,
44+
onNext: function () {
45+
$('.main-menu--arrow-left-to-project')[0].click();
46+
}
47+
},
48+
{
49+
'next .members-menu-item': I18n.t('js.onboarding.steps.members'),
50+
'showSkip': false
51+
},
52+
{
53+
'next .wiki-menu--main-item': I18n.t('js.onboarding.steps.wiki'),
54+
'showSkip': false
55+
},
56+
{
57+
'next .menu-item--help': I18n.t('js.onboarding.steps.help_menu'),
58+
'shape': 'circle',
59+
'nextButton': {text: I18n.t('js.onboarding.steps.got_it')},
60+
'showSkip': false
61+
}
62+
];
63+
});
64+
}(jQuery))

app/assets/javascripts/settings.js.erb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,26 @@ See docs/COPYRIGHT.rdoc for more details.
100100
.removeAttr('required') // Rails 4.0 still seems to use attribute
101101
.prop('required', wasChecked);
102102
})
103+
104+
/** Toggle highlighted attributes visibility depending on if the highlighting mode 'inline' was selected*/
105+
$('.settings--highlighting-mode select').change(function() {
106+
var highlightingMode = $(this).val();
107+
$(".settings--highlighted-attributes").toggle(highlightingMode === "inline")
108+
})
109+
110+
/** Initialize hightlighted attributes checkboxes. If none is selected, it means we want them all. So let's
111+
* show them all as selected.
112+
* On submitting the form, we remove all checkboxes before sending to communicate, we actually want all and not
113+
* only the selected.*/
114+
if ($(".settings--highlighted-attributes input[type='checkbox']:checked").length == 0) {
115+
$(".settings--highlighted-attributes input[type='checkbox']").prop("checked", true);
116+
}
117+
$('#tab-content-work_packages form').submit(function() {
118+
var availableAttributes = $(".settings--highlighted-attributes input[type='checkbox']");
119+
var selectedAttributes = $(".settings--highlighted-attributes input[type='checkbox']:checked");
120+
if (selectedAttributes.length == availableAttributes.length) {
121+
availableAttributes.prop("checked", false);
122+
}
123+
})
103124
});
104125
}(jQuery));

app/assets/javascripts/specific/main_menu.js.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,8 @@ jQuery(document).ready(function($) {
115115
$(child).before(header);
116116
})
117117

118+
if($('.menu_root').hasClass('closed')) {
119+
// TODO: Instead of hiding the sidebar move sidebar's contents to submenus and cache it.
120+
$('#sidebar').toggleClass('-hidden', true);
121+
}
118122
});

0 commit comments

Comments
 (0)