Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Mar 8, 2024
1 parent e99a99a commit 2e9bed0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/contentstack-audit/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const commonMsg = {
CONFIG: 'Path of the external config',
DATA_DIR: 'Path where the data is stored',
FIX_CONFIRMATION: 'Would you like to overwrite existing file.?',
WORKFLOW_FIX_WARN: `Workflow {uid} named '{name}' will be removed.`,
WORKFLOW_FIX_CONFIRMATION: 'Would you like to overwrite existing file.?',
WORKFLOW_FIX_WARN: `The workflow associated with UID {uid} and name {name} will be removed.`,
WORKFLOW_FIX_CONFIRMATION: 'Would you like to overwrite existing file?',
};

const auditMsg = {
Expand All @@ -31,7 +31,7 @@ const auditMsg = {
SCAN_CT_SUCCESS_MSG: "Successfully completed the scanning of {module} '{title}'.",
SCAN_ENTRY_SUCCESS_MSG: "Successfully completed the scanning of {module} ({local}) '{title}'.",
AUDIT_CMD_DESCRIPTION: 'Perform audits and find possible errors in the exported Contentstack data',
SCAN_WF_SUCCESS_MSG: "Successfully completed the scanning of {module} '{name}'.",
SCAN_WF_SUCCESS_MSG: "Successfully removed the workflow with UID {uid} and name {name}.",
};

const auditFixMsg = {
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-audit/src/modules/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default class Workflows {
if (ctNotPresent.length) {
const tempwf = cloneDeep(workflow);
tempwf.content_types = ctNotPresent;
ctNotPresent.forEach((ct) => this.missingCts.add(ct));
this.missingCtInWorkflows.push(tempwf);
}

Expand Down Expand Up @@ -93,7 +94,6 @@ export default class Workflows {
if (Object.keys(newWorkflowSchema).length !== 0) {
for (const workflow of this.workflowSchema) {
const fixedCts = workflow.content_types.filter((ct) => !this.missingCts.has(ct));

if (fixedCts.length) {
newWorkflowSchema[workflow.uid].content_types = fixedCts;
} else {
Expand All @@ -114,7 +114,7 @@ export default class Workflows {

async writeFixContent(newWorkflowSchema: Record<string, Workflow>) {
if (
this.fix &&
this.fix ||
!(this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm) &&
(this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION)))
) {
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 @@ -132,7 +132,7 @@ class ModuleImporter {
args.push('--modules', this.importConfig.moduleName);
} else if (this.importConfig.modules.types.length) {
this.importConfig.modules.types
.filter((val) => ['content-types', 'global-fields', 'entries'].includes(val))
.filter((val) => ['content-types', 'global-fields', 'entries', 'workflows'].includes(val))
.forEach((val) => {
args.push('--modules', val);
});
Expand Down

0 comments on commit 2e9bed0

Please sign in to comment.