Skip to content

Commit 2054bd2

Browse files
authored
Merge branch 'main' into footer-link
2 parents 36d5e58 + c02da74 commit 2054bd2

10 files changed

Lines changed: 539 additions & 55 deletions

File tree

frontend/cypress/tests/main/workspace-search-dialog.cy.js

Lines changed: 81 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
// Tests for the workspace search dialog local/global scope switch
2-
// (ticket #426): inside a workspace the Workspace chip scopes the
3-
// livesearch and the Enter results page to the workspace subtree by
4-
// default; selecting "Intranet Portal" widens to a global search.
1+
// Tests for the workspace search dialog scope switch (tickets #426 and
2+
// #570): inside a workspace the Workspace chip scopes the livesearch
3+
// and the Enter results page to the workspace subtree by default; the
4+
// chip's dropdown offers "Everywhere" plus every workspace the user
5+
// can access. Result rows carry a location label, and an empty scoped
6+
// search offers a one-click "Search everywhere" escape.
57
//
68
// The AI parts ("Ask AI") are not covered here: the acceptance backend
79
// has no LLM configured, so rag_available is false and the button is
810
// hidden by design (graceful degradation).
911
//
1012
// The solr setup follows the style of search-persons.cy.js.
1113

12-
context('Workspace search dialog (local/global scope)', () => {
14+
context('Workspace search dialog (scope dropdown)', () => {
1315
beforeEach(() => {
1416
// The solr connection parameters are provided by the COLLECTIVE_SOLR_*
1517
// environment variables (docker compose setup) or by the registry
@@ -28,7 +30,19 @@ context('Workspace search dialog (local/global scope)', () => {
2830
contentTitle: 'Vacation rules of the GreenCat team',
2931
path: '/greencat',
3032
});
31-
// content outside the workspace, matching the same search term
33+
// a second workspace, to pick from the scope dropdown
34+
cy.createContent({
35+
contentType: 'Workspace',
36+
contentId: 'quantum',
37+
contentTitle: 'Quantum Workspace',
38+
});
39+
cy.createContent({
40+
contentType: 'WikiPage',
41+
contentId: 'vacation-quantum',
42+
contentTitle: 'Vacation policy of the Quantum group',
43+
path: '/quantum',
44+
});
45+
// content outside the workspaces, matching the same search term
3246
cy.createContent({
3347
contentType: 'Document',
3448
contentId: 'vacation-form',
@@ -42,7 +56,7 @@ context('Workspace search dialog (local/global scope)', () => {
4256
cy.clearSolr();
4357
});
4458

45-
it('scopes the livesearch to the workspace and can widen to global', () => {
59+
it('scopes the livesearch to the workspace and can widen to everywhere', () => {
4660
cy.visit('/greencat');
4761
cy.get('.header-search-button').click();
4862
cy.get('.header-search-input-row input').type('vacation');
@@ -56,14 +70,66 @@ context('Workspace search dialog (local/global scope)', () => {
5670
'Workspace: GreenCat Workspace',
5771
);
5872

59-
// switch the Workspace chip to Intranet Portal -> global results
73+
// the dropdown lists Everywhere plus all workspaces
74+
cy.get('.header-search-chip').contains('Workspace:').click();
75+
cy.get('.header-search-scope-menu').contains('Search in all areas');
76+
cy.get('.header-search-scope-menu').contains('GreenCat Workspace');
77+
cy.get('.header-search-scope-menu').contains('Quantum Workspace');
78+
79+
// switch to Everywhere -> global results with location labels
80+
cy.get('.header-search-scope-menu .react-aria-MenuItem')
81+
.contains('Everywhere')
82+
.click();
83+
cy.get('.header-search-result-title').should('have.length.at.least', 3);
84+
cy.get('.header-search-chip').contains('Workspace: Everywhere');
85+
cy.contains('.header-search-result', 'Vacation request form')
86+
.find('.header-search-result-location')
87+
.contains('Intranet Portal');
88+
cy.contains('.header-search-result', 'Vacation rules of the GreenCat team')
89+
.find('.header-search-result-location')
90+
.contains('GreenCat Workspace');
91+
});
92+
93+
it('scopes the livesearch to another workspace picked from the dropdown', () => {
94+
cy.visit('/greencat');
95+
cy.get('.header-search-button').click();
96+
cy.get('.header-search-input-row input').type('vacation');
97+
cy.get('.header-search-result-title').should('have.length', 1);
98+
6099
cy.get('.header-search-chip').contains('Workspace:').click();
61-
cy.get('.header-search-chip-menu .react-aria-MenuItem')
62-
.contains('Intranet Portal')
100+
cy.get('.header-search-scope-menu .react-aria-MenuItem')
101+
.contains('Quantum Workspace')
63102
.click();
64-
cy.get('.header-search-result-title').should('have.length.at.least', 2);
103+
104+
cy.get('.header-search-result-title').should('have.length', 1);
105+
cy.get('.header-search-result-title').contains(
106+
'Vacation policy of the Quantum group',
107+
);
108+
cy.get('.header-search-chip.is-active').contains(
109+
'Workspace: Quantum Workspace',
110+
);
111+
112+
// Enter goes to the picked workspace's scoped results page
113+
cy.get('.header-search-input-row input').type('{enter}');
114+
cy.url().should('include', '/quantum/@@search');
115+
cy.url().should('include', 'local=true');
116+
cy.contains('Vacation policy of the Quantum group');
117+
cy.contains('Vacation rules of the GreenCat team').should('not.exist');
118+
});
119+
120+
it('offers "Search everywhere" when the scoped search is empty', () => {
121+
cy.visit('/greencat');
122+
cy.get('.header-search-button').click();
123+
// "request" only matches the portal document, not the workspace
124+
cy.get('.header-search-input-row input').type('request');
125+
126+
cy.get('.header-search-no-results').contains(
127+
'No results in “GreenCat Workspace”.',
128+
);
129+
cy.get('.header-search-widen').contains('Search everywhere').click();
130+
65131
cy.get('.header-search-result-title').contains('Vacation request form');
66-
cy.get('.header-search-chip').contains('Workspace: Intranet Portal');
132+
cy.get('.header-search-chip').contains('Workspace: Everywhere');
67133
});
68134

69135
it('Enter opens the workspace-scoped results page without a local toggle', () => {
@@ -81,13 +147,13 @@ context('Workspace search dialog (local/global scope)', () => {
81147
cy.get('.search-localized').should('not.exist');
82148
});
83149

84-
it('Enter searches globally when Intranet Portal is selected', () => {
150+
it('Enter searches globally when Everywhere is selected', () => {
85151
cy.visit('/greencat');
86152
cy.get('.header-search-button').click();
87153
cy.get('.header-search-input-row input').type('vacation');
88154
cy.get('.header-search-chip').contains('Workspace:').click();
89-
cy.get('.header-search-chip-menu .react-aria-MenuItem')
90-
.contains('Intranet Portal')
155+
cy.get('.header-search-scope-menu .react-aria-MenuItem')
156+
.contains('Everywhere')
91157
.click();
92158
cy.get('.header-search-input-row input').type('{enter}');
93159

frontend/packages/kitconcept-intranet/locales/de/LC_MESSAGES/volto.po

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ msgstr "Fehler"
189189
msgid "Event"
190190
msgstr "Termin"
191191

192+
#. Default: "Everywhere"
193+
#: components/Header/HeaderSearch
194+
msgid "Everywhere"
195+
msgstr "Überall"
196+
192197
#. Default: "Expand sidebar"
193198
#: components/ContentReviewSidebar/ReviewSidebar
194199
msgid "Expand sidebar"
@@ -354,6 +359,11 @@ msgstr "Keine Antwort — keine passenden Dokumente gefunden."
354359
msgid "No results for “{term}”."
355360
msgstr "Keine Ergebnisse für „{term}“."
356361

362+
#. Default: "No results in “{scope}”."
363+
#: components/Header/HeaderSearch
364+
msgid "No results in “{scope}”."
365+
msgstr "Keine Ergebnisse in „{scope}“."
366+
357367
#. Default: "No selection"
358368
#: components/widgets/QuerystringWidget
359369
msgid "No selection"
@@ -458,6 +468,16 @@ msgstr "Raum"
458468
msgid "Search"
459469
msgstr ""
460470

471+
#. Default: "Search everywhere"
472+
#: components/Header/HeaderSearch
473+
msgid "Search everywhere"
474+
msgstr "Überall suchen"
475+
476+
#. Default: "Search in all areas"
477+
#: components/Header/HeaderSearch
478+
msgid "Search in all areas"
479+
msgstr "In allen Bereichen suchen"
480+
461481
#. Default: "Search titles only"
462482
#: components/Header/HeaderSearch
463483
msgid "Search titles only"

frontend/packages/kitconcept-intranet/locales/en/LC_MESSAGES/volto.po

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ msgstr ""
189189
msgid "Event"
190190
msgstr ""
191191

192+
#. Default: "Everywhere"
193+
#: components/Header/HeaderSearch
194+
msgid "Everywhere"
195+
msgstr ""
196+
192197
#. Default: "Expand sidebar"
193198
#: components/ContentReviewSidebar/ReviewSidebar
194199
msgid "Expand sidebar"
@@ -354,6 +359,11 @@ msgstr ""
354359
msgid "No results for “{term}”."
355360
msgstr ""
356361

362+
#. Default: "No results in “{scope}”."
363+
#: components/Header/HeaderSearch
364+
msgid "No results in “{scope}”."
365+
msgstr ""
366+
357367
#. Default: "No selection"
358368
#: components/widgets/QuerystringWidget
359369
msgid "No selection"
@@ -458,6 +468,16 @@ msgstr ""
458468
msgid "Search"
459469
msgstr ""
460470

471+
#. Default: "Search everywhere"
472+
#: components/Header/HeaderSearch
473+
msgid "Search everywhere"
474+
msgstr ""
475+
476+
#. Default: "Search in all areas"
477+
#: components/Header/HeaderSearch
478+
msgid "Search in all areas"
479+
msgstr ""
480+
461481
#. Default: "Search titles only"
462482
#: components/Header/HeaderSearch
463483
msgid "Search titles only"

frontend/packages/kitconcept-intranet/locales/es/LC_MESSAGES/volto.po

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ msgstr ""
196196
msgid "Event"
197197
msgstr ""
198198

199+
#. Default: "Everywhere"
200+
#: components/Header/HeaderSearch
201+
msgid "Everywhere"
202+
msgstr ""
203+
199204
#. Default: "Expand sidebar"
200205
#: components/ContentReviewSidebar/ReviewSidebar
201206
msgid "Expand sidebar"
@@ -361,6 +366,11 @@ msgstr ""
361366
msgid "No results for “{term}”."
362367
msgstr ""
363368

369+
#. Default: "No results in “{scope}”."
370+
#: components/Header/HeaderSearch
371+
msgid "No results in “{scope}”."
372+
msgstr ""
373+
364374
#. Default: "No selection"
365375
#: components/widgets/QuerystringWidget
366376
msgid "No selection"
@@ -465,6 +475,16 @@ msgstr ""
465475
msgid "Search"
466476
msgstr ""
467477

478+
#. Default: "Search everywhere"
479+
#: components/Header/HeaderSearch
480+
msgid "Search everywhere"
481+
msgstr ""
482+
483+
#. Default: "Search in all areas"
484+
#: components/Header/HeaderSearch
485+
msgid "Search in all areas"
486+
msgstr ""
487+
468488
#. Default: "Search titles only"
469489
#: components/Header/HeaderSearch
470490
msgid "Search titles only"

frontend/packages/kitconcept-intranet/locales/pt_BR/LC_MESSAGES/volto.po

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ msgstr "Erro"
194194
msgid "Event"
195195
msgstr ""
196196

197+
#. Default: "Everywhere"
198+
#: components/Header/HeaderSearch
199+
msgid "Everywhere"
200+
msgstr ""
201+
197202
#. Default: "Expand sidebar"
198203
#: components/ContentReviewSidebar/ReviewSidebar
199204
msgid "Expand sidebar"
@@ -359,6 +364,11 @@ msgstr ""
359364
msgid "No results for “{term}”."
360365
msgstr ""
361366

367+
#. Default: "No results in “{scope}”."
368+
#: components/Header/HeaderSearch
369+
msgid "No results in “{scope}”."
370+
msgstr ""
371+
362372
#. Default: "No selection"
363373
#: components/widgets/QuerystringWidget
364374
msgid "No selection"
@@ -463,6 +473,16 @@ msgstr "Sala"
463473
msgid "Search"
464474
msgstr ""
465475

476+
#. Default: "Search everywhere"
477+
#: components/Header/HeaderSearch
478+
msgid "Search everywhere"
479+
msgstr ""
480+
481+
#. Default: "Search in all areas"
482+
#: components/Header/HeaderSearch
483+
msgid "Search in all areas"
484+
msgstr ""
485+
466486
#. Default: "Search titles only"
467487
#: components/Header/HeaderSearch
468488
msgid "Search titles only"

frontend/packages/kitconcept-intranet/locales/volto.pot

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: Plone\n"
4-
"POT-Creation-Date: 2026-07-30T17:17:45.797Z\n"
4+
"POT-Creation-Date: 2026-08-05T11:38:01.716Z\n"
55
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
66
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
77
"Content-Type: text/plain; charset=utf-8\n"
@@ -191,6 +191,11 @@ msgstr ""
191191
msgid "Event"
192192
msgstr ""
193193

194+
#. Default: "Everywhere"
195+
#: components/Header/HeaderSearch
196+
msgid "Everywhere"
197+
msgstr ""
198+
194199
#. Default: "Expand sidebar"
195200
#: components/ContentReviewSidebar/ReviewSidebar
196201
msgid "Expand sidebar"
@@ -356,6 +361,11 @@ msgstr ""
356361
msgid "No results for “{term}”."
357362
msgstr ""
358363

364+
#. Default: "No results in “{scope}”."
365+
#: components/Header/HeaderSearch
366+
msgid "No results in “{scope}”."
367+
msgstr ""
368+
359369
#. Default: "No selection"
360370
#: components/widgets/QuerystringWidget
361371
msgid "No selection"
@@ -460,6 +470,16 @@ msgstr ""
460470
msgid "Search"
461471
msgstr ""
462472

473+
#. Default: "Search everywhere"
474+
#: components/Header/HeaderSearch
475+
msgid "Search everywhere"
476+
msgstr ""
477+
478+
#. Default: "Search in all areas"
479+
#: components/Header/HeaderSearch
480+
msgid "Search in all areas"
481+
msgstr ""
482+
463483
#. Default: "Search titles only"
464484
#: components/Header/HeaderSearch
465485
msgid "Search titles only"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Workspace search dialog: the Workspace chip opens a scope dropdown - search everywhere or in any workspace you can access; result rows show their location and an empty scoped search offers "Search everywhere". @reebalazs

0 commit comments

Comments
 (0)