Skip to content

Commit 2527907

Browse files
committed
fix: Added Option which has been selected and fixStatus for the select field
1 parent e848bad commit 2527907

File tree

8 files changed

+297
-290
lines changed

8 files changed

+297
-290
lines changed

package-lock.json

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

packages/contentstack-audit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/cli-audit",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "Contentstack audit plugin",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/cli",

packages/contentstack-audit/src/config/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ const config = {
9393
'entry_uid',
9494
'publish_locale',
9595
'publish_environment',
96-
'asset_uid'
96+
'asset_uid',
97+
'selectedValue'
9798
],
9899
ReportTitleForEntries: {
99100
Entries_Select_feild: 'Entries_Select_feild',

packages/contentstack-audit/src/modules/entries.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ export default class Entries {
850850

851851
let missingCTSelectFieldValues;
852852
let isMissingValuePresent = false;
853-
853+
let selectedValue: string | string [] | number | number[] | any = '';
854854
if (multiple) {
855855
let obj = this.findNotPresentSelectField(entry, selectOptions);
856856
let { notPresent, filteredFeild } = obj;
@@ -868,13 +868,15 @@ export default class Entries {
868868
.slice(0, missingInstances)
869869
.map((choice) => choice.value);
870870
entry.push(...newValues);
871+
selectedValue = newValues;
871872
this.log($t(auditFixMsg.ENTRY_SELECT_FIELD_FIX, { value: newValues.join(' '), uid }), 'error');
872873
}
873874
} else {
874875
if (entry.length === 0) {
875876
isMissingValuePresent = true;
876877
const defaultValue = selectOptions.choices.length > 0 ? selectOptions.choices[0].value : null;
877878
entry.push(defaultValue);
879+
selectedValue = defaultValue;
878880
this.log($t(auditFixMsg.ENTRY_SELECT_FIELD_FIX, { value: defaultValue as string, uid }), 'error');
879881
}
880882
}
@@ -885,6 +887,7 @@ export default class Entries {
885887
isMissingValuePresent = true;
886888
let defaultValue = selectOptions.choices.length > 0 ? selectOptions.choices[0].value : null;
887889
entry = defaultValue;
890+
selectedValue = defaultValue;
888891
this.log($t(auditFixMsg.ENTRY_SELECT_FIELD_FIX, { value: defaultValue as string, uid }), 'error');
889892
}
890893
}
@@ -895,6 +898,7 @@ export default class Entries {
895898
display_name,
896899
display_type,
897900
missingCTSelectFieldValues,
901+
selectedValue,
898902
min_instance: min_instance ?? 'NA',
899903
tree,
900904
treeStr: tree

0 commit comments

Comments
 (0)