Skip to content

Commit 999e8cc

Browse files
committed
PR comment fixes
1 parent 7816bb1 commit 999e8cc

4 files changed

Lines changed: 168 additions & 162 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ const config = {
113113
Entries_Title_feild: 'Entries_Title_feild',
114114
Entry_Missing_Locale_and_Env: 'Entry_Missing_Locale_and_Env',
115115
Entry_Missing_Locale_and_Env_in_Publish_Details: 'Entry_Missing_Locale_and_Env_in_Publish_Details',
116+
Entry_Multiple_Fields:"Entry_Multiple_Fields"
116117
},
117118
feild_level_modules: [
118119
'Entries_Title_feild',

packages/contentstack-audit/src/modules/content-types.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default class ContentType {
4444
protected schema: ContentTypeStruct[] = [];
4545
protected missingRefs: Record<string, any> = {};
4646
public moduleName: keyof typeof auditConfig.moduleConfig;
47-
public f:any = []
4847
constructor({ log, fix, config, moduleName, ctSchema, gfSchema }: ModuleConstructorParam & CtConstructorParam) {
4948
this.log = log;
5049
this.config = config;
@@ -91,7 +90,7 @@ export default class ContentType {
9190
this.currentTitle = schema.title;
9291
this.missingRefs[this.currentUid] = [];
9392
const { uid, title } = schema;
94-
await this.lookForReference([{ uid, name: title }], schema, null);
93+
await this.lookForReference([{ uid, name: title }], schema);
9594
this.log(
9695
$t(auditMsg.SCAN_CT_SUCCESS_MSG, { title, module: this.config.moduleConfig[this.moduleName].name }),
9796
'info',
@@ -179,17 +178,13 @@ export default class ContentType {
179178
async lookForReference(
180179
tree: Record<string, unknown>[],
181180
field: ContentTypeStruct | GlobalFieldDataType | ModularBlockType | GroupFieldDataType,
182-
parent: any = null
183181
): Promise<void> {
184182
const fixTypes = this.config.flags['fix-only'] ?? this.config['fix-fields'];
185183

186184
if (this.fix) {
187185
field.schema = this.runFixOnSchema(tree, field.schema as ContentTypeSchemaType[]);
188186
}
189187
for (let child of field.schema ?? []) {
190-
if(parent) {
191-
this.f.push(parent+"."+child.uid)
192-
}
193188

194189
if (!fixTypes.includes(child.data_type) && child.data_type !== 'json') continue;
195190

@@ -321,7 +316,7 @@ export default class ContentType {
321316
return void 0;
322317
}
323318

324-
await this.lookForReference(tree, field, field.uid);
319+
await this.lookForReference(tree, field);
325320
}
326321

327322
/**
@@ -355,7 +350,7 @@ export default class ContentType {
355350
for (const block of blocks) {
356351
const { uid, title } = block;
357352

358-
await this.lookForReference([...tree, { uid, name: title }], block, block.uid);
353+
await this.lookForReference([...tree, { uid, name: title }], block);
359354
}
360355
}
361356

@@ -371,7 +366,7 @@ export default class ContentType {
371366
*/
372367
async validateGroupField(tree: Record<string, unknown>[], field: GroupFieldDataType): Promise<void> {
373368
// NOTE Any Group Field related logic can be added here (Ex data serialization or picking any metadata for report etc.,)
374-
await this.lookForReference(tree, field, field.uid);
369+
await this.lookForReference(tree, field);
375370
}
376371

377372
/**

0 commit comments

Comments
 (0)