Skip to content

Conversation

bseifert14
Copy link
Contributor

Description

IALERT-3123 deals with not showing a warning immediately when a user lands on the Distribution Job creation form. This warning shows because the channel would be preset when the form renders on the page, but the Provider was not set. After some talks with the Alert team, we want to proactively counteract this by not presetting the channel on form render.

Technical Description

In the DistributionConfigurationForm, we no longer preset the channel. The preset channel is just an empty string rather than Azure Board. I'm not sure why it was preset in the past, my assumption is that it's the first in the list of selectable options for channels. Regardless, unsetting the channel on form render no longer renders the channel part of the form (bottom part of the form that changes when the user changes the selected channel). Now when the form renders there is no warning displayed and the form looks like the attached screenshot.

Screenshot 2025-09-22 at 10 12 24 AM

Copy link

@Copilot 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 PR resolves an issue where a warning was immediately displayed when users accessed the Distribution Job creation form. The warning occurred because the channel was preset to Azure Board while the Provider remained unset, creating an inconsistent state.

  • Removed the default preset channel selection to eliminate the immediate warning
  • Updated the form logic to not auto-populate the channel name field
  • Modified the display conditions for Save and Test buttons when no channel is selected

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +358 to +359
displaySave={!readonly || isOneOperationAssigned(descriptors[selectedChannel], [OPERATIONS.WRITE, OPERATIONS.CREATE])}
displayTest={!readonly || isOperationAssigned(descriptors[selectedChannel], OPERATIONS.EXECUTE)}
Copy link
Preview

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The logical operators have been changed from AND (&&) to OR (||), which will cause the Save and Test buttons to always be displayed when readonly is false, regardless of permissions. This appears to be an unintended change that could allow users to attempt operations they don't have permissions for.

Suggested change
displaySave={!readonly || isOneOperationAssigned(descriptors[selectedChannel], [OPERATIONS.WRITE, OPERATIONS.CREATE])}
displayTest={!readonly || isOperationAssigned(descriptors[selectedChannel], OPERATIONS.EXECUTE)}
displaySave={!readonly && isOneOperationAssigned(descriptors[selectedChannel], [OPERATIONS.WRITE, OPERATIONS.CREATE])}
displayTest={!readonly && isOperationAssigned(descriptors[selectedChannel], OPERATIONS.EXECUTE)}

Copilot uses AI. Check for mistakes.

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.

1 participant