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

pull/9676/head
Oliver Günther 3 years ago
commit 46e5eb93f4
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 4
      config/initializers/carrierwave.rb
  2. 19
      config/locales/crowdin/id.yml
  3. 6
      lib/open_project/configuration/helpers.rb
  4. 2
      lib/open_project/enterprise.rb
  5. 67
      modules/bim/spec/features/revit_add_in/bim_revit_add_in_navigation_spec.rb
  6. 70
      modules/bim/spec/features/revit_add_in/bim_revit_add_in_refresh_button_spec.rb
  7. 8
      modules/bim/spec/support/pages/ifc_models/show_default.rb
  8. 47
      spec/lib/open_project/enterprise_spec.rb
  9. 6
      spec/support/pages/work_packages/work_package_cards.rb

@ -39,12 +39,12 @@ module CarrierWave
# Ensure that the provider AWS is uppercased
provider = credentials[:provider] || 'AWS'
if [:aws, 'aws'].include? provider
provider = 'AWS'
credentials[:provider] = 'AWS'
end
CarrierWave.configure do |config|
config.fog_provider = 'fog/aws'
config.fog_credentials = { provider: provider }.merge(credentials)
config.fog_credentials = credentials
config.fog_directory = directory
config.fog_public = public

@ -107,9 +107,9 @@ id:
contoh: uid=openproject,ou=system,dc=example,dc=com
system_user_password: Masukan password yang terikat dengan pengguna sistem
base_dn: |
Enter the Base DN of the subtree in LDAP you want OpenProject to look for users and groups.
OpenProject will filter for provided usernames in this subtree only.
Example: ou=users,dc=example,dc=com
Masukan Base DN dari subtree LDAP yang anda inginkan agar OpenProject dapat melihat pengguna dan grup.
OpenProject akan memfilter username pada subtree saja.
Contoh: users,dc=example,dc=com
filter_string: |
Add an optional RFC4515 filter to apply to the results returned for users filtered in the LDAP.
This can be used to restrict the set of users that are found by OpenProject for authentication and group synchronization.
@ -117,16 +117,15 @@ id:
OpenProject will always filter for the login attribute provided by the user to identify the record. If you provide a filter here,
it will be concatenated with an AND. By default, a catch-all (objectClass=*) will be used as a filter.
onthefly_register: |
If you check this box, OpenProject will automatically create new users from their LDAP entries
when they first authenticate with OpenProject.
Leave this unchecked to only allow existing accounts in OpenProject to authenticate through LDAP!
Jika anda ceklis box ini, OpenProject akan secara otomatis membuat pengguna baru dari seluruh LDAP saat pertamakali autentikasi dengan OpenProject.
Biarkan tidak terceklis untuk mengizinkan akun yang ada di OpenProject untuk mengautentikasi melalui LDAP!
connection_encryption: 'Enkripsi sambungan'
system_account: 'System account'
system_account: 'Akun sistem'
system_account_legend: |
OpenProject requires read-only access through a system account to lookup users and groups in your LDAP tree.
Please specify the bind credentials for that system user in the following section.
OpenProject membutuhkan akses hanya baca melalui akun sistem untuk melihat pengguna dan grup pada pohon LDAP anda.
Harap tentukan kredensial pengikatan untuk pengguna sistem tersebut di bagian berikut.
ldap_details: 'detil dari LDAP'
user_settings: 'Attribute mapping'
user_settings: 'Pemetaan atribut'
user_settings_legend: |
The following fields are related to how users are created in OpenProject from LDAP entries and
what LDAP attributes are used to define the attributes of an OpenProject user (attribute mapping).

@ -92,7 +92,11 @@ module OpenProject
end
def remote_storage_hosts
[remote_storage_upload_host, remote_storage_download_host].compact
[
fog_credentials[:host],
remote_storage_upload_host,
remote_storage_download_host
].compact
end
def attachments_storage_path

@ -61,7 +61,7 @@ module OpenProject
# While the active user limit has not been reached yet it would be reached
# if all registered and invited users were to activate their accounts.
def imminent_user_limit?
User.human.not_locked.count >= user_limit if user_limit
User.human.not_locked.count > user_limit if user_limit
end
def fail_fast?

