Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: Shapefile Exports.
This pull request 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_id
toproperty_pk
for the export layer endpoint.landmapper/app/views.py
: Updated theexport_layer
function 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.css
andlandmapper/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.