conwetlab / ckanext-right_time_context

CKAN extension providing right time context support through FIWARE NGSI
GNU Affero General Public License v3.0
2 stars 10 forks source link

"Go to Resource" button should be hidden for V2 NGSI APIs #13

Closed Nisha1293 closed 8 months ago

Nisha1293 commented 2 years ago

Issue Description: When I created a new resource on the CKAN UI with the format fiware-ngsi and resource is created successfully. Data preview is working fine as shown in below image. But on that screen there is one button visible with name "Go to Resource" as shown below.

ngsi_view

On clicking on the "Go to Resource" button , it is giving the below error.

Error:


900902
Missing Credentials
Required OAuth credentials not provided. Make sure your API invocation call has a header: "Authorization: Bearer ACCESS_TOKEN"

Investigation: On the source code analysis, We found that there are two below files which has the functionality of hiding the "Go to Resource" button for V1 APIs.

  1. https://github.com/conwetlab/ckanext-right_time_context/blob/master/ckanext/right_time_context/templates/package/resource_read.html

    **Line no 8:**
    {% if res.url.lower().find('/querycontext') == -1 and res.url.lower().find('/contextentities/') == -1 %}
    
  2. https://github.com/conwetlab/ckanext-right_time_context/blob/master/ckanext/right_time_context/templates/package/snippets/resource_item.html

**Line No 15:**
{% if res.url.lower().find('/querycontext')== -1 and res.url.lower().find('/contextentities/')== -1 %}

We found that these entries are only for V1 and these are hiding the "Go to Resource" button on that screen. It is working fine for V1, but for there is no source code for V2 entities and /op/query/.

Labuschagne-Miro commented 8 months ago

@nisha-nec I think you should close this issue. Pull request is already merged.

Nisha1293 commented 8 months ago

I am closing this issue, as PR is already merged.