Skip to content

Commit

Permalink
Merge branch 'master' into cypress13
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Sep 12, 2023
2 parents 70d0c7a + f205332 commit 546c790
Show file tree
Hide file tree
Showing 50 changed files with 628 additions and 611 deletions.
55 changes: 55 additions & 0 deletions cypress/tests/core/basic/view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
describe('Add Content Tests', () => {
beforeEach(() => {
cy.intercept('GET', `/**/*?expand*`).as('content');
// give a logged in editor and the site root
cy.autologin();
cy.visit('/');
cy.wait('@content');
});

it('As editor I can change the view to Listing View', function () {

cy.visit('/events');
cy.get('#toolbar-more').click();
cy.findByText('Listing view').click();
cy.findByText('Album view').click();
cy.visit('/events');
cy.wait('@content');
cy.wait(2000);
cy.get('main').contains('Event').should('be.visible');
});

it('As editor I can change the view to Summary View', function () {

cy.visit('/events');
cy.get('#toolbar-more').click();
cy.findByText('Listing view').click();
cy.findByText('Summary view').click();
cy.visit('/events');
cy.wait('@content');
cy.wait(2000);
cy.get('main').contains('Event').should('be.visible');
});
it('As editor I can change the view to Tabular View', function () {

cy.visit('/events');
cy.get('#toolbar-more').click();
cy.findByText('Listing view').click();
cy.findByText('Tabular view').click();
cy.visit('/events');
cy.wait('@content');
cy.wait(2000);
cy.get('main').contains('Event').should('be.visible');
});
it('As editor I can change the view to Album View', function () {

cy.visit('/events');
cy.get('#toolbar-more').click();
cy.findByText('Listing view').click();
cy.visit('/events');
cy.wait('@content');
cy.wait(2000);
cy.get('main').contains('Event').should('be.visible');
});
});

