Skip to content

Commit

Permalink
Merge pull request #1215 from contentstack/fix/early-access-ui-text
Browse files Browse the repository at this point in the history
fix: early access feature ui text
  • Loading branch information
aman19K authored Dec 14, 2023
2 parents 61e2ee4 + c409999 commit 6ee00c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions packages/contentstack-config/messages/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"CLI_CONFIG_INQUIRE_API_KEY": "Enter stack api key",
"CLI_CONFIG_INQUIRE_BASE_BRANCH": "Enter base branch",
"CLI_CONFIG_BRANCH_LIST_NO_BRANCHES": "No branches are added. Use config:set:base-branch command to add base branch.",
"CLI_CONFIG_INQUIRE_EARLY_ACCESS_HEADER_VALUE": "Enter early access header value",
"CLI_CONFIG_INQUIRE_EARLY_ACCESS_HEADER_ALIAS": "Enter early access header alias",
"CLI_BRANCH_REQUIRED_FIELD": "Required given field"
"CLI_CONFIG_INQUIRE_EARLY_ACCESS_HEADER_VALUE": "Please enter Early Access Program header value",
"CLI_CONFIG_INQUIRE_EARLY_ACCESS_HEADER_ALIAS": "Please enter Early Access Program header alias",
"CLI_BRANCH_REQUIRED_FIELD": "Please enter the required field details"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cliux, configHandler } from '@contentstack/cli-utilities';
import { Command } from '@contentstack/cli-command';

export default class GetEarlyAccessHeaderCommand extends Command {
static description = 'Display early access headers';
static description = 'Display Early Access Program headers';
static aliases: string[] = ['config:get:ea-header'];
static examples = ['$ <%= config.bin %> <%= command.id %>'];

Expand All @@ -29,10 +29,10 @@ export default class GetEarlyAccessHeaderCommand extends Command {
},
);
} else {
cliux.print(`No early access header found`, { color: 'red' });
cliux.print(`No Early Access Program header found!`, { color: 'red' });
}
} catch (error) {
this.log('Failed to get the early access header config', error instanceof Error ? error.message : error);
this.log('Unable to retrieve the Early Access Program header config', error instanceof Error ? error.message : error);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { interactive } from '../../../utils';
import { Command } from '@contentstack/cli-command';

export default class RemoveEarlyAccessHeader extends Command {
static description = 'Remove early access header';
static description = 'Remove Early Access Program header';
static aliases: string[] = ['config:remove:ea-header'];
static flags: FlagInput = {
'header-alias': flags.string({ description: 'Early access header alias' }),
Expand All @@ -23,7 +23,7 @@ export default class RemoveEarlyAccessHeader extends Command {
earlyAccessHeaderAlias = await interactive.askEarlyAccessHeaderAlias();
}
if (configHandler.get(`earlyAccessHeaders.${earlyAccessHeaderAlias}`) === undefined) {
cliux.error(`No early access header set for alias : ${earlyAccessHeaderAlias}`);
cliux.error(`Early Access Program header not configured for alias: ${earlyAccessHeaderAlias}`);
return;
}
if (!skipConfirmation) {
Expand All @@ -33,9 +33,9 @@ export default class RemoveEarlyAccessHeader extends Command {
}
}
configHandler.delete(`earlyAccessHeaders.${earlyAccessHeaderAlias}`);
cliux.success(`Removed early access header '${earlyAccessHeaderAlias}' successfully`);
cliux.success(`Early Access Program header '${earlyAccessHeaderAlias}' has been successfully removed`);
} catch (error) {
this.log('Failed to remove the early access header config', error instanceof Error ? error.message : error);
this.log('Unable to remove the Early Access Program header config', error instanceof Error ? error.message : error);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { interactive } from '../../../utils';
import { Command } from '@contentstack/cli-command';

export default class SetEarlyAccessHeaderCommand extends Command {
static description = 'Set early access header';
static description = 'Set Early Access Program header';
static aliases: string[] = ['config:set:ea-header'];
static flags: FlagInput = {
'header-alias': flags.string({ description: 'Alias for the header' }),
'header-alias': flags.string({ description: 'Early access header alias' }),
header: flags.string({ description: 'Early access header value' }),
};
static examples: string[] = [
Expand All @@ -27,10 +27,10 @@ export default class SetEarlyAccessHeaderCommand extends Command {
}
configHandler.set(`earlyAccessHeaders.${earlyAccessHeaderAlias}`, earlyAccessHeader);
cliux.success(
`Early access header '${earlyAccessHeader}' with alias '${earlyAccessHeaderAlias}' is set successfully`,
`Early access header '${earlyAccessHeader}' with alias '${earlyAccessHeaderAlias}' has been successfully set `,
);
} catch (error) {
this.log('Failed to set the early access header config', error instanceof Error ? error.message : error);
this.log('Unable to set the Early Access Program header config', error instanceof Error ? error.message : error);
}
}
}

0 comments on commit 6ee00c5

Please sign in to comment.