Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 81 additions & 15 deletions frontend/cypress/tests/main/workspace-search-dialog.cy.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// Tests for the workspace search dialog local/global scope switch
// (ticket #426): inside a workspace the Workspace chip scopes the
// livesearch and the Enter results page to the workspace subtree by
// default; selecting "Intranet Portal" widens to a global search.
// Tests for the workspace search dialog scope switch (tickets #426 and
// #570): inside a workspace the Workspace chip scopes the livesearch
// and the Enter results page to the workspace subtree by default; the
// chip's dropdown offers "Everywhere" plus every workspace the user
// can access. Result rows carry a location label, and an empty scoped
// search offers a one-click "Search everywhere" escape.
//
// The AI parts ("Ask AI") are not covered here: the acceptance backend
// has no LLM configured, so rag_available is false and the button is
// hidden by design (graceful degradation).
//
// The solr setup follows the style of search-persons.cy.js.

context('Workspace search dialog (local/global scope)', () => {
context('Workspace search dialog (scope dropdown)', () => {
beforeEach(() => {
// The solr connection parameters are provided by the COLLECTIVE_SOLR_*
// environment variables (docker compose setup) or by the registry
Expand All @@ -28,7 +30,19 @@ context('Workspace search dialog (local/global scope)', () => {
contentTitle: 'Vacation rules of the GreenCat team',
path: '/greencat',
});
// content outside the workspace, matching the same search term
// a second workspace, to pick from the scope dropdown
cy.createContent({
contentType: 'Workspace',
contentId: 'quantum',
contentTitle: 'Quantum Workspace',
});
cy.createContent({
contentType: 'WikiPage',
contentId: 'vacation-quantum',
contentTitle: 'Vacation policy of the Quantum group',
path: '/quantum',
});
// content outside the workspaces, matching the same search term
cy.createContent({
contentType: 'Document',
contentId: 'vacation-form',
Expand All @@ -42,7 +56,7 @@ context('Workspace search dialog (local/global scope)', () => {
cy.clearSolr();
});

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

// switch the Workspace chip to Intranet Portal -> global results
// the dropdown lists Everywhere plus all workspaces
cy.get('.header-search-chip').contains('Workspace:').click();
cy.get('.header-search-scope-menu').contains('Search in all areas');
cy.get('.header-search-scope-menu').contains('GreenCat Workspace');
cy.get('.header-search-scope-menu').contains('Quantum Workspace');

// switch to Everywhere -> global results with location labels
cy.get('.header-search-scope-menu .react-aria-MenuItem')
.contains('Everywhere')
.click();
cy.get('.header-search-result-title').should('have.length.at.least', 3);
cy.get('.header-search-chip').contains('Workspace: Everywhere');
cy.contains('.header-search-result', 'Vacation request form')
.find('.header-search-result-location')
.contains('Intranet Portal');
cy.contains('.header-search-result', 'Vacation rules of the GreenCat team')
.find('.header-search-result-location')
.contains('GreenCat Workspace');
});

it('scopes the livesearch to another workspace picked from the dropdown', () => {
cy.visit('/greencat');
cy.get('.header-search-button').click();
cy.get('.header-search-input-row input').type('vacation');
cy.get('.header-search-result-title').should('have.length', 1);

cy.get('.header-search-chip').contains('Workspace:').click();
cy.get('.header-search-chip-menu .react-aria-MenuItem')
.contains('Intranet Portal')
cy.get('.header-search-scope-menu .react-aria-MenuItem')
.contains('Quantum Workspace')
.click();
cy.get('.header-search-result-title').should('have.length.at.least', 2);

cy.get('.header-search-result-title').should('have.length', 1);
cy.get('.header-search-result-title').contains(
'Vacation policy of the Quantum group',
);
cy.get('.header-search-chip.is-active').contains(
'Workspace: Quantum Workspace',
);

// Enter goes to the picked workspace's scoped results page
cy.get('.header-search-input-row input').type('{enter}');
cy.url().should('include', '/quantum/@@search');
cy.url().should('include', 'local=true');
cy.contains('Vacation policy of the Quantum group');
cy.contains('Vacation rules of the GreenCat team').should('not.exist');
});

it('offers "Search everywhere" when the scoped search is empty', () => {
cy.visit('/greencat');
cy.get('.header-search-button').click();
// "request" only matches the portal document, not the workspace
cy.get('.header-search-input-row input').type('request');

cy.get('.header-search-no-results').contains(
'No results in “GreenCat Workspace”.',
);
cy.get('.header-search-widen').contains('Search everywhere').click();

cy.get('.header-search-result-title').contains('Vacation request form');
cy.get('.header-search-chip').contains('Workspace: Intranet Portal');
cy.get('.header-search-chip').contains('Workspace: Everywhere');
});

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

it('Enter searches globally when Intranet Portal is selected', () => {
it('Enter searches globally when Everywhere is selected', () => {
cy.visit('/greencat');
cy.get('.header-search-button').click();
cy.get('.header-search-input-row input').type('vacation');
cy.get('.header-search-chip').contains('Workspace:').click();
cy.get('.header-search-chip-menu .react-aria-MenuItem')
.contains('Intranet Portal')
cy.get('.header-search-scope-menu .react-aria-MenuItem')
.contains('Everywhere')
.click();
cy.get('.header-search-input-row input').type('{enter}');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ msgstr "Fehler"
msgid "Event"
msgstr "Termin"

#. Default: "Everywhere"
#: components/Header/HeaderSearch
msgid "Everywhere"
msgstr "Überall"

#. Default: "Expand sidebar"
#: components/ContentReviewSidebar/ReviewSidebar
msgid "Expand sidebar"
Expand Down Expand Up @@ -354,6 +359,11 @@ msgstr "Keine Antwort — keine passenden Dokumente gefunden."
msgid "No results for “{term}”."
msgstr "Keine Ergebnisse für „{term}“."

#. Default: "No results in “{scope}”."
#: components/Header/HeaderSearch
msgid "No results in “{scope}”."
msgstr "Keine Ergebnisse in „{scope}“."

#. Default: "No selection"
#: components/widgets/QuerystringWidget
msgid "No selection"
Expand Down Expand Up @@ -458,6 +468,16 @@ msgstr "Raum"
msgid "Search"
msgstr ""

#. Default: "Search everywhere"
#: components/Header/HeaderSearch
msgid "Search everywhere"
msgstr "Überall suchen"

#. Default: "Search in all areas"
#: components/Header/HeaderSearch
msgid "Search in all areas"
msgstr "In allen Bereichen suchen"

#. Default: "Search titles only"
#: components/Header/HeaderSearch
msgid "Search titles only"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ msgstr ""
msgid "Event"
msgstr ""

#. Default: "Everywhere"
#: components/Header/HeaderSearch
msgid "Everywhere"
msgstr ""

#. Default: "Expand sidebar"
#: components/ContentReviewSidebar/ReviewSidebar
msgid "Expand sidebar"
Expand Down Expand Up @@ -354,6 +359,11 @@ msgstr ""
msgid "No results for “{term}”."
msgstr ""

#. Default: "No results in “{scope}”."
#: components/Header/HeaderSearch
msgid "No results in “{scope}”."
msgstr ""

#. Default: "No selection"
#: components/widgets/QuerystringWidget
msgid "No selection"
Expand Down Expand Up @@ -458,6 +468,16 @@ msgstr ""
msgid "Search"
msgstr ""

#. Default: "Search everywhere"
#: components/Header/HeaderSearch
msgid "Search everywhere"
msgstr ""

#. Default: "Search in all areas"
#: components/Header/HeaderSearch
msgid "Search in all areas"
msgstr ""

#. Default: "Search titles only"
#: components/Header/HeaderSearch
msgid "Search titles only"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ msgstr ""
msgid "Event"
msgstr ""

#. Default: "Everywhere"
#: components/Header/HeaderSearch
msgid "Everywhere"
msgstr ""

#. Default: "Expand sidebar"
#: components/ContentReviewSidebar/ReviewSidebar
msgid "Expand sidebar"
Expand Down Expand Up @@ -361,6 +366,11 @@ msgstr ""
msgid "No results for “{term}”."
msgstr ""

#. Default: "No results in “{scope}”."
#: components/Header/HeaderSearch
msgid "No results in “{scope}”."
msgstr ""

#. Default: "No selection"
#: components/widgets/QuerystringWidget
msgid "No selection"
Expand Down Expand Up @@ -465,6 +475,16 @@ msgstr ""
msgid "Search"
msgstr ""

#. Default: "Search everywhere"
#: components/Header/HeaderSearch
msgid "Search everywhere"
msgstr ""

#. Default: "Search in all areas"
#: components/Header/HeaderSearch
msgid "Search in all areas"
msgstr ""

#. Default: "Search titles only"
#: components/Header/HeaderSearch
msgid "Search titles only"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ msgstr "Erro"
msgid "Event"
msgstr ""

#. Default: "Everywhere"
#: components/Header/HeaderSearch
msgid "Everywhere"
msgstr ""

#. Default: "Expand sidebar"
#: components/ContentReviewSidebar/ReviewSidebar
msgid "Expand sidebar"
Expand Down Expand Up @@ -359,6 +364,11 @@ msgstr ""
msgid "No results for “{term}”."
msgstr ""

#. Default: "No results in “{scope}”."
#: components/Header/HeaderSearch
msgid "No results in “{scope}”."
msgstr ""

#. Default: "No selection"
#: components/widgets/QuerystringWidget
msgid "No selection"
Expand Down Expand Up @@ -463,6 +473,16 @@ msgstr "Sala"
msgid "Search"
msgstr ""

#. Default: "Search everywhere"
#: components/Header/HeaderSearch
msgid "Search everywhere"
msgstr ""

#. Default: "Search in all areas"
#: components/Header/HeaderSearch
msgid "Search in all areas"
msgstr ""

#. Default: "Search titles only"
#: components/Header/HeaderSearch
msgid "Search titles only"
Expand Down
22 changes: 21 additions & 1 deletion frontend/packages/kitconcept-intranet/locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2026-07-30T17:17:45.797Z\n"
"POT-Creation-Date: 2026-08-05T11:38:01.716Z\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Content-Type: text/plain; charset=utf-8\n"
Expand Down Expand Up @@ -191,6 +191,11 @@ msgstr ""
msgid "Event"
msgstr ""

#. Default: "Everywhere"
#: components/Header/HeaderSearch
msgid "Everywhere"
msgstr ""

#. Default: "Expand sidebar"
#: components/ContentReviewSidebar/ReviewSidebar
msgid "Expand sidebar"
Expand Down Expand Up @@ -356,6 +361,11 @@ msgstr ""
msgid "No results for “{term}”."
msgstr ""

#. Default: "No results in “{scope}”."
#: components/Header/HeaderSearch
msgid "No results in “{scope}”."
msgstr ""

#. Default: "No selection"
#: components/widgets/QuerystringWidget
msgid "No selection"
Expand Down Expand Up @@ -460,6 +470,16 @@ msgstr ""
msgid "Search"
msgstr ""

#. Default: "Search everywhere"
#: components/Header/HeaderSearch
msgid "Search everywhere"
msgstr ""

#. Default: "Search in all areas"
#: components/Header/HeaderSearch
msgid "Search in all areas"
msgstr ""

#. Default: "Search titles only"
#: components/Header/HeaderSearch
msgid "Search titles only"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +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
Loading
Loading