Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/14.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed May 21, 2024
2 parents d9952b2 + 2873824 commit c3d0ebc
Show file tree
Hide file tree
Showing 39 changed files with 314 additions and 326 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ See COPYRIGHT and LICENSE files for more details.
<% helpers.html_title t(:label_administration), @title %>

<%= render(Primer::OpenProject::PageHeader.new(border_bottom: 0)) do |header| %>
<% header.with_title { @title } %>
<% header.with_title { t(:"attributes.attachments") } %>
<% header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
{ href: admin_settings_storages_path, text: t("project_module_storages") },
@title]) %>
t(:"attributes.attachments")]) %>
<% end %>

<%= render(Primer::Alpha::TabNav.new(label: "label")) do |component|
Expand Down
1 change: 0 additions & 1 deletion config/locales/js-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ en:
# Otherwise, e.g. chinese might still have the translations for 10.0 in the 12.0 release.
"14_1":
standard:
learn_about_link: https://www.openproject.org/docs/release-notes/14-1-0/
new_features_html: >
The release contains various new features and improvements: <br>
<ul class="%{list_styling_class}">
Expand Down
3 changes: 3 additions & 0 deletions docker/prod/web
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ if [ "$MIGRATE" = "true" ]; then
bundle exec rake db:migrate
fi

# Clean up any dangling PID file
rm -f ${APP_PATH}/tmp/pids/*

# see `config/puma.rb` for configuration
exec bundle exec rails server -u puma -b $BIND -p $PORT
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion docs/system-admin-guide/integrations/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ In the configuration page that appears, you'll see a blank text field titled **O

Click on the **Save** button.

> **Note:** If the OpenProject host cannot be added, you may check the [Troubleshooting](#troubleshooting) section at the bottom of this page
> **Note:** If the OpenProject host cannot be added, you may check the [Troubleshooting](#troubleshooting) section at the bottom of this page.
Please note, when you use the **Terms of Service** app on the Nextcloud side, all terms also need to be accepted for the OpenProject user that gets created during the setup. This is set to happen automatically during the initial set-up. If you see an error message indicating otherwise or the integration does not behave as expected, please refer to the [Troubleshooting](#troubleshooting) section at the bottom of this page.

The next part of the setup will require you to enter OpenProject OAuth values here, but before we do that, you will need to generate them in OpenProject. To do so, navigate to your OpenProject instance in a new browser tab.

Expand Down Expand Up @@ -216,6 +218,14 @@ Some administrators setup OpenProject using a self signed TLS/SSL certificate wi

Attention: Please do not confuse the CA for the Nextcloud server's certificate with the CA of the OpenProject server's certificate which you might have provided in the OpenProject installation wizard. They do not necessarily need to be the same.

#### Error message "Sign terms of services"

**Terms of services** is an app on the Nextcloud side of integration that makes it mandatory for users to accept terms of services before Nextcloud can be used. In order for the integration to work properly the OpenProject user also needs to accept all terms that are set up. It should be accepted automatically during the set up process. However, it is possible that in certain situations it does not happen automatically.


To fix this please log into Nextcloud, proceed to Administration and select OpenProject. This will trigger an automatic background check and suggest that *Terms of services* be signed.
![Fix a Terms of services error in Nextcloud](openproject_system_guide_tos_fix.png)

#### While setting up Project folders

While setting up the project folders we create a new user, group and group folder named `OpenProject`. At the time of set up the system expects either all of these entities to have been set up with proper permissions or none of them to be present. If one or more of these entities are present without required permissions, an error message will be displayed.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ In the **Details** side panel, click on the **OpenProject** tab. This tab lets y

To link this file to a work package in OpenProject for the first time, use the search bar to find the correct work package (you can search either using a word in the title of the work package, or simply enter the work package ID) and click on it.

![Search work package in Nextcloud](NC_0_01-FileRelationSearch.png)
![Search work package in Nextcloud](NC_0_01-FileRelationSearch_new.png)

This linked file will then appear underneath the search bar. Doing so will also automatically add the file to the Files tab of the corresponding work package(s) in OpenProject.

![Show linked work packages in Nextcloud](NC_1_00-FileWPRelation.png)
![Show linked work packages in Nextcloud](NC_1_00-FileWPRelation_new.png)

#### Link multiple files to a work packages

Expand Down
23 changes: 23 additions & 0 deletions frontend/src/app/core/routing/openproject.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,29 @@ export function initializeUiRouterListeners(injector:Injector) {
(transition) => redirectToMobileAlternative(transition),
);

// Fire an event when navigating to a different module. This event then can be detected in
// the non-angular parts of the application. A usecase for this can be found in the
// overview-header.controllers.ts
// See https://community.openproject.org/wp/55024 for details.
$transitions.onBefore(
{},
(transition:Transition) => {
const fromState = transition.from();
const toState = transition.to();
if (
!!fromState.name
&& !!toState.name
&& fromState.name?.split('.')[0] !== toState.name?.split('.')[0]
) {
window.dispatchEvent(new CustomEvent('angular:router:module-changed', {
detail: toState.name?.split('.')[0],
}));
}

return true;
},
);

// Apply classes from bodyClasses in each state definition
// This was defined as onEnter, onExit functions in each state before
// but since AOT doesn't allow anonymous functions, we can't re-use them now.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export const homescreenNewFeaturesBlockSelector = 'homescreen-new-features-block
// The key used in the I18n files to distinguish between versions.
const OpVersionI18n = '14_1';

const OpReleaseURL = 'https://www.openproject.org/docs/release-notes/14-1-0/';

/** Update the teaser image to the next version */
const featureTeaserImage = `${OpVersionI18n}_features.svg`;

Expand Down Expand Up @@ -90,8 +92,7 @@ export class HomescreenNewFeaturesBlockComponent {
}

public get teaserWebsiteUrl() {
const url = this.translated('learn_about_link');
return this.domSanitizer.bypassSecurityTrustResourceUrl(url);
return this.domSanitizer.bypassSecurityTrustResourceUrl(OpReleaseURL);
}

public get currentNewFeatureHtml():string {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* -- copyright
* OpenProject is an open source project management software.
* Copyright (C) 2023 the OpenProject GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 3.
*
* OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
* Copyright (C) 2006-2013 Jean-Philippe Lang
* Copyright (C) 2010-2013 the ChiliProject Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* See COPYRIGHT and LICENSE files for more details.
* ++
*/

import { Controller } from '@hotwired/stimulus';

export default class OverviewHeaderController extends Controller {
connect() {
window.addEventListener('angular:router:module-changed', this.toggleHeaderVisibility);
}

disconnect() {
window.removeEventListener('angular:router:module-changed', this.toggleHeaderVisibility);
}

toggleHeaderVisibility = (event:CustomEvent) => {
const name = event.detail as string;
const element = this.element as HTMLElement;

if (name === 'overview') {
element.classList.remove('d-none');
} else {
element.classList.add('d-none');
}
};
}
9 changes: 6 additions & 3 deletions lib/redmine/menu_manager/menu_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def render_wrapped_menu_parent_node(node, project)
html_id = node.html_options[:id] || node.name
content_tag(:div, class: "main-item-wrapper", id: "#{html_id}-wrapper") do
concat render_single_menu_node(node, project)
concat render_menu_toggler
concat render_menu_toggler(node.name)
end
end

Expand All @@ -163,11 +163,14 @@ def render_wrapped_single_node(node, project)
end
end

def render_menu_toggler
def render_menu_toggler(node_name)
content_tag(:button,
class: "toggler main-menu-toggler",
type: :button,
data: { action: "menus--main#descend" }) do
data: {
action: "menus--main#descend",
test_selector: "main-menu-toggler--#{node_name}"
}) do
render(Primer::Beta::Octicon.new("arrow-right", size: :small))
end
end
Expand Down
3 changes: 1 addition & 2 deletions modules/boards/spec/features/board_navigation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@
with_settings: { notifications_polling_interval: 1_000 } do
visit project_path(project)

item = page.find('#menu-sidebar li[data-name="boards"]', wait: 10)
item.find(".toggler").click
page.find_test_selector("main-menu-toggler--boards", wait: 10).click

subitem = page.find_test_selector("op-sidemenu--item-action--Myboard", wait: 10)
# Ends with boards due to lazy route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@

# Navigate to the WP module
find(".main-menu--arrow-left-to-project").click
find("#main-menu-work-packages-wrapper .main-menu-toggler").click
page.find_test_selector("main-menu-toggler--work_packages").click

# Select other query
query_menu.select query
Expand All @@ -128,7 +128,7 @@

# Navigate to the Gantt module agin
find(".main-menu--arrow-left-to-project").click
find("#main-menu-gantt-wrapper .main-menu-toggler").click
page.find_test_selector("main-menu-toggler--gantt").click

# Select first query again
query_menu.click_item query_tl.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
<% end -%>

<%=
render(Primer::OpenProject::PageHeader.new(data: { turbo: true })) do |header|
render(Primer::OpenProject::PageHeader.new(
data: {
'controller': 'overview-header',
'application-target': 'dynamic',
turbo: true
}
)) do |header|
header.with_title(variant: :medium) { t("overviews.label") }
header.with_breadcrumbs(
[
Expand Down
49 changes: 49 additions & 0 deletions modules/overviews/spec/features/navigation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,53 @@
.to have_content("Overview")
end
end

context "as user with permissions" do
let(:project) { create(:project, enabled_module_names: %i[work_package_tracking]) }
let(:user) { create(:admin) }
let(:query) do
create(:query_with_view_work_packages_table,
project:,
user:,
name: "My important Query")
end

before do
query
login_as user
end

it "can navigate to other modules (regression #55024)" do
visit project_overview_path(project.id)

# Expect page to be loaded
within "#content" do
expect(page).to have_content("Overview")
end

# Navigate to the WP module
page.find_test_selector("main-menu-toggler--work_packages").click

# Click on a saved query
page.find_test_selector("op-sidemenu--item-action--MyimportantQuery", wait: 10).click

loading_indicator_saveguard

within "#content" do
# Expect the query content to be shown
expect(page).to have_field("editable-toolbar-title", with: query.name)

# Expect no page header of the Overview to be shown any more
expect(page).to have_no_content("Overview")
end

# Navigate back to the Overview page
page.execute_script("window.history.back()")

# Expect page to be loaded
within "#content" do
expect(page).to have_content("Overview")
end
end
end
end
Loading

0 comments on commit c3d0ebc

Please sign in to comment.