Skip to content

Commit 8a8adf0

Browse files
committed
Merge branch 'segment_types' into 'main'
introduced segment_type and type specific attributes in model, form and view... Closes #31 and #25 See merge request 701/netbox/cesnet_service_path_plugin!31
2 parents b87d605 + b61289d commit 8a8adf0

File tree

22 files changed

+1734
-57
lines changed

22 files changed

+1734
-57
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"makefile.configureOnOpen": false
3+
}

CHANGELOG.md

Lines changed: 143 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,83 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [5.0.2] - 2025-01-XX
8+
## [5.1.0] - 2025-09-23
9+
10+
### Added
11+
- **Segment Type System**: Complete implementation of segment type classification
12+
- `segment_type` field with Dark Fiber, Optical Spectrum, and Ethernet Service types
13+
- Type-specific data fields stored as JSON with dynamic schemas
14+
- Smart numeric filtering for type-specific fields with operators (>, <, >=, <=, ranges)
15+
- Dynamic form generation based on selected segment type
16+
- Type-specific field validation and conversion (Decimal, Integer)
17+
- Enhanced GraphQL API with type-specific data filtering (`has_type_specific_data`)
18+
19+
- **Enhanced Map Visualization**: Advanced mapping features
20+
- Segment type-based coloring and legend in map views
21+
- Color schemes: by status and by provider
22+
- Improved overlapping segment detection and selection
23+
- Multiple background map layers (OpenStreetMap, satellite, topographic, CartoDB)
24+
25+
- **Smart Filtering System**: Advanced filtering capabilities
26+
- Smart numeric filters for JSON fields with operator support
27+
- Type-specific field filters (fiber_type, connector_type, modulation_format, etc.)
28+
- Range filters for numeric fields (fiber_attenuation_max, wavelength, port_speed, etc.)
29+
- Boolean value parsing improvements
30+
- Enhanced search functionality including segment_type
31+
32+
### Changed
33+
- Updated segment form to preserve type-specific field values during type changes
34+
- Enhanced JavaScript form handling to hide fields without clearing values
35+
- Improved field initialization and population logic
36+
- Updated segment table to include segment_type column
37+
- Modified API serializers to handle path file uploads
38+
- Removed unnecessary SegmentListSerializer, unified with SegmentSerializer
39+
40+
### Fixed
41+
- Fixed form rendering issues with type-specific fields
42+
- Improved value preservation when switching segment types
43+
- Enhanced JSON field conversion for Decimal types
44+
- Fixed smart numeric filtering edge cases
45+
- Resolved issues with dynamic field visibility
46+
47+
48+
## [5.0.3] - 2025-08-29
49+
50+
### Fixed
51+
- **Critical**: Added save_m2m() call to SegmentForm to properly save tags
52+
- Fixed missing many-to-many relationship saving (tags were being lost)
53+
- Ensured proper persistence of all many-to-many fields
54+
55+
### Changed
56+
- Updated documentation with sample map in README
57+
- Added Apache 2.0 License (same as NetBox)
58+
- Updated pyproject.toml with repository information
59+
60+
## [5.0.2] - 2025-08-21
61+
62+
### Added
63+
- **Documentation Improvements**: Enhanced README and licensing
64+
- Apache 2.0 License badge and full license file
65+
- Sample map visualization in README
66+
- Updated repository information in pyproject.toml
67+
68+
### Changed
69+
- Repository metadata and documentation updates
70+
- Warning about work-in-progress status
71+
72+
## [5.0.1] - 2025-08-04
73+
74+
### Added
75+
- **Comprehensive Segment Map**: Interactive map view for all segments
76+
- Map utilizes list view filtering capabilities
77+
- Multiple background layer options
78+
- Improved navigation and user experience
79+
80+
### Fixed
81+
- Fixed button types to prevent form submission when changing map layers
82+
- Enhanced map layer switching controls
83+
84+
## [5.0.0] - 2025-08-01
985

1086
### Added
1187
- **Geographic Path Visualization**: Complete interactive map system with Leaflet
@@ -74,6 +150,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
74150
- Improved date validation with better error messaging
75151
- Enhanced KMZ file processing for complex archive structures
76152
- Fixed coordinate system handling for accurate length calculations
153+
- Fixed segment detail view table rendering and typos
77154

78155
### Technical Details
79156
- Added `geopandas`, `fiona`, and `shapely` as core dependencies
@@ -82,19 +159,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
82159
- Created reusable template components for map functionality
83160
- Enhanced error handling and logging for geographic operations
84161
- Implemented proper geometric validation and sanitization
162+
- Replaced setup.py with pyproject.toml for modern Python packaging
85163

86164
### Migration Notes
87165
- **Database Migration Required**: New geographic fields require PostGIS
88166
- **Dependency Installation**: Geographic libraries (GDAL, GEOS, PROJ) required
89167
- **Configuration Updates**: May need GeoDjango configuration updates
90168
- **Data Migration**: Existing installations will have empty path geometry fields
91169

