Skip to content

Commit

Permalink
Merge branch 'master' into draft_save
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Sep 15, 2023
2 parents 18dcdce + f3fc56c commit e9d4c3b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions api/versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# Added by buildout at 2021-12-15 17:25:36.097866
collective.folderishtypes = 3.0.0
collective.recipe.plonesite = 1.12.0
pyyaml = 5.3.1 # without this volto is not building locally
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 slate Link view. @iFlameing
7 changes: 7 additions & 0 deletions packages/generator-volto/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

<!-- towncrier release notes start -->

## 7.0.0-alpha.6 (2023-09-14)

### Bugfix

- Fix addon i18n local command when executed outside the scope of a Volto project. @sneridagh [#5181](https://github.com/plone/volto/issues/5181)


## 7.0.0-alpha.5 (2023-09-13)

### Feature
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (api) {
api.cache(true);
const presets = ['razzle/babel'];
const presets = ['razzle'];
const plugins = [
[
'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
Expand Down
1 change: 1 addition & 0 deletions packages/generator-volto/news/5181.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix addon i18n local command when executed outside the scope of a Volto project. @sneridagh
2 changes: 1 addition & 1 deletion packages/generator-volto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"license": "MIT",
"version": "7.0.0-alpha.5",
"version": "7.0.0-alpha.6",
"repository": {
"type": "git",
"url": "git+https://github.com/plone/generator-volto.git"
Expand Down
11 changes: 5 additions & 6 deletions packages/volto-slate/src/editor/plugins/Link/render.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import cx from 'classnames';
import { UniversalLink } from '@plone/volto/components';
import config from '@plone/volto/registry';
import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
Expand All @@ -20,18 +21,16 @@ const ViewLink = ({ url, target, download, children }) => {

export const LinkElement = (props) => {
const { attributes, children, element, mode = 'edit' } = props;
const isInternalUrl = isInternalURL(element.data?.url);
const linkUrl = element.data?.url;

return mode === 'view' ? (
<ViewLink {...(element.data || {})}>{children}</ViewLink>
) : (
<a
{...attributes}
className="slate-editor-link"
href={
isInternalURL(element.data?.url)
? flattenToAppURL(element.data?.url)
: element.data?.url
}
className={cx('slate-editor-link', { external: !isInternalUrl })}
href={isInternalUrl ? flattenToAppURL(linkUrl) : linkUrl}
onClick={(e) => e.preventDefault()}
>
{Array.isArray(children)
Expand Down

0 comments on commit e9d4c3b

Please sign in to comment.