diff --git a/frontend/src/app/components/modals/save-modal/save-query.modal.html b/frontend/src/app/components/modals/save-modal/save-query.modal.html index ec14ff8bb5..2bfd0b6f5b 100644 --- a/frontend/src/app/components/modals/save-modal/save-query.modal.html +++ b/frontend/src/app/components/modals/save-modal/save-query.modal.html @@ -12,8 +12,9 @@ +

+
-

diff --git a/frontend/src/app/components/modals/share-modal/query-sharing-form.component.ts b/frontend/src/app/components/modals/share-modal/query-sharing-form.component.ts index 9602dae6ef..12e53af44c 100644 --- a/frontend/src/app/components/modals/share-modal/query-sharing-form.component.ts +++ b/frontend/src/app/components/modals/share-modal/query-sharing-form.component.ts @@ -37,7 +37,7 @@ export class QuerySharingForm { public get canPublish() { const form = this.states.query.form.value!; - return this.authorisationService.can('query', 'saveImmediately') + return this.authorisationService.can('query', 'updateImmediately') && form.schema.public.writable; } diff --git a/spec/features/work_packages/table/queries/query_menu_spec.rb b/spec/features/work_packages/table/queries/query_menu_spec.rb index 7f6241e4ca..42d9e25699 100644 --- a/spec/features/work_packages/table/queries/query_menu_spec.rb +++ b/spec/features/work_packages/table/queries/query_menu_spec.rb @@ -50,6 +50,23 @@ describe 'Query menu item', js: true do wp_table.visit! end + it 'allows to save query as name with sharing options (Regression #27915)' do + # Publish query + wp_table.click_setting_item 'Save as' + + fill_in 'save-query-name', with: 'Some query name' + find('#show-in-menu').set true + find('#show-public').set true + + find('.button', text: 'Save').click + + wp_table.expect_notification message: 'Successful creation.' + expect(page).to have_selector('.query-menu-item', text: 'Some query name') + + last_query = Query.last + expect(last_query.is_public).to be_truthy + end + it 'allows filtering, saving, retrieving and altering the saved filter (Regression #25372)' do filters.open filters.add_filter_by('Version', 'is', version.name)