@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
require_relative '../spec_helper'
require_relative '../../spec_helper'
describe 'BIM Revit Add-in navigation spec',
type: :feature,
@ -48,26 +48,26 @@ describe 'BIM Revit Add-in navigation spec',
end
context "when logged in on model page" do
let(:full_create) { ::Pages::FullWorkPackageCreate.new }
before do
login_as(user)
model_page.visit!
end
it 'shows "Cards" view by default' do
model_page.expect_view_toggle_at 'Cards'
# Guard to ensure toolbar is completely loaded and doesn't rerender again.
# At first there is no badge. It gets set later and only then the toolbar's
# switches are ready to test.
model_page.find('#work-packages-filter-toggle-button .badge', text: '1')
end
it 'shows no viewer' do
model_page.model_viewer_visible false
end
let(:full_create) { ::Pages::FullWorkPackageCreate.new }
it 'shows a toolbar' do
it 'show the right elements on the page' do
# shows "Cards" view by default
model_page.expect_view_toggle_at 'Cards'
# shows no viewer
model_page.model_viewer_visible false
# shows a toolbar' do
model_page.page_has_a_toolbar
end
it 'menu has no viewer options' do
# menu has no viewer options
model_page.has_no_menu_item_with_text? 'Viewer'
end
@ -89,15 +89,27 @@ describe 'BIM Revit Add-in navigation spec',
end
it 'shows work package details page in full view on Cards display mode' do
card_element = page.find('[data-qa-selector="op-wp-single-card"]')
card_element.hover
card_element.find('[data-qa-selector="op-wp-single-card--details-button"]').click
model_page.click_info_icon(work_package)
expect(page).to have_selector('.work-packages-partitioned-page--content-left', text: work_package.subject)
expect(page).to have_selector('.work-packages-partitioned-page--content-right', visible: false)
end
context 'with the table display mode' do
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }
it 'shows work package details page in full view on Table display mode' do
model_page.switch_view 'Table'
loading_indicator_saveguard
expect(page).to have_selector('.work-package-table')
wp_table.expect_work_package_listed work_package
wp_table.open_split_view work_package
expect(page).to have_selector('.work-packages-partitioned-page--content-left', text: work_package.subject)
expect(page).to have_selector('.work-packages-partitioned-page--content-right', visible: false)
end
end
end
context "when signed out" do
@ -109,25 +121,4 @@ describe 'BIM Revit Add-in navigation spec',
expect(page).to have_text(I18n.t('js.revit.revit_add_in_settings'))
end
end
context 'with the table display mode' do
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }
before do
login_as user
model_page.visit!
model_page.switch_view 'Table'
loading_indicator_saveguard
end
it 'shows work package details page in full view' do
expect(page).to have_selector('.work-package-table')
wp_table.expect_work_package_listed work_package
wp_table.open_split_view work_package
expect(page).to have_selector('.work-packages-partitioned-page--content-left', text: work_package.subject)
expect(page).to have_selector('.work-packages-partitioned-page--content-right', visible: :hidden)
end
end
end

@ -0,0 +1,70 @@
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.
#++
require_relative '../../spec_helper'
describe 'BIM Revit Add-in navigation spec',
type: :feature,
with_config: { edition: 'bim' },
js: true,
driver: :chrome_revit_add_in do
let(:project) { FactoryBot.create :project, enabled_module_names: %i[bim work_package_tracking] }
let!(:work_package) { FactoryBot.create(:work_package, project: project) }
let(:role) do
FactoryBot.create(:role,
permissions: %i[view_ifc_models manage_ifc_models add_work_packages edit_work_packages view_work_packages])
end
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }
let(:user) do
FactoryBot.create :user,
member_in_project: project,
member_through_role: role
end
let(:model_page) { ::Pages::IfcModels::ShowDefault.new(project) }
before do
login_as(user)
model_page.visit!
end
it 'click on refresh button reloads information' do
# Context BCF cards view
model_page.page_shows_a_filter_button(true)
work_package.update_attribute(:subject, 'Refreshed while in cards view')
model_page.click_refresh_button
expect(page).to have_text('Refreshed while in cards view')
# Context BCF full view
model_page.click_info_icon(work_package)
work_package.update_attribute(:subject, 'Refreshed while in full view')
model_page.click_refresh_button
expect(page).to have_text('Refreshed while in full view')
end
end

@ -85,6 +85,14 @@ module Pages
expect(page).to have_conditional_selector(visible, '.toolbar-item', text: 'Filter')
end
def page_shows_a_refresh_button(visible)
expect(page).to have_conditional_selector(visible, '.toolbar-item a.refresh-button')
end
def click_refresh_button
page.find('.toolbar-item a.refresh-button').click
end
def switch_view(value)
page.find('#bim-view-toggle-button').click
within('#bim-view-context-menu') do

@ -30,8 +30,6 @@ require 'spec_helper'
require 'open_project/passwords'
describe OpenProject::Enterprise do
describe "#user_limit_reached?" do
let(:user_limit) { 2 }
# create 3 built-in users, only 2 of which are active
# Also create a placeholder user which will not count against the limit
let!(:system_user) { User.system }
@ -39,12 +37,15 @@ describe OpenProject::Enterprise do
let!(:deleted_user) { DeletedUser.first } # locked, not active
let!(:placeholder_user) { FactoryBot.create(:placeholder_user) }
let(:user_limit) { 2 }
before do
allow(OpenProject::Enterprise)
.to receive(:user_limit)
.and_return(user_limit)
end
describe "#user_limit_reached?" do
context "with fewer active users than the limit allows" do
before do
FactoryBot.create :user
@ -85,4 +86,46 @@ describe OpenProject::Enterprise do
end
end
end
describe "#imminent_user_limit?" do
context "with the number of active + invited users below (or at) the user limit" do
shared_examples "user limit is not imminent" do
let(:num_invited_users) { 0 }
before do
FactoryBot.create :user
FactoryBot.create_list :invited_user, num_invited_users
expect(User.human.not_locked.count).to eq num_invited_users + 1
end
it "is true" do
expect(subject).not_to be_imminent_user_limit
end
end
context "(less)" do
it_behaves_like "user limit is not imminent" do
let(:num_invited_users) { 0 }
end
end
context "(equal)" do
it_behaves_like "user limit is not imminent" do
let(:num_invited_users) { 1 }
end
end
end
context "with the number of active + invited users over the user limit" do
before do
FactoryBot.create :user
FactoryBot.create_list :invited_user, user_limit
end
it "is true" do
expect(subject).to be_imminent_user_limit
end
end
end
end

@ -84,6 +84,12 @@ module Pages
card(work_package).click
end
def click_info_icon(work_package)
card_element = card(work_package)
card_element.hover
card_element.find('[data-qa-selector="op-wp-single-card--details-button"]').click
end
def deselect_work_package(work_package)
element = find("wp-single-card[data-work-package-id='#{work_package.id}']")

Loading…
Cancel
Save