Version 2.2
Closes: Shapefile Exports.
What's Changed
- Property2shp by @pollardld in #138
This Release includes various changes to the landmapper project, mainly focusing on CSS updates, JavaScript improvements, template modifications, and the addition of new tests. The most important changes include enhancements to the export layer functionality, CSS updates for better styling, and new tests for exporting shapefiles.
Export Layer Functionality:
landmapper/app/js/report.js: Added functionality to disable the export button during the export process and re-enable it afterward to prevent multiple clicks. [1] [2]landmapper/app/urls.py: Changed the URL parameter fromproperty_idtoproperty_pkfor the export layer endpoint.landmapper/app/views.py: Updated theexport_layerfunction to use the primary key (property_pk) and added input sanitization for filenames. [1] [2]
CSS Updates:
landmapper/app/static/landmapper/css/base.css: Added RGB variables for primary colors and adjusted the margin for horizontal rules. [1] [2]landmapper/app/static/landmapper/css/or.cssandlandmapper/app/static/landmapper/css/wa.css: Added RGB variables for primary colors for OR and WA themes. [1] [2]landmapper/app/static/landmapper/css/report.css: Added styles for disabled buttons, anchor links, and action buttons. [1] [2] [3] [4]
Template Modifications:
landmapper/app/templates/landmapper/report/report-overview.html: Enhanced the export layer button logic and added new sections for downloading and sharing reports. [1] [2]landmapper/app/templates/landmapper/report/report-share.html: Updated the share button to use the new action button styles and added accessibility attributes.
New Tests:
landmapper/app/tests/test_exportshp.py: Added comprehensive tests for the export layer functionality, including success, property not found, export error, unauthenticated user, and cleanup scenarios.
Full Changelog: v2.1...v2.2