Skip to content

Commit

Permalink
Merge pull request #75 from eea/develop
Browse files Browse the repository at this point in the history
Add advanced link for volto-slate
  • Loading branch information
claudiaifrim authored Dec 8, 2022
2 parents dac4881 + f51810b commit 075f406
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
13 changes: 7 additions & 6 deletions .project.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
const fs = require('fs');
const path = require('path');

const projectRootPath = fs.realpathSync('./project'); // __dirname
const projectRootPath = fs.existsSync('./project')
? fs.realpathSync('./project')
: fs.realpathSync('./../../../');
const packageJson = require(path.join(projectRootPath, 'package.json'));
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json'))
.compilerOptions;

const pathsConfig = jsConfig.paths;

let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');

Object.keys(pathsConfig).forEach(pkg => {
Object.keys(pathsConfig).forEach((pkg) => {
if (pkg === '@plone/volto') {
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
}
Expand All @@ -18,12 +21,11 @@ const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
const reg = new AddonConfigurationRegistry(projectRootPath);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(reg.packages).map(o => [
const addonAliases = Object.keys(reg.packages).map((o) => [
o,
reg.packages[o].modulePath,
]);


module.exports = {
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
settings: {
Expand All @@ -43,4 +45,3 @@ module.exports = {
},
},
};

6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ 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).

### [2.0.2](https://github.com/eea/volto-bise/compare/2.0.1...2.0.2) - 3 November 2022
### [2.0.3](https://github.com/eea/volto-bise/compare/2.0.2...2.0.3) - 7 December 2022

#### :hammer_and_wrench: Others

- Remove volto-slate dependency [Miu Razvan - [`5d4a097`](https://github.com/eea/volto-bise/commit/5d4a097a69ee47e52f55ef13e4c147da22cbe944)]
- Add advanced link for volto-slate [Miu Razvan - [`98eff6a`](https://github.com/eea/volto-bise/commit/98eff6a06e0276b073d0212aeeb99ae0dbd3392e)]
### [2.0.2](https://github.com/eea/volto-bise/compare/2.0.1...2.0.2) - 4 November 2022

### [2.0.1](https://github.com/eea/volto-bise/compare/2.0.0...2.0.1) - 2 November 2022

## [2.0.0](https://github.com/eea/volto-bise/compare/1.1.11...2.0.0) - 1 November 2022
Expand Down
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ pipeline {

"ES lint": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha eslint'''
sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha eslint'''
}
},

"Style lint": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha stylelint'''
sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha stylelint'''
}
},

"Prettier": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha prettier'''
sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha prettier'''
}
}
)
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-bise",
"version": "2.0.2",
"version": "2.0.3",
"description": "Volto theme and integration for BISE",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
10 changes: 10 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';

import installLink from '@plone/volto-slate/editor/plugins/AdvancedLink';

import { DefaultView } from '@plone/volto/components';

import InpageNavigation from './customizations/volto/components/theme/InpageNavigation/InpageNavigation';
Expand Down Expand Up @@ -245,6 +247,14 @@ export default (config) => {
config.blocks.blocksConfig.title.edit = TitleBlockEdit;
config.blocks.blocksConfig.title.view = TitleBlockView;

// Install advanced link
config = installLink(config);
const toolbarButtons = config.settings.slate.toolbarButtons || [];
const linkIndex = toolbarButtons.indexOf('link');
const advancedLinkIndex = toolbarButtons.indexOf('a');
toolbarButtons.splice(linkIndex, 1, 'a');
toolbarButtons.splice(advancedLinkIndex, 1);

return [
installDataCatalogue,
installKeyFacts,
Expand Down

0 comments on commit 075f406

Please sign in to comment.