-
Notifications
You must be signed in to change notification settings - Fork 121
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
Adds a secondary form to project:create for template, catalog, and initialize options #831
base: development
Are you sure you want to change the base?
Adds a secondary form to project:create for template, catalog, and initialize options #831
Conversation
…l requested change
If I'm reading this properly, the If so, then IMO it should be split. Have a |
We're skipping the "catalog definition" step, that's provided by Accounts based on any of your vendor/organization[NYI]/user-level catalog files, or falling back to the default if none of those are found. The Console is going to support a |
…essaging around an empty catalog
…d and automatically initializing projects that allow for it
$regions[$region->id] = $region->label; | ||
// First look to the setup/options API for a region list. | ||
$account = $this->api()->getMyAccount(true); | ||
$setupOptions = $this->api()->getClient()->getSetupOptions(NULL, NULL, NULL, $account['username'], NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the setup options API supposed to fall back to all the available regions automatically, thus making the subsequent $this->api()->getClient()->getRegions()
unnecessary?
} | ||
|
||
if (empty($catalog)) { | ||
// Should we throw an error here? Do we want to kill the process? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the getTemplateFields()
receives an empty catalog array? If nothing significant -- I'd remove this condition. If something unexpected -- I'd throw an Exception and bail out.
I don't have a clue what am I writing about, right here, so please be free to ignore me if I make no sense at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $catalog
comes back as empty it will cause a logic exception since it's an asChoice
field. So, do we want it to fail and skip to the next step and just now allow a template choice or stop the process? I'm not sure what the preference is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'd personally fail it. What do you think @pjcdawkins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd return []
here, and let Symfony throw the LogicException
if ($runtime) { | ||
$catalog = []; | ||
$catalog_items = $this->api()->getClient()->getCatalog()->getData(); | ||
if (!empty($catalog_items)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the if
isn't needed - if it's always an array, the foreach
won't mind if it's empty
A new form will be built and served if the
--template
flag is passed. The fields aretemplate_url
which allows for the passing of a url,catalog_url
which will list all options from the catalog, andinitialize
which will initialize the project after creation if selected.