bcgov / ckan-ui

CKAN UI - VueJS
GNU Affero General Public License v3.0
14 stars 4 forks source link

OFI Resources - URL needs to be hidden on Resource #489

Closed annikaLiving closed 3 years ago

annikaLiving commented 3 years ago

The URL listed on the BCGW Custom Download resource needs to be hidden as it is in cat classic.

This URL doesn't work on it's own and must be access with the Request Access button on the Resource Card or the Resource Toolbar., thus a user will be confused on how to get access and think download doesn't work.

joe-taylor commented 3 years ago

For reference in testing later, here's a random sample of OFI resources and their pages in prod. On these pages, the URL should be hidden.

fadm-provincial-forest-addition aquifer-vulnerability-to-saltwater-intrusion-pumping-and-coastal-hazard oil-and-gas-commission-changes-in-and-about-a-stream-applications bc-major-watersheds ungulate-winter-range-proposed conservation-cross-reference-table nts-50k-grid-digital-baseline-mapping-at-1-50-000-nts mta-coal-grid-unit protected-lands-access-restrictions nts-bc-designated-area-points-1-250-000-digital-baseline-mapping-nts

SQL select statement
select
  concat('[', package.name ,'](https://catalogue.data.gov.bc.ca/dataset/', package.name, '/resource/', resource.id, ')') url
from package
inner join package_extra
  on package_extra.package_id = package.id and
     package_extra.key = 'download_audience'
inner join resource
  on resource.package_id = package.id and
     resource.state = 'active'
where
  package_extra.value in ('Public', 'Not downloadable') and
  package.state = 'active' and
  resource.extras::json->>'ofi' = 'true'
order by random()
limit 10;

Now, here's a sample of non-OFI resources, linked to corresponding prod pages. On these pages, the URL should be shown.

summerland-district-of-2007-community-energy-and-emissions-inventory-report how-about-this railway-markerpost-point mount-polley-sampling-sites-data census-marital-status-profiles-by-sex-and-relationship-type-for-chsa-2016-census north-cowichan-land-parcels other-forest-carbon-initiative-projects shorezone-biobanding-polygons local-government-tax-rates-and-assessments-assessed-values-2009 georgia-basin-ecosystem-initiative-boundary-polygon

SQL select statement
select
  concat('[', package.name ,'](https://catalogue.data.gov.bc.ca/dataset/', package.name, '/resource/', resource.id, ')') url
from package
inner join package_extra
  on package_extra.package_id = package.id and
     package_extra.key = 'download_audience'
inner join resource
  on resource.package_id = package.id and
     resource.state = 'active'
where
  package_extra.value in ('Public', 'Not downloadable') and
  resource.extras::json->>'ofi' is null and
  package.state = 'active'
order by random();
joe-taylor commented 3 years ago

Removing the highlighted parts of the interface for OFI resources, those being resources where the "Request Access" button is visible.

image

ghost commented 3 years ago

The URL is visible in edit mode (pass) and the URL is hiddent in read only mode (pass) for Geographic Data type records. This is a conditional pass as the POW is not loading when I select the Request Access link to download the resource. Unsure if this is related. @joe-taylor - can you confirm? I will move this back to Toyger (QA).

joe-taylor commented 3 years ago

I can confirm this is an unrelated issue concerning configuration in toyger. I'm addressing POW loading issues including this one in bcgov#501.

ghost commented 3 years ago

Thanks for the clarification - I will move this to Ready for Beta.

ghost commented 3 years ago

URL is hidden as requested and tested - ready for production