Skip to content

Commit

Permalink
Merge pull request #36 from eea/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 authored Dec 21, 2022
2 parents 97c5770 + bf7e8e7 commit e428874
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.0.34](https://github.com/eea/volto-energy-theme/compare/1.0.33...1.0.34) - 21 December 2022

#### :hammer_and_wrench: Others

- prettier fix [nileshgulia1 - [`752ca1c`](https://github.com/eea/volto-energy-theme/commit/752ca1cabf761b659476b31b01e84ee091ded1d9)]
- install advanced link plugin [Nilesh - [`e0d98f5`](https://github.com/eea/volto-energy-theme/commit/e0d98f59be6f7af0ce21b0235bfa76e2f07bbb8d)]
### [1.0.33](https://github.com/eea/volto-energy-theme/compare/1.0.32...1.0.33) - 19 December 2022

#### :hammer_and_wrench: Others

- Merge pull request #35 from eea/develop [Nilesh - [`97c5770`](https://github.com/eea/volto-energy-theme/commit/97c57704c8e0f5cd223d8f36adf8253ae386d211)]
- override volto-block-styles [nileshgulia1 - [`0f6d4b4`](https://github.com/eea/volto-energy-theme/commit/0f6d4b4cf8aacd92b0de98fcca1ebb451f40cd8c)]
### [1.0.32](https://github.com/eea/volto-energy-theme/compare/1.0.31...1.0.32) - 19 December 2022

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-energy-theme",
"version": "1.0.33",
"version": "1.0.34",
"description": "@eeacms/volto-energy-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
49 changes: 49 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ import MetaFieldWidget from '@eeacms/volto-energy-theme/components/manage/Widget
import GridListingBlockTemplate from '@eeacms/volto-energy-theme/components/manage/Blocks/Listing/GridTemplate';
import CollectionView from '@eeacms/volto-energy-theme/components/theme/View/CollectionView';
import reducers from '@eeacms/volto-energy-theme/reducers';
import linkSVG from '@plone/volto/icons/link.svg';
import { makeInlineElementPlugin } from '@plone/volto-slate/elementEditor';
import { LINK } from '@plone/volto-slate/constants';
import { LinkElement } from '@plone/volto-slate/editor/plugins/AdvancedLink/render';
import { withLink } from '@plone/volto-slate/editor/plugins/AdvancedLink/extensions';
import { linkDeserializer } from '@plone/volto-slate/editor/plugins/AdvancedLink/deserialize';
import LinkEditSchema from '@plone/volto-slate/editor/plugins/AdvancedLink/schema';

import { defineMessages } from 'react-intl'; // , defineMessages

// import FolderListingBlockView from 'volto-addons/FolderListing/BlockView';
// import FolderListingBlockEdit from 'volto-addons/FolderListing/BlockEdit';

Expand Down Expand Up @@ -38,6 +48,17 @@ import reducers from '@eeacms/volto-energy-theme/reducers';

import '@plone/volto/config';

const messages = defineMessages({
edit: {
id: 'Edit link',
defaultMessage: 'Edit link',
},
delete: {
id: 'Remove link',
defaultMessage: 'Remove link',
},
});

export default function applyConfig(config) {
// Add here your project's configuration here by modifying `config` accordingly

Expand Down Expand Up @@ -170,5 +191,33 @@ export default function applyConfig(config) {
...config.addonReducers,
...reducers,
};

//advancedlink is currently not working properly/not recognized in fise, so we add it to config manually
const { slate } = config.settings;

slate.toolbarButtons = [...(slate.toolbarButtons || []), LINK];
slate.expandedToolbarButtons = [
...(slate.expandedToolbarButtons || []),
LINK,
];

slate.htmlTagsToSlate.A = linkDeserializer;

const opts = {
title: 'Link',
pluginId: LINK,
elementType: LINK,
element: LinkElement,
isInlineElement: true,
editSchema: LinkEditSchema,
extensions: [withLink],
hasValue: (formData) => !!formData.link,
toolbarButtonIcon: linkSVG,
messages,
};

const [installLinkEditor] = makeInlineElementPlugin(opts);
config = installLinkEditor(config);

return config;
}

0 comments on commit e428874

Please sign in to comment.