Skip to content

Commit

Permalink
chore: merge main into develop (#1036)
Browse files Browse the repository at this point in the history
Backport of the #1034
  • Loading branch information
vtsvetkov-splunk authored Feb 1, 2024
2 parents 751990c + 559cfd6 commit 08beffb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
6 changes: 3 additions & 3 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

The following 3rd-party software packages may be used by or distributed with addonfactory-ucc-generator. Any information relevant to third-party vendors listed below are collected using common, reasonable means.

Date generated: 2024-1-12
Date generated: 2024-1-31

Revision ID: 21ee4ae7effd49933a7f5c885b1524085219be00
Revision ID: 73358ee58c211e55608e09e1b45e1eeed8ec8df7

================================================================================
================================================================================
Expand Down Expand Up @@ -11472,4 +11472,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Report Generated by FOSSA on 2024-1-12
Report Generated by FOSSA on 2024-1-31
7 changes: 7 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [5.37.0](https://github.com/splunk/addonfactory-ucc-generator/compare/v5.36.2...v5.37.0) (2024-01-31)


### Features

* **checkboxGroup:** correctly parsing values with spaces ([#1034](https://github.com/splunk/addonfactory-ucc-generator/issues/1034)) ([73358ee](https://github.com/splunk/addonfactory-ucc-generator/commit/73358ee58c211e55608e09e1b45e1eeed8ec8df7))

## [5.36.2](https://github.com/splunk/addonfactory-ucc-generator/compare/v5.36.1...v5.36.2) (2024-01-12)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

[tool.poetry]
name = "splunk_add_on_ucc_framework"
version = "5.36.2"
version = "5.37.0"
description = "Splunk Add-on SDK formerly UCC is a build and code generation framework"
license = "Apache-2.0"
authors = ["Splunk <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion splunk_add_on_ucc_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "5.36.2"
__version__ = "5.37.0"

import logging

Expand Down
11 changes: 11 additions & 0 deletions ui/src/components/CheckboxGroup/checkboxGroup.utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ describe('parseValue', () => {
expect(resultMap.get('collect_file')?.inputValue).toBe(1);
expect(resultMap.get('collect_task')?.inputValue).toBe(1);
});

it('should correctly parse a collection string with spaces into a Map', () => {
const collection = 'ec2_volumes/3600, ec2_instances/1800, ec2_reserved_instances/900';
const resultMap = parseValue(collection);

expect(resultMap.size).toBe(3);
expect(resultMap.get('ec2_volumes')?.inputValue).toBe(3600);
expect(resultMap.get('ec2_instances')?.inputValue).toBe(1800);
expect(resultMap.get('ec2_reserved_instances')?.inputValue).toBe(900);
});

it('should return an empty Map for undefined collection', () => {
const resultMap = parseValue();
expect(resultMap.size).toBe(0);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/CheckboxGroup/checkboxGroup.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function parseValue(collection?: string): ValueByField {

const splitValues = collection.split(',');
splitValues.forEach((rawValue) => {
const [field, inputValue] = rawValue.split('/');
const [field, inputValue] = rawValue.trim().split('/');
const parsedInputValue = inputValue === '' ? undefined : Number(inputValue);
if (!field || Number.isNaN(parsedInputValue)) {
throw new Error(`Value is not parsable: ${collection}`);
Expand Down

0 comments on commit 08beffb

Please sign in to comment.