[#43257] Fix Can not find users with the user creation/invitation form

https://community.openproject.org/work_packages/43257
fix/43259-the-list-style-in-the-nextcloud-section-is-not-correct
Dombi Attila 2 years ago committed by Oliver Günther
parent 997924fbaa
commit 367555397d
  1. 5
      frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.ts
  2. 11
      spec/features/users/invite_user_modal/invite_user_modal_spec.rb
  3. 8
      spec/support/components/users/invite_user_modal.rb

@ -1,4 +1,5 @@
import {
ChangeDetectionStrategy,
Component,
OnInit,
Input,
@ -16,6 +17,7 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import { BannersService } from 'core-app/core/enterprise/banners.service';
import { CurrentUserService } from 'core-app/core/current-user/current-user.service';
import { IOpOptionListOption } from 'core-app/shared/components/option-list/option-list.component';
import { cloneHalResource } from 'core-app/features/hal/helpers/hal-resource-builder';
import { ProjectResource } from 'core-app/features/hal/resources/project-resource';
import { PrincipalType } from '../invite-user.component';
import { ProjectAllowedValidator } from './project-allowed.validator';
@ -27,6 +29,7 @@ import idFromLink from 'core-app/features/hal/helpers/id-from-link';
@Component({
selector: 'op-ium-project-selection',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './project-selection.component.html',
styleUrls: ['./project-selection.component.sass'],
})
@ -94,7 +97,7 @@ export class ProjectSelectionComponent implements OnInit {
this.typeControl.setValue(this.type);
if (this.project) {
this.projectControl.setValue({ ...this.project });
this.projectControl.setValue(cloneHalResource<ProjectResource>(this.project));
}
this.setPlaceholderOption();

@ -56,10 +56,10 @@ describe 'Invite user modal', type: :feature, js: true do
global_permissions:
end
shared_examples 'invites the principal to the project' do
shared_examples 'invites the principal to the project' do |skip_project_autocomplete = false|
it 'invites that principal to the project' do
perform_enqueued_jobs do
modal.run_all_steps
modal.run_all_steps(skip_project_autocomplete:)
end
assignee_field.expect_inactive!
@ -153,6 +153,13 @@ describe 'Invite user modal', type: :feature, js: true do
let(:added_principal) { principal }
let(:mail_membership_recipients) { [principal] }
end
context 'when keeping the default project selection' do
it_behaves_like 'invites the principal to the project', skip_project_autocomplete: true do
let(:added_principal) { principal }
let(:mail_membership_recipients) { [principal] }
end
end
end
context 'with a user to be invited' do

@ -44,11 +44,11 @@ module Components
super()
end
def run_all_steps
def run_all_steps(skip_project_autocomplete: false)
expect_open
# STEP 1: Project and type
project_step
project_step(skip_autocomplete: skip_project_autocomplete)
# STEP 2: User name
principal_step
@ -90,9 +90,9 @@ module Components
expect_closed
end
def project_step(next_step: true)
def project_step(next_step: true, skip_autocomplete: false)
expect_title 'Invite user'
autocomplete project.name
autocomplete project.name unless skip_autocomplete
select_type type
click_next if next_step

Loading…
Cancel
Save