mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Merge branch 'main' into add-and-improve-tests
This commit is contained in:
Vendored
+3
-1
@@ -6,5 +6,7 @@
|
||||
"eslint.workingDirectories": [
|
||||
{ "directory": "./frontend", "changeProcessCWD": true },
|
||||
{ "directory": "./backend", "changeProcessCWD": true }
|
||||
]
|
||||
],
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ describe('Open each page, table view and detail view, and check at least some co
|
||||
})
|
||||
|
||||
it('Locality works', () => {
|
||||
cy.contains('Search').click()
|
||||
cy.contains('Localities').click()
|
||||
cy.contains('Dmanisi')
|
||||
cy.get('[data-cy="detailview-button-21050"]').click()
|
||||
@@ -17,7 +16,6 @@ describe('Open each page, table view and detail view, and check at least some co
|
||||
})
|
||||
|
||||
it('Species works', () => {
|
||||
cy.contains('Search').click()
|
||||
cy.contains('Species').click()
|
||||
cy.contains('Rodentia')
|
||||
cy.get('[data-cy="detailview-button-21052"]').first().click()
|
||||
|
||||
@@ -14,7 +14,6 @@ describe('Button Tests', () => {
|
||||
cy.contains('References').should('be.visible')
|
||||
cy.contains('Time Units').should('be.visible')
|
||||
|
||||
cy.contains('Search').click()
|
||||
cy.contains('Cross-Search').should('be.visible')
|
||||
cy.contains('Localities').should('be.visible')
|
||||
cy.contains('Species').should('be.visible')
|
||||
@@ -22,7 +21,6 @@ describe('Button Tests', () => {
|
||||
|
||||
it('Localities button works', () => {
|
||||
cy.visit('/')
|
||||
cy.contains('Search').click()
|
||||
cy.contains('Localities').click()
|
||||
cy.url().should('include', '/locality')
|
||||
cy.contains('Name').should('be.visible')
|
||||
@@ -33,7 +31,6 @@ describe('Button Tests', () => {
|
||||
|
||||
it('Species button works', () => {
|
||||
cy.visit('/')
|
||||
cy.contains('Search').click()
|
||||
cy.contains('Species').click()
|
||||
cy.url().should('include', '/species')
|
||||
cy.contains('Order').should('be.visible')
|
||||
@@ -52,7 +49,6 @@ describe('Button Tests', () => {
|
||||
|
||||
it('Cross Search button works', () => {
|
||||
cy.visit('/')
|
||||
cy.contains('Search').click()
|
||||
cy.contains('Cross-Search').click()
|
||||
cy.url().should('include', '/crosssearch')
|
||||
cy.contains('Locality name').should('be.visible')
|
||||
|
||||
@@ -45,7 +45,14 @@ export const LocalitiesMap = ({ localitiesQueryData, localitiesQueryIsFetching }
|
||||
const markers: Layer = L.markerClusterGroup()
|
||||
|
||||
const localityIds = columnFilters.idList as unknown as number[]
|
||||
const filteredLocalities = localitiesQueryData?.filter(locality => localityIds.includes(locality.lid))
|
||||
const filterApplied = localityIds.length > 0 && localityIds.every(id => id === null)
|
||||
|
||||
const validIds = localityIds.filter(id => typeof id === 'number')
|
||||
|
||||
const filteredLocalities = !filterApplied
|
||||
? localitiesQueryData?.filter(locality => validIds.includes(locality.lid))
|
||||
: localitiesQueryData
|
||||
|
||||
filteredLocalities?.forEach(locality =>
|
||||
markers.addLayer(
|
||||
L.marker([locality.dec_lat, locality.dec_long], {
|
||||
@@ -71,17 +78,29 @@ export const LocalitiesMap = ({ localitiesQueryData, localitiesQueryIsFetching }
|
||||
noWrap: true,
|
||||
})
|
||||
|
||||
const baseMaps = {
|
||||
OpenTopoMap: topomap,
|
||||
OpenStreetMap: osm,
|
||||
}
|
||||
|
||||
// LAYERS ON TOP OF BASE MAPS
|
||||
//// Add borders to the map
|
||||
borders.forEach(poly => {
|
||||
L.polygon(poly as LatLngExpression[], { color: 'gray', weight: 1 }).addTo(map)
|
||||
})
|
||||
|
||||
// create a polygon layer for the country borders that is in layer control panel
|
||||
const borderLayer = L.layerGroup()
|
||||
borders.forEach(country_border => {
|
||||
const polygon = L.polygon(country_border as LatLngExpression[], {
|
||||
color: '#136f94',
|
||||
fillOpacity: 0.3,
|
||||
weight: 1,
|
||||
})
|
||||
borderLayer.addLayer(polygon)
|
||||
})
|
||||
|
||||
const baseMaps = {
|
||||
OpenTopoMap: topomap,
|
||||
OpenStreetMap: osm,
|
||||
Countries: borderLayer,
|
||||
}
|
||||
|
||||
// Add a scale bar to the map
|
||||
L.control.scale({ position: 'bottomright' }).addTo(map)
|
||||
// Add a layer control to the map
|
||||
|
||||
@@ -17,15 +17,9 @@ export const NavBar = () => {
|
||||
const dispatch = useDispatch()
|
||||
const notify = useNotify()
|
||||
const pages: LinkDefinition[] = [
|
||||
{
|
||||
title: 'Search',
|
||||
url: '',
|
||||
children: [
|
||||
{ title: 'Localities', url: '/locality' },
|
||||
{ title: 'Species', url: '/species' },
|
||||
{ title: 'Cross-Search', url: '/crosssearch' },
|
||||
],
|
||||
},
|
||||
{ title: 'Localities', url: '/locality' },
|
||||
{ title: 'Species', url: '/species' },
|
||||
{ title: 'Cross-Search', url: '/crosssearch' },
|
||||
{ title: 'References', url: '/reference' },
|
||||
{ title: 'Time Units', url: '/time-unit' },
|
||||
{ title: 'Time Bounds', url: '/time-bound', allowedRoles: [Role.Admin, Role.EditUnrestricted] },
|
||||
|
||||
Reference in New Issue
Block a user