Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/13.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Dec 22, 2023
2 parents c56f4f1 + df921c1 commit 200e11c
Show file tree
Hide file tree
Showing 23 changed files with 195 additions and 151 deletions.
1 change: 0 additions & 1 deletion .pkgr.yml
Expand Up @@ -25,7 +25,6 @@ targets:
<<: *debian
centos-8: &centos8
env:
- BUNDLE_BUILD__PG="--with-pg-config=/usr/pgsql-13/bin/pg_config"
- NODE_ENV=production
- NPM_CONFIG_PRODUCTION=false
dependencies:
Expand Down
41 changes: 21 additions & 20 deletions app/services/journals/create_service.rb
Expand Up @@ -229,6 +229,14 @@ def journal_modification_sql(predecessor, notes, cause)
def relation_modifications_sql(predecessor)
relations = []

for_supported_associations do |association|
relations << association_modifications_sql(association, predecessor)
end

relations
end

def for_supported_associations
associations = {
attachable?: :attachable,
customizable?: :customizable,
Expand All @@ -238,11 +246,9 @@ def relation_modifications_sql(predecessor)

associations.each do |is_associated, association|
if journable.respond_to?(is_associated)
relations << association_modifications_sql(association, predecessor)
yield association
end
end

relations
end

def association_modifications_sql(association, predecessor)
Expand Down Expand Up @@ -612,28 +618,23 @@ def select_max_journal_sql(predecessor)
end

def select_changed_sql
<<~SQL
sql = <<~SQL
SELECT
*
FROM
(#{data_changes_sql}) data_changes
FULL JOIN
(#{customizable_changes_sql}) customizable_changes
ON
customizable_changes.journable_id = data_changes.journable_id
FULL JOIN
(#{attachable_changes_sql}) attachable_changes
ON
attachable_changes.journable_id = data_changes.journable_id
FULL JOIN
(#{storable_changes_sql}) storable_changes
ON
storable_changes.journable_id = data_changes.journable_id
FULL JOIN
(#{agenda_itemable_changes_sql}) agenda_itemable_changes
ON
agenda_itemable_changes.journable_id = data_changes.journable_id
SQL

for_supported_associations do |association|
sql += <<~SQL
FULL JOIN
(#{send(:"#{association}_changes_sql")}) #{association}_changes
ON
#{association}_changes.journable_id = data_changes.journable_id
SQL
end

sql
end

def attachable_changes_sql
Expand Down
4 changes: 4 additions & 0 deletions config/application.rb
Expand Up @@ -66,6 +66,10 @@ class Application < Rails::Application
# https://community.openproject.org/wp/45463 for details.
config.load_defaults 5.0

# Silence the "multiple database warning"
# Note that this warning can be removed in the 7.1 upgrade
ActiveRecord.suppress_multiple_database_warning = true

# Do not require `belongs_to` associations to be present by default.
# Rails 5.0+ default is true. Because of history, lots of tests fail when
# set to true.
Expand Down
5 changes: 5 additions & 0 deletions docs/development/code-review-guidelines/README.md
Expand Up @@ -135,6 +135,11 @@ Verify that the appropriate tests have been added as documented above.

When testing a feature or change, check out the code test at least the happy paths according to the specification of the ticket.

### Documenting changes right away

If possible, add smaller documentation changes right away.

If there are breaking changes (e.g., to permissions, code relevant for developers), add them to the release notes draft for the release or create a new draft if none exists yet.


## Other
Expand Down
34 changes: 34 additions & 0 deletions docs/release-notes/13-1-1/README.md
@@ -0,0 +1,34 @@
---
title: OpenProject 13.1.1
sidebar_navigation:
title: 13.1.1
release_version: 13.1.1
release_date: 2023-12-20
---

# OpenProject 13.1.1

Release date: 2023-12-20

We released [OpenProject 13.1.1](https://community.openproject.com/versions/1980).
The release contains several bug fixes and we recommend updating to the newest version.

<!--more-->
#### Bug fixes and changes

- Fixed: Inconsistent hrefs in wp shared mail \[[#51480](https://community.openproject.com/wp/51480)\]
- Fixed: Slow notification polling \[[#51622](https://community.openproject.com/wp/51622)\]
- Fixed: Error from rails at openproject configure : Rails couldn't infer whether you are using multiple databases from your database.yml and can't generate the tasks for the non-primary databases. \[[#51625](https://community.openproject.com/wp/51625)\]
- Fixed: Share modal has two close options \[[#51652](https://community.openproject.com/wp/51652)\]
- Fixed: Missing translation "<user> wrote:" when quoting in work package activity \[[#51656](https://community.openproject.com/wp/51656)\]
- Fixed: Very slow Project.visible scope for administrators \[[#51659](https://community.openproject.com/wp/51659)\]
- Fixed: Meeting agenda create Form Buttons overlap on mobile \[[#51687](https://community.openproject.com/wp/51687)\]
- Fixed: Time and costs \[[#51700](https://community.openproject.com/wp/51700)\]
- Fixed: Pasting into autocompleter does not work initially \[[#51730](https://community.openproject.com/wp/51730)\]

#### Contributions
A big thanks to community members for reporting bugs and helping us identifying and providing fixes.

Special thanks for reporting and finding bugs go to

Tom Gugel, Marek Krempa
7 changes: 7 additions & 0 deletions docs/release-notes/README.md
Expand Up @@ -14,6 +14,13 @@ Stay up to date and get an overview of the new features included in the releases
<!--- New release notes are generated below. Do not remove comment. -->
<!--- RELEASE MARKER -->

## 13.1.1

Release date: 2023-12-20

[Release Notes](13-1-1/)


## 13.1.0

Release date: 2023-12-13
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/work-packages/share-work-packages/README.md
Expand Up @@ -20,7 +20,7 @@ To share a work package with a project non-member select the detailed view of a

A dialogue window will open, showing the list of all users, who this work package has already been shared with. If the work package has not yet been shared, the list will be empty.

> **Note**: In order to be able to share a work package with non members you need to have specific rights. If you do not see the option to share a work package, please contact your administrator.
> **Note**: In order to be able to share a work package with non members you need to have been assigned a [global role *create users*](./././system-admin-guide/users-permissions/users/#create-users). If you do not see the option to share a work package, please contact your administrator.
![List of users with access to a work package in OpenProject](openproject_user_guide_shared_with_list.png)

Expand All @@ -46,7 +46,7 @@ Following user roles are available as filters:

![Filter list of users by user role](openproject_user_guide_sharing_member_role_filter.png)

**Note:** Please keep in mind that users listed after you have applied a filter may have additional permissions. For example if you select the **View** filter, it is possible that a user is listed, which has inherited additional role as part of user group with permissions exceeding the viewing ones.
> **Note:** Please keep in mind that users listed after you have applied a filter may have additional permissions. For example if you select the **View** filter, it is possible that a user is listed, which has inherited additional role as part of user group with permissions exceeding the viewing ones.
You can search for a user or a group via a user name, group name or an email address. You can either select an existing user from the dropdown menu or enter an email address for an entirely new user, who will receive an invitation to create an account on your instance.

Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Expand Up @@ -165,7 +165,7 @@
"build:watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks",
"tokens:generate": "theo src/app/spot/styles/tokens/tokens.yml --transform web --format sass,json --dest src/app/spot/styles/tokens/dist",
"icon-font:generate": "node ./src/app/spot/icon-font/generate.js ./src/app/spot/icon-font",
"serve": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --public-host http://localhost:4200",
"serve": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --public-host http://${PROXY_HOSTNAME:-localhost}:4200",
"serve:test": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --disable-host-check --public-host http://frontend-test:4200",
"test": "ng test --watch=false",
"test:watch": "ng test --watch=true",
Expand Down
Expand Up @@ -34,15 +34,19 @@ import {
OnDestroy,
OnInit,
Output,

} from '@angular/core';
import { WorkPackageViewFiltersService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
import {
WorkPackageViewFiltersService,
} from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
import { DebouncedEventEmitter } from 'core-app/shared/helpers/rxjs/debounced-event-emitter';
import { QueryFilterInstanceResource } from 'core-app/features/hal/resources/query-filter-instance-resource';
import { Observable } from 'rxjs';
import { from, merge, Observable } from 'rxjs';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { componentDestroyed } from '@w11k/ngx-componentdestroyed';
import { WorkPackageFiltersService } from 'core-app/features/work-packages/components/filters/wp-filters/wp-filters.service';
import {
WorkPackageFiltersService,
} from 'core-app/features/work-packages/components/filters/wp-filters/wp-filters.service';
import { WorkPackagesListService } from 'core-app/features/work-packages/components/wp-list/wp-list.service';

@Component({
templateUrl: './filter-container.directive.html',
Expand All @@ -66,14 +70,17 @@ export class WorkPackageFilterContainerComponent extends UntilDestroyedMixin imp
readonly wpTableFilters:WorkPackageViewFiltersService,
readonly cdRef:ChangeDetectorRef,
readonly wpFiltersService:WorkPackageFiltersService,
readonly wpListService:WorkPackagesListService,
) {
super();
this.visible$ = this.wpFiltersService.observeUntil(componentDestroyed(this));
}

ngOnInit():void {
this.wpTableFilters
.pristine$()
merge(
this.wpTableFilters.pristine$(),
from(this.wpListService.conditionallyLoadForm()),
)
.pipe(
this.untilDestroyed(),
)
Expand Down
Expand Up @@ -32,17 +32,23 @@ import { States } from 'core-app/core/states/states.service';
import { IFieldSchema } from 'core-app/shared/components/fields/field.base';

import { EditFieldHandler } from 'core-app/shared/components/fields/edit/editing-portal/edit-field-handler';
import { WorkPackageViewColumnsService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service';
import {
WorkPackageViewColumnsService,
} from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service';
import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helper';
import { EditingPortalService } from 'core-app/shared/components/fields/edit/editing-portal/editing-portal-service';
import { CellBuilder, editCellContainer, tdClassName } from 'core-app/features/work-packages/components/wp-fast-table/builders/cell-builder';
import {
CellBuilder,
tdClassName,
} from 'core-app/features/work-packages/components/wp-fast-table/builders/cell-builder';
import { WorkPackageTable } from 'core-app/features/work-packages/components/wp-fast-table/wp-fast-table';
import { EditForm } from 'core-app/shared/components/fields/edit/edit-form/edit-form';
import { editModeClassName } from 'core-app/shared/components/fields/edit/edit-field.component';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { editFieldContainerClass } from 'core-app/shared/components/fields/display/display-field-renderer';
import { WorkPackagesListService } from 'core-app/features/work-packages/components/wp-list/wp-list.service';

export const activeFieldContainerClassName = 'inline-edit--active-field';
export const activeFieldClassName = 'inline-edit--field';
Expand All @@ -58,6 +64,8 @@ export class TableEditForm extends EditForm<WorkPackageResource> {

@InjectField() public editingPortalService:EditingPortalService;

@InjectField() wpListService:WorkPackagesListService;

// Use cell builder to reset edit fields
private cellBuilder = new CellBuilder(this.injector);

Expand Down Expand Up @@ -134,8 +142,14 @@ export class TableEditForm extends EditForm<WorkPackageResource> {
}

public requireVisible(fieldName:string):Promise<any> {
this.wpTableColumns.addColumn(fieldName);
return this.waitForContainer(fieldName);
// Ensure the query form is loaded before trying to set fields
// as we require new columns to be present
return this.wpListService
.conditionallyLoadForm()
.then(() => {
this.wpTableColumns.addColumn(fieldName);
return this.waitForContainer(fieldName);
});
}

protected focusOnFirstError():void {
Expand Down
Expand Up @@ -36,21 +36,9 @@ import isPersistedResource from 'core-app/features/hal/helpers/is-persisted-reso
import { UrlParamsHelperService } from 'core-app/features/work-packages/components/wp-query/url-params-helper';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import {
firstValueFrom,
from,
Observable,
of,
} from 'rxjs';
import { firstValueFrom, from, Observable, of } from 'rxjs';
import { input } from '@openproject/reactivestates';
import {
catchError,
mapTo,
mergeMap,
share,
switchMap,
take,
} from 'rxjs/operators';
import { catchError, mapTo, mergeMap, share, switchMap, take } from 'rxjs/operators';
import {
WorkPackageViewPaginationService,
} from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-pagination.service';
Expand Down Expand Up @@ -359,12 +347,19 @@ export class WorkPackagesListService {
return this.wpTablePagination.paginationObject;
}

private conditionallyLoadForm(query:QueryResource):void {
public conditionallyLoadForm(query = this.currentQuery):Promise<QueryFormResource> {
const currentForm = this.querySpace.queryForm.value;

if (!query) {
return firstValueFrom(this.queryLoading)
.then((loaded) => this.conditionallyLoadForm(loaded));
}

if (!currentForm || query.$links.update.href !== currentForm.href) {
setTimeout(() => this.loadForm(query), 0);
return this.loadForm(query);
}

return Promise.resolve(currentForm);
}

public get currentQuery() {
Expand Down
Expand Up @@ -109,7 +109,6 @@ export class WorkPackageEmbeddedTableComponent extends WorkPackageEmbeddedBaseCo
}

protected initializeStates(query:QueryResource) {
void this.loadForm(query);
super.initializeStates(query);

this.querySpace
Expand All @@ -127,29 +126,7 @@ export class WorkPackageEmbeddedTableComponent extends WorkPackageEmbeddedBaseCo
});
}

private loadForm(query:QueryResource):Promise<QueryFormResource|undefined> {
if (!this.formPromise) {
this.formPromise = firstValueFrom(
this
.apiv3Service
.withOptionalProject(this.projectIdentifier)
.queries
.form
.load(query),
)
.then(([form, _]) => {
this.wpStatesInitialization.updateStatesFromForm(query, form);
return form;
})
.catch(() => undefined);
}

return this.formPromise;
}

public loadQuery(visible = true, firstPage = false):Promise<QueryResource> {
// Ensure we are loading the form.
this.formPromise = undefined;

if (this.loadedQuery) {
const query = this.loadedQuery;
Expand Down
Expand Up @@ -360,8 +360,6 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet
}

public opened():void { // eslint-disable-line no-unused-vars
// Re-search for empty value as search value gets removed
this.typeahead?.next('');
this.repositionDropdown();
this.open.emit();
}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/global_styles/content/editor/_ckeditor.sass
Expand Up @@ -103,7 +103,6 @@ ckeditor-augmented-textarea .op-ckeditor--wrapper
border-bottom-right-radius: 0

.document-editor__editable-container
overflow-y: auto
border: 1px solid var(--ck-color-base-border)
border-top: none
border-radius: var(--ck-border-radius)
Expand Down
Expand Up @@ -66,8 +66,6 @@
display: inline-block

.comment ul
list-style-type: disc !important

li
padding: 0 !important
margin: 0 !important
Expand Down
4 changes: 2 additions & 2 deletions lib/open_project/version.rb
Expand Up @@ -32,8 +32,8 @@
module OpenProject
module VERSION # :nodoc:
MAJOR = 13
MINOR = 1
PATCH = 1
MINOR = 2
PATCH = 0

class << self
# Used by semver to define the special version (if any).
Expand Down
Expand Up @@ -10,4 +10,5 @@
justify-self: end

@media screen and (max-width: $breakpoint-sm)
grid-template-columns: 1fr auto
grid-template-areas: "title title" "duration duration" "notes notes" "add_note actions"

0 comments on commit 200e11c

Please sign in to comment.