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

Create new prompt for is_available_for_new_content. #1226

Merged
merged 2 commits into from
Nov 21, 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 acceptance-tests/tests/commands/create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('hs create', () => {
it('creates a module', async () => {
await testState.cli.execute(
['create', 'module', FOLDERS.module.name],
['label', ENTER, ENTER, ENTER, 'y', ENTER]
['label', ENTER, ENTER, ENTER, 'y', ENTER, ENTER]
);

expect(testState.existsInTestOutputDirectory(FOLDERS.module.folder)).toBe(
Expand Down
1 change: 1 addition & 0 deletions lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,7 @@ en:
selectReactType: "Is this a React module?"
selectContentType: "What types of content will this module be used in?"
confirmGlobal: "Is this a global module?"
availableForNewContent: "Make this module available for new content?"
errors:
invalidLabel: "You entered an invalid name. Please try again."
labelRequired: "The name may not be blank. Please try again."
Expand Down
8 changes: 8 additions & 0 deletions lib/prompts/createModulePrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,20 @@ const GLOBAL_PROMPT = {
default: false,
};

const AVAILABLE_FOR_NEW_CONTENT = {
type: 'confirm',
name: 'availableForNewContent',
message: i18n(`${i18nKey}.availableForNewContent`),
default: true,
};

Comment on lines +55 to +61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the addition of the prompt is causing an AT failure. I think it is as simple as adding another ENTER on this line

function createModulePrompt() {
return promptUser([
MODULE_LABEL_PROMPT,
REACT_TYPE_PROMPT,
CONTENT_TYPES_PROMPT,
GLOBAL_PROMPT,
AVAILABLE_FOR_NEW_CONTENT,
]);
}

Expand Down
Loading