Ticket #2204 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

[super] Related (Stuff) Extension

Reported by: rgrp Owned by: ross
Priority: critical Milestone: ckan-sprint-2012-04-30
Component: ckan Keywords: [7.5d][r:3d]
Cc: Repository: ckan
Theme: none

Description (last modified by ross) (diff)

This is a reworking of the existing apps extension.

Initial proposal at http://wiki.ckan.org/Proposals#Apps_in_CKAN and http://wiki.ckan.org/Proposals#References.2FLinks_in_CKAN

Naming

What do we call this extension?

  • related
    • RP best IMO but perhaps too close to separate relationships concept?
  • relatedstuff
  • links
  • references

Proposal

"Related Stuff": Apps as in an application (website/service/tool) that uses this dataset (as in Apps and Ideas extension)

Implementation

New table named Related with following structure

|| id (int) || type || title || description (markdown) || image_url || owner_id || url || created (timestamp)
  • type = Idea | App | API | Visualization | Post | Paper | News Article
    • Suggest we make this a ckan.ini config option (comma separated ...?)
      • Do we want the possibility of different templates for different types of Related objects?
  • image: ?? Depends where we store images. Simplest option would be to change to image_url and leave it to users to have already uploaded an image somewhere. If not we need to support image uploading and storage. See #1692 (add image attribute to datasets and groups) for more discussion, once implemented the URL here can be an internal url.
  • owner_id = user_id or creating user (see authorization below)

Related2Dataset (note that related_id, dataset_id tuple should be unique). This allows for m2m connections. If a given related item is only with one dataset this could be simplified. May contain status so dataset owner can turn this on/off.

|| id || dataset_id || related_id || status

status should be used to allow for a dataset owner (for dataset_id) to de-activate the relationship between the dataset and the related.

Url

  • /dataset/{dataset-name}/related/{related-item-id}/{related-item-title-stringified}
    • If a reference item could exist in its own right (and perhaps refer to multiple datasets then it should get its own url at e.g. /related/{id}
  • /dataset/{dataset-name}/related/add => Modal dialog on related tab so we can use API to create them.

/dataset/{id}/related <- list

  • use image_url for small icon etc, title description (shortened?)
  • Click through to full related item (optional)
  • dataset owner is shown show / hide button ... (or on /dataset/{id}/related/{id} )
  • related owner sees an edit button / icon (pops up modal)

/dataset/{id}/related/{id} (optional)

/dataset/{id} will have a Related tab (with bubble with count).

  • Drop down with Add Related -> Pop-up modal and save via API

(Not used: /related/add with dataset prefilled ... )

/related/{id}/edit

Authorization

Addition of related item be considered orthogonal to datasets (and hence with separate authorization i.e. i can add the info that site X uses dataset Y without needing permission to edit dataset Y).

Thus any logged in user could add a Related item. We set the owner of the related item to creating user and going forward only that user or a sysadmin can update or delete.

NB: we could have a system where datasets owners have to approve related items before they show up next to their dataset. This would add substantial complexity so I propose we leave out of phase 1.

Tasks and estimates {7.5d}

[x] Model + Migration for Related table. {0.75d}

[x] Controller for Related (or relevant sections in Package controller). {0.75d}

[x] Routing setup. {0.25d}

[x] Schema for related. {0.5d}

[x] Logic layer actions. {1.0d}

[x] Auth (default + publisher). {0.5d}

[x] Templates + Dataset changes (new tab etc). {1.0d}

[x] JS Application for adding Related objects in a modal. {1.0d}

[x] Testing. {0.75d}

[x] Dataset owner disabling of Related (via M2M table). {0.5d}

  • Updated to allow author of related to delete as well

[x] Documentation. {0.25d}

Change History

comment:1 Changed 2 years ago by rgrp

  • Description modified (diff)

comment:2 Changed 2 years ago by rgrp

  • Description modified (diff)

comment:3 Changed 2 years ago by rgrp

  • Owner changed from amercader to toby
  • Status changed from new to assigned
  • Milestone changed from ckan-v1.7 to current-ckan-sprint-2012-04-02

comment:4 Changed 2 years ago by toby

needs discussion - planned for 23-3-2012

comment:6 Changed 2 years ago by toby

still awaiting discussion

comment:7 Changed 2 years ago by ross

  • Owner changed from toby to ross

comment:8 Changed 2 years ago by ross

  • Keywords [?d] added
  • Milestone changed from ckan-sprint-2012-04-02 to current-ckan-sprint-2012-04-16

comment:9 Changed 2 years ago by ross

  • Description modified (diff)

comment:10 Changed 2 years ago by ross

  • Description modified (diff)

comment:11 Changed 2 years ago by ross

  • Description modified (diff)

comment:12 Changed 2 years ago by ross

  • Description modified (diff)

comment:13 Changed 2 years ago by ross

  • Keywords [7.5d] added; [?d] removed
  • Description modified (diff)

comment:14 Changed 2 years ago by ross

  • Description modified (diff)

comment:15 Changed 2 years ago by rgrp

Important comment: not sure how much we have thought through using this for storing queries / views / visualizations coming from our data viewer. In particular, wonder if this necessitates some kind of support for arbitrary json data ...

Also (@icmurray): does this interact with our desire to do embedding?

comment:16 Changed 2 years ago by ross

I'd be happier adding this to another ticket rather than moving the target for this ticket half way through so have created #2284 Should only be a short ticket in the next sprint.

comment:17 Changed 2 years ago by ross

  • Description modified (diff)

comment:18 Changed 2 years ago by ross

  • Keywords [7.5d][r:3d] added; [7.5d] removed

comment:19 Changed 2 years ago by ross

  • Milestone changed from ckan-sprint-2012-04-16 to current-ckan-sprint-2012-04-30

comment:20 Changed 2 years ago by ross

  • Description modified (diff)

comment:21 Changed 2 years ago by aron.carroll

Making some notes of front-end changes that I think need to be implemented sooooon.

Implement better truncation (the expanded text should pop out on hover rather than expand the entire row)
Show the type of related item (an icon would be good here)
Test in IE
Make the form work without JavaScript by accepting x-www-form-urlencoded.
Add classes to first item in a row to clear the row (currently uses :nth-child CSS)
Touch gestures and re-ordering (David's request)

comment:22 Changed 2 years ago by ross

  • Description modified (diff)

comment:23 Changed 2 years ago by ross

  • Owner changed from ross to aron.carroll

Giving this ticket to Aron to fix the front end

comment:24 Changed 2 years ago by rgrp

  • Owner changed from aron.carroll to rossjones

Surely this ticket was closed 3w ago?

@Ross: can you close ...

comment:25 Changed 2 years ago by rgrp

  • Owner changed from rossjones to ross
  • Priority changed from awaiting triage to critical

comment:26 Changed 2 years ago by ross

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Description modified (diff)

Was waiting for documentation, can close now.

Note: See TracTickets for help on using tickets.