Skip to content

NMS-19364: Improve Source Selection Flow Before Event Creation#8229

Open
Shahbaz-dataq wants to merge 29 commits intorelease-35.xfrom
jira/NMS-19364
Open

NMS-19364: Improve Source Selection Flow Before Event Creation#8229
Shahbaz-dataq wants to merge 29 commits intorelease-35.xfrom
jira/NMS-19364

Conversation

@Shahbaz-dataq
Copy link
Contributor

External References

@Shahbaz-dataq Shahbaz-dataq marked this pull request as ready for review January 13, 2026 19:11
@cgorantla cgorantla requested a review from Copilot January 14, 2026 14:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' })
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@synqotik synqotik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss, I have a number of questions.

Copy link
Contributor

@synqotik synqotik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss, I have various questions.

import java.util.Map;
import java.util.stream.Collectors;

public class SourceNameDto {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need this? We can already get all names, and get all complete sources if we need the id.

@Shahbaz-dataq
Copy link
Contributor Author

New Add Event Config Button

Screenshot from 2026-01-16 00-08-41

Autocomplete dropdown to select source

Screenshot from 2026-01-16 00-09-46

When user comes from source details to create a event config source is already selected and disabled

Screenshot from 2026-01-16 00-11-44

If no source is selected when user click on Create Source and Save a popup for user to enter name and vendor.

Screenshot from 2026-01-16 00-13-55

@cgorantla cgorantla requested a review from synqotik January 20, 2026 18:11
@Shahbaz-dataq
Copy link
Contributor Author

Screenshot from 2026-01-26 19-44-21

synqotik
synqotik previously approved these changes Jan 28, 2026
Copy link
Contributor

@synqotik synqotik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Should this target release-35.x or another branch?

Copy link
Contributor

@cgorantla cgorantla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Shahbaz-dataq
Copy link
Contributor Author

Screenshot from 2026-01-30 22-51-38 Screenshot from 2026-01-30 22-52-57 Screenshot from 2026-01-30 22-53-42

Copy link
Contributor

@synqotik synqotik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of comments re vendor handling.

Copy link
Contributor

@synqotik synqotik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cgorantla cgorantla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants