Skip to content

Commit

Permalink
Merge pull request #11 from eea/more-addons
Browse files Browse the repository at this point in the history
add missing addons from volto-addons
  • Loading branch information
nileshgulia1 authored Mar 30, 2021
2 parents 265a5df + 78ab6ec commit d2e545b
Show file tree
Hide file tree
Showing 6 changed files with 415 additions and 534 deletions.
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
FROM node:12-stretch-slim

#RUN apt-get update && apt-get install -y git

RUN runDeps="openssl ca-certificates patch" \
&& apt-get update \
&& apt-get install -y --no-install-recommends $runDeps \
&& apt-get install -y --no-install-recommends $runDeps git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY . /opt/frontend/
RUN chown -R node /opt/frontend/
RUN rm -rf /opt/frontend/src/addons/*

WORKDIR /opt/frontend/
RUN npm install -g mrs-developer
USER node

RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn \
&& RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build \
ARG MAX_OLD_SPACE_SIZE=8192
ENV NODE_OPTIONS=--max_old_space_size=$MAX_OLD_SPACE_SIZE

RUN cd /opt/frontend

RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn
RUN yarn develop
RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn

RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build \
&& rm -rf /home/node/.cache

EXPOSE 3000 3001 4000 4001
Expand Down
9 changes: 8 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"compilerOptions": {
"paths": {},
"jsx": "react",
"paths": {
"volto-addons": ["addons/volto-addons/src"],
"volto-plotlycharts": ["addons/volto-plotlycharts/src"],
"volto-datablocks": ["addons/volto-datablocks/src"],
"@eeacms/volto-tabs-block": ["addons/volto-tabs-block/src"],
"volto-embed": ["addons/volto-embed/src"]
},
"baseUrl": "src"
}
}
30 changes: 29 additions & 1 deletion mrs.developer.json
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
{}
{
"volto-addons": {
"url": "https://github.com/eea/volto-addons.git",
"path": "src",
"develop": true
},
"volto-tabs-block": {
"url": "https://github.com/eea/volto-tabs-block.git",
"path": "src",
"package": "@eeacms/volto-tabs-block",
"branch": "master",
"develop": false
},
"volto-embed": {
"url": "https://github.com/eea/volto-embed.git",
"path": "src",
"develop": false
},
"volto-datablocks": {
"url": "https://github.com/eea/volto-datablocks.git",
"path": "src",
"develop": false
},
"volto-plotlycharts": {
"url": "https://github.com/eea/volto-plotlycharts.git",
"path": "src",
"develop": false
}
}
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
],
"addons": [
"volto-slate",
"@eeacms/volto-tabs-block",
"volto-plotlycharts",
"volto-embed",
"volto-datablocks",
"@eeacms/volto-columns-block",
"@eeacms/volto-pdf-block",
"@eeacms/volto-corsproxy",
"@eeacms/volto-block-style",
"@eeacms/volto-collection-block",
Expand Down Expand Up @@ -103,15 +108,21 @@
},
"dependencies": {
"@eeacms/volto-corsproxy": "2.1.0",
"volto-plotlycharts": "github:eea/volto-plotlycharts",
"volto-embed": "github:eea/volto-embed",
"volto-datablocks": "github:eea/volto-datablocks",
"@eeacms/volto-tabs-block": "github:eea/volto-tabs-block",
"@eeacms/volto-collection-block": "github:eea/volto-collection-block",
"@eeacms/volto-pdf-block": "github:eea/volto-pdf-block",
"@eeacms/volto-block-style": "2.2.0",
"@eeacms/volto-columns-block": "^3.0.0",
"@eeacms/volto-sentry-rancher-config": "^2.0.0",
"@n8tb1t/use-scroll-position": "^1.0.43",
"@plone/volto": "12.2.0",
"@plone/volto": "12.4.0",
"mgr-pdf-viewer-react": "^1.0.3",
"react-scrollspy": "^3.4.2",
"volto-slate": "^2.1.0"
"volto-slate": "^2.1.0",
"volto-addons": "github:eea/volto-addons"
},
"devDependencies": {
"eslint-plugin-prettier": "3.1.3",
Expand Down
120 changes: 118 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,38 @@ import {
} from '@plone/volto/config';

import TokenWidget from '@plone/volto/components/manage/Widgets/TokenWidget';

import chartIcon from '@plone/volto/icons/world.svg';
import TopicsView from '~/components/theme/View/TopicsView';
import TopicsTabView from '~/components/theme/View/TopicsTabView';
import FolderListingBlockView from 'volto-addons/FolderListing/BlockView';
import FolderListingBlockEdit from 'volto-addons/FolderListing/BlockEdit';
import TableauBlockEdit from 'volto-addons/Tableau/Edit';
import TableauBlockView from 'volto-addons/Tableau/View';

import HiddenWidget from 'volto-addons/Widgets/Hidden';
import CollectionYears from 'volto-addons/Widgets/CollectionYears';
import PickObject from 'volto-addons/PickObject';
import ObjectListWidget from 'volto-addons/Widgets/ObjectList';
import AlignBlockWidget from 'volto-addons/Widgets/Align';
import AttachedImageWidget from 'volto-addons/Widgets/AttachedImage';
import TemplatingToolbarWidget from 'volto-addons/Widgets/TemplatingToolbar';

import MapView from 'volto-addons/Map/View';

import WebMapBlockView from 'volto-addons/WebMap/BlockView';
import WebMapBlockEdit from 'volto-addons/WebMap/BlockEdit';

import ConnectedMapView from 'volto-addons/ConnectedMap/BlockView';
import ConnectedMapEdit from 'volto-addons/ConnectedMap/BlockEdit';

import ConnectedControl from 'volto-addons/ConnectedControl/ConnectedControl';
import SearchEdit from 'volto-addons/SearchBlock/Edit';
import SearchView from 'volto-addons/SearchBlock/View';

import TableEdit from 'volto-addons/TableBlock/Edit';
import TableView from 'volto-addons/TableBlock/View';

import * as remoteAddonReducers from 'volto-addons/reducers';

// import {
// applyConfig as addonsConfig,
Expand Down Expand Up @@ -58,6 +87,7 @@ export const settings = {
],
navDepth: 4,
allowed_cors_destinations,
tableauVersion: '2.3.0',
};

export const views = {
Expand All @@ -67,6 +97,11 @@ export const views = {
topics_view: TopicsView,
topic_tab_view: TopicsTabView,
},
contentTypesViews: {
...defaultViews.contentTypesViews,
EmbeddedMap: MapView,
embeddedmap: MapView,
},
};

export const widgets = {
Expand All @@ -76,11 +111,92 @@ export const widgets = {
'energy.resource_type': TokenWidget,
'energy.topics': TokenWidget,
},
id: {
...defaultWidgets.id,
collection_years: CollectionYears,
blocks: HiddenWidget,
blocks_layout: HiddenWidget,
templatingtoolbar: TemplatingToolbarWidget,
},
widget: {
...defaultWidgets.widget,
sidebar: [TemplatingToolbarWidget],
object_by_path: PickObject,
objectlist: ObjectListWidget,
align: AlignBlockWidget,
attachedimage: AttachedImageWidget,
},
};

export const blocks = {
...defaultBlocks,
};

blocks.blocksConfig.folder_contents_block = {
id: 'folder_contents_block',
title: 'Folder Contents',
view: FolderListingBlockView,
edit: FolderListingBlockEdit,
icon: chartIcon,
group: 'custom_addons',
};

blocks.blocksConfig.search_block = {
id: 'search_block',
title: 'Search block',
view: SearchView,
edit: SearchEdit,
icon: chartIcon,
group: 'custom_addons',
};

blocks.blocksConfig.table_block = {
id: 'table_block',
title: 'Table block',
view: TableView,
edit: TableEdit,
icon: chartIcon,
group: 'custom_addons',
};

blocks.blocksConfig.tableau = {
id: 'tableau',
title: 'Tableau',
view: TableauBlockView,
edit: TableauBlockEdit,
icon: chartIcon,
group: 'custom_addons',
};
blocks.blocksConfig.connected_map = {
id: 'connected_map',
title: 'Connected Map',
view: ConnectedMapView,
edit: ConnectedMapEdit,
icon: chartIcon,
group: 'custom_addons',
};

blocks.blocksConfig.connected_control = {
id: 'connected_control',
title: 'Connected Control',
view: ConnectedControl,
edit: ConnectedControl,
icon: chartIcon,
group: 'custom_addons',
};

blocks.blocksConfig.web_map = {
id: 'web_map',
title: 'Web Map',
view: WebMapBlockView,
edit: WebMapBlockEdit,
icon: chartIcon,
group: 'custom_addons',
sidebarTab: 1,
};

export const addonRoutes = [...defaultAddonRoutes];
export const addonReducers = { ...defaultAddonReducers };
export const addonReducers = {
...defaultAddonReducers,
...remoteAddonReducers,
};
Loading

0 comments on commit d2e545b

Please sign in to comment.