Skip to content

Commit d150165

Browse files
authored
Merge pull request #21 from contentstack/fix/DX-4900
fix: Typos and message fixes
2 parents 40d6f4f + a841546 commit d150165

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

packages/contentstack-audit/src/audit-base-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
672672
| 'Summary',
673673
listOfMissingRefs: Record<string, any>,
674674
): Promise<void> {
675-
if (Object.keys(config.moduleConfig).includes(moduleName) || config.feild_level_modules.includes(moduleName)) {
675+
if (Object.keys(config.moduleConfig).includes(moduleName) || config.field_level_modules.includes(moduleName)) {
676676
const csvPath = join(sanitizePath(this.sharedConfig.reportPath), `${sanitizePath(moduleName)}.csv`);
677677
return new Promise<void>((resolve, reject) => {
678678
// file deepcode ignore MissingClose: Will auto close once csv stream end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const config = {
130130
Entry_Missing_Locale_and_Env_in_Publish_Details: 'Entry_Missing_Locale_and_Env_in_Publish_Details',
131131
Entry_Multiple_Fields: 'Entry_Multiple_Fields',
132132
},
133-
feild_level_modules: [
133+
field_level_modules: [
134134
'Entries_Title_field',
135135
'Entries_Mandatory_field',
136136
'Entries_Select_field',

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const commonMsg = {
1818
WORKFLOW_FIX_CONFIRMATION: 'Would you like to overwrite existing file?',
1919
EXTENSION_FIX_WARN: `The extension associated with UID {uid} and title '{title}' will be removed.`,
2020
EXTENSION_FIX_CONFIRMATION: `Would you like to overwrite existing file?`,
21-
WF_BRANCH_REMOVAL: `Removing the branch '{branch} from workflow with UID {uid} and name {name} will be removed.'`,
22-
CR_BRANCH_REMOVAL: `Removing the branch '{branch} from custom role with UID {uid} and name {name} will be removed.'`,
21+
WF_BRANCH_REMOVAL: `Removing the branch '{branch}' from workflow with UID {uid} and name {name}.`,
22+
CR_BRANCH_REMOVAL: `Removing the branch '{branch}' from custom role with UID {uid} and name {name}.`,
2323
SHOW_CONSOLE_OUTPUT: `Display the audit and audit fix result for individual modules`,
2424
};
2525

@@ -41,7 +41,7 @@ const auditMsg = {
4141
SCAN_CS_SUCCESS_MSG: 'Successfully completed the scanning of studio project with UID {uid} and name {name}.',
4242
SCAN_ASSET_SUCCESS_MSG: `Successfully completed the scanning of Asset with UID '{uid}'.`,
4343
SCAN_ASSET_WARN_MSG: `The locale '{locale}' or environment '{environment}' are not present for asset with uid '{uid}'`,
44-
ENTRY_PUBLISH_DETAILS: `Removing the publish detials for entry '{uid}' of ct '{ctuid}' in locale '{locale}' as locale '{publocale}' or environment '{environment}' does not exist`,
44+
ENTRY_PUBLISH_DETAILS: `Removing the publish details for entry '{uid}' of ct '{ctuid}' in locale '{locale}' as locale '{publocale}' or environment '{environment}' does not exist`,
4545
CT_REFERENCE_FIELD: `The mentioned Reference field is not Array field reference is '{reference_to}' having display name '{display_name}''`,
4646
ASSET_NOT_EXIST: `The publish_details either does not exist or is not an array for asset uid '{uid}'`,
4747
ENTRY_PUBLISH_DETAILS_NOT_EXIST: `The publish_details either does not exist or is not an array for entry uid '{uid}'`,
@@ -61,8 +61,8 @@ const auditFixMsg = {
6161
WF_FIX_MSG: 'Successfully removed the workflow {uid} named {name}.',
6262
ENTRY_MANDATORY_FIELD_FIX: `Removing the publish details from the entry with UID '{uid}' in Locale '{locale}'...`,
6363
ENTRY_SELECT_FIELD_FIX: `Adding the value '{value}' in the select field of entry UID '{uid}'...`,
64-
ASSET_FIX: `Fixed publish detials for Asset with UID '{uid}'`,
65-
FIELD_RULE_FIX_MESSAGE: `Fixed Field Rule '{num}' target of Content-type '{ctUid}`,
64+
ASSET_FIX: `Fixed publish details for Asset with UID '{uid}'`,
65+
FIELD_RULE_FIX_MESSAGE: `Fixed Field Rule '{num}' target of Content-type '{ctUid}'`,
6666
};
6767

6868
const messages: typeof errors &

packages/contentstack-audit/src/modules/assets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export default class Assets extends BaseClass {
181181
}
182182

183183
/**
184-
* This function traverse over the publish detials of the assets and remove the publish details where the locale or environment does not exist
184+
* This function traverses over the publish details of the assets and removes the publish details where the locale or environment does not exist
185185
*/
186186
async lookForReference(): Promise<void> {
187187
log.debug('Starting asset reference validation', this.config.auditContext);

packages/contentstack-audit/test/unit/messages/index.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { fancy } from 'fancy-test';
22
import { expect } from 'chai';
33

4-
import { $t, auditMsg } from '../../../src/messages';
4+
import { $t, auditMsg, auditFixMsg } from '../../../src/messages';
55

66
describe('messages utility', () => {
77
describe('$t method', () => {
@@ -21,4 +21,13 @@ describe('messages utility', () => {
2121
expect($t('', {})).to.be.empty.string;
2222
});
2323
});
24+
25+
describe('typo regression: details not detials', () => {
26+
it('ASSET_FIX and ENTRY_PUBLISH_DETAILS should contain "details"', () => {
27+
expect(auditMsg.ENTRY_PUBLISH_DETAILS).to.include('details');
28+
expect(auditMsg.ENTRY_PUBLISH_DETAILS).to.not.include('detials');
29+
expect(auditFixMsg.ASSET_FIX).to.include('details');
30+
expect(auditFixMsg.ASSET_FIX).to.not.include('detials');
31+
});
32+
});
2433
});

0 commit comments

Comments
 (0)