AdhocAdam / smletsexchangeconnector

SMLets PowerShell based Exchange Connector for controlling Microsoft System Center Service Manager 2016+
https://adhocadam.github.io/smletsexchangeconnector/
GNU General Public License v3.0
29 stars 19 forks source link

settings checkbox clears values #287

Closed PeterMiklian closed 3 years ago

PeterMiklian commented 3 years ago

Describe the bug Dropboxes in Settings revert to default value.

Help us reproduce the bug Version of the connector you are using: In SMLets Exchange Connector Settings:

  1. I enable the Change Incident Status on Incidents based on Who replied.
  2. I change any of 3 dropdowns e.g. When the Assigned To Replies, Change Incident Status to: Pending
  3. I uncheck the box from point 1
  4. I check back the box from point 1
  5. all dropdowns get back to default values (Active) I don't know if it's a bug or feature :)

Expected behavior I would expect my settings stay as I set them even after (de)selecting the checkbox.

Location and Environment SCSM 2016 UR10 + SMLets Exchange Connector v3.3.0.12

Additional context

AdhocAdam commented 3 years ago

When I was first putting the MP together, rather than have to build validation for each of the dropdowns my thought was if you've never configured this (or were coming from v1) - you'd check the box and the UI would force values on you. Even if you just wanted to see what the checkbox did, the values would be forced and set. No opportunity to have a null value.

Next, I wanted to force a conscious decision upon the person configuring this so they had to decide how they wanted this to work. If you want to turn it off, you could quickly just uncheck the box or even set it through PowerShell. But upon turning it back on, you'd once again be set back as though you never configured it.

The point is I very much wanted someone to understand why and what they were setting even if they were simply just playing around with the UI. The fact the enum is set back to Active is actually not intentional, it just more than likely is the first item in the list alphabetically. Here's the code for that page, when the box is checked all of the values are set to the first item in the list which is Item 0.

https://github.com/AdhocAdam/smletsexchangeconnector/blob/f15885e4cdecf262479e58e0323ffe7ada7fe38a/ManagementPack/2016/SMLetsExchangeConnectorSettingsUI/Forms/ProcessingLogicForm.xaml.cs#L116-L121