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.

26 lines
911B

  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. if (mode === 'launch')
  12. return ('/workflow-launch/' + item.uuid)
  13. else
  14. return ('/workflow/' + item.uuid);
  15. } else if (objectType === 'collection') {
  16. if (mode === 'primary' || mode === 'browse')
  17. return ('/collection-browse/' + item.uuid);
  18. else
  19. return ('/collection/' + item.uuid);
  20. } else if (objectType === 'container')
  21. return ('/container/' + item.uuid);
  22. }
  23. export default urlForObject;