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!
Ver código fonte

Fixes not to fetch manifest_text when not needed.

master
Stanislaw Adaszewski 4 anos atrás
pai
commit
7a49cdce1e
7 arquivos alterados com 56 adições e 44 exclusões
  1. +9
    -4
      frontend/src/js/component/wb-collection-fields.js
  2. +8
    -7
      frontend/src/js/component/wb-common-fields.js
  3. +19
    -7
      frontend/src/js/component/wb-name-and-uuid.js
  4. +0
    -0
      frontend/src/js/deprecated/fetch-project-parents.js
  5. +0
    -0
      frontend/src/js/deprecated/wb-project-crumbs.js
  6. +17
    -22
      frontend/src/js/misc/fetch-object-parents.js
  7. +3
    -4
      frontend/src/js/page/wb-browse.js

+ 9
- 4
frontend/src/js/component/wb-collection-fields.js Ver arquivo

@@ -22,12 +22,17 @@ class WBCollectionFields extends Component {
let { uuid, app } = this.props;
let { arvHost, arvToken } = app.state;
let item;
const filters = [
['uuid', '=', uuid]
];
let prom = makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/collections/' + uuid);
prom = prom.then(xhr => (item = xhr.response));
'/arvados/v1/collections?filters=' + encodeURIComponent(JSON.stringify(filters)));
prom = prom.then(() => {
prom = prom.then(xhr => {
const item = xhr.response.items[0];
if (!item)
throw Error('Item not found');
let rows = [
[ 'Name', item.name ],
[ 'Description', item.description || (<i>{ String(item.description) }</i>) ],


+ 8
- 7
frontend/src/js/component/wb-common-fields.js Ver arquivo

@@ -22,17 +22,18 @@ class WBCommonFields extends Component {
let { uuid, app } = this.props;
let { arvHost, arvToken } = app.state;
let item;
let owner;
let modifiedByUser;
const filters = [
['uuid', '=', uuid]
];
let prom = makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/' + arvadosTypeName(uuid) +
's/' + uuid);
's?filters=' + encodeURIComponent(JSON.stringify(filters)));
prom = prom.then(xhr => (item = xhr.response));
prom = prom.then(() => {
prom = prom.then(xhr => {
const item = xhr.response.items[0];
if (!item)
throw Error('Item not found');
let rows = [
[ 'UUID', item.uuid ],
[ 'Kind', item.kind ],


+ 19
- 7
frontend/src/js/component/wb-name-and-uuid.js Ver arquivo

@@ -45,14 +45,26 @@ class WBNameAndUuid extends Component {
} else if (/[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/.exec(uuid)) {
let typeName = arvadosTypeName(uuid);
const filters = [
['uuid', '=', uuid]
];
let prom = makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/' + typeName + 's/' + uuid );
prom = prom.then(xhr => this.setState({
'item': xhr.response
}));
prom = prom.catch(xhr => this.setState({
'error': 'Unable to retrieve: ' + xhr.status + ' (' + xhr.statusText + ')'
}));
'/arvados/v1/' + typeName +
's?filters=' + encodeURIComponent(JSON.stringify(filters)));
prom = prom.then(xhr => {
const item = xhr.response.items[0];
if (!item)
this.setState({ 'error': 'Item not found' });
else
this.setState({
'item': item
});
});
prom = prom.catch(xhr => {
this.setState({
'error': 'Unable to retrieve: ' + xhr.status + ' (' + xhr.statusText + ')'
});
});
} else {
this.setState({


frontend/src/js/misc/fetch-project-parents.js → frontend/src/js/deprecated/fetch-project-parents.js Ver arquivo


frontend/src/js/component/wb-project-crumbs.js → frontend/src/js/deprecated/wb-project-crumbs.js Ver arquivo


+ 17
- 22
frontend/src/js/misc/fetch-object-parents.js Ver arquivo

@@ -1,46 +1,41 @@
import makeArvadosRequest from 'make-arvados-request';
import arvadosTypeName from 'arvados-type-name';
import arvadosObjectName from 'arvados-object-name';
function fetchObjectParents(arvHost, arvToken, uuid) {
let parents = [];
let cb = xhr => {
let objectType = arvadosTypeName(xhr.response['uuid'].split('-')[1]);
let item = {
'uuid': xhr.response['uuid']
};
if (objectType === 'user') {
item['name'] = xhr.response['first_name'] + ' ' + xhr.response['last_name'];
} else {
item['name'] = xhr.response['name'];
}
if (objectType === 'group') {
item['group_class'] = xhr.response['group_class'];
}
const item = xhr.response.items[0];
if (!item)
return parents.reverse();
item.name = arvadosObjectName(item);
parents.push(item);
if (!xhr.response['owner_uuid'] ||
xhr.response['owner_uuid'].endsWith('-tpzed-000000000000000')) {
if (!item.owner_uuid ||
item.owner_uuid.endsWith('-tpzed-000000000000000')) {
return parents.reverse();
}
objectType = arvadosTypeName(xhr.response['owner_uuid'].split('-')[1]);
const objectType = arvadosTypeName(item.owner_uuid);
const filters = [
['uuid', '=', item.owner_uuid]
];
return makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/' + objectType + 's' +
'/' + xhr.response['owner_uuid']).then(cb);
'?filters=' + encodeURIComponent(JSON.stringify(filters))).then(cb);
};
let objectType = arvadosTypeName(uuid.split('-')[1]);
const objectType = arvadosTypeName(uuid);
const filters = [
['uuid', '=', uuid]
];
let prom = makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/' + objectType + 's' +
'/' + uuid);
'?filters=' + encodeURIComponent(JSON.stringify(filters)));
prom = prom.then(cb);
return prom;


+ 3
- 4
frontend/src/js/page/wb-browse.js Ver arquivo

@@ -3,7 +3,7 @@ import { route } from 'preact-router';
import WBNavbarCommon from 'wb-navbar-common';
import WBProjectListing from 'wb-project-listing';
import WBInlineSearch from 'wb-inline-search';
import WBProjectCrumbs from 'wb-project-crumbs';
import WBArvadosCrumbs from 'wb-arvados-crumbs';
import WBTabs from 'wb-tabs';
import WBProcessListing from 'wb-process-listing';
import WBCollectionListing from 'wb-collection-listing';
@@ -34,8 +34,7 @@ class WBBrowse extends Component {
<WBNavbarCommon app={ app } activeItem={ !ownerUuid ? 'all-projects' :
(ownerUuid === app.state.currentUser.uuid ? 'home' : null) } />
<WBProjectCrumbs uuid={ ownerUuid } appState={ appState }
onItemClicked={ item => route('/browse/' + item['uuid']) } />
<WBArvadosCrumbs uuid={ ownerUuid } app={ app } />
<WBTabs tabs={ [ { 'name': 'Projects', 'isActive': true } ] } />
@@ -73,7 +72,7 @@ class WBBrowse extends Component {
itemsPerPage="20"
page={ Number(workflowPage || 0) }
getPageUrl={ i => this.getUrl({ 'workflowPage': i }) } />
) : null))
}
</div>


Carregando…
Cancelar
Salvar