|
12345678910111213141516171819202122232425 |
- import arvadosTypeName from 'arvados-type-name';
-
- function urlForObject(item, mode='primary') {
- let objectType = arvadosTypeName(item.uuid.split('-')[1]);
- if (objectType === 'user')
- return ('/browse/' + item.uuid);
- else if (objectType === 'group' && item.group_class === 'project')
- return ('/browse/' + item.uuid);
- else if (objectType === 'container_request')
- return ('/process/' + item.uuid);
- else if (objectType === 'workflow') {
- if (mode === 'launch')
- return ('/workflow-launch/' + item.uuid)
- else
- return ('/workflow/' + item.uuid);
- } else if (objectType === 'collection') {
- if (mode === 'primary' || mode === 'browse')
- return ('/collection-browse/' + item.uuid);
- else
- return ('/collection/' + item.uuid);
- } else if (objectType === 'container')
- return ('/container/' + item.uuid);
- }
-
- export default urlForObject;
|