Skip to content

Commit 404804a

Browse files
authored
Merge pull request #1671 from contentstack/fix/DX-1700
fixed the case where multiple select field contains null value
2 parents 4b0762a + e6b67a4 commit 404804a

File tree

8 files changed

+258
-276
lines changed

8 files changed

+258
-276
lines changed

package-lock.json

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

packages/contentstack-audit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
1919
$ csdx COMMAND
2020
running command...
2121
$ csdx (--version|-v)
22-
@contentstack/cli-audit/1.7.2 darwin-arm64 node-v22.2.0
22+
@contentstack/cli-audit/1.7.3 darwin-arm64 node-v22.8.0
2323
$ csdx --help [COMMAND]
2424
USAGE
2525
$ csdx COMMAND

packages/contentstack-audit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/cli-audit",
3-
"version": "1.7.2",
3+
"version": "1.7.3",
44
"description": "Contentstack audit plugin",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/cli",
@@ -27,7 +27,7 @@
2727
"fs-extra": "^11.2.0",
2828
"lodash": "^4.17.21",
2929
"uuid": "^9.0.1",
30-
"winston": "^3.16.0"
30+
"winston": "^3.17.0"
3131
},
3232
"devDependencies": {
3333
"@contentstack/cli-dev-dependencies": "^1.2.4",

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -890,24 +890,27 @@ export default class Entries {
890890
}
891891

892892
/**
893-
*
893+
* this is called in case the select field has multiple optins to chose from
894894
* @param field It contains the value to be searched
895895
* @param selectOptions It contains the options that were added in CT
896896
* @returns An Array of entry containing only the values that were present in CT, An array of not present entries
897897
*/
898898
findNotPresentSelectField(field: any, selectOptions: any) {
899+
if(!field){
900+
field = []
901+
}
899902
let present = [];
900903
let notPresent = [];
901904
const choicesMap = new Map(selectOptions.choices.map((choice: { value: any }) => [choice.value, choice]));
902-
for (const value of field) {
903-
const choice: any = choicesMap.get(value);
904-
905-
if (choice) {
906-
present.push(choice.value);
907-
} else {
908-
notPresent.push(value);
905+
for (const value of field) {
906+
const choice: any = choicesMap.get(value);
907+
908+
if (choice) {
909+
present.push(choice.value);
910+
} else {
911+
notPresent.push(value);
912+
}
909913
}
910-
}
911914
return { filteredFeild: present, notPresent };
912915
}
913916

0 commit comments

Comments
 (0)