Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Expandable table Popup map fix #68

Merged
merged 3 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ 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).

#### [0.2.11](https://github.com/eea/volto-forests-theme/compare/0.2.10...0.2.11)

- Expandable table Popup map fix [`d84234a`](https://github.com/eea/volto-forests-theme/commit/d84234a4c80a93e35a7101a375f677b0150c53ce)

#### [0.2.10](https://github.com/eea/volto-forests-theme/compare/0.2.9...0.2.10)

> 10 May 2022

- Merge pull request #67 from eea/develop [`adffc47`](https://github.com/eea/volto-forests-theme/commit/adffc4781fe040cb6acb4f7a275baea2e4e9575e)
- stylelint [`bb88d6e`](https://github.com/eea/volto-forests-theme/commit/bb88d6ef8034df89108a0f386baa033b1afc529c)
- Expandable table mobile views [`5ed9d38`](https://github.com/eea/volto-forests-theme/commit/5ed9d38493e2f2ea05b060f1470b317001701ca5)

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-forests-theme",
"version": "0.2.10",
"version": "0.2.11",
"description": "@eeacms/volto-forests-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ const PopupRow = ({
country: popupCountryCode,
},
});
} else {
}
if (!expand) {
setPopupSchema(defaultSchema);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -148,12 +149,6 @@ const PopupRow = ({
queryVal,
type,
);
handleSetFilterProvider(
popup_table_provider_url,
popup_data_query,
queryVal,
type,
);
}
};

Expand All @@ -171,13 +166,9 @@ const PopupRow = ({
popup_data_query,
type,
);
handleRemoveFilterProvider(
popup_table_provider_url,
popup_data_query,
type,
);
}
};

return (
<Modal
className="expandable-modal"
Expand All @@ -197,83 +188,94 @@ const PopupRow = ({
</div>
}
>
<Modal.Header className="popup-header">{popupSchema.title}</Modal.Header>
<Modal.Content scrolling>
<div className="popup-header-data">
{popupSchema.logo && (
<a
className="popup-logo-container"
href={popupSchema.url}
target="_blank"
rel="noreferrer"
>
<img
src={popupSchema.logo}
alt={popupSchema.logo}
className="popup-logo"
onError={() => setPopupSchema({ ...popupSchema, logo: '' })} // don't show it if it's not available
/>
</a>
)}
<div className="info-container">
{popupSchema.email && (
<div style={{ display: 'flex' }}>
<p style={{ margin: '0 10px 0 0', fontSize: '24px' }}>Email:</p>
<a href={`mailto:${popupSchema.email}`} className="popup-url">
{popupSchema.email}
</a>
</div>
)}
{popupSchema.url && (
<div style={{ display: 'flex' }}>
<p style={{ margin: '0 10px 0 0', fontSize: '24px' }}>
Website:
</p>
{popupSchema !== defaultSchema && (
<React.Fragment>
<Modal.Header className="popup-header">
{popupSchema.title}
</Modal.Header>
<Modal.Content scrolling>
<div className="popup-header-data">
{popupSchema.logo && (
<a
className="popup-logo-container"
href={popupSchema.url}
target="_blank"
rel="noreferrer"
className="popup-url"
>
{popupSchema.url}
<img
src={popupSchema.logo}
alt={popupSchema.logo}
className="popup-logo"
onError={() => setPopupSchema({ ...popupSchema, logo: '' })} // don't show it if it's not available
/>
</a>
)}
<div className="info-container">
{popupSchema.email && (
<div style={{ display: 'flex' }}>
<p style={{ margin: '0 10px 0 0', fontSize: '24px' }}>
Email:
</p>
<a
href={`mailto:${popupSchema.email}`}
className="popup-url"
>
{popupSchema.email}
</a>
</div>
)}
{popupSchema.url && (
<div style={{ display: 'flex' }}>
<p style={{ margin: '0 10px 0 0', fontSize: '24px' }}>
Website:
</p>
<a
href={popupSchema.url}
target="_blank"
rel="noreferrer"
className="popup-url"
>
{popupSchema.url}
</a>
</div>
)}
</div>
)}
</div>
</div>
<Modal.Description style={{ display: 'flex' }}>
{popupSchema.description && (
<div className="description-container">
<ReadMore maxChars={600} text={popupSchema.description} />
</div>
)}
</Modal.Description>
<Modal.Description style={{ display: 'flex' }}>
{popupSchema.description && (
<div className="description-container">
<ReadMore maxChars={600} text={popupSchema.description} />
</div>
)}
</Modal.Description>

<div className="popup-columns-container">
<div className="popup-column">
{rowData && (
<PopupTable
rowData={rowData}
providerUrl={popup_table_provider_url}
tableColumns={popupSchema.tableColumns}
/>
)}
</div>
<div className="popup-column">
{rowData && (
<PopupMap
rowData={rowData}
providerUrl={popup_map_provider_url}
mapData={popupSchema.mapData}
/>
)}
</div>
</div>
</Modal.Content>
<div className="popup-columns-container">
<div className="popup-column">
{rowData && (
<PopupTable
rowData={rowData}
providerUrl={popup_table_provider_url}
tableColumns={popupSchema.tableColumns}
/>
)}
</div>
<div className="popup-column">
{rowData && (
<PopupMap
rowData={rowData}
providerUrl={popup_map_provider_url}
mapData={popupSchema.mapData}
/>
)}
</div>
</div>
</Modal.Content>

<Modal.Actions>
<Button onClick={() => handleClose()}>Close</Button>
</Modal.Actions>
<Modal.Actions>
<Button onClick={() => handleClose()}>Close</Button>
</Modal.Actions>
</React.Fragment>
)}
</Modal>
);
};
Expand Down