Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ed87aea
Merge pull request #859 from PathwayCommons/v0.11.0
jvwong Oct 5, 2020
4b70bad
Take into account `lastEditedDate` in the document image cache
maxkfranz Oct 8, 2020
e370d33
Remove logs
maxkfranz Oct 8, 2020
605163b
More aggressive Indra retries
maxkfranz Oct 8, 2020
2cdb267
Merge pull request #864 from PathwayCommons/clear-img-cache-851
maxkfranz Oct 8, 2020
4def92b
More salient organism in entity grounding popover
maxkfranz Oct 8, 2020
47c3f16
Merge pull request #866 from PathwayCommons/organism-validation
jvwong Oct 8, 2020
636a1b6
- Warn if organisms are different
jvwong Oct 8, 2020
c5dc3e0
Make the message for organisms more generic
jvwong Oct 8, 2020
9d7bfe4
Irregular organism message and list text
jvwong Oct 9, 2020
ff88cfa
- Add warning for no entity in submit
jvwong Oct 9, 2020
6f18854
Allow for excluding entities in doc organism counts
maxkfranz Oct 9, 2020
b0431a2
Allow for entity comparison via `ele.same(otherEle)`
maxkfranz Oct 9, 2020
79c9ca3
Exclude popover entity from being included in organism count
maxkfranz Oct 9, 2020
4eee4b6
Use grounding IDs instead of indices for dropdowns
maxkfranz Oct 9, 2020
6588858
Merge pull request #865 from PathwayCommons/indra-more-retries-851
maxkfranz Oct 9, 2020
0102a3f
Swap out 'Submit' with 'Show me how' button
jvwong Oct 9, 2020
9c2039e
Merge pull request #868 from PathwayCommons/iss860_empty-submit_iss86…
jvwong Oct 9, 2020
7ae22ec
Merge pull request #869 from PathwayCommons/org-dropdown-misc
maxkfranz Oct 9, 2020
e95cc42
Remove disabling of email buttons
jvwong Oct 9, 2020
1324693
Add spinner on load
jvwong Oct 9, 2020
b5b7d8c
Remove the extremely large width of the page.
jvwong Oct 9, 2020
8de2c0a
Merge pull request #870 from PathwayCommons/iss852_eliminate-disable-…
jvwong Oct 9, 2020
74ceb10
Use smooth scroll polyfill for the carousel on Safari
maxkfranz Oct 13, 2020
0388c7e
Allow long interaction strings to be readable in the carousel
maxkfranz Oct 13, 2020
52568e9
0.12.0
jvwong Oct 13, 2020
6751b85
Merge pull request #871 from PathwayCommons/carousel-misc-tweaks
maxkfranz Oct 13, 2020
c7c45b5
Merge branch 'unstable' into v0.12.0
jvwong Oct 13, 2020
4d85fed
0.12.1
jvwong Oct 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"react-router-dom": "^4.0.0",
"rethinkdb": "^2.3.2",
"serve-favicon": "^2.3.0",
"smoothscroll-polyfill": "^0.4.4",
"soap": "^0.25.0",
"socket.io": "^2.1.1",
"socket.io-client": "^2.1.1",
Expand Down Expand Up @@ -128,5 +129,5 @@
"engines": {
"node": ">=10.0.0"
},
"version": "0.11.0"
"version": "0.12.1"
}
6 changes: 2 additions & 4 deletions src/client/components/document-management-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,14 @@ class DocumentManagementDocumentComponent extends React.Component {
workingMessage: 'Sending...',
buttonKey: EMAIL_TYPE_INVITE,
value: EMAIL_TYPE_INVITE,
label: _.capitalize( EMAIL_TYPE_INVITE ),
disableWhen: doc.initiated() || doc.trashed()
label: _.capitalize( EMAIL_TYPE_INVITE )
}),
h( DocumentEmailButtonComponent, {
params: { doc, apiKey },
workingMessage: 'Sending...',
buttonKey: EMAIL_TYPE_FOLLOWUP,
value: EMAIL_TYPE_FOLLOWUP,
label: _.upperFirst( EMAIL_TYPE_FOLLOWUP.replace(/([A-Z])/g, (match, letter) => '-' + letter) ),
disableWhen: doc.initiated() || doc.trashed()
label: _.upperFirst( EMAIL_TYPE_FOLLOWUP.replace(/([A-Z])/g, (match, letter) => '-' + letter) )
})
]);
}
Expand Down
33 changes: 23 additions & 10 deletions src/client/components/document-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DocumentManagementDocumentComponent } from './document-management-compo
import logger from '../logger';
import DirtyComponent from './dirty-component';
import Document from '../../model/document';
import { tryPromise } from '../../util';
import { makeClassList, tryPromise } from '../../util';
import Popover from './popover/popover';
import { checkHTTPStatus } from '../../util';
import { RequestForm } from './home';
Expand Down Expand Up @@ -63,7 +63,8 @@ class DocumentManagement extends DirtyComponent {
status,
pageCount: 0,
limit: 10,
offset: 0
offset: 0,
isLoading: false
};

this.bus = new EventEmitter();
Expand Down Expand Up @@ -100,6 +101,8 @@ class DocumentManagement extends DirtyComponent {
const url = '/api/document';
const params = this.getUrlParams();

this.setState({ isLoading: true });

return fetch(`${url}?${params}`)
.then( res => {
const total = res.headers.get('X-Document-Count');
Expand All @@ -112,7 +115,10 @@ class DocumentManagement extends DirtyComponent {
return docs;
})
.then( docs => new Promise( resolve => this.setState( { docs }, resolve ) ) )
.then( () => this.updateUrlParams() );
.then( () => this.updateUrlParams() )
.finally( () => {
new Promise( resolve => this.setState( { isLoading: false }, resolve ) );
});
}

handleApiKeyFormChange( apiKey ) {
Expand Down Expand Up @@ -151,7 +157,7 @@ class DocumentManagement extends DirtyComponent {
}

render(){
let { docs, apiKey, status, validApiKey } = this.state;
let { docs, apiKey, status, validApiKey, isLoading } = this.state;
const header = h('div.page-content-title', [
h('h1', 'Document management panel')
]);
Expand Down Expand Up @@ -228,15 +234,22 @@ class DocumentManagement extends DirtyComponent {
})
);

const documentContainer = h( 'div.document-management-document-container', [
documentMenu,
documentList
]);

const documentContainer = h( 'div.document-management-document-container',
[
h('i.icon.icon-spinner.document-management-spinner', {
className: makeClassList({ 'document-management-hidden': !isLoading })
}),
h('div', {
className: makeClassList({ 'document-management-hidden': isLoading })
}, [documentMenu, documentList])
]
);

let body = validApiKey ? documentContainer: apiKeyForm;

const footer = h('div.document-management-footer', [
const footer = h('div.document-management-footer', {
className: makeClassList({ 'document-management-hidden': isLoading })
}, [
h( 'div.document-management-paginator', [
h( ReactPaginate, {
pageCount: this.state.pageCount,
Expand Down
12 changes: 11 additions & 1 deletion src/client/components/editor/submit.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
import EventEmitter from 'eventemitter3';

import { TaskView } from '../tasks';
import Popover from '../popover/popover';
import { makeClassList } from '../../../util';
import h from 'react-hyperscript';

export const Submit = props => {

const emitter = new EventEmitter();
const { document, bus, controller } = props;

if( !document.editable() ){
return null;
}

// emitter.on('close', () => { console.log( 'close triggered'); });

return h('div.editor-submit', [
h(Popover, { tippy: { html: h(TaskView, { document, bus, controller } ) } }, [
h(Popover, {
tippy: {
html: h(TaskView, { document, bus, controller, emitter } )
}
}, [
h('button.editor-submit-button', {
disabled: document.trashed(),
className: makeClassList({
Expand Down
39 changes: 18 additions & 21 deletions src/client/components/element-info/entity-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import assocDisp from './entity-assoc-display';
import CancelablePromise from 'p-cancelable';
import { isComplex, isGGP, ELEMENT_TYPE } from '../../../model/element/element-type';
import RelatedPapers from '../related-papers';
import Organism from '../../../model/organism';

import {
focusDomElement, makeClassList, initCache, SingleValueCache,
Expand Down Expand Up @@ -191,7 +192,7 @@ class EntityInfo extends DataComponent {
name: name,
limit: s.limit,
offset: offset,
organismCounts: doc.organismCountsJson()
organismCounts: doc.organismCountsJson(el) // exclude el from org count (avoids mid typing biases)
};

if( s.updatePromise ){
Expand Down Expand Up @@ -383,11 +384,10 @@ class EntityInfo extends DataComponent {
nameChildren.push( matchName() );
}

if( complete && m.name.toLowerCase() !== s.name.toLowerCase() ){
if( m.organism != null ){
nameChildren.push(
h('br'),
h('span', '('),
matchName(),
h('span', ' ('),
Organism.fromId(m.organism).name(),
h('span', ')')
);
}
Expand Down Expand Up @@ -467,7 +467,6 @@ class EntityInfo extends DataComponent {

orgMatches = _.sortBy(orgMatches, m => m.organismName);

const selectedIndex = _.findIndex(orgMatches, match => match.id === m.id && match.namespace === m.namespace);
const selectedOrg = assoc ? assoc.organism : null;

const getSelectDisplay = (om, includeName = false) => {
Expand All @@ -490,20 +489,20 @@ class EntityInfo extends DataComponent {
organism = h('div.entity-info-section.entity-info-organism-refinement', [
h('span.entity-info-title', 'Organism'),
h('select.entity-info-organism-dropdown', {
defaultValue: selectedIndex,
value: `${m.namespace}:${m.id}`,
onChange: e => {
const val = e.target.value;
const index = parseInt(val);
const om = orgMatches[index];
const [ns, id] = val.split(':');
const om = s.matches.find(match => match.namespace === ns && match.id === id);

if( om ){
this.associate(om);
} else {
this.enableManualMatchMode();
}
}
}, orgMatches.map((om, index) => {
const value = index;
}, orgMatches.map((om) => {
const value = `${om.namespace}:${om.id}`;
const orgMatches = orgToMatches.get(om.organism);
const multOrgMatches = orgMatches.length > 1;
const isFirstOrgMatch = orgMatches[0].id === om.id && orgMatches[0].namespace === om.namespace;
Expand All @@ -514,7 +513,7 @@ class EntityInfo extends DataComponent {

return h('option', { value }, getSelectDisplay(om));
}).concat([
selectedIndex < 0 ? h('option', { value: -1 }, getSelectDisplay(m, true)) : null,
// selectedIndex < 0 ? h('option', { value: -1 }, getSelectDisplay(m, true)) : null,
h('option', { value: -2 }, 'Other')
]))
]);
Expand All @@ -524,30 +523,28 @@ class EntityInfo extends DataComponent {
const needDisam = ambigGrs && ambigGrs.length > 1;

if( needDisam ){
const selectedAmIndex = _.findIndex(ambigGrs, match => match.id === m.id && match.namespace === m.namespace);

disambiguation = h('div.entity-info-section.entity-info-organism-refinement', [
h('span.entity-info-title', 'Which' + (s.name ? ` ${s.name}` : '') + ''),
h('select.entity-info-organism-dropdown', {
defaultValue: selectedAmIndex,
value: `${m.namespace}:${m.id}`,
onChange: e => {
const val = e.target.value;
const index = parseInt(val);
const om = ambigGrs[index];
const [ns, id] = val.split(':');
const om = s.matches.find(om => om.namespace === ns && om.id === id);

if( om ){
this.associate(om);
} else {
this.enableManualMatchMode();
}
}
}, ambigGrs.map((om, index) => {
const value = index;
}, ambigGrs.map((om) => {
const value = `${om.namespace}:${om.id}`;

return h('option', { value }, getDisamtDisplay(om));
}).concat([
selectedIndex < 0 ? h('option', { value: -1 }, getSelectDisplay(m, true)) : null,
h('option', { value: -2 }, 'Other')
// selectedIndex < 0 ? h('option', { value: -1 }, getSelectDisplay(m, true)) : null,
h('option', { value: 'other:other' }, 'Other')
]))
]);
}
Expand Down
Loading