Skip to content

Commit

Permalink
Merge branch 'master' into querystring-search-get
Browse files Browse the repository at this point in the history
  • Loading branch information
robgietema authored Apr 6, 2023
2 parents dbdfd0a + c40e772 commit 27745be
Show file tree
Hide file tree
Showing 24 changed files with 228 additions and 54 deletions.
4 changes: 2 additions & 2 deletions locales/ca/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,7 @@ msgid "My email is"
msgstr ""

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "El meu nom d'usuari és"

Expand Down Expand Up @@ -4193,7 +4193,7 @@ msgid "label_my_email_is"
msgstr ""

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "El meu nom d'usuari és"

Expand Down
8 changes: 4 additions & 4 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2095,9 +2095,9 @@ msgid "My email is"
msgstr "Meine E-Mail ist"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Mein Benutzername ist"
msgstr "Mein Nutzername lautet"

#: components/manage/Sharing/Sharing
#: components/theme/ContactForm/ContactForm
Expand Down Expand Up @@ -4190,9 +4190,9 @@ msgid "label_my_email_is"
msgstr "Meine E-Mail ist"

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "El meu nom d'usuari és"
msgstr "Mein Nutzername lautet"

#: config/Blocks
# defaultMessage: Lead Image Field
Expand Down
4 changes: 2 additions & 2 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ msgid "My email is"
msgstr ""

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr ""

Expand Down Expand Up @@ -4184,7 +4184,7 @@ msgid "label_my_email_is"
msgstr ""

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ msgid "My email is"
msgstr "Mi dirección de correo electrónico es"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Mi nombre de usuario es"

Expand Down Expand Up @@ -4195,7 +4195,7 @@ msgid "label_my_email_is"
msgstr "Mi dirección de correo es"

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Mi nombre de usuario es"

Expand Down
4 changes: 2 additions & 2 deletions locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ msgid "My email is"
msgstr "Nire helbidea hauxe da"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Nire erabiltzaile izena da"

Expand Down Expand Up @@ -4191,7 +4191,7 @@ msgid "label_my_email_is"
msgstr "Nire helbidea hauxe da: "

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Nire erabiltzaile izena da"

Expand Down
4 changes: 2 additions & 2 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,7 @@ msgid "My email is"
msgstr "Mon email est"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Mon nom d'utilisateur est"

Expand Down Expand Up @@ -4201,7 +4201,7 @@ msgid "label_my_email_is"
msgstr "Mon email est"

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Mon nom d'utilisateur est"

Expand Down
4 changes: 2 additions & 2 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ msgid "My email is"
msgstr "La mia email è"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Il mio nome utente è"

Expand Down Expand Up @@ -4184,7 +4184,7 @@ msgid "label_my_email_is"
msgstr "La mia email è"

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Il mio nome utente è"

Expand Down
4 changes: 2 additions & 2 deletions locales/ja/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ msgid "My email is"
msgstr ""

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "私のユーザー名は"

Expand Down Expand Up @@ -4192,7 +4192,7 @@ msgid "label_my_email_is"
msgstr ""

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "私のユーザー名は"

Expand Down
4 changes: 2 additions & 2 deletions locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ msgid "My email is"
msgstr "Mijn e-mail is"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Mijn gebruikersnaam is"

Expand Down Expand Up @@ -4191,7 +4191,7 @@ msgid "label_my_email_is"
msgstr "Mijn e-mail is"

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Mijn gebruikersnaam is"

Expand Down
4 changes: 2 additions & 2 deletions locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ msgid "My email is"
msgstr ""

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Meu nome de usuário é"

Expand Down Expand Up @@ -4192,7 +4192,7 @@ msgid "label_my_email_is"
msgstr ""

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Meu nome de usuário é"

Expand Down
4 changes: 2 additions & 2 deletions locales/pt_BR/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ msgid "My email is"
msgstr "Meu e-mail é"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Meu nome de usuário é"

Expand Down Expand Up @@ -4194,7 +4194,7 @@ msgid "label_my_email_is"
msgstr "Meu endereço de e-mail é"

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Meu nome de usuário é<<<<<<< HEAD"

Expand Down
4 changes: 2 additions & 2 deletions locales/ro/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ msgid "My email is"
msgstr ""

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "Numele meu de utilizator este"

Expand Down Expand Up @@ -4184,7 +4184,7 @@ msgid "label_my_email_is"
msgstr ""

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "Numele meu de utilizator este"

Expand Down
6 changes: 3 additions & 3 deletions 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: 2023-03-01T10:46:45.512Z\n"
"POT-Creation-Date: 2023-04-05T10:12:20.363Z\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -2091,7 +2091,7 @@ msgid "My email is"
msgstr ""

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr ""

Expand Down Expand Up @@ -4186,7 +4186,7 @@ msgid "label_my_email_is"
msgstr ""

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions locales/zh_CN/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ msgid "My email is"
msgstr "我的邮箱是"

#: components/theme/PasswordReset/PasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "My username is"
msgstr "我的用户名是"

Expand Down Expand Up @@ -4190,7 +4190,7 @@ msgid "label_my_email_is"
msgstr "我的邮箱是"

#: components/theme/PasswordReset/RequestPasswordReset
# defaultMessage: My username is
# defaultMessage: My user name is
msgid "label_my_username_is"
msgstr "我的用户名是"

Expand Down
1 change: 1 addition & 0 deletions news/4159.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added current page parameter to route in listing and search block pagination - Fix: #3868 @bipoza
1 change: 1 addition & 0 deletions news/4656.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed wrong localization on password reset page @iRohitSingh
20 changes: 20 additions & 0 deletions src/components/manage/Blocks/Listing/ListingBody.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@ test('renders a ListingBody component', () => {
content: {
data: {
is_folderish: true,
blocks: {
'839ee00b-013b-4f4a-9b10-8867938fdac3': {
'@type': 'listing',
block: '839ee00b-013b-4f4a-9b10-8867938fdac3',
headlineTag: 'h2',
query: [],
querystring: {
b_size: '2',
query: [
{
i: 'path',
o: 'plone.app.querystring.operation.string.absolutePath',
v: '/',
},
],
sort_order: 'ascending',
},
variation: 'default',
},
},
},
},
intl: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function withQuerystringResults(WrappedComponent) {
const [initialPath] = React.useState(getBaseUrl(path));

const copyFields = ['limit', 'query', 'sort_on', 'sort_order', 'depth'];

const { currentPage, setCurrentPage } = usePagination(data.block, 1);
const adaptedQuery = Object.assign(
variation?.fullobjects ? { fullobjects: 1 } : { metadata_fields: '_all' },
{
Expand All @@ -37,7 +37,6 @@ export default function withQuerystringResults(WrappedComponent) {
: {},
),
);
const { currentPage, setCurrentPage } = usePagination(querystring, 1);
const querystringResults = useSelector(
(state) => state.querystringsearch.subrequests,
);
Expand Down
12 changes: 8 additions & 4 deletions src/components/manage/Blocks/Search/hocs/withSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ const getSearchFields = (searchData) => {
};

/**
* A HOC that will mirror the search block state to a hash location
* A hook that will mirror the search block state to a hash location
*/
const useHashState = () => {
const location = useLocation();
const history = useHistory();

/**
* Required to maintain parameter compatibility.
With this we will maintain support for receiving hash (#) and search (?) type parameters.
*/
const oldState = React.useMemo(() => {
return {
...qs.parse(location.search),
Expand All @@ -165,7 +169,7 @@ const useHashState = () => {

const setSearchData = React.useCallback(
(searchData) => {
const newParams = qs.parse(location.hash);
const newParams = qs.parse(location.search);

let changed = false;

Expand All @@ -182,11 +186,11 @@ const useHashState = () => {

if (changed) {
history.push({
hash: qs.stringify(newParams),
search: qs.stringify(newParams),
});
}
},
[history, oldState, location.hash],
[history, oldState, location.search],
);

return [current, setSearchData];
Expand Down
2 changes: 1 addition & 1 deletion src/components/theme/PasswordReset/PasswordReset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const messages = defineMessages({
},
usernameTitle: {
id: 'My username is',
defaultMessage: 'My username is',
defaultMessage: 'My user name is',
},
emailTitle: {
id: 'My email is',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const messages = defineMessages({
},
usernameTitle: {
id: 'label_my_username_is',
defaultMessage: 'My username is',
defaultMessage: 'My user name is',
},
emailTitle: {
id: 'label_my_email_is',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports[`RequestPasswordReset renders a RequestPasswordReset component 1`] = `
className="mocked-default-widget"
id="mocked-field-username"
>
My username is
My user name is
-
No description
</div>
Expand Down
Loading

0 comments on commit 27745be

Please sign in to comment.