Skip to content

Commit

Permalink
Merge branch 'release/13.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
akabiru committed Dec 14, 2023
2 parents af699e3 + 19d68b9 commit be085c3
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 72 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/docker.yml
Expand Up @@ -40,7 +40,13 @@ jobs:
bim_support: false
target: all-in-one
steps:
- name: Checkout
- name: Checkout current release
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v3
- name: Checkout specific version
if: ${{ github.event_name != 'push' }}
with:
ref: ${{ inputs.version }}
uses: actions/checkout@v3
- name: Prepare docker files
run: |
Expand Down
2 changes: 1 addition & 1 deletion app/models/queries/principals/principal_query.rb
Expand Up @@ -32,6 +32,6 @@ def self.model
end

def default_scope
Principal.not_builtin
Principal.visible(User.current).not_builtin
end
end
2 changes: 1 addition & 1 deletion app/views/sharing_mailer/shared_work_package.html.erb
Expand Up @@ -29,7 +29,7 @@
work_package: @work_package,
unique_reasons: [:shared],
show_count: false,
notification_url: @notification_url,
notification_url: @url,
open_in_browser_path: @url
} do %>
<table <%= placeholder_table_styles(width:'100%',style: 'width:100%;') %>>
Expand Down
7 changes: 7 additions & 0 deletions config/constants/settings/definition.rb
Expand Up @@ -648,6 +648,13 @@ class Definition
default: nil,
allowed: -> { Role.pluck(:id) }
},
notifications_hidden: {
default: false
},
notifications_polling_interval: {
format: :integer,
default: 60000
},
oauth_allow_remapping_of_existing_users: {
description: 'When set to false, prevent users from other identity providers to take over accounts connected ' \
'to another identity provider.',
Expand Down
4 changes: 2 additions & 2 deletions config/locales/crowdin/ko.yml
Expand Up @@ -1478,7 +1478,7 @@ ko:
non_working: "%{date}은(는) 이제 휴무일입니다."
system_update:
file_links_journal: >
이제부터 파일 링크(외부 저장소에 저장된 파일)와 관련된 활동이 활동 탭에 표시됩니다. 다음은 이미 존재하는 링크와 관련된 활동을 나타냅니다.
지금부터 파일 링크(외부 저장소에 저장된 파일)와 관련된 활동이 활동 탭에 표시됩니다. 다음은 이미 존재하는 링크와 관련된 활동을 나타냅니다.
links:
configuration_guide: "구성 가이드"
get_in_touch: "질문이 있으신가요? 문의해 주세요."
Expand Down Expand Up @@ -1670,7 +1670,7 @@ ko:
label_copy_workflow_from: "다음에서 워크플로 복사"
label_copy_project: "프로젝트 복사"
label_core_version: "코어 버전"
label_core_build: "Core build"
label_core_build: "코어 빌드"
label_current_status: "현재 상태"
label_current_version: "현재 버전"
label_custom_field_add_no_type: "작업 패키지 유형에 이 필드 추가"
Expand Down
4 changes: 2 additions & 2 deletions config/locales/en.yml
Expand Up @@ -2348,9 +2348,9 @@ en:
sharing:
work_packages:
allowed_actions: "You may %{allowed_actions} this work package. This can change depending on your project role and permissions."
create_account: "To access this work package you will need to create and activate an %{instance} account. "
create_account: "To access this work package, you will need to create and activate an account on %{instance}."
open_work_package: "Open work package"
subject: "You have been shared work package #%{id}"
subject: "Work package #%{id} was shared with you"
enterprise_text: "Share work packages with users who are not members of the project."
summary:
user: "%{user} shared a work package with you with %{role_rights} rights"
Expand Down
3 changes: 3 additions & 0 deletions docker/prod/bimworker
@@ -0,0 +1,3 @@
#!/bin/bash -e
export QUEUE=bim,ifc_conversion
exec bundle exec rake jobs:work
@@ -1,74 +1,73 @@
import {
ChangeDetectionStrategy,
Component,
} from '@angular/core';
import {
combineLatest,
merge,
timer,
} from 'rxjs';
import {
filter,
map,
shareReplay,
switchMap,
throttleTime,
} from 'rxjs/operators';
import { ChangeDetectionStrategy, Component, ElementRef, Input, OnInit } from '@angular/core';
import { combineLatest, merge, Observable, timer } from 'rxjs';
import { filter, map, shareReplay, switchMap, throttleTime } from 'rxjs/operators';
import { ActiveWindowService } from 'core-app/core/active-window/active-window.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { IanBellService } from 'core-app/features/in-app-notifications/bell/state/ian-bell.service';
import { populateInputsFromDataset } from 'core-app/shared/components/dataset-inputs';

export const opInAppNotificationBellSelector = 'op-in-app-notification-bell';
const ACTIVE_POLLING_INTERVAL = 10000;
const INACTIVE_POLLING_INTERVAL = 120000;

@Component({
selector: opInAppNotificationBellSelector,
templateUrl: './in-app-notification-bell.component.html',
styleUrls: ['./in-app-notification-bell.component.sass'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class InAppNotificationBellComponent {
polling$ = merge(
timer(10, ACTIVE_POLLING_INTERVAL).pipe(filter(() => this.activeWindow.isActive)),
timer(10, INACTIVE_POLLING_INTERVAL).pipe(filter(() => !this.activeWindow.isActive)),
)
.pipe(
throttleTime(ACTIVE_POLLING_INTERVAL),
switchMap(() => this.storeService.fetchUnread()),
);

unreadCount$ = combineLatest([
this.storeService.unread$,
this.polling$,
]).pipe(
map(([count]) => count),
shareReplay(1),
);
export class InAppNotificationBellComponent implements OnInit {
@Input() interval = 50000;

unreadCountText$ = this
.unreadCount$
.pipe(
map((count) => {
if (count > 99) {
return '99+';
}
polling$:Observable<number>;

if (count <= 0) {
return '';
}
unreadCount$:Observable<number>;

return count;
}),
);
unreadCountText$:Observable<number|string>;

constructor(
readonly elementRef:ElementRef,
readonly storeService:IanBellService,
readonly apiV3Service:ApiV3Service,
readonly activeWindow:ActiveWindowService,
readonly pathHelper:PathHelperService,
) { }
) {
populateInputsFromDataset(this);
}

ngOnInit() {
this.polling$ = merge(
timer(10, this.interval).pipe(filter(() => this.activeWindow.isActive)),
timer(10, this.interval * 10).pipe(filter(() => !this.activeWindow.isActive)),
)
.pipe(
throttleTime(this.interval),
switchMap(() => this.storeService.fetchUnread()),
);

this.unreadCount$ = combineLatest([
this.storeService.unread$,
this.polling$,
]).pipe(
map(([count]) => count),
shareReplay(1),
);

this.unreadCountText$ = this
.unreadCount$
.pipe(
map((count) => {
if (count > 99) {
return '99+';
}

if (count <= 0) {
return '';
}

return count;
}),
);
}

notificationsPath():string {
return this.pathHelper.notificationsPath();
Expand Down
4 changes: 3 additions & 1 deletion lib/api/v3/notifications/notifications_api.rb
Expand Up @@ -60,8 +60,10 @@ def bulk_update_status(attributes)
end
end

# No need to reapply the visibility scope here as this will be done by the used
# NotificationQuery.
get &::API::V3::Utilities::Endpoints::SqlFallbackedIndex
.new(model: Notification, scope: -> { notification_scope })
.new(model: Notification, scope: -> { Notification.where.not(read_ian: nil) })
.mount

post :read_ian do
Expand Down
2 changes: 1 addition & 1 deletion lib/api/v3/principals/principals_api.rb
Expand Up @@ -33,7 +33,7 @@ class PrincipalsAPI < ::API::OpenProjectAPI
resource :principals do
get &::API::V3::Utilities::Endpoints::SqlFallbackedIndex
.new(model: Principal,
scope: -> { Principal.visible(current_user).includes(:preference) })
scope: -> { Principal.includes(:preference) })
.mount
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/api/v3/utilities/endpoints/index.rb
Expand Up @@ -164,7 +164,7 @@ def apply_scope_constraint(constraint, result_scope)
else
result_scope
.includes(constraint.includes_values)
.where id: constraint.select(:id)
.merge constraint
end
end
end
Expand Down
6 changes: 5 additions & 1 deletion lib/redmine/menu_manager/top_menu_helper.rb
Expand Up @@ -86,9 +86,13 @@ def top_menu_right_menu_items

def render_notification_top_menu_node
return ''.html_safe unless User.current.logged?
return ''.html_safe if Setting.notifications_hidden?

content_tag('li', class: 'op-app-menu--item', title: I18n.t('mail.notification.center')) do
tag('op-in-app-notification-bell')
angular_component_tag 'op-in-app-notification-bell',
inputs: {
interval: Setting.notifications_polling_interval
}
end
end

Expand Down
Expand Up @@ -27,10 +27,11 @@
#++

require 'spec_helper'
require_relative './../support/onboarding_steps'
require_relative '../support/onboarding_steps'

RSpec.describe 'boards onboarding tour',
js: true do
# We decrease the notification polling interval because some portions of the JS code rely on something triggering
# the Angular change detection. This is usually done by the notification polling, but we don't want to wait
RSpec.describe 'boards onboarding tour', :js, with_settings: { notifications_polling_interval: 1_000 } do
let(:next_button) { find('.enjoyhint_next_btn') }
let(:user) do
create(:admin,
Expand Down
4 changes: 2 additions & 2 deletions modules/meeting/config/locales/en.yml
Expand Up @@ -161,7 +161,7 @@ en:
text_notificiation_invited: "This mail contains an ics entry for the meeting below:"

text_meeting_empty_heading: "Your meeting is empty"
text_meeting_empty_description_1: "Start by adding agenda items below. Each item can be as simple as just a title, but you can also add additional details like duration, notes and a person responsible."
text_meeting_empty_description_1: "Start by adding agenda items below. Each item can be as simple as just a title, but you can also add additional details like duration and notes."
text_meeting_empty_description_2: "You can also add references to existing work packages. When you do, related notes will automatically be visible in the work package's \"Meetings\" tab."
label_meeting_empty_action: "Add agenda item"

Expand All @@ -171,7 +171,7 @@ en:
label_meeting_created_by: "Created by"
label_meeting_last_updated: "Last updated"

label_agenda_item_undisclosed_wp: "Undisclosed work package reference #%{id}"
label_agenda_item_undisclosed_wp: "Work package #%{id} not visible"
label_agenda_item_deleted_wp: "Deleted work package reference"
label_agenda_item_actions: "Agenda items actions"
label_agenda_item_move_to_top: "Move to top"
Expand Down
7 changes: 4 additions & 3 deletions modules/storages/spec/features/manage_project_storage_spec.rb
Expand Up @@ -34,9 +34,10 @@
# Setup storages in Project -> Settings -> File Storages
# This tests assumes that a Storage has already been setup
# in the Admin section, tested by admin_storage_spec.rb.
RSpec.describe(
'Activation of storages in projects', :js, :webmock
) do

# We decrease the notification polling interval because some portions of the JS code rely on something triggering
# the Angular change detection. This is usually done by the notification polling, but we don't want to wait
RSpec.describe 'Activation of storages in projects', :js, :webmock, with_settings: { notifications_polling_interval: 1_000 } do
let(:user) { create(:user) }
# The first page is the Project -> Settings -> General page, so we need
# to provide the user with the edit_project permission in the role.
Expand Down
Expand Up @@ -29,9 +29,11 @@
require 'spec_helper'
require_relative '../../support/onboarding/onboarding_steps'

RSpec.describe 'team planner onboarding tour', :js,
with_cuprite: false,
with_ee: %i[team_planner_view] do
RSpec.describe 'team planner onboarding tour', :js, with_cuprite: false, with_ee: %i[team_planner_view],
# We decrease the notification polling interval because some portions
# of the JS code rely on something triggering the Angular change detection.
# This is usually done by the notification polling, but we don't want to wait
with_settings: { notifications_polling_interval: 1_000 } do
let(:next_button) { find('.enjoyhint_next_btn') }

let(:demo_project) do
Expand Down
Expand Up @@ -2,7 +2,9 @@

RSpec.describe "Notification center", :js, :with_cuprite,
with_ee: %i[date_alerts],
with_settings: { journal_aggregation_time_minutes: 0 } do
# We decrease the notification polling interval because some portions of the JS code rely on something triggering
# the Angular change detection. This is usually done by the notification polling, but we don't want to wait
with_settings: { journal_aggregation_time_minutes: 0, notifications_polling_interval: 1_000 } do
# Notice that the setup in this file here is not following the normal rules as
# it also tests notification creation.
let!(:project1) { create(:project) }
Expand Down

0 comments on commit be085c3

Please sign in to comment.