Skip to content

Commit a886dd7

Browse files
Merge branch 'develop' into docs/ucc_version
2 parents ef13d41 + df6d53c commit a886dd7

File tree

9 files changed

+4194
-9113
lines changed

9 files changed

+4194
-9113
lines changed

NOTICE

Lines changed: 3904 additions & 8962 deletions
Large diffs are not rendered by default.

docs/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
# [6.1.0](https://github.com/splunk/addonfactory-ucc-generator/compare/v6.0.1...v6.1.0) (2025-11-13)
4+
5+
6+
### Bug Fixes
7+
8+
* include built UI files in the wheel package ([#1927](https://github.com/splunk/addonfactory-ucc-generator/issues/1927)) ([0e83b49](https://github.com/splunk/addonfactory-ucc-generator/commit/0e83b490468bfb19bff3bb0634ad172caa5a044e))
9+
* **UI:** respect allowed "mode" in "modifyFieldsOnValue" ([#1951](https://github.com/splunk/addonfactory-ucc-generator/issues/1951)) ([b2bf2d1](https://github.com/splunk/addonfactory-ucc-generator/commit/b2bf2d192b112f062e1d61870b8dc0cfeaaf5f64))
10+
11+
12+
### Features
13+
14+
* add a new flag overwrite for build command ([#1916](https://github.com/splunk/addonfactory-ucc-generator/issues/1916)) ([1dab3ae](https://github.com/splunk/addonfactory-ucc-generator/commit/1dab3ae00d9e5f79517db949026dda5c67ccdd4c)), closes [#1913](https://github.com/splunk/addonfactory-ucc-generator/issues/1913)
15+
* **date:** date picker as a new component ([#1857](https://github.com/splunk/addonfactory-ucc-generator/issues/1857)) ([e6a8be2](https://github.com/splunk/addonfactory-ucc-generator/commit/e6a8be2da7bc09fc9118e21943925dc59a9b72c9))
16+
* provide support for python.required ([#1932](https://github.com/splunk/addonfactory-ucc-generator/issues/1932)) ([16bd281](https://github.com/splunk/addonfactory-ucc-generator/commit/16bd2812cd836715790b01f797437edf83259bd5))
17+
* support custom favicons ([#1864](https://github.com/splunk/addonfactory-ucc-generator/issues/1864)) ([dd6e7f9](https://github.com/splunk/addonfactory-ucc-generator/commit/dd6e7f95b5544d8ebe774fc25686352f8859ed37))
18+
319
## [6.0.1](https://github.com/splunk/addonfactory-ucc-generator/compare/v6.0.0...v6.0.1) (2025-09-30)
420

521

poetry.lock

Lines changed: 212 additions & 143 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
[tool.poetry]
1818
name = "splunk_add_on_ucc_framework"
19-
version = "6.0.1"
19+
version = "6.1.0"
2020
description = "Splunk Add-on SDK formerly UCC is a build and code generation framework"
2121
license = "Apache-2.0"
2222
authors = ["Splunk <[email protected]>"]
@@ -68,7 +68,7 @@ validate = ["splunk-appinspect"]
6868
mkdocs = "^1.6.1"
6969
pytest = "^7.2.1"
7070
pytest-splunk-addon = "^6.0.0"
71-
pytest-splunk-addon-ui-smartx = "5.4.0"
71+
pytest-splunk-addon-ui-smartx = "5.4.1"
7272
pytest-rerunfailures = "^11.1.1"
7373
mkdocs-material = "^9.6.16"
7474
mkdocstrings = {version=">=0", extras=["python"]}

splunk_add_on_ucc_framework/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "6.0.1"
16+
__version__ = "6.1.0"
1717

1818
import logging
1919

ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"url": "git+https://github.com/splunk/addonfactory-ucc-generator.git",
77
"directory": "ui"
88
},
9-
"version": "6.0.1",
9+
"version": "6.1.0",
1010
"license": "Apache-2.0",
1111
"author": "Splunk Inc.",
1212
"homepage": "https://splunk.github.io/addonfactory-ucc-generator",

ui/src/components/FormModifications/FormModifications.test.tsx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { z } from 'zod';
66

77
import { setUnifiedConfig } from '../../util/util';
88
import {
9+
editOnlyModificationField,
910
firstModificationField,
1011
firstStandardTextField,
1112
getConfigWithModifications,
@@ -15,9 +16,10 @@ import {
1516
thirdModificationField,
1617
} from './TestConfig';
1718
import EntityModal, { EntityModalProps } from '../EntityModal/EntityModal';
18-
import { EntitiesAllowingModifications } from '../../types/components/BaseFormTypes';
19+
import { BaseFormState, EntitiesAllowingModifications } from '../../types/components/BaseFormTypes';
1920
import { invariant } from '../../util/invariant';
2021
import { StringOrTextWithLinks } from '../../types/globalConfig/baseSchemas';
22+
import { getModificationForEntity } from './FormModifications';
2123

2224
const handleRequestClose = vi.fn();
2325
const setUpConfigWithDefaultValue = () => {
@@ -286,3 +288,36 @@ it('verify no modifications', async () => {
286288

287289
verifyAllProps(componentParentElement, componentInput, firstStandardTextField);
288290
});
291+
292+
it('check mode for getModificationForEntity', () => {
293+
const state: BaseFormState = {
294+
data: {
295+
[editOnlyModificationField.field]: {
296+
value: 'a',
297+
disabled: false,
298+
error: false,
299+
display: true,
300+
},
301+
},
302+
};
303+
304+
const modificationEdit = getModificationForEntity(
305+
editOnlyModificationField,
306+
state,
307+
'edit',
308+
'configuration'
309+
);
310+
expect(modificationEdit).toBeDefined();
311+
expect(modificationEdit?.fieldValue).toBe('a');
312+
expect(modificationEdit?.fieldsToModify).toHaveLength(1);
313+
expect(modificationEdit?.fieldsToModify[0].fieldId).toBe(firstStandardTextField.field);
314+
315+
// create mode should not return modification, when only edit mode is specified
316+
const modificationCreate = getModificationForEntity(
317+
editOnlyModificationField,
318+
state,
319+
'create',
320+
'configuration'
321+
);
322+
expect(modificationCreate).toBeUndefined();
323+
});

ui/src/components/FormModifications/FormModifications.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const ifRegexpMatchesValue = (
100100
}
101101
};
102102

103-
const getModificationForEntity = (
103+
export const getModificationForEntity = (
104104
entity: EntitiesAllowingModifications,
105105
stateShallowCopy: BaseFormState,
106106
mode: Mode,
@@ -118,8 +118,8 @@ const getModificationForEntity = (
118118
getValueMapTruthyFalse(currentFieldValue, page) ===
119119
getValueMapTruthyFalse(mod.fieldValue, page) ||
120120
// or if the mod value is a regex pattern and it matches the current field value
121-
(ifRegexpMatchesValue(currentFieldValue, mod.fieldValue) &&
122-
(!mod.mode || mod.mode === mode)))
121+
ifRegexpMatchesValue(currentFieldValue, mod.fieldValue)) &&
122+
(!mod.mode || mod.mode === mode)
123123
);
124124
});
125125

ui/src/components/FormModifications/TestConfig.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,25 @@ export const thirdModificationField = {
145145
help: 'Third Modification field - checkbox - help',
146146
} satisfies z.infer<typeof CheckboxEntitySchema>;
147147

148+
export const editOnlyModificationField = {
149+
type: 'text',
150+
label: 'Edit Only Modification field - text - label',
151+
field: 'edit_only_modification_field',
152+
help: 'Edit Only Modification field - text - help',
153+
modifyFieldsOnValue: [
154+
{
155+
fieldValue: 'a',
156+
mode: 'edit',
157+
fieldsToModify: [
158+
{
159+
fieldId: 'standard_text1',
160+
disabled: true,
161+
},
162+
],
163+
},
164+
],
165+
} satisfies z.infer<typeof TextEntitySchema>;
166+
148167
export const regexpModificationField = {
149168
type: 'text',
150169
label: 'Regexp Modification field - text - label',

0 commit comments

Comments
 (0)