Skip to content

Commit

Permalink
Merge branch 'master' into ionlizarazu-ok-view
Browse files Browse the repository at this point in the history
  • Loading branch information
erral authored Jul 17, 2023
2 parents 45f60b1 + 12fc876 commit 515af71
Show file tree
Hide file tree
Showing 65 changed files with 1,651 additions and 315 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,43 @@

<!-- towncrier release notes start -->

## 17.0.0-alpha.18 (2023-07-16)

### Feature

- Refactor CommentEdit -@Tishasoumya-02 [#4075](https://github.com/plone/volto/issues/4075)
- Facets should be able to decide themselves if they should show or not. Made defaultShowFacet to be a fallback in case there is no custom function for each facet type. @tedw87 [#4579](https://github.com/plone/volto/issues/4579)
- Add backward compatibility to `slate_richtext` with fields that are plain text @razvanMiu [#4796](https://github.com/plone/volto/issues/4796)
- Refactor-Contact Form @Tishasoumya-02 [#4850](https://github.com/plone/volto/issues/4850)
- Refactor BreadcrumbsComponent @Tishasoumya-02 [#4858](https://github.com/plone/volto/issues/4858)
- Refactor SearchWidget @Tishasoumya-02 [#4864](https://github.com/plone/volto/issues/4864)
- Refactor LinkView -@Tishasoumya-02 [#4866](https://github.com/plone/volto/issues/4866)
- Use container from component registry in content type views, if defined. @sneridagh [#4962](https://github.com/plone/volto/issues/4962)

### Bugfix

- Fix temporary rendering of folder contents while query results are loading. @davisagli [#4351](https://github.com/plone/volto/issues/4351)
- Fix isBlacklisted method check for volto externalRoutes [#4725](https://github.com/plone/volto/issues/4725)
- fix(styleMenu): Highlight selected block styles @nileshgulia1 [#4851](https://github.com/plone/volto/issues/4851)
- Fix tablet main menu. [#4859](https://github.com/plone/volto/issues/4859)
- Fix the table of contents block so that if one or more items get out of the viewport, a dropdown menu appears with all the items that do not fit the viewport and also added an option to make the TOC sticky. @MihaelaCretu11 [#4907](https://github.com/plone/volto/issues/4907)
- Add a marker in the props passed to `RenderBlocks` in the Grid block view @sneridagh [#4932](https://github.com/plone/volto/issues/4932)
- Typo in Italian locales @mamico [#4944](https://github.com/plone/volto/issues/4944)
- Fix handling of overriden image in Teaser, improve in case that a custom image component is present. @sneridagh [#4964](https://github.com/plone/volto/issues/4964)
- Fix slateTable still uses old style of sidebar generation @iFlameing [#4972](https://github.com/plone/volto/issues/4972)
- Fix password autocomplete hint for login form. @davisagli [#4976](https://github.com/plone/volto/issues/4976)

### Internal

- Upgrade bundlewatch to 0.3.3. @wesleybl [#4967](https://github.com/plone/volto/issues/4967)

### Documentation

- Added note that Pluggables are not compatible with server-side rendering (SSR). @Akshat2Jain [#4735](https://github.com/plone/volto/issues/4735)
- Replace broken link for @albertcasado to use GitHub instead of Twitter. @stevepiercy [#4941](https://github.com/plone/volto/issues/4941)
- Exclude video markup from `make text` builder. @stevepiercy [#4966](https://github.com/plone/volto/issues/4966)


## 17.0.0-alpha.17 (2023-07-11)

### Breaking
Expand Down
17 changes: 17 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ const ploneAuthObj = {
pass: ploneAuth[1],
};

// --- isInViewport ----------------------------------------------------------
Cypress.Commands.add('isInViewport', (element) => {
cy.get(element).then(($el) => {
const windowInnerWidth = Cypress.config(`viewportWidth`);
const windowInnerHeight = Cypress.config(`viewportHeight`);
const rect = $el[0].getBoundingClientRect();

const rightBoundOfWindow = windowInnerWidth;
const bottomBoundOfWindow = windowInnerHeight;

expect(rect.top).to.be.at.least(0);
expect(rect.left).to.be.at.least(0);
expect(rect.right).to.be.lessThan(rightBoundOfWindow);
expect(rect.bottom).to.be.lessThan(bottomBoundOfWindow);
});
});

// --- AUTOLOGIN -------------------------------------------------------------
Cypress.Commands.add('autologin', (usr, pass) => {
let api_url, user, password;
Expand Down
48 changes: 48 additions & 0 deletions cypress/tests/core/basic/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,51 @@ describe('Navigation', () => {
cy.get('#navigation a.item').contains('My Page').should('not.exist');
});
});

describe('Navigation menu', () => {
context('menu hamburger', () => {
beforeEach(() => {
cy.visit('/');
cy.waitForResourceToLoad('@navigation');
cy.waitForResourceToLoad('@breadcrumbs');
cy.waitForResourceToLoad('@actions');
cy.waitForResourceToLoad('');
});
const hambClass =
'nav.navigation .hamburger-wrapper.mobile.tablet.only button.hamburger';
it('iphone-xr', () => {
cy.viewport('iphone-xr');
cy.get(hambClass).should('be.visible');
cy.get(hambClass).click();
cy.get(`${hambClass}.is-active`).should('be.visible');
cy.get('nav.navigation a.item.active').contains('Home');
cy.isInViewport(`${hambClass}.is-active`);

cy.get('body')
.invoke('css', 'overflow')
.then((ov) => {
expect(ov).to.eq('hidden');
});
cy.get('nav .ui.pointing.secondary.stackable.menu')
.invoke('css', 'flex-direction')
.then((ov) => {
expect(ov).to.eq('column');
});
});

it('ipad-mini', () => {
cy.viewport('ipad-mini');
cy.get(hambClass).should('be.visible');
cy.get(hambClass).click();
cy.get(`${hambClass}.is-active`).should('be.visible');
cy.get('nav.navigation a.item.active').contains('Home');
cy.isInViewport(`${hambClass}.is-active`);

cy.get('body')
.invoke('css', 'overflow')
.then((ov) => {
expect(ov).to.eq('hidden');
});
});
});
});
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/source/configuration/settings-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ blockSettingsTabFieldsetsInitialStateOpen
A Boolean, `true` by default.
The fieldsets in the blocks settings tab start by default as non-collapsed (opened), you can decide to have them collapsed (closed) by default setting this to `false`.

excludeLinksAndReferencesMenuItem
A Boolean, `false` by default.
The content menu links to the {guilabel}`Links and references` view per default.
Exclude this menu item by setting `excludeLinksAndReferencesMenuItem` to `true`.

okRoute
Volto provides an `/ok` URL where it responds with a `text/plain ok` response, with an `HTTP 200` status code, to signal third party health check services that the Volto process is running correctly.

Expand Down
24 changes: 14 additions & 10 deletions docs/source/recipes/pluggables.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ To understand how they work, it's useful to look at the architecture:
at `App.jsx` component level), so you don't have to do it:

```jsx
<PluggablesProvider>
...
</PluggablesProvider>
<PluggablesProvider>...</PluggablesProvider>
```

This `Provider` acts like a centralized place where "insertion points" and
Expand All @@ -47,7 +45,9 @@ Then we can plug things as children to the `<Pluggable>` with some `<Plug>`
components:

```jsx
<Plug pluggable="left-column" id="navigation">relevant nav stuff</Plug>
<Plug pluggable="left-column" id="navigation">
relevant nav stuff
</Plug>
```

Declaring a `<Plug>` with the same `id` twice will make the second one (in
Expand All @@ -57,16 +57,20 @@ Internally, the `<PluggablesProvider>` keeps a record of `Pluggables` and `Plug`
this is achieved by having the `<Pluggables>` and `<Plug>` components register
themselves with the Provider via React context.

```{note}
While Pluggables are a powerful framework for enhancing component integration, they are currently not compatible with server-side rendering (SSR).
They excel in providing dynamic visual enhancements for the user interface, such as client components and widgets.
However, when it comes to handling critical data that needs to load quickly, alternative approaches may be more suitable.
```
## Customize the rendering of plugs

You can customize the rendering of pluggables. The `<Pluggable>` component can take a function as a child and use that function to describe the rendering of pluggables.

```jsx
<Pluggable name="block-toolbar">
{(pluggables) => pluggables.map((p) => (<>{p()}</>))}
{(pluggables) => pluggables.map((p) => <>{p()}</>)}
</Pluggable>
```

## Passing parameters from the Pluggable to the Plugs

You can also pass options to the `Plugs`, to enable inter-component communication:
Expand All @@ -79,9 +83,9 @@ To use the passed params, you can do:

```jsx
<Plug pluggable="block-toolbar" id="style">
{({options}) => {
console.log(options);
return <Button>Click me</Button>
}}
{({ options }) => {
console.log(options);
return <Button>Click me</Button>;
}}
</Plug>
```
4 changes: 4 additions & 0 deletions docs/source/user-manual/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,10 @@ The TOC block has several configuration options.

Variation
: Toggles the display of the TOC to be a listing (default) or horizontal as tabs.
The horizontal variation also adds a dropdown button, if necessary, so the items that won't fit would be displayed in the dropdown list.
```{video} /_static/user-manual/blocks/table-of-contents-block-with-dropdown.mp4
:alt: Table of contents block with dropdown menu.
```

Block title
: Optionally add a title above the table of contents.
Expand Down
4 changes: 4 additions & 0 deletions docs/source/user-manual/copy-paste-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ Volto also allows the selection of multiple contiguous blocks.
This feature can be used by selecting a start block and an end block while holding the {kbd}`shift` key.
This will select all the blocks between the start and end blocks, allowing you to copy, cut, or delete multiple blocks at once.

````{only} not text
```{video} /_static/user-manual/blocks/block-copy-cut.mp4
```
````


(paste-blocks-label)=
Expand All @@ -40,5 +42,7 @@ You can click the paste option <img alt="Paste icon" src="../_static/paste.svg"

Also if you hold the {kbd}`ctrl` key while clicking the paste button, it keeps the clipboard buffer, allowing you to repeatedly paste it.

````{only} not text
```{video} /_static/user-manual/blocks/block-paste.mp4
```
````
1 change: 1 addition & 0 deletions docs/source/user-manual/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Note that the audience for these sources may be a Developer, not an Editor, and
blocks
copy-paste-blocks
links-to-item
```
37 changes: 37 additions & 0 deletions docs/source/user-manual/links-to-item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
myst:
html_meta:
"description": "User manual on how to find all links and relations to the current item."
"property=og:description": "User manual on how to find all links and relations to the current item."
"property=og:title": "Finding links and relations to the current item."
"keywords": "Volto, Plone, frontend, React, User manual, links, relations, references, related content"
---

(links-to-item-label)=

# Finding links and references to the current page

Sometimes it can be hard to keep track from where a certain page is referenced.
This is especially true whenever you want to reconstruct your website with a greater number of objects being moved or deleted.
For this situation, you can visit the {guilabel}`Links and references` page, which is an overview of all content items that reference a certain content item.

```{note}
An item references another item by creating a hyperlink to this item, using the item in a block, referencing it in the {guilabel}`Related Items` field, or referencing it in a relation field.
```

## {guilabel}`Links and references` view

In the toolbar on the left side, you can click on the item with the three horizontally aligned dots, called {guilabel}`More menu`.
Click then on the item labeled {guilabel}`Links and references`.

You can see now a table displaying all links to and references of the current item.

```{image} ../_static/user-manual/manage/link-to-items.png
:alt: A panel captioned with "Content that links to or references 'Supervisor Adélaïde Pickavance'". Below the caption, there is a table with one section per relation type, where each section has three columns. The first column's heading is the relation name, the second is "Review State", and the third is "Type". The sections are named, from top to bottom, "Linking this item with hyperlink in text", "Referencing the item as related item", and "Referencing this item with '[Name of Relation]'".
```

For editors, this view gives insight to whether those links and references are still relevant.
On second sight, it also helps to prevent potential broken links and relations.

For example, when you try to delete this page with other pages linking to it, you will get a warning that this will cause broken links or relations that lead to a "not found" error page.
If you receive such a warning, you can inspect this view and go through each referencing page, removing any references.
39 changes: 39 additions & 0 deletions locales/ca/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ msgstr ""
#: components/manage/Controlpanels/UpgradeControlPanel
#: components/manage/Diff/Diff
#: components/manage/History/History
#: components/manage/LinksToItem/LinksToItem
#: components/manage/Multilingual/ManageTranslations
#: components/manage/Preferences/ChangePassword
#: components/manage/Preferences/PersonalPreferences
Expand Down Expand Up @@ -769,6 +770,11 @@ msgstr ""
msgid "Content rules from parent folders"
msgstr ""

#: components/manage/LinksToItem/LinksToItem
# defaultMessage: Content that links to or references {title}
msgid "Content that links to or references {title}"
msgstr ""

#: components/manage/Controlpanels/ContentTypes
# defaultMessage: Content type created
msgid "Content type created"
Expand Down Expand Up @@ -1959,6 +1965,17 @@ msgstr "Enllaç a"
msgid "Link translation for"
msgstr "Traducció d'enllaços per"

#: components/manage/LinksToItem/LinksToItem
# defaultMessage: Linking this item with hyperlink in text
msgid "Linking this item with hyperlink in text"
msgstr ""

#: components/manage/LinksToItem/LinksToItem
#: components/manage/Toolbar/More
# defaultMessage: Links and references
msgid "Links and references"
msgstr ""

#: components/manage/Blocks/Listing/schema
# defaultMessage: Listing
msgid "Listing"
Expand Down Expand Up @@ -2292,6 +2309,11 @@ msgstr "No s'han trobat articles en aquest contenidor."
msgid "No items selected"
msgstr "No s'ha seleccionat cap element"

#: components/manage/LinksToItem/LinksToItem
# defaultMessage: No links to this item found.
msgid "No links to this item found."
msgstr ""

#: components/manage/Blocks/Maps/MapsSidebar
# defaultMessage: No map selected
msgid "No map selected"
Expand Down Expand Up @@ -2420,6 +2442,11 @@ msgstr "Obre el navegador d'objectes"
msgid "Origin"
msgstr "Origen"

#: components/manage/LinksToItem/LinksToItem
# defaultMessage: Overview of relations of all content items
msgid "Overview of relations of all content items"
msgstr ""

#: components/manage/Toolbar/Toolbar
# defaultMessage: Page
msgid "Page"
Expand Down Expand Up @@ -2669,6 +2696,16 @@ msgstr ""
msgid "Reduce complexity"
msgstr "Disseny de taula minimalista"

#: components/manage/LinksToItem/LinksToItem
# defaultMessage: Referencing this item as related item
msgid "Referencing this item as related item"
msgstr ""

#: components/manage/LinksToItem/LinksToItem
# defaultMessage: Referencing this item with {relationship}
msgid "Referencing this item with {relationship}"
msgstr ""

#: components/theme/Anontools/Anontools
#: components/theme/Login/Login
#: components/theme/Register/Register
Expand Down Expand Up @@ -2844,6 +2881,7 @@ msgid "Revert to this revision"
msgstr "Torna a aquesta revisió"

#: components/manage/Contents/Contents
#: components/manage/LinksToItem/LinksToItem
# defaultMessage: Review state
msgid "Review state"
msgstr "Estat de revisió"
Expand Down Expand Up @@ -3721,6 +3759,7 @@ msgid "Triggering event field error. Please select a value"
msgstr ""

#: components/manage/Controlpanels/ContentTypes
#: components/manage/LinksToItem/LinksToItem
#: components/manage/Widgets/SchemaWidget
#: components/theme/View/TabularView
# defaultMessage: Type
Expand Down
Loading

0 comments on commit 515af71

Please sign in to comment.