This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Updated Apigility Admin to allow setting of the default API version #27
Closed
michaelmoussa
wants to merge
9
commits into
zfcampus:master
from
michaelmoussa:configurable-default-version
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c132f3e
Initial UI
michaelmoussa 4a125cc
Model logic to update the default API version
michaelmoussa e9d9460
Route + controller action to handle default api version updates
michaelmoussa d518d98
Angular logic to update the default version
michaelmoussa 3321c41
ModuleModel logic returns default version for /admin/api/module
michaelmoussa d4024c0
Set the default version based on /admin/api/module response
michaelmoussa e50f1b4
Code formatting
michaelmoussa c4a2208
Fixes to default versioning UI after rebasing
michaelmoussa 5d8bab0
Whitespace fix
michaelmoussa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
<div id="api-version" class="pull-right" ng-controller="ApiVersionController"> | ||
<div>Current Version: {{ api.version }}</div> | ||
<div> | ||
<select ng-model="currentVersion" ng-options="ver for ver in api.versions" ng-change="changeVersion()"></select> | ||
<label for="current-api-version">Current Version:</label> | ||
<select id="current-api-version" ng-model="currentVersion" ng-options="ver for ver in api.versions" | ||
ng-change="changeVersion()"></select> | ||
</div> | ||
<div> | ||
<label for="default-api-version">Default Version:</label> | ||
<select id="default-api-version" ng-model="defaultApiVersion" ng-options="ver for ver in api.versions" | ||
ng-change="setDefaultApiVersion()"></select> | ||
</div> | ||
<div> | ||
<button class="btn btn-primary btn-sm" ng-click="createNewApiVersion()">Create New Version</button> | ||
</div> | ||
</div> | ||
|
||
<div ng-switch="section" class="clearfix"> | ||
<div ng-switch-when="info"><api-info></api-info></div> | ||
<div ng-switch-when="rest-services"><api-rest-services></api-rest-services></div> | ||
<div ng-switch-when="rpc-services"><api-rpc-services></api-rpc-services></div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause | ||
* @copyright Copyright (c) 2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
*/ | ||
|
||
namespace ZFTest\Apigility\Admin\Model; | ||
|
||
use PHPUnit_Framework_TestCase as TestCase; | ||
use ZF\Apigility\Admin\Model\ModuleEntity; | ||
|
||
class ModuleEntityTest extends TestCase | ||
{ | ||
public function testCanSetAndRetrieveModuleDefaultVersion() | ||
{ | ||
$moduleEntity = new ModuleEntity('Test\Foo'); | ||
$this->assertSame(1, $moduleEntity->getDefaultVersion()); // initial state | ||
|
||
$moduleEntity->exchangeArray(array('default_version' => 123)); | ||
$this->assertSame(123, $moduleEntity->getDefaultVersion()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,8 @@ | |
|
||
class Module implements ApigilityModuleInterface | ||
{ | ||
public function getConfig() | ||
{ | ||
return array(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.