4 changes: 2 additions & 2 deletions cypress/tests/core/blocks/block-anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ describe('Block Tests: Anchors', () => {
cy.contains('Slate Heading Anchors');
cy.get('h2[id="title-1"]').contains('Title 1');
cy.get('h2[id="title-2"]').contains('Title 2');
cy.get('a[href="#title-1"]').click();
cy.get('.table-of-contents a[href="/my-page#title-1"]').click();
cy.get('h2[id="title-1"]').scrollIntoView().should('be.visible');
cy.get('a[href="#title-2"]').click();
cy.get('.table-of-contents a[href="/my-page#title-2"]').click();
cy.get('h2[id="title-2"]').scrollIntoView().should('be.visible');
});
});
53 changes: 53 additions & 0 deletions cypress/tests/core/blocks/blocks-search.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
describe('Search Block Tests', () => {
var results_number = 3;
beforeEach(() => {
cy.intercept('GET', `/**/*?expand*`).as('content');
cy.intercept('GET', '/**/Document').as('schema');
Expand Down Expand Up @@ -91,6 +92,12 @@ describe('Search Block Tests', () => {

cy.wait(500);

// test search results number
cy.get('.search-details').should(
'contain',
`Search results: ${results_number}`,
);

// test if type facet works
cy.get('.block.search .facets > .facet .entries > .entry label')
.contains('Event')
Expand Down Expand Up @@ -158,6 +165,12 @@ describe('Search Block Tests', () => {
cy.get('#toolbar-save > .icon').click();

cy.wait(500);

// test search results number
cy.get('.search-details').should(
'contain',
`Search results: ${results_number}`,
);
});

it('Search block - test live searchbox', () => {
Expand Down Expand Up @@ -201,6 +214,13 @@ describe('Search Block Tests', () => {
cy.wait('@content');

cy.wait(500);

// test search results number
cy.get('.search-details').should(
'contain',
`Search results: ${results_number}`,
);

// test searching for Event
cy.get('.search-wrapper .search-input input').focus().type('Event');
cy.get('#page-document .listing-item:first-of-type a').should(
Expand Down Expand Up @@ -237,6 +257,12 @@ describe('Search Block Tests', () => {
);
cy.url().should('not.contain', '%22SearchableText%22');

// test search results number
cy.get('.search-details').should(
'contain',
`Search results: ${results_number}`,
);

// test searching for Event
cy.get('.search-wrapper .search-input input').focus().type('Event');
cy.get('#page-document .listing-item:first-of-type a').should(
Expand All @@ -253,6 +279,9 @@ describe('Search Block Tests', () => {
'%7B%22i%22%3A%22SearchableText%22%2C%22o%22%3A%22paqo.string.contains%22%2C%22v%22%3A%22Event%22%7D',
);

// test search results number
cy.get('.search-details').should('contain', 'Search results: 1');

// test removing one char
cy.get('.search-wrapper .search-input input').focus().type('{backspace}');
cy.get('.search-results-count-sort .search-details em')
Expand Down Expand Up @@ -319,6 +348,12 @@ describe('Search Block Tests', () => {

cy.wait(500);

// test search results number
cy.get('.search-details').should(
'contain',
`Search results: ${results_number}`,
);

// test searching for Event
cy.get('.search-wrapper .search-input input').focus().type('Event');
cy.get('.search-wrapper > .ui.button').click();
Expand All @@ -337,6 +372,9 @@ describe('Search Block Tests', () => {
'%7B%22i%22%3A%22SearchableText%22%2C%22o%22%3A%22paqo.string.contains%22%2C%22v%22%3A%22Event%22%7D',
);

// test search results number
cy.get('.search-details').should('contain', 'Search results: 1');

// test removing one char
cy.get('.search-wrapper .search-input input').focus().type('{backspace}');
cy.get('.search-wrapper > .ui.button').click();
Expand All @@ -359,6 +397,12 @@ describe('Search Block Tests', () => {
);
cy.url().should('not.contain', '%22SearchableText%22');

// test search results number
cy.get('.search-details').should(
'contain',
`Search results: ${results_number}`,
);

// test searching for Event
cy.get('.search-wrapper .search-input input').focus().type('Event');
cy.get('.search-wrapper > .ui.button').click();
Expand All @@ -376,6 +420,9 @@ describe('Search Block Tests', () => {
'%7B%22i%22%3A%22SearchableText%22%2C%22o%22%3A%22paqo.string.contains%22%2C%22v%22%3A%22Event%22%7D',
);

// test search results number
cy.get('.search-details').should('contain', 'Search results: 1');

// test removing one char
cy.get('.search-wrapper .search-input input').focus().type('{backspace}');
cy.get('.search-wrapper > .ui.button').click();
Expand All @@ -397,5 +444,11 @@ describe('Search Block Tests', () => {
'Searched for:',
);
cy.url().should('not.contain', '%22SearchableText%22');

// test search results number
cy.get('.search-details').should(
'contain',
`Search results: ${results_number}`,
);
});
});
2 changes: 1 addition & 1 deletion locales/ca/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4645,7 +4645,7 @@ msgstr "a"
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr "[mes] [dia], [any]"
msgstr "[month] [day], [year]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
2 changes: 1 addition & 1 deletion locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4642,7 +4642,7 @@ msgstr "Regel AT"
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr "Regel Datumsformat"
msgstr "[day] [month] [year]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
2 changes: 1 addition & 1 deletion locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4647,7 +4647,7 @@ msgstr "a las"
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr "formato de fecha"
msgstr "[day]/[month]/[year]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
2 changes: 1 addition & 1 deletion locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4653,7 +4653,7 @@ msgstr "à"
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr "[mois] [jour], [année]"
msgstr "[month] [day], [year]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
2 changes: 1 addition & 1 deletion locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4655,7 +4655,7 @@ msgstr ""
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr ""
msgstr "[month] [day], [year]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
2 changes: 1 addition & 1 deletion locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4644,7 +4644,7 @@ msgstr ""
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr ""
msgstr "[day] de [month] de [year]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
2 changes: 1 addition & 1 deletion locales/ro/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4636,7 +4636,7 @@ msgstr "La"
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr ""
msgstr "[year]-[month]-[day]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
2 changes: 1 addition & 1 deletion locales/zh_CN/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -4642,7 +4642,7 @@ msgstr ""
#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: [month] [day], [year]
msgid "rrule_dateFormat"
msgstr ""
msgstr "[year]-[month]-[day]"

#: components/manage/Widgets/RecurrenceWidget/Utils
# defaultMessage: day
Expand Down
1 change: 1 addition & 0 deletions news/3250.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix for responsive error in the login page when the width of the screen decreases. @suman9893
1 change: 1 addition & 0 deletions news/4076.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor Navigation -@Tishasoumya-02
1 change: 1 addition & 0 deletions news/4402.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix back button in the search block to execute the search by adding two useEffects that update the facets and search data based on the current URL. @MihaelaCretu11
1 change: 1 addition & 0 deletions news/4503.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix : RecursiveWidget is incorrectly translated. @suman9893
1 change: 1 addition & 0 deletions news/4926.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Messages Component Refactor - @Tishasoumya-02
1 change: 1 addition & 0 deletions news/4933.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor Login -@Tishasoumya-02
1 change: 1 addition & 0 deletions news/5019.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix use of CSS modules in webpack 5. @wesleybl
1 change: 1 addition & 0 deletions news/5058.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix toc accessibility issue @dobri1408
1 change: 1 addition & 0 deletions news/5109.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add external className to UniversalLink for external link. @iFlameing
1 change: 1 addition & 0 deletions news/5146.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(feat): Update toc block entries @dobri1408
1 change: 1 addition & 0 deletions news/5149.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Views cypress test -@Tishasoumya
1 change: 1 addition & 0 deletions news/5171.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix search block search results number @ionlizarazu
1 change: 1 addition & 0 deletions news/5171.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cypress test to test if 'Search results: number' text is present @ionlizarazu
5 changes: 2 additions & 3 deletions packages/volto-slate/src/editor/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,12 @@ export const renderLinkElement = (tagName) => {
appPathname.concat(`#${slug}`),
);
const intl = useIntl();

return slate.useLinkedHeadings === false ? (
<Tag {...attributes} className={className}>
<Tag {...attributes} className={className} tabIndex={0}>
{children}
</Tag>
) : (
<Tag {...attributes} className={className}>
<Tag {...attributes} className={className} tabIndex={0}>
{children}
{mode === 'view' && slug && (
<UniversalLink
Expand Down
1 change: 1 addition & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export {
login,
loginRenew,
logout,
resetLoginRequest,
} from '@plone/volto/actions/userSession/userSession';
export {
getVocabulary,
Expand Down
18 changes: 17 additions & 1 deletion src/actions/userSession/userSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
* @module actions/search/search
*/

import { LOGIN, LOGIN_RENEW, LOGOUT } from '@plone/volto/constants/ActionTypes';
import {
LOGIN,
LOGIN_RENEW,
LOGOUT,
RESET_LOGIN_REQUEST,
} from '@plone/volto/constants/ActionTypes';

/**
* Login function.
Expand Down Expand Up @@ -52,3 +57,14 @@ export function logout() {
},
};
}

/**
* Reset login request data function
* @function resetLoginRequest
* @returns {Object} Get content action
*/
export function resetLoginRequest() {
return {
type: RESET_LOGIN_REQUEST,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ exports[`renders a Lead Image block Sidebar component 1`] = `
fetchpriority="high"
height={400}
sizes="188px"
src="http://localhost:3000/image.png"
srcSet="http://localhost:3000/image.png/@@images/image/image-400.png 400w"
src="/image.png"
srcSet="/image.png/@@images/image/image-400.png 400w"
style={
Object {
"aspectRatio": "400 / 400",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function withQuerystringResults(WrappedComponent) {
} = props;
const { settings } = config;
const querystring = data.querystring || data; // For backwards compat with data saved before Blocks schema. Note, this is also how the Search block passes data to ListingBody
const subrequestID = content?.UID + '-' + id;
const subrequestID = content?.UID ? `${content?.UID}-${id}` : id;
const { b_size = settings.defaultPageSize } = querystring; // batchsize

// save the path so it won't trigger dispatch on eager router location change
Expand Down
Loading

0 comments on commit 546c790

Please sign in to comment.