Skip to content

Commit dfb52ed

Browse files
authored
Fix colors for color swatch widget buttons (#12)
* fix colors for color swatch widget buttons * changelog * update storybook & eslint files * update import paths
1 parent 4ddfdd6 commit dfb52ed

File tree

8 files changed

+31
-10
lines changed

8 files changed

+31
-10
lines changed

.eslintrc.js

+23-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
const fs = require('fs');
22
const projectRootPath = __dirname;
3-
const AddonConfigurationRegistry = require('@plone/registry/src/addon-registry');
3+
const { AddonRegistry } = require('@plone/registry/addon-registry');
44

55
let coreLocation;
66
if (fs.existsSync(`${projectRootPath}/core`))
77
coreLocation = `${projectRootPath}/core`;
88
else if (fs.existsSync(`${projectRootPath}/../../core`))
99
coreLocation = `${projectRootPath}/../../core`;
1010

11-
const registry = new AddonConfigurationRegistry(
12-
`${coreLocation}/packages/volto`,
13-
);
11+
const { registry } = AddonRegistry.init(`${coreLocation}/packages/volto`);
1412

1513
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
1614
const addonAliases = Object.keys(registry.packages).map((o) => [
@@ -22,6 +20,27 @@ module.exports = {
2220
extends: `${coreLocation}/packages/volto/.eslintrc`,
2321
rules: {
2422
'import/no-unresolved': 1,
23+
'import/named': 'error',
24+
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
25+
'no-restricted-imports': [
26+
'error',
27+
{
28+
name: '@plone/volto/components',
29+
message:
30+
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
31+
},
32+
{
33+
name: '@plone/volto/helpers',
34+
message:
35+
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
36+
},
37+
{
38+
name: '@plone/volto/actions',
39+
message:
40+
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
41+
},
42+
],
43+
'react/jsx-key': [2, { checkFragmentShorthand: true }],
2544
},
2645
settings: {
2746
'import/resolver': {

.storybook/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ module.exports = {
107107
[],
108108
defaultRazzleOptions,
109109
);
110-
const AddonConfigurationRegistry = require('@plone/registry/src/addon-registry');
110+
const { AddonRegistry } = require('@plone/registry/addon-registry');
111111

112-
const registry = new AddonConfigurationRegistry(projectRootPath);
112+
const { registry } = AddonRegistry.init(projectRootPath);
113113

114114
config = lessPlugin({ registry }).modifyWebpackConfig({
115115
env: { target: 'web', dev: 'dev' },
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add style for color-swatch-widget. @danalvrz

packages/volto-highlight-block/src/components/Blocks/Highlight/Data.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { useIntl } from 'react-intl';
3-
import { BlockDataForm } from '@plone/volto/components';
3+
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
44

55
import { HighlightSchema } from './schema';
66
import { useSelector } from 'react-redux';

packages/volto-highlight-block/src/components/Blocks/Highlight/Edit.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import { SidebarPortal } from '@plone/volto/components';
2+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
33
import HighlightData from './Data';
44
import HighlightView from './View';
55

packages/volto-highlight-block/src/components/Blocks/Highlight/View.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import cx from 'classnames';
33
import { TextBlockView } from '@plone/volto-slate/blocks/Text';
44
import { DetachedTextBlockEditor } from '@plone/volto-slate/blocks/Text/DetachedTextBlockEditor';
55
import TextLineEdit from '@plone/volto/components/manage/TextLineEdit/TextLineEdit';
6-
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers';
6+
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url';
77
import { Container as SemanticContainer, Button } from 'semantic-ui-react';
88
import { useSelector } from 'react-redux';
99
import config from '@plone/volto/registry';

packages/volto-highlight-block/src/components/Blocks/Highlight/adapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flattenToAppURL } from '@plone/volto/helpers';
1+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
22

33
export const HighlightBlockDataAdapter = ({
44
block,

packages/volto-highlight-block/src/theme/highlight.scss

+1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ $highlight-images-object-position: top left;
238238
}
239239

240240
.color-picker-widget,
241+
.color-swatch-widget,
241242
.theme-picker-widget {
242243
// Color widget &
243244
// Theme color picker widget

0 commit comments

Comments
 (0)