IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
846B

  1. import arvadosTypeName from 'arvados-type-name';
  2. function urlForObject(item, mode='primary') {
  3. let objectType = arvadosTypeName(item.uuid.split('-')[1]);
  4. if (objectType === 'user')
  5. return ('/browse/' + item.uuid);
  6. else if (objectType === 'group' && item.group_class === 'project')
  7. return ('/browse/' + item.uuid);
  8. else if (objectType === 'container_request')
  9. return ('/process/' + item.uuid);
  10. else if (objectType === 'workflow')
  11. return ('/workflow/' + item.uuid);
  12. else if (objectType === 'collection') {
  13. if (mode === 'primary' || mode === 'browse')
  14. return ('/collection-browse/' + item.uuid);
  15. else
  16. return ('/collection/' + item.uuid);
  17. } else if (objectType === 'container')
  18. return ('https://wb.arkau.roche.com/containers/' + item.uuid);
  19. }
  20. export default urlForObject;