Skip to content

Commit

Permalink
ui text update
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Feb 20, 2024
1 parent 1c99ea8 commit 78235ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/contentstack-import/src/import/modules/content-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ export default class ContentTypesImport extends BaseClass {
if (this.fieldRules.length > 0) {
await fsUtil.writeFile(path.join(this.cTsFolderPath, 'field_rules_uid.json'), this.fieldRules);
}
log(this.importConfig, 'Updating the Extensions', 'success');
log(this.importConfig, 'Updating the extensions...', 'success');
await this.updatePendingExtensions();
log(this.importConfig, 'Extensions Updated', 'success');
log(this.importConfig, 'Successfully updated the extensions.', 'success');
await this.updatePendingGFs().catch((error) => {
log(this.importConfig, `Error while updating pending global field ${formatError(error)}`, 'error');
});
Expand Down Expand Up @@ -259,22 +259,22 @@ export default class ContentTypesImport extends BaseClass {
async updatePendingExtensions(): Promise<any> {
let apiContent = fsUtil.readFile(this.extPendingPath) as Record<string, any>[];
if (apiContent.length === 0) {
log(this.importConfig, `No Extension are present to be updated`, 'success');
log(this.importConfig, `No extensions found to be updated.`, 'success');
return;
}

const onSuccess = ({ response, apiData: { uid, title } = { uid: null, title: '' } }: any) => {
log(this.importConfig, `Extension '${response.title}' updated successfully`, 'success');
log(this.importConfig, `Successfully updated the '${response.title}' extension.`, 'success');
};

const onReject = ({ error, apiData }: any) => {
const { uid } = apiData;
if (error?.errors?.title) {
if (!this.importConfig.skipExisting) {
log(this.importConfig, `Extension '${uid}' already exists`, 'info');
log(this.importConfig, `Extension '${uid}' already exists.`, 'info');
}
} else {
log(this.importConfig, `Extension '${uid}' failed to be updated ${formatError(error)}`, 'error');
log(this.importConfig, `Failed to update '${uid}' extension due to ${formatError(error)}.`, 'error');
log(this.importConfig, error, 'error');
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export default class ImportExtensions extends BaseClass {
extension.forEach((ext: ExtensionType) => {
let ct: any = ext?.scope?.content_types || [];
if ((ct.length === 1 && ct[0] !== '$all') || ct?.length > 1) {
log(this.importConfig, `Removing the Content-types ${ct.join(',')} from Extension ${ext.title}`, 'info');
log(this.importConfig, `Removing the content-types ${ct.join(',')} from the extension ${ext.title} ...`, 'info');
const { uid, scope } = ext;
this.extensionObject.push({ uid, scope });
delete ext.scope;
Expand Down

0 comments on commit 78235ed

Please sign in to comment.