refactor | Added a new property to expose the ability to disable the sorting#7360
Open
ByronMayne wants to merge 2 commits intoelsa-workflows:mainfrom
Open
refactor | Added a new property to expose the ability to disable the sorting#7360ByronMayne wants to merge 2 commits intoelsa-workflows:mainfrom
ByronMayne wants to merge 2 commits intoelsa-workflows:mainfrom
Conversation
This was because I don't want my items to be sorted by the control
Contributor
Greptile SummaryThis PR adds a
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| src/clients/Elsa.Api.Client/Shared/UIHints/DropDown/SelectList.cs | Adds SortItems boolean parameter to the SelectList record. Default value of false may conflict with current sorting behavior in Studio, potentially causing a backward compatibility issue when the Studio-side PR is implemented. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class `SelectList (Api.Client)` {
+ICollection~SelectListItem~ Items
+bool IsFlagsEnum = false
+bool SortItems = false ⬅ NEW
}
class `SelectList (Workflows.Core)` {
+ICollection~SelectListItem~ Items
}
class DropDownProps {
+SelectList? SelectList
+string? ProviderName
}
class SelectListItem {
+string Text
+string Value
}
DropDownProps --> `SelectList (Api.Client)` : uses (client)
DropDownProps --> `SelectList (Workflows.Core)` : uses (server)
`SelectList (Api.Client)` --> SelectListItem : contains
`SelectList (Workflows.Core)` --> SelectListItem : contains
Last reviewed commit: 3aba559
src/clients/Elsa.Api.Client/Shared/UIHints/DropDown/SelectList.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Currently the DropDown control has the following logic
Sorting by the text is not always desirable. For example I have a drop down that has a list of versions. So sorting by the Text field does not make sense anymore. If I were to rewrite this I would not add any sorting and just use the original collection order that was provided. However I don't want to break the current feature set. So I added a boolean
SortItemswhich will allow user to disable this feature.Scope
Select one primary concern:
Description
Exposed a new boolean to disable sorting of items in a dropdown. The actual logic change needs to happen in Studio and that would be another PR.
Problem
Have the ability to disable the auto sorting of items in the dropdown. For example if the user case of the drop down having version numbers.
Solution
Added a boolean
Verification
Right now it's just a boolean the validation would need to come from studio
Checklist