Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/1839 limit noRootFolder validation rule to types other than cloudpa… #1843

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions @types/lib/metadataTypes/Automation.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion @types/lib/metadataTypes/Automation.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion @types/lib/util/validations.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion lib/util/validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ export default async function validation(definition, item, targetDir, codeExtrac
try {
if (customRuleImport) {
customRules = customRuleImport
? await customRuleImport.validation(definition, item, targetDir, Util)
? await customRuleImport.validation(
definition,
item,
targetDir,
Util,
codeExtractItemArr
)
: {};
}
} catch (ex) {
Expand Down Expand Up @@ -67,6 +73,14 @@ export default async function validation(definition, item, targetDir, codeExtrac
// some types do not support folders
return true;
}
const doNotEvaluate = ['automation', 'attributeSet', 'list'];
if (
doNotEvaluate.includes(definition.type) ||
(definition.type === 'asset' && item?.assetType?.name === 'webpage')
) {
// this subtype is not visible in the interface and hence always technically sits in the root
return true;
}

return folderPath.includes('/');
},
Expand Down
Loading