Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Oct 9, 2020
1 parent 9d33e4d commit 2c87a6c
Show file tree
Hide file tree
Showing 12 changed files with 839 additions and 131 deletions.
20 changes: 10 additions & 10 deletions src/components/manage/Blocks/DiscodataOpenlayersMapBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1185,15 +1185,17 @@ const OpenlayersMapView = (props) => {
<Link
as="a"
className={
!state.popupDetails.properties.nLCP
!state.popupDetails.properties.nInstallations
? 'disabled-link'
: ''
}
onClick={setSiteQueryParams}
to={'/industrial-site/large-scale-fuel-combustion'}
to={
'/industrial-site/regulatory-information/site-overview'
}
>
{state.popupDetails.properties.nLCP || 0} Large
combustion plants
{state.popupDetails.properties.nInstallations || 0}{' '}
Installations
</Link>
</p>
</div>
Expand All @@ -1202,17 +1204,15 @@ const OpenlayersMapView = (props) => {
<Link
as="a"
className={
!state.popupDetails.properties.nInstallations
!state.popupDetails.properties.nLCP
? 'disabled-link'
: ''
}
onClick={setSiteQueryParams}
to={
'/industrial-site/regulatory-information/site-overview'
}
to={'/industrial-site/large-scale-fuel-combustion'}
>
{state.popupDetails.properties.nInstallations || 0}{' '}
Installations
{state.popupDetails.properties.nLCP || 0} Large
combustion plants
</Link>
</p>
</div>
Expand Down
92 changes: 92 additions & 0 deletions src/components/manage/Blocks/GlossarySearchBlock/Edit.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import React from 'react';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { injectIntl } from 'react-intl';
import View from './View';

import RenderFields from 'volto-addons/Widgets/RenderFields';

const schema = {
title: {
title: 'Title',
type: 'text',
},
description: {
title: 'Description',
type: 'text',
},
placeholder: {
title: 'Placeholder',
type: 'text',
},
searchButton: {
title: 'Search button',
type: 'boolean',
},
buttonText: {
title: 'Button text',
type: 'text',
requires: 'searchButton',
},
className: {
title: 'Class name',
type: 'text',
},
buttonClassName: {
title: 'Button class name',
type: 'text',
requires: 'searchButton',
},
query: {
title: 'Query parameters',
type: 'schema',
fieldSetTitle: 'Query metadata',
fieldSetId: 'query-metadata',
fieldSetSchema: {
fieldsets: [
{
id: 'default',
title: 'title',
fields: ['title', 'id', 'value'],
},
],
properties: {
title: {
type: 'string',
title: 'Query title',
},
id: {
type: 'string',
title: 'Query id',
description: 'This will be used as query parameter key',
},
value: {
type: 'array',
title: 'Values',
},
},
required: ['id', 'title', 'value'],
},
editFieldset: false,
deleteFieldset: false,
},
};

const Edit = (props) => {
if (__SERVER__) {
return <div />;
}
return (
<div>
<RenderFields schema={schema} {...props} title="Search block" />
<View {...props} />
</div>
);
};

export default compose(
injectIntl,
connect((state) => ({
content: state.content.data,
})),
)(Edit);
Loading

0 comments on commit 2c87a6c

Please sign in to comment.