NMS-19364: Improve Source Selection Flow Before Event Creation#8229
NMS-19364: Improve Source Selection Flow Before Event Creation#8229Shahbaz-dataq wants to merge 29 commits intorelease-35.xfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request improves the source selection flow for event creation by allowing users to create events without first selecting a source. The changes enable direct event creation from the Event Configuration page and support creating new sources during the event creation process.
Changes:
- Added a "Create New Event Config" button to the Event Configuration page that allows users to initiate event creation without pre-selecting a source
- Modified the event creation workflow to support selecting or creating a source during the event configuration process
- Updated the data structure for uploaded source names from a simple string array to objects containing both ID and name
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/tests/stores/eventModificationStore.test.ts | New comprehensive test suite for the event modification store |
| ui/tests/stores/eventConfigStore.test.ts | Updated tests to reflect the new uploadedSources structure |
| ui/tests/containers/EventConfiguration.test.ts | Added tests for the new "Create New Event Config" button functionality |
| ui/tests/components/EventConfiguration/eventConfigXmlValidator.test.ts | Updated validation tests to support .xml extension instead of .events.xml |
| ui/tests/components/EventConfiguration/EventConfigUploadFilesTab.test.ts | Updated file upload tests for new source structure and .xml extension |
| ui/tests/components/EventConfiguration/EventConfigEventCreate.test.ts | Updated event creation component tests for new navigation logic |
| ui/tests/components/EventConfiguration/Dialog/UploadedFileRenameDialog.test.ts | Expanded test coverage for file rename dialog functionality |
| ui/tests/components/EventConfiguration/Dialog/EventConfigFilesUploadReportDialog.test.ts | Updated to use new uploadedSources structure |
| ui/tests/components/EventConfiguration/Dialog/DeleteEventConfigSourceDialog.test.ts | Updated to use new uploadedSources structure |
| ui/tests/components/EventConfiguration/Dialog/CreateEventConfigurationDialog.test.ts | Removed tests for deprecated description field |
| ui/tests/components/EventConfigEventCreate/BasicInformation.test.ts | New comprehensive test file for BasicInformation component (moved from old location) |
| ui/src/stores/eventModificationStore.ts | Added openCreateWithoutSource method for creating events without pre-selected source |
| ui/src/stores/eventConfigStore.ts | Changed uploadedSourceNames to uploadedSources with new structure |
| ui/src/services/eventConfigService.ts | Updated getAllSourceNames to return array of objects with id and name |
| ui/src/mappers/eventConfig.mapper.ts | Added mapper for uploaded source names from server |
| ui/src/containers/EventConfiguration.vue | Added "Create New Event Config" button and navigation logic |
| ui/src/containers/EventConfigEventCreate.vue | Modified render condition to check edit mode instead of source/event existence |
| ui/src/components/EventConfiguration/eventConfigXmlValidator.ts | Enhanced XML validation with improved error handling |
| ui/src/components/EventConfiguration/EventConfigUploadFilesTab.vue | Updated to use new uploadedSources structure and .xml extension |
| ui/src/components/EventConfiguration/Dialog/UploadedFileRenameDialog.vue | Updated to use new uploadedSources structure |
| ui/src/components/EventConfiguration/Dialog/CreateEventConfigurationDialog.vue | Removed description field and improved cancel/success handling |
| ui/src/components/EventConfigEventCreate/VarbindsDecode.vue | Removed unnecessary store dependency |
| ui/src/components/EventConfigEventCreate/MaskVarbinds.vue | Removed unnecessary store dependency |
| ui/src/components/EventConfigEventCreate/MaskElements.vue | Removed unnecessary store dependency |
| ui/src/components/EventConfigEventCreate/BasicInformation.vue | Added source selection autocomplete and inline source creation capability |
| opennms-webapp-rest/src/test/java/org/opennms/web/rest/v2/EventConfRestServiceIT.java | Updated tests for new SourceNameDto return type |
| opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/model/SourceNameDto.java | New DTO class for source name responses |
| opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/EventConfRestService.java | Updated to return SourceNameDto list instead of strings |
| opennms-dao/src/test/java/org/opennms/netmgt/dao/EventConfSourceDaoIT.java | Updated tests for new Map return type from findAllNames |
| opennms-dao/src/main/java/org/opennms/netmgt/dao/hibernate/EventConfSourceDaoHibernate.java | Changed findAllNames to return Map<Long, String> instead of List |
| opennms-dao-api/src/main/java/org/opennms/netmgt/dao/api/EventConfSourceDao.java | Updated interface signature for findAllNames |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }) | ||
| } else { | ||
| console.error('No new event configuration source ID available.') | ||
| router.push({ name: 'Event Configuration' }) |
There was a problem hiding this comment.
When newId.value is 0, the code logs an error and then navigates to 'Event Configuration'. However, this navigation occurs even when there's no valid source ID, which may not be the desired behavior. Consider whether navigation should only occur when there's a valid source to view, or if a different error state should be shown to the user.
synqotik
left a comment
There was a problem hiding this comment.
Let's discuss, I have a number of questions.
ui/src/components/EventConfiguration/Dialog/CreateEventConfigurationDialog.vue
Outdated
Show resolved
Hide resolved
ui/src/components/EventConfiguration/eventConfigXmlValidator.ts
Outdated
Show resolved
Hide resolved
ui/src/components/EventConfiguration/eventConfigXmlValidator.ts
Outdated
Show resolved
Hide resolved
ui/src/components/EventConfiguration/eventConfigXmlValidator.ts
Outdated
Show resolved
Hide resolved
ui/src/components/EventConfiguration/eventConfigXmlValidator.ts
Outdated
Show resolved
Hide resolved
opennms-dao/src/main/java/org/opennms/netmgt/dao/hibernate/EventConfSourceDaoHibernate.java
Show resolved
Hide resolved
opennms-dao/src/test/java/org/opennms/netmgt/dao/EventConfSourceDaoIT.java
Show resolved
Hide resolved
opennms-dao/src/test/java/org/opennms/netmgt/dao/EventConfSourceDaoIT.java
Show resolved
Hide resolved
synqotik
left a comment
There was a problem hiding this comment.
Let's discuss, I have various questions.
| import java.util.Map; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class SourceNameDto { |
There was a problem hiding this comment.
Not sure we need this? We can already get all names, and get all complete sources if we need the id.
synqotik
left a comment
There was a problem hiding this comment.
LGTM!
Should this target release-35.x or another branch?
cgorantla
left a comment
There was a problem hiding this comment.
vendor != source name.
When we upload an eventconf file, backend is already deriving vendor from source. We should do that here as well and UI should allow vendor name to be provided by user as a optional field.
synqotik
left a comment
There was a problem hiding this comment.
Added a couple of comments re vendor handling.
cgorantla
left a comment
There was a problem hiding this comment.
I think we need to leave the logic of deriving vendor name to Backend. If frontend sends a blank/null vendor, backend should be able to derive vendor name from source.








External References