Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Rename query-select to view-select as it should work on views instead of queries in the future

Henriette Dargef077d36ebf40
diff --git a/app/views/work_packages/_menu_query_select.html.erb b/app/views/work_packages/_menu_query_select.html.erb
index ca34e91ef0b..991c4722598 100644
--- a/app/views/work_packages/_menu_query_select.html.erb
+++ b/app/views/work_packages/_menu_query_select.html.erb
@@ -1,5 +1,5 @@
<%=
- angular_component_tag 'op-query-select',
+ angular_component_tag 'op-view-select',
inputs: {
projectIdentifier: (@project ? @project.identifier : ''),
menuItems: [parent_name, name],
diff --git a/frontend/src/app/core/apiv3/endpoints/views/apiv3-views-paths.ts b/frontend/src/app/core/apiv3/endpoints/views/apiv3-views-paths.ts
index 81148dd1afe..155e59e6b45 100644
--- a/frontend/src/app/core/apiv3/endpoints/views/apiv3-views-paths.ts
+++ b/frontend/src/app/core/apiv3/endpoints/views/apiv3-views-paths.ts
@@ -47,7 +47,8 @@ export class APIv3ViewsPaths extends APIv3ResourceCollection<View, APIv3Gettable
/**
* Create a new view
*
- * @param TODO
+ * @param resource
+ * @param type The query's view type
*/
post(resource:ViewCreatePayload, type:string):Observable<View> {
return this
diff --git a/frontend/src/app/core/setup/global-dynamic-components.const.ts b/frontend/src/app/core/setup/global-dynamic-components.const.ts
index ebcc94bd920..cb9a839d3ac 100644
--- a/frontend/src/app/core/setup/global-dynamic-components.const.ts
+++ b/frontend/src/app/core/setup/global-dynamic-components.const.ts
@@ -98,9 +98,9 @@ import {
wpOverviewGraphSelector,
} from 'core-app/shared/components/work-package-graphs/overview/wp-overview-graph.component';
import {
- opQuerySelectSelector,
- QuerySelectComponent,
-} from 'core-app/shared/components/op-query-select/op-query-select.component';
+ opViewSelectSelector,
+ ViewSelectComponent,
+} from 'core-app/shared/components/op-view-select/op-view-select.component';
import {
GlobalSearchTitleComponent,
globalSearchTitleSelector,
@@ -223,7 +223,7 @@ export const globalDynamicComponents:OptionalBootstrapDefinition[] = [
{ selector: projectMenuAutocompleteSelector, cls: ProjectMenuAutocompleteComponent },
{ selector: remoteFieldUpdaterSelector, cls: RemoteFieldUpdaterComponent },
{ selector: wpOverviewGraphSelector, cls: WorkPackageOverviewGraphComponent },
- { selector: opQuerySelectSelector, cls: QuerySelectComponent },
+ { selector: opViewSelectSelector, cls: ViewSelectComponent },
{ selector: triggerActionsEntryComponentSelector, cls: TriggerActionsEntryComponent, embeddable: true },
{ selector: backlogsPageComponentSelector, cls: BacklogsPageComponent },
{ selector: attributeValueMacro, cls: AttributeValueMacroComponent, embeddable: true },
diff --git a/frontend/src/app/features/work-packages/routing/wp-view-base/work-packages-view.base.ts b/frontend/src/app/features/work-packages/routing/wp-view-base/work-packages-view.base.ts
index d531e4a8da2..99645152c05 100644
--- a/frontend/src/app/features/work-packages/routing/wp-view-base/work-packages-view.base.ts
+++ b/frontend/src/app/features/work-packages/routing/wp-view-base/work-packages-view.base.ts
@@ -35,7 +35,7 @@ import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/q
import { filter, take, withLatestFrom } from 'rxjs/operators';
import { LoadingIndicatorService } from 'core-app/core/loading-indicator/loading-indicator.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { StaticQueriesService } from 'core-app/shared/components/op-query-select/op-static-queries.service';
+import { StaticQueriesService } from 'core-app/shared/components/op-view-select/op-static-queries.service';
import { WorkPackageViewHighlightingService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-highlighting.service';
import { States } from 'core-app/core/states/states.service';
import { WorkPackageViewColumnsService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service';
diff --git a/frontend/src/app/shared/components/op-query-select/op-static-queries.service.ts b/frontend/src/app/shared/components/op-view-select/op-static-queries.service.ts
similarity index 100%
rename from frontend/src/app/shared/components/op-query-select/op-static-queries.service.ts
rename to frontend/src/app/shared/components/op-view-select/op-static-queries.service.ts
diff --git a/frontend/src/app/shared/components/op-query-select/op-query-select.component.ts b/frontend/src/app/shared/components/op-view-select/op-view-select.component.ts
similarity index 93%
rename from frontend/src/app/shared/components/op-query-select/op-query-select.component.ts
rename to frontend/src/app/shared/components/op-view-select/op-view-select.component.ts
index c7f42de0332..8100f2bb64e 100644
--- a/frontend/src/app/shared/components/op-query-select/op-query-select.component.ts
+++ b/frontend/src/app/shared/components/op-view-select/op-view-select.component.ts
@@ -48,17 +48,17 @@ import { MainMenuNavigationService } from 'core-app/core/main-menu/main-menu-nav
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { IOpSidemenuItem } from 'core-app/shared/components/sidemenu/sidemenu.component';
import { QueryResource } from 'core-app/features/hal/resources/query-resource';
-import { StaticQueriesService } from 'core-app/shared/components/op-query-select/op-static-queries.service';
+import { StaticQueriesService } from 'core-app/shared/components/op-view-select/op-static-queries.service';
-export const opQuerySelectSelector = 'op-query-select';
+export const opViewSelectSelector = 'op-view-select';
@DatasetInputs
@Component({
- selector: opQuerySelectSelector,
+ selector: opViewSelectSelector,
changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './op-query-select.template.html',
+ templateUrl: './op-view-select.template.html',
})
-export class QuerySelectComponent extends UntilDestroyedMixin implements OnInit {
+export class ViewSelectComponent extends UntilDestroyedMixin implements OnInit {
public text = {
search: this.I18n.t('js.toolbar.search_query_label'),
label: this.I18n.t('js.toolbar.search_query_label'),
@@ -115,12 +115,12 @@ export class QuerySelectComponent extends UntilDestroyedMixin implements OnInit
.pipe(
map(([searchText, categories]) => categories
.map((category) => {
- if (QuerySelectComponent.matchesText(category.title, searchText)) {
+ if (ViewSelectComponent.matchesText(category.title, searchText)) {
return category;
}
const filteredChildren = category.children
- ?.filter((query) => QuerySelectComponent.matchesText(query.title, searchText));
+ ?.filter((query) => ViewSelectComponent.matchesText(query.title, searchText));
return { title: category.title, children: filteredChildren, collapsible: true };
})
.filter((category) => category.children && category.children.length > 0)),
diff --git a/frontend/src/app/shared/components/op-query-select/op-query-select.template.html b/frontend/src/app/shared/components/op-view-select/op-view-select.template.html
similarity index 95%
rename from frontend/src/app/shared/components/op-query-select/op-query-select.template.html
rename to frontend/src/app/shared/components/op-view-select/op-view-select.template.html
index c9ed5dac4cf..7668ac34fe7 100644
--- a/frontend/src/app/shared/components/op-query-select/op-query-select.template.html
+++ b/frontend/src/app/shared/components/op-view-select/op-view-select.template.html
@@ -18,7 +18,7 @@
[textContent]="text.no_results"></p>
<op-sidemenu
- class="op-query-select--search-results"
+ class="op-view-select--search-results"
[items]="$queries | async"
[collapsible]="true"
[searchable]="true"
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 38348ddff9e..c5f6b65e419 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -57,8 +57,8 @@ import { EnterpriseBannerBootstrapComponent } from 'core-app/shared/components/e
import { HomescreenNewFeaturesBlockComponent } from 'core-app/features/homescreen/blocks/new-features.component';
import { TablePaginationComponent } from 'core-app/shared/components/table-pagination/table-pagination.component';
import { HookService } from 'core-app/features/plugins/hook-service';
-import { QuerySelectComponent } from 'core-app/shared/components/op-query-select/op-query-select.component';
-import { StaticQueriesService } from 'core-app/shared/components/op-query-select/op-static-queries.service';
+import { ViewSelectComponent } from 'core-app/shared/components/op-view-select/op-view-select.component';
+import { StaticQueriesService } from 'core-app/shared/components/op-view-select/op-static-queries.service';
import {
highlightColSelector,
OpHighlightColDirective,
@@ -193,7 +193,7 @@ export function bootstrapModule(injector:Injector) {
],
declarations: [
OpDateTimeComponent,
- QuerySelectComponent,
+ ViewSelectComponent,
ToastsContainerComponent,
ToastComponent,
diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/_panels.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_panels.html.erb
index 3c0cc78bd05..c9408a151b2 100644
--- a/modules/bim/app/views/bim/ifc_models/ifc_models/_panels.html.erb
+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/_panels.html.erb
@@ -1,6 +1,6 @@
<div class="op-ifc-viewer--sidemenu">
<%=
- angular_component_tag 'op-query-select',
+ angular_component_tag 'op-view-select',
inputs: {
projectIdentifier: (@project ? @project.identifier : ''),
menuItems: [parent_name, name],
diff --git a/spec/features/work_packages/navigation_spec.rb b/spec/features/work_packages/navigation_spec.rb
index ce5d4d8e885..4acae44fc20 100644
--- a/spec/features/work_packages/navigation_spec.rb
+++ b/spec/features/work_packages/navigation_spec.rb
@@ -158,7 +158,7 @@ RSpec.feature 'Work package navigation', js: true, selenium: true do
visit project_path(project)
find('#main-menu-work-packages ~ .toggler').click
- expect(page).to have_selector('.op-query-select--search-results')
+ expect(page).to have_selector('.op-view-select--search-results')
find('.op-sidemenu--item-action', text: query.name).click
expect(page).not_to have_selector('.title-container', text: 'Overview')
diff --git a/spec/features/work_packages/table/queries/hidden_query_spec.rb b/spec/features/work_packages/table/queries/hidden_query_spec.rb
index c97b45dc3bf..6867e3c791c 100644
--- a/spec/features/work_packages/table/queries/hidden_query_spec.rb
+++ b/spec/features/work_packages/table/queries/hidden_query_spec.rb
@@ -16,7 +16,7 @@ describe 'Visiting a hidden query', js: true do
end
it 'does not render the hidden query' do
- expect(page).to have_selector('.op-query-select--search-results')
+ expect(page).to have_selector('.op-view-select--search-results')
expect(page).to have_no_selector('.op-sidemenu--item-action', text: 'my hidden query')
query.update(name: 'my visible query', hidden: false)
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 ec8f3b4d989..bcd6b8c8648 100644
--- a/spec/features/work_packages/table/queries/query_menu_spec.rb
+++ b/spec/features/work_packages/table/queries/query_menu_spec.rb
@@ -43,7 +43,7 @@ describe 'Query menu item', js: true do
let(:wp_table) { ::Pages::WorkPackagesTable.new }
it 'should show the query menu (Regression #30082)' do
wp_table.visit!
- expect(page).to have_selector('.op-query-select--search-results')
+ expect(page).to have_selector('.op-view-select--search-results')
expect(page).to have_selector('.op-sidemenu--item-action', wait: 20, minimum: 1)
end
end
diff --git a/spec/support/components/work_packages/query_menu.rb b/spec/support/components/work_packages/query_menu.rb
index 70367985715..914fd0aa97a 100644
--- a/spec/support/components/work_packages/query_menu.rb
+++ b/spec/support/components/work_packages/query_menu.rb
@@ -47,7 +47,7 @@ module Components
end
def autocompleter_results_selector
- '.op-query-select--search-results'
+ '.op-view-select--search-results'
end
def autocompleter_item_selector