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

Merge staging to development #1343

Merged
merged 6 commits into from
Mar 18, 2024
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
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
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
Loading