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

Reorder firebase init dataconnect prompts for better local onboarding flow. #7733

Merged
merged 8 commits into from
Sep 26, 2024

Conversation

rosalyntan
Copy link
Member

@rosalyntan rosalyntan commented Sep 25, 2024

Description

  • If there are existing services / instances, use those for setting up local files
    • Until b/368609569 is fixed, this is only for projects with billing. After, should work regardless of billing state
  • If there are no existing services / instances:
    • If no billing:
      • Set up local files with defaults
    • If yes billing:
      • Ask if they want to configure backend resource, otherwise set up local files with defaults

Scenarios Tested

  • project with no billing
  • project with billing with existing services
  • project with billing with no services, (y) for configuring backend resources
  • project with billing with no services, (n) for configuring backend resources

Sample Commands

project with billing with existing services:
Screenshot 2024-09-25 at 9 40 59 PM

project with billing with no services, (n) for configuring backend resources:
Screenshot 2024-09-25 at 9 39 15 PM

@rosalyntan rosalyntan changed the title Initial reordering of prompts for better local onboarding flow. Reorder firebase init dataconnect prompts for better local onboarding flow. Sep 25, 2024
@rosalyntan rosalyntan marked this pull request as ready for review September 26, 2024 04:49
Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

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

Small type nits but lgtm otherwise

}),
);
if (existingServicesAndSchemas.length) {
const choices: { name: string; value: any }[] = existingServicesAndSchemas.map((s) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
const choices: { name: string; value: any }[] = existingServicesAndSchemas.map((s) => {
const choices: { name: string; value: { schema: Schema, service: Service } | undefined }[] = existingServicesAndSchemas.map((s) => {

};
});
choices.push({ name: "Create a new service", value: undefined });
const choice: { service: Service; schema: Schema } = await promptOnce({
Copy link
Contributor

Choose a reason for hiding this comment

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

If you set it above, you can remove this type declaration here because promptOnce will return a defined type.

@joehan joehan enabled auto-merge (squash) September 26, 2024 13:22
@joehan joehan merged commit 2a0cff4 into master Sep 26, 2024
39 of 41 checks passed
@rosalyntan rosalyntan deleted the rosalyntan.local branch September 26, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants