Skip to content

Commit

Permalink
[46827] Custom project attribute triggers error when selected during …
Browse files Browse the repository at this point in the history
…project creation (#13095)

* while creating a new project the project context is projects and it should behave like global

* add a test for this bug fixing
  • Loading branch information
bsatarnejad committed Jul 17, 2023
1 parent b38eb4d commit dee3d81
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/app/core/current-user/current-user.service.ts
Expand Up @@ -83,7 +83,7 @@ export class CurrentUserService {
const filters:ApiV3ListFilter[] = [userFilter];

if (projectContext) {
filters.push(['context', '=', [projectContext === 'global' ? 'g' : `p${projectContext}`]]);
filters.push(['context', '=', [projectContext === 'global' || projectContext === 'projects' ? 'g' : `p${projectContext}`]]);
}

if (actions.length > 0) {
Expand Down
12 changes: 12 additions & 0 deletions spec/features/projects/projects_custom_fields_spec.rb
Expand Up @@ -275,5 +275,17 @@
cv = project.custom_values.find_by(custom_field_id: custom_field.id).typed_value
expect(cv).to eq invisible_user
end

it 'does not show invite user button when there is no project selected' do
visit new_project_path

name_field.set_value 'My project name'

find('.op-fieldset--toggle', text: 'ADVANCED SETTINGS').click

cf_field.expect_visible
cf_field.expect_no_option invisible_user
expect(page).not_to have_selector('.ng-dropdown-footer button', text: 'Invite')
end
end
end

0 comments on commit dee3d81

Please sign in to comment.