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

re #996 Delete APIs in UI #427

Merged
merged 1 commit into from Mar 9, 2016
Merged

Conversation

kahboom
Copy link
Member

@kahboom kahboom commented Mar 2, 2016

Changes:

  • Add modal template and button to delete API (let me know if you don't like the cog dropdown option. I personally like it but we can go the traditional button route, I just didn't want to clutter the UI or "encourage" the user to delete).
  • Add request to API to delete API
  • Add comparison check for user input vs name of API after forcing both as lowercase, for user convenience
  • Quick fix for How to Invoke API modal close button not working (JIRA: https://issues.jboss.org/browse/APIMAN-1001)
  • Minor styling (mostly inline for now, will be improved later)

Also, in the future we need to implement a check that determines whether to show/hide the delete button at all in the UI. For now, the user will know because they will get an error when they try to delete an "undeletable" API.

Screenshots:

screen shot 2016-03-02 at 11 52 34 am

screen shot 2016-03-02 at 12 02 46 pm

screen shot 2016-03-02 at 12 02 55 pm

JIRA: https://issues.jboss.org/browse/APIMAN-996

cc @EricWittmann @msavy

modalInstance.result.then(function (selectedItem) {
$scope.selected = selectedItem;
}, function () {
$log.info('Modal dismissed at: ' + new Date());
Copy link
Member

Choose a reason for hiding this comment

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

Don't use $log - instead use Logger, which is already being injected.

@EricWittmann
Copy link
Member

This looks really great! Nice job.

Does it actually work?! :)

@kahboom
Copy link
Member Author

kahboom commented Mar 3, 2016

@EricWittmann - Well, I get a "method not allowed" error when trying to delete, if that's what you mean (see screenshot below). I couldn't test this with mock requests because I don't have unit tests set up, and the backend isn't ready yet. Or should this request have succeeded? I tested manually with a published API and an API that has never been published before (with only one version).

screen shot 2016-03-02 at 8 44 12 pm

@EricWittmann
Copy link
Member

Ah yes I see - you're not sending the correct REST request. You're sending a request here:

/apiman/actions

https://github.com/apiman/apiman/blob/master/manager/api/rest/src/main/java/io/apiman/manager/api/rest/contract/IActionResource.java#L34

Instead, you want to send the DELETE request here:

/apiman/organizations/{orgId}/apis/{apiId}

https://github.com/apiman/apiman/blob/master/manager/api/rest/src/main/java/io/apiman/manager/api/rest/contract/IOrganizationResource.java#L825-L829

I believe it should work.

@kahboom
Copy link
Member Author

kahboom commented Mar 4, 2016

Wow lol, thanks.

On Thu, Mar 3, 2016 at 7:39 AM, Eric Wittmann notifications@github.com
wrote:

Ah yes I see - you're not sending the correct REST request. You're sending
a request here:

/apiman/actions

https://github.com/apiman/apiman/blob/master/manager/api/rest/src/main/java/io/apiman/manager/api/rest/contract/IActionResource.java#L34

Instead, you want to send the DELETE request here:

/apiman/organizations/{orgId}/apis/{apiId}

https://github.com/apiman/apiman/blob/master/manager/api/rest/src/main/java/io/apiman/manager/api/rest/contract/IOrganizationResource.java#L825-L829

I believe it should work.


Reply to this email directly or view it on GitHub
#427 (comment).

@kahboom kahboom force-pushed the 996-delete-apis branch 2 times, most recently from 85b70ef to 5333c31 Compare March 4, 2016 20:51
re apiman#1001 Quick fix for How to Invoke API modal close button not working

Update API method

re apiman#996 Use Logger instead of ; log cleanup; use proper method to close modal
EricWittmann added a commit that referenced this pull request Mar 9, 2016
@EricWittmann EricWittmann merged commit 1fc9bc2 into apiman:master Mar 9, 2016
@EricWittmann
Copy link
Member

Sorry - I was waiting for this to be updated with the proper REST api call. You did update it but I didn't get a notification of that change. So now it's merged!

@kahboom kahboom deleted the 996-delete-apis branch April 18, 2016 17:30
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.

None yet

2 participants