170+
## [4.3.0] - 2025-05-16
171+
172+
### Added
173+
- **NetBox 4.3 Compatibility**: Updated for NetBox 4.3 support
174+
- New URL patterns for bulk operations on service paths, segment mappings, and circuit mappings
175+
- Enhanced Meta classes for filter consistency
176+
- Improved import structure for better maintainability
177+
178+
### Changed
179+
- Updated imports in filters.py for better readability
180+
- Changed `model` to `models` in template_content.py for multi-model compatibility
181+
- Removed unused imports and decorators for cleaner code
182+
- Updated plugin version to 4.3.0
183+
184+
## [4.0.1] - 2025-02-24
185+
186+
### Fixed
187+
- **Bookmark and Subscription Issues**: Resolved non-functional bookmark and subscription features
188+
- Updated plugin configuration and version management
189+
- Removed unused imports for cleaner codebase
190+
191+
## [4.0.0] - 2025-02-19
192+
193+
### Added
194+
- **Enhanced Service Management**: Comprehensive service path and segment management
195+
- Ability to assign segments to circuits or service paths from segment detail view
196+
- Improved ServicePath kind field with ChoiceSet system
197+
- Enhanced date validation logic in SegmentForm
198+
- Date status display in table and detail views with color-coded progress bars
199+
200+
### Changed
201+
- **Breaking**: Refactored from "Komora" to "CESNET" branding throughout
202+
- Plugin renamed from `komora_service_path_plugin` to `cesnet_service_path_plugin`
203+
- Database table names changed from `komora_*` to `cesnet_*`
204+
- URL patterns and configuration updated
205+
- All references and documentation updated
206+
207+
- **Model Improvements**:
208+
- Replaced `state` field with `status` field in ServicePath and Segment models
209+
- Added StatusChoices for consistent status options
210+
- Made provider field required in SegmentForm
211+
- Enhanced date validation with install_date/termination_date constraints
212+
213+
- **Data Cleanup**:
214+
- Removed sync_status from all models
215+
- Removed device_ and port_ fields from Segment model
216+
- Merged segment notes (note_a, note_b) into unified comments field
217+
- Removed imported_data and komora_id fields
218+
- Removed unnecessary db_table options from models
219+
220+
### Fixed
221+
- Fixed link for adding segment to a circuit
222+
- Fixed EditForm for SegmentCircuitMapping model
223+
- Enabled ID linkify for mapping tables
224+
- Fixed date status logic and display
225+
- Enhanced form validation and error handling
226+
227+
### Migration Notes
228+
- **Breaking**: Database table renaming requires careful migration
229+
- **Data Migration**: Existing installations need to migrate from old table names
230+
- **Configuration**: Update plugin configuration from komora to cesnet references
231+
92232
## [0.1.0] - 2024-04-23
93233

94234
### Added
95-
- Initial release on PyPI
235+
- **Initial Release**: First version published on PyPI
96236
- Basic segment and service path management
97-
- Provider and circuit relationship tracking
237+
- Provider and circuit relationship tracking
98238
- Simple filtering and table views
99239
- REST API endpoints
100240
- NetBox 3.7 compatibility

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ include README.md
44

55
recursive-include tests *
66
recursive-include cesnet_service_path_plugin/templates *
7+
recursive-include cesnet_service_path_plugin/static *
78
recursive-exclude * __pycache__
89
recursive-exclude * *.py[co]
910

11+
1012
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
1113

1214
graft templates

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The CESNET ServicePath Plugin extends NetBox's capabilities by providing compreh
2727

2828
| NetBox Version | Plugin Version |
2929
|----------------|----------------|
30+
| 4.4 | 5.1.x |
3031
| 4.3 | 5.0.x |
3132
| 4.2 | 4.0.x |
3233
| 3.7 | 0.1.0 |
@@ -46,9 +47,10 @@ The CESNET ServicePath Plugin extends NetBox's capabilities by providing compreh
4647
- Link circuits to segments
4748
- Automatic status tracking based on dates
4849
- **Geographic path visualization with actual route data**
50+
- segment types (dark fiber, optical spectrum, ethernet) with type specific data
4951

5052
### Geographic Features
51-
- **Interactive map visualization** with multiple tile layers (OpenStreetMap, satellite, topographic)
53+
- **Interactive map visualization** with multiple tile layers (OpenStreetMap, satellite, topographic) and multiple color schema (status, provider, segment type)
5254
- **Path data upload** supporting KML, KMZ, and GeoJSON formats
5355
- **Automatic path length calculation** in kilometers
5456
- **Multi-segment path support** with complex routing

cesnet_service_path_plugin/api/serializers/segment.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Meta:
4242
"url",
4343
"display",
4444
"name",
45+
"segment_type",
4546
"status",
4647
"network_label",
4748
"install_date",
@@ -55,6 +56,7 @@ class Meta:
5556
"site_b",
5657
"location_b",
5758
"circuits",
59+
"type_specific_data",
5860
# Only basic path info, no heavy geometry
5961
"path_length_km",
6062
"path_source_format",
@@ -68,6 +70,7 @@ class Meta:
6870
"url",
6971
"display",
7072
"name",
73+
"segment_type",
7174
"status",
7275
"has_path_data",
7376
"tags",
@@ -160,6 +163,7 @@ class Meta:
160163
"url",
161164
"display",
162165
"name",
166+
"segment_type",
163167
"status",
164168
"network_label",
165169
"install_date",
@@ -173,6 +177,7 @@ class Meta:
173177
"site_b",
174178
"location_b",
175179
"circuits",
180+
"type_specific_data",
176181
# All path geometry fields
177182
"path_geometry_geojson",
178183
"path_coordinates",
@@ -188,6 +193,7 @@ class Meta:
188193
"url",
189194
"display",
190195
"name",
196+
"segment_type",
191197
"status",
192198
"has_path_data",
193199
"tags",

0 commit comments

Comments
 (0)