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

CORE-4887: hide map temporary #341

Merged
merged 1 commit into from
Apr 9, 2024
Merged
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
48 changes: 26 additions & 22 deletions templates/data-providers/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ import AddDataProviderForm from './form'

import { formatNumber } from 'utils/format-number'
import Search from 'modules/search-layout'
import Map from 'modules/map'

const filterAndMapDataProviders = (dataProviders) =>
dataProviders
.filter(
({ name, dataProviderLocation }) =>
dataProviderLocation?.latitude != null &&
dataProviderLocation?.longitude != null &&
name
)
.map(({ id, name, dataProviderLocation }) => ({
name,
href: `/data-providers/${id}`,
latitude: dataProviderLocation?.latitude,
longitude: dataProviderLocation?.longitude,
}))
// REMOVE TEMP until data is correct

// const filterAndMapDataProviders = (dataProviders) =>
// dataProviders
// .filter(
// ({ name, dataProviderLocation }) =>
// dataProviderLocation?.latitude != null &&
// dataProviderLocation?.longitude != null &&
// name
// )
// .map(({ id, name, dataProviderLocation }) => ({
// name,
// href: `/data-providers/${id}`,
// latitude: dataProviderLocation?.latitude,
// longitude: dataProviderLocation?.longitude,
// }))

const getCountryName = (code) => {
const countryName = countries[String(code).toUpperCase()]
Expand Down Expand Up @@ -174,13 +175,16 @@ const DataProvidersSearchTemplate = React.memo(
</div>
</SearchResults>
<Search.Sidebar>
{results.length > 0 && (
<Map
className={styles.map}
// We have too long load map with full list data-providers
locations={filterAndMapDataProviders(results.slice(0, 200))}
/>
)}
{/* // REMOVE TEMP until data is correct */}

{/* {results.length > 0 && ( */}
{/* <Map */}
{/* className={styles.map} */}
{/* // We have too long load map with full list data-providers */}
{/* eslint-disable-next-line max-len */}
{/* locations={filterAndMapDataProviders(results.slice(0, 200))} */}
{/* /> */}
{/* )} */}
<p>
We aggregate research papers from data providers all over the world
including institutional and subject repositories and journal
Expand Down
Loading