Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Updated Apigility Admin to allow setting of the default API version #27

Closed
wants to merge 9 commits into from
Closed

Updated Apigility Admin to allow setting of the default API version #27

wants to merge 9 commits into from

Conversation

michaelmoussa
Copy link
Contributor

See zf-versioning:PR #1

Thoughts @weierophinney? My only concern is that there is no visible confirmation that the default version has been changed once the user changes the SELECT option. Perhaps a confirm("Are you sure you want to change the default API version?"); (or something prettier)?

On the other hand, they'll see it in the git diff for their module before committing the changes, so the lack of a visual confirmation right now isn't the end of the world.

NOTE: This assertion will fail until this PR is merged. I inadvertently introduced a BC break with the readable PhpArray config writer change. :/

$config = $this->configResource->fetch(true);

return isset($config['zf-versioning']['default-version']) &&
$config['zf-versioning']['default-version'] === $defaultVersion;
Copy link
Member

Choose a reason for hiding this comment

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

Move the && to the next line.

@weierophinney
Copy link
Member

@michaelmoussa I just tried to merge locally so I could test, but it appears that the app.js version you based your work on is quite out-of-date. Can you please rebase and resolve the conflict? I'm worried I'll mess it up, considering the scope of changes.

Thanks!

@michaelmoussa
Copy link
Contributor Author

It should be fine now. I did my best to make sure I didn't break anything, but the branch/PR was pretty old so I may have overlooked something.

Specifically, I:

  • Created New Api (cur ver: 1, def ver: 1)
  • Added a rest service (same)
  • Created New Version (cur ver: 2, def ver: 1)
  • Created New Version (cur ver: 3, def ver 1)
  • Changed default version to 2 (cur ver: 3, def ver 2)

Default Version is preserved on reload, and changing Current Version shows me the listing of Rest Services.

Apologies in advance if I goofed somewhere (I re-read the PR diff in the conflicted files and it seems OK, though). Feel free to make any trivial changes if necessary to accept the PR, or let me know if there's anything major you'd prefer I address.

@weierophinney
Copy link
Member

@michaelmoussa I'd like to do the following:

  • Move this to the API overview page. I think it's confusing having it associated with the "create new version" button.
  • Use the "flash" service to indicate when (a) that you're saving the change, and (b) when the response comes back saying it's been updated. (You can see the flash service being used elsewhere in the app at this point).

I'm going to move forward with this and then finish merging.

@michaelmoussa
Copy link
Contributor Author

Sounds good. Thanks!


$this->configResource->patch(array(
'zf-versioning' => array(
'default-version' => $defaultVersion
Copy link
Member

Choose a reason for hiding this comment

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

This key should be underscore separated, not dash (we use dash-separated for top-level keys representing modules, but underscore-separated for the options beneath them).

I'll modify this on merge.

weierophinney added a commit that referenced this pull request Dec 6, 2013
Updated Apigility Admin to allow setting of the default API version
@ghost ghost assigned weierophinney Dec 6, 2013
@weierophinney
Copy link
Member

Merged!

@michaelmoussa Where's the PR against develop to fix the config writer? I'd like to take care of that today, too. :)

@michaelmoussa
Copy link
Contributor Author

Ooh, two in one day! :-) Here you go: zendframework/zendframework#5569

@michaelmoussa michaelmoussa deleted the configurable-default-version branch December 7, 2013 14:17
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this pull request Aug 12, 2016
Add "zfcampus/zf-configuration" dependency
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this pull request Aug 12, 2016
- zf-configuration is only used by the admin
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this pull request Aug 12, 2016
- only used by the admin; moved to development config
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this pull request Aug 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants