Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat osm download #55

Merged
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
2 changes: 2 additions & 0 deletions frontend/src/components/projectDetail/downloadOsmData.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
projectMappingTypes?.includes(icon.value),
);
setDownloadDataList(filteredMappingTypes);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [projectMappingTypes]);

useEffect(() => {
Expand Down Expand Up @@ -184,6 +185,7 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
});
};
multipleHeadCallForFormat();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedCategoryFormat]);

return (
Expand Down
31 changes: 23 additions & 8 deletions frontend/src/components/projectDetail/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,48 @@ import { AddToFavorites } from './favorites';
import { HorizontalScroll } from '../horizontalScroll';

import './styles.scss';
import { ENABLE_EXPORT_TOOL } from '../../config';

const menuItems = [
{
href: '#top',
label: <FormattedMessage {...messages.overview} />,
isVisibleCondition: true,
},
{
href: '#description',
label: <FormattedMessage {...messages.description} />,
isVisibleCondition: true,
},
{
href: '#coordination',
label: <FormattedMessage {...messages.coordination} />,
isVisibleCondition: true,
},
{
href: '#teams',
label: <FormattedMessage {...messages.teamsAndPermissions} />,
isVisibleCondition: true,
},
{
href: '#questionsAndComments',
label: <FormattedMessage {...messages.questionsAndComments} />,
isVisibleCondition: true,
},
{
href: '#contributions',
label: <FormattedMessage {...messages.contributions} />,
isVisibleCondition: true,
},
{
href: '#downloadOsmData',
label: <FormattedMessage {...messages.downloadOsmData} />,
isVisibleCondition: +ENABLE_EXPORT_TOOL === 1,
},
{
href: '#similarProjects',
label: <FormattedMessage {...messages.similarProjects} />,
isVisibleCondition: true,
},
];

Expand All @@ -64,14 +73,20 @@ export const ProjectDetailFooter = ({ className, projectId }) => {
containerClass={'.menu-items-container'}
>
<div ref={menuItemsContainerRef} className="menu-items-container nowrap overflow-x-auto">
{menuItems.map((menuItem, index) => (
<Fragment key={menuItem.href}>
<a className="link blue-dark" href={menuItem.href}>
{menuItem.label}
</a>
{index < menuItems.length - 1 && <span className="ph2">&#183;</span>}
</Fragment>
))}
{menuItems.map((menuItem, index) => {
if (menuItem.isVisibleCondition) {
return (
<Fragment key={menuItem.href}>
<a className="link blue-dark" href={menuItem.href}>
{menuItem.label}
</a>
{index < menuItems.length - 1 && <span className="ph2">&#183;</span>}
</Fragment>
);
} else {
return null;
}
})}
</div>
</HorizontalScroll>
<div className="flex items-center ml-auto gap-1">
Expand Down
Loading