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

[Service - ApiDocs relationship] Adapt Liquid Drops to it #71

Merged
merged 13 commits into from Oct 4, 2018

Conversation

Martouta
Copy link
Contributor

@Martouta Martouta commented Oct 2, 2018

Depends on #62 in which ActiveDocs and Service have a relationship.

fixes https://github.com/3scale/porta/issues/61 and belongs to THREESCALE-1340

  1. Service drop -> api_specs
    http://provider-admin.example.com.lvh.me:3000/p/admin/liquid_docs#service-drop
    image
  2. ApiSpecs drop -> service
    http://provider-admin.example.com.lvh.me:3000/p/admin/liquid_docs#apispec-drop
    image
  3. Improve the already existing ProviderDrop#api_specs documentation
    http://provider-admin.example.com.lvh.me:3000/p/admin/liquid_docs#provider-drop
    image
    Removing the access to deleted api_specs from provider for the service is already done in [Service - ApiDocs relationship] Create relationship and adapt endpoints for Create and Update (UI & API) #62

@Martouta Martouta self-assigned this Oct 2, 2018
@Martouta Martouta changed the title [WIP] Expose API/Service on api_specs liquid drop [Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop Oct 2, 2018
@Martouta Martouta changed the title [Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop [WIP][Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop Oct 2, 2018
@Martouta Martouta changed the title [WIP][Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop [WIP][Not reviewable][Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop Oct 3, 2018
@Martouta Martouta force-pushed the liquid-drop-api-docs-with-service branch 2 times, most recently from 8641c88 to 0d9e534 Compare October 3, 2018 06:55
@Martouta Martouta force-pushed the liquid-drop-api-docs-with-service branch from 0d9e534 to 032ea46 Compare October 3, 2018 08:27
@Martouta Martouta changed the title [WIP][Not reviewable][Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop [WIP][Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop Oct 3, 2018
@Martouta Martouta force-pushed the liquid-drop-api-docs-with-service branch from 032ea46 to a78f4f8 Compare October 3, 2018 08:28
@Martouta Martouta changed the title [WIP][Service - ApiDocs relationship] Expose API/Service on api_specs liquid drop [WIP][Service - ApiDocs relationship] Adapt Liquid Drops to it Oct 3, 2018
@Martouta Martouta force-pushed the liquid-drop-api-docs-with-service branch from a78f4f8 to ea02152 Compare October 3, 2018 11:19

desc 'Returns the service of the spec if it has any or nil otherwise.'
def service
return nil unless (service = @spec.service)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know if in this case I should return nil or an empty service drop, but I saw that for other cases we are currently returning nil so I kept it the same way. For example in:

def service
if s = find_service
Drops::Service.new(s)
end
end

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's nil then it can be less verbose

return unless service = @spec.service

@Martouta Martouta force-pushed the liquid-drop-api-docs-with-service branch from ea02152 to 2fbfdd9 Compare October 3, 2018 11:25
@Martouta Martouta changed the title [WIP][Service - ApiDocs relationship] Adapt Liquid Drops to it [Do not merge][Service - ApiDocs relationship] Adapt Liquid Drops to it Oct 3, 2018
@Martouta Martouta force-pushed the liquid-drop-api-docs-with-service branch from 2fbfdd9 to f14f5b6 Compare October 3, 2018 12:07
@Martouta Martouta force-pushed the liquid-drop-api-docs-with-service branch from f14f5b6 to e9e6086 Compare October 3, 2018 12:41
@Martouta Martouta changed the base branch from master to reference-api-docs-with-its-service October 3, 2018 12:42
@@ -362,6 +362,9 @@ Returns the url of the API spec.
### system_name
Returns the name of the spec.

### service
Returns the service of the spec if it has any or nil otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we backquote nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea 😱 This is autogenerated, but I will try to accomplish that 😄 Maybe it is as easy as typing backquoted the original text 😊 I will try 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You were right, it was that easy and it looks better 👍 💪

@Martouta Martouta removed the jenkins label Oct 4, 2018
@Martouta Martouta changed the base branch from reference-api-docs-with-its-service to master October 4, 2018 05:26
@Martouta Martouta changed the title [Do not merge][Service - ApiDocs relationship] Adapt Liquid Drops to it [Service - ApiDocs relationship] Adapt Liquid Drops to it Oct 4, 2018
@Martouta Martouta merged commit 562fbf2 into master Oct 4, 2018
@Martouta Martouta deleted the liquid-drop-api-docs-with-service branch October 4, 2018 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants