Skip to content

Commit

Permalink
Merge branch 'staging' into stage-to-development
Browse files Browse the repository at this point in the history
  • Loading branch information
aman19K committed Mar 18, 2024
2 parents 56365da + b7d10b3 commit 3f71032
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/contentstack-audit/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const auditMsg = {
SCAN_ENTRY_SUCCESS_MSG: "Successfully completed the scanning of {module} ({local}) '{title}'.",
SCAN_EXT_SUCCESS_MSG: "Successfully completed scanning the {module} titled '{title}' with UID '{uid}'",
AUDIT_CMD_DESCRIPTION: 'Perform audits and find possible errors in the exported Contentstack data',
SCAN_WF_SUCCESS_MSG: 'Successfully removed the workflow with UID {uid} and name {name}.',
SCAN_WF_SUCCESS_MSG: 'Successfully completed the scanning of workflow with UID {uid} and name {name}.',
};

const auditFixMsg = {
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-audit/src/modules/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class Extensions {
if (this.fix && this.missingCtInExtensions.length) {
await this.fixExtensionsScope(cloneDeep(this.missingCtInExtensions));
this.missingCtInExtensions.forEach((ext) => (ext.fixStatus = 'Fixed'));
return this.missingCtInExtensions
return this.missingCtInExtensions;
}
return this.missingCtInExtensions;
}
Expand All @@ -106,7 +106,7 @@ export default class Extensions {

async writeFixContent(fixedExtensions: Record<string, Extension>) {
if (
this.fix ||
this.fix &&
(this.config.flags['copy-dir'] ||
this.config.flags['external-config']?.skipConfirm ||
(await ux.confirm(commonMsg.FIX_CONFIRMATION)))
Expand Down
9 changes: 5 additions & 4 deletions packages/contentstack-audit/src/modules/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default class Workflows {
return {};
}


this.workflowPath = join(this.folderPath, this.fileName);
this.workflowSchema = existsSync(this.workflowPath)
? values(JSON.parse(readFileSync(this.workflowPath, 'utf8')) as Workflow[])
Expand Down Expand Up @@ -87,7 +88,7 @@ export default class Workflows {
this.log(
$t(auditMsg.SCAN_WF_SUCCESS_MSG, {
name: workflow.name,
module: this.config.moduleConfig[this.moduleName].name,
uid: workflow.uid,
}),
'info',
);
Expand Down Expand Up @@ -144,9 +145,9 @@ export default class Workflows {

async writeFixContent(newWorkflowSchema: Record<string, Workflow>) {
if (
this.fix ||
(!(this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm) &&
(this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION))))
this.fix &&
!(this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm) &&
(this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION)))
) {
writeFileSync(
join(this.folderPath, this.config.moduleConfig[this.moduleName].fileName),
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/src/import/module-importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ModuleImporter {
if (
!this.importConfig.skipAudit &&
(!this.importConfig.moduleName ||
['content-types', 'global-fields', 'entries'].includes(this.importConfig.moduleName))
['content-types', 'global-fields', 'entries', 'extensions', 'workflows'].includes(this.importConfig.moduleName))
) {
if (!(await this.auditImportData(logger))) {
return { noSuccessMsg: true };
Expand Down

0 comments on commit 3f71032

Please sign in to comment.