Skip to content

Commit a7c3559

Browse files
committed
Enhances publication contribution workflow
Adds temporal extent contribution, unified contribution form, admin unpublish functionality, RSS/Atom feed harvesting, and comprehensive test coverage. Refactors contribution page layout, improves URL structure consistency and unifies admin control panel.
1 parent 425381e commit a7c3559

File tree

5 files changed

+216
-356
lines changed

5 files changed

+216
-356
lines changed

CHANGELOG.md

Lines changed: 17 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -4,221 +4,26 @@
44

55
### Added
66

7-
- **Temporal extent contribution** (`publications/views_geometry.py`, `work_landing_page.html`)
8-
- Users can now contribute temporal extent (start/end dates) in addition to spatial extent
9-
- Added temporal extent contribution form on work landing page with date validation
10-
- Contribute page now lists publications missing either spatial OR temporal extent
11-
- Works can be published with only spatial extent, only temporal extent, or both
12-
- Support for flexible date formats: YYYY, YYYY-MM, or YYYY-MM-DD
13-
- 12 new tests covering temporal contribution and publishing workflows
14-
- Updated provenance tracking to log temporal extent contributions
15-
- **Complete status workflow documentation** (`README.md`, `tests/test_status_workflow.py`)
16-
- Documented all 6 publication statuses: Draft, Harvested, Contributed, Published, Testing, Withdrawn
17-
- Added detailed workflow transitions and visibility rules
18-
- 10 new compliance tests verifying status definitions and access controls
19-
- Tests confirm only Published status is publicly visible
20-
- Tests verify contribution only allowed for Harvested status
21-
- **Map popup enhancement** (`publications/static/js/main.js`)
22-
- Added "View Publication Details" button to map popups
23-
- Links to work landing page for detailed publication view
24-
- Supports both DOI-based (`/work/<doi>/`) and ID-based (`/work/<id>/`) URLs
25-
- Styled as Bootstrap primary button for visibility
26-
- **Geometry contribution workflow enhancements**
27-
- Added support for publications without DOI via ID-based URLs (`/work/<id>/`)
28-
- ID-based API endpoints for contribution, publishing, and unpublishing
29-
- Template automatically selects DOI or ID-based URLs based on publication
30-
- 5 new tests covering ID-based contribution workflow
31-
- **Admin unpublish functionality** (`publications/views_geometry.py`)
32-
- `unpublish_work()` and `unpublish_work_by_id()` endpoints
33-
- Changes published works to Draft status with provenance tracking
34-
- Unpublish button on work landing page for admin users
35-
- 4 new tests for unpublish workflow
36-
- Test data fixtures with Contributed status records (`fixtures/test_data_optimap.json`)
37-
- Records 903-904: Contributed publications with DOI and geometry
38-
- Records 905-906: Publications without DOI (one harvested, one contributed)
39-
- Realistic provenance information showing contribution workflow
40-
- **RSS/Atom feed harvesting support** (`publications/tasks.py`)
41-
- `parse_rss_feed_and_save_publications()` function for parsing RSS/Atom feeds
42-
- `harvest_rss_endpoint()` function for complete RSS harvesting workflow
43-
- Support for RDF-based RSS feeds (Scientific Data journal)
44-
- DOI extraction from multiple feed fields (prism:doi, dc:identifier)
45-
- Duplicate detection by DOI and URL
46-
- Abstract/description extraction from feed content
47-
- feedparser library integration (v6.0.12)
48-
- Added to requirements.txt for RSS/Atom feed parsing
49-
- Supports RSS 1.0/2.0, Atom, and RDF feeds
50-
- Django management command `harvest_journals` enhanced for RSS/Atom feeds
51-
- Added Scientific Data journal with RSS feed support
52-
- Support for both OAI-PMH and RSS/Atom feed types
53-
- Automatic feed type detection based on journal configuration
54-
- Now supports 4 journals: ESSD, AGILE-GISS, GEO-LEO (OAI-PMH), Scientific Data (RSS)
55-
- Comprehensive RSS harvesting tests (`RSSFeedHarvestingTests`)
56-
- 7 test cases covering RSS parsing, duplicate detection, error handling
57-
- Test fixture with sample RDF/RSS feed (`tests/harvesting/rss_feed_sample.xml`)
58-
- Tests for max_records limit, invalid feeds, and HTTP errors
59-
- Django management command `harvest_journals` for harvesting real journal sources
60-
- Command-line options for journal selection, record limits, and source creation
61-
- Detailed progress reporting with colored output
62-
- Statistics for spatial/temporal metadata extraction
63-
- Integration tests for real journal harvesting (`tests/test_real_harvesting.py`)
64-
- 6 tests covering ESSD, AGILE-GISS, GEO-LEO, and EssOAr
65-
- Tests skipped by default (use `SKIP_REAL_HARVESTING=0` to enable)
66-
- Max records parameter to limit harvesting for testing
67-
- Comprehensive error handling tests for OAI-PMH harvesting (`HarvestingErrorTests`)
68-
- 10 test cases covering malformed XML, missing metadata, HTTP errors, network timeouts
69-
- Test fixtures for various error conditions in `tests/harvesting/error_cases/`
70-
- Verification of graceful error handling and logging
71-
- pytest configuration with custom markers (`pytest.ini`)
72-
- `real_harvesting` marker for integration tests
73-
- Configuration for Django test discovery
7+
- **Temporal extent contribution** - Users can now contribute temporal extent (start/end dates) in addition to spatial extent. Works can be published with either spatial, temporal, or both extents. Supports flexible date formats: YYYY, YYYY-MM, YYYY-MM-DD.
8+
- **Complete status workflow documentation** - Documented all 6 publication statuses (Draft, Harvested, Contributed, Published, Testing, Withdrawn) with workflow transitions and visibility rules in README.md.
9+
- **Map popup enhancement** - Added "View Publication Details" button to map popups linking to work landing pages.
10+
- **Admin unpublish functionality** - Admins can unpublish works, changing status from Published to Draft.
11+
- **RSS/Atom feed harvesting support** - Added support for harvesting publications from RSS/Atom feeds in addition to OAI-PMH.
12+
- **Django management command `harvest_journals`** - Command-line tool for harvesting from real journal sources with progress reporting and statistics.
13+
- **Comprehensive test coverage** - Added 40+ new tests covering temporal contribution, status workflow, RSS harvesting, error handling, and real journal harvesting.
7414

7515
### Changed
7616

77-
- **Contribution endpoint now accepts both spatial and temporal extents**
78-
- `contribute_geometry_by_id()` renamed conceptually to handle both extent types
79-
- Single endpoint can accept geometry, temporal extent, or both in one request
80-
- Updated error messages to reflect dual-extent support
81-
- Provenance notes now detail all changes made in single contribution
82-
- **Publishing workflow updated for flexible extent requirements**
83-
- Harvested publications can be published with spatial extent only, temporal extent only, or both
84-
- Contributed publications can always be published regardless of extent
85-
- Updated `publish_work_by_id()` to check for at least one extent type
86-
- Error message: "Cannot publish harvested publication without spatial or temporal extent"
87-
- **Contribute page query expanded**
88-
- Now shows publications missing spatial extent OR temporal extent
89-
- Previously only showed publications missing spatial extent
90-
- Allows crowdsourcing of both types of metadata
91-
- **Work landing page alerts updated**
92-
- Dynamic messages show which extent types are missing
93-
- Conditional UI shows geometry map tools and/or temporal form as needed
94-
- Context variables `has_geometry` and `has_temporal` passed to template
95-
- **Unified URL structure for work landing pages**
96-
- Changed ID-based URLs from `/publication/<id>/` to `/work/<id>/`
97-
- Both DOI-based and ID-based URLs now use `/work/` prefix for consistency
98-
- Updated all templates, JavaScript, and tests to use new URL structure
99-
- Legacy `/publication/<id>/` paths no longer exist
100-
- **Refactored views_geometry.py to eliminate code duplication**
101-
- DOI-based functions now wrap ID-based functions instead of duplicating logic
102-
- `contribute_geometry()`, `publish_work()`, and `unpublish_work()` translate DOI to ID
103-
- Core business logic consolidated in `*_by_id()` functions
104-
- Reduced code from 375 lines to 240 lines (~36% reduction)
105-
- Easier maintenance with single source of truth for each operation
106-
- **Renamed "Locate" page to "Contribute"** for clarity
107-
- URL changed from `/locate/` to `/contribute/` (legacy redirect in place)
108-
- View function renamed: `locate()``contribute()`
109-
- Template renamed: `locate.html``contribute.html`
110-
- Footer link updated: "Locate" → "Contribute"
111-
- Page title: "Locate Publications" → "Contribute Geolocation Data"
112-
- Better reflects the crowdsourcing action users perform
113-
- **Completely refactored contribute page layout** to fix text overflow
114-
- Rewrote CSS from scratch with proper containment strategy
115-
- Added `min-width: 0` to all flex items (critical for proper shrinking)
116-
- Added `overflow: hidden` at card, card-body, and card-footer levels
117-
- Changed DOI breaking from `break-word` to `break-all` for long identifiers
118-
- Used `<div>` instead of `<br>` for footer metadata (better structure)
119-
- Reduced button text: "Contribute geospatial metadata" → "Contribute metadata"
120-
- Text now properly wraps within card boundaries with no overflow
121-
- **Publishing workflow now supports harvested publications with geometry**
122-
- `publish_work()` and `publish_work_by_id()` functions accept both Contributed and Harvested status
123-
- Harvested publications can be published directly if they already have geometry
124-
- Contributed publications can always be published (existing behavior)
125-
- Updated provenance messages to indicate source status (Contributed vs Harvested)
126-
- Test updated to verify harvested publication publishing
127-
- **CSS organization improved**
128-
- Moved all inline CSS from locate.html to central main.css file
129-
- Better maintainability and consistent styling across pages
130-
- Fixed OAI-PMH harvesting test failures by updating response format parameters
131-
- Changed from invalid 'structured'/'raw' to valid 'geojson'/'wkt'/'wkb' formats
132-
- Updated test assertions to expect GeoJSON FeatureCollection
133-
- Fixed syntax errors in `publications/tasks.py`
134-
- Fixed import statement typo
135-
- Fixed indentation in `extract_timeperiod_from_html` function
136-
- Fixed misplaced return statement in `regenerate_geopackage_cache` function
137-
- Fixed test setup method in `tests/test_harvesting.py`
138-
- Removed incorrect `@classmethod` decorator from `setUp` method
139-
- Fixed `test_regular_harvesting.py` to include `max_records` parameter in mock function
140-
- Updated README.md with comprehensive documentation for:
141-
- Integration test execution
142-
- `harvest_journals` management command usage
143-
- Journal harvesting workflows
17+
- **Unified contribution workflow** - Single "Submit contribution" button for both spatial and temporal extent. Users can submit either or both in one action.
18+
- **Unified admin control panel** - Consolidated admin status display, publish/unpublish buttons, and "Edit in Admin" link into single highlighted box at top of work landing page.
19+
- **Improved text wrapping** - Page titles and abstract text now properly wrap on narrow windows instead of overflowing.
20+
- **Unified URL structure** - Changed ID-based URLs from `/publication/<id>/` to `/work/<id>/` for consistency with DOI-based URLs.
21+
- **Refactored views_geometry.py** - Eliminated code duplication by making DOI-based functions wrap ID-based functions. Reduced from 375 to 240 lines (~36% reduction).
22+
- **Renamed "Locate" to "Contribute"** - URL, page title, and navigation updated for clarity about crowdsourcing purpose.
23+
- **Contribute page layout refactored** - Fixed text overflow issues with proper CSS containment strategy.
24+
- **Flexible publishing requirements** - Harvested publications with geometry can be published directly without requiring user contribution.
25+
- **Contribute page login button improved** - Changed to informational disabled button with clear text: "Please log in to contribute (user menu at top right)".
14426

14527
### Fixed
14628

147-
- Docker build for geoextent installation (added git dependency to Dockerfile)
148-
- 18 geoextent API test failures due to invalid response format values
149-
- 8 test setup errors in OAI-PMH harvesting tests
150-
- Test harvesting function signature mismatch
151-
152-
### Deprecated
153-
154-
- None.
155-
156-
### Removed
157-
158-
- None.
159-
160-
### Security
161-
162-
- None.
163-
164-
## [0.2.0] - 2025-10-09
165-
166-
### Added
167-
168-
- Work landing page improvements:
169-
- Clickable DOI links to https://doi.org resolver
170-
- Clickable source links to journal homepages
171-
- Link to raw JSON API response
172-
- Publication title and DOI in HTML `<title>` tag
173-
- Map enhancements on work landing page:
174-
- Fullscreen control using Leaflet Fullscreen plugin
175-
- Custom "Zoom to All Features" button
176-
- Scroll wheel zoom enabled
177-
- Comprehensive test suite for work landing page (9 tests)
178-
- Comprehensive test suite for geoextent API (24 tests)
179-
180-
### Changed
181-
182-
- None.
183-
184-
### Fixed
185-
186-
- None.
187-
188-
### Deprecated
189-
190-
- None.
191-
192-
### Removed
193-
194-
- None.
195-
196-
### Security
197-
198-
- External links (DOI, source, API) now use `target="_blank"` with `rel="noopener"` for security
199-
200-
## [0.1.0] - 2025-04-16
201-
202-
### Added
203-
204-
- Changelog
205-
206-
### Changed
207-
208-
- None.
209-
210-
### Fixed
211-
212-
- None.
213-
214-
### Deprecated
215-
216-
- None.
217-
218-
### Removed
219-
220-
- None.
221-
222-
### Security
223-
224-
- None.
29+
- **JavaScript scope error** - Fixed "drawnItems is not defined" error in contribution form by declaring variable in outer scope.

optimap/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.3.0"
1+
__version__ = "0.4.0"
22
VERSION = __version__

publications/static/css/main.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,25 +183,39 @@ main {
183183
}
184184

185185
/* Work landing page styles */
186+
.work-landing-page {
187+
max-width: 1200px;
188+
margin: 0 auto;
189+
padding: 0 1rem;
190+
overflow-wrap: break-word;
191+
word-wrap: break-word;
192+
word-break: break-word;
193+
}
194+
186195
h1.page-title {
187196
margin-top: 2rem;
188197
margin-bottom: .5rem;
189198
word-wrap: break-word;
190199
overflow-wrap: break-word;
200+
word-break: break-word;
191201
hyphens: auto;
202+
white-space: normal !important;
203+
max-width: 100%;
192204
}
193205

194206
.muted {
195207
color: #666;
196208
font-size: .92rem;
197209
word-wrap: break-word;
198210
overflow-wrap: break-word;
211+
word-break: break-word;
199212
}
200213

201214
.meta {
202215
margin: 1rem 0 1.5rem;
203216
word-wrap: break-word;
204217
overflow-wrap: break-word;
218+
word-break: break-word;
205219
}
206220

207221
.meta a {
@@ -251,7 +265,16 @@ h1.page-title {
251265
.work-landing-page p {
252266
word-wrap: break-word;
253267
overflow-wrap: break-word;
268+
word-break: break-word;
254269
hyphens: auto;
270+
max-width: 100%;
271+
white-space: normal;
272+
}
273+
274+
/* Ensure abstract text wraps properly */
275+
.work-landing-page > p {
276+
margin: 1rem 0;
277+
line-height: 1.6;
255278
}
256279

257280
/* Contribute page styles - completely refactored */

publications/templates/contribute.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ <h5 class="card-title">
6767
</a>
6868
{% endif %}
6969
{% else %}
70-
<a href="/loginres/" class="btn btn-outline-primary btn-sm">
71-
<i class="fas fa-sign-in-alt"></i> Log in to contribute
72-
</a>
70+
<button disabled class="btn btn-outline-secondary btn-sm" title="Please use the user menu at the top right to log in">
71+
<i class="fas fa-user-circle"></i> Please log in to contribute (user menu at top right)
72+
</button>
7373
{% endif %}
7474
</div>
7575
</div>

0 commit comments

Comments
 (0)