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!
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

29 lines
1000B

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