-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add search and save for the remaining tables (#128)
* add points of interest to asset map search; implement a simple popup * add search for parking lots * add migration to LocalAsset so we can use PicnicGrove.fpd_uid CharField * make popup relevant to local assets and search assets * cleanup code * add signage search + tidy up point markers * cleanup code * cleanup code * cleanup code * catch and render 400 error from client * allow null for LocalAsset.asset_id * bring back docstring * change CharField to a TextField and create a new migration instead of having the two migrations that do nothing * remove signage table for now * remove dead code
- Loading branch information
Showing
8 changed files
with
213 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.1.7 on 2022-02-16 17:20 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('asset_dashboard', '0025_auto_20220126_1731'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='localasset', | ||
name='asset_id', | ||
field=models.TextField(blank=True, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react' | ||
|
||
function Popup({ feature }) { | ||
const properties = feature.properties | ||
return ( | ||
<> | ||
{properties && | ||
<div> | ||
<h6>Asset Info</h6> | ||
<ul className='list-group list-group-flush'> | ||
<li className='list-group-item'> | ||
<strong>ID:</strong> {properties.asset_id ? properties.asset_id : properties.identifier } | ||
</li> | ||
<li className='list-group-item'> | ||
<strong>Name:</strong> {properties.asset_name ? properties.asset_name : properties.name } | ||
</li> | ||
{properties.asset_type | ||
&& <li className='list-group-item'> | ||
<strong>Asset Type:</strong> {properties.asset_type} | ||
</li> | ||
} | ||
</ul> | ||
</div> | ||
} | ||
</> | ||
) | ||
} | ||
|
||
export default Popup |
12 changes: 12 additions & 0 deletions
12
asset_dashboard/static/js/components/map_utils/circleMarker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default function circleMarker (feature, latlng) { | ||
return L.circleMarker( | ||
latlng, | ||
{ | ||
radius: 7, | ||
fillColor: 'green', | ||
weight: 1, | ||
opacity: 1, | ||
fillOpacity: 1 | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.