Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
52 changes: 0 additions & 52 deletions src/client/client-util/file.js

This file was deleted.

1 change: 0 additions & 1 deletion src/client/client-util/index.js

This file was deleted.

3 changes: 2 additions & 1 deletion src/client/components/carousel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { tryPromise, makeClassList } from '../../util';
import { tryPromise } from '../../util';
import h from 'react-hyperscript';
import { Component } from 'react';
import _ from 'lodash';
import { formatDistanceToNow } from 'date-fns';
import queryString from 'query-string';
import { makeClassList } from '../dom';

import Document from '../../model/document';

Expand Down
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 @@ -6,10 +6,8 @@ import { format, formatDistanceToNow, isThisMonth } from 'date-fns';
import queryString from 'query-string';

import Document from '../../model/document';
import {
tryPromise,
makeClassList
} from '../../util';
import { tryPromise } from '../../util';
import { makeClassList } from '../dom';
import logger from '../logger';
import DirtyComponent from './dirty-component';
import {
Expand Down
3 changes: 2 additions & 1 deletion src/client/components/document-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { DocumentManagementDocumentComponent } from './document-management-compo
import logger from '../logger';
import DirtyComponent from './dirty-component';
import Document from '../../model/document';
import { makeClassList, tryPromise } from '../../util';
import { tryPromise } from '../../util';
import { makeClassList } from '../dom';
import Popover from './popover/popover';
import { checkHTTPStatus } from '../../util';
import { RequestForm } from './home';
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/editor/help.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import h from 'react-hyperscript';
import { makeClassList } from '../../../util';
import { makeClassList } from '../../dom';

export const Help = props => {
const { showHelp, controller, document } = props;
Expand Down
3 changes: 2 additions & 1 deletion src/client/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import Mousetrap from 'mousetrap';

import { DEMO_ID, DEMO_SECRET, DEMO_AUTHOR_EMAIL } from '../../../config';

import { getId, defer, makeClassList, tryPromise } from '../../../util';
import { makeClassList } from '../../dom';
import { getId, defer, tryPromise } from '../../../util';
import Document from '../../../model/document';
import { PARTICIPANT_TYPE } from '../../../model/element/participant-type';

Expand Down
2 changes: 1 addition & 1 deletion src/client/components/editor/info-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import h from 'react-hyperscript';
import { Component } from 'react';
import { DOI_LINK_BASE_URL, PUBMED_LINK_BASE_URL, GOOGLE_SCHOLAR_BASE_URL } from '../../../config';
// import { Carousel, CAROUSEL_CONTENT } from '../carousel';
import { makeClassList } from '../../../util';
import { makeClassList } from '../../dom';
import ElementInfo from '../element-info/element-info';
import RelatedPapers from '../related-papers';

Expand Down
2 changes: 1 addition & 1 deletion src/client/components/editor/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import EventEmitter from 'eventemitter3';

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

export const Submit = props => {
Expand Down
4 changes: 3 additions & 1 deletion src/client/components/element-info/entity-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import { isComplex, isGGP, ELEMENT_TYPE } from '../../../model/element/element-t
import RelatedPapers from '../related-papers';
import Organism from '../../../model/organism';

import { makeClassList, focusDomElement } from '../../dom';

import {
focusDomElement, makeClassList, initCache, SingleValueCache,
initCache, SingleValueCache,
makeCancelable, stringDistanceMetric
} from '../../../util';

Expand Down
2 changes: 1 addition & 1 deletion src/client/components/element-info/progression-stepper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Tooltip from '../popover/tooltip';
import h from 'react-hyperscript';
import { makeClassList } from '../../../util';
import { makeClassList } from '../../dom';

export default ({ progression }) => {
let { STAGES } = progression;
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _ from 'lodash';
import h from 'react-hyperscript';
import { Component } from 'react';
import Popover from './popover/popover';
import { makeClassList } from '../../util';
import { makeClassList } from '../dom';
import EventEmitter from 'eventemitter3';
import { truncateString } from '../../util';
import { Carousel, CAROUSEL_CONTENT } from './carousel';
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/notification/base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DirtyComponent from '../dirty-component';
import h from 'react-hyperscript';
import { makeClassList } from '../../../util';
import { makeClassList } from '../../dom';

/**
* A base component for notifications. A concrete component should contain a NotifcationBase.
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/notification/corner.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DirtyComponent from '../dirty-component';
import h from 'react-hyperscript';
import NotificationBase from './base';
import { makeClassList } from '../../../util';
import { makeClassList } from '../../dom';

class CornerNotification extends DirtyComponent {
constructor(props){
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/notification/inline.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DirtyComponent from '../dirty-component';
import h from 'react-hyperscript';
import NotificationBase from './base';
import { makeClassList } from '../../../util';
import { makeClassList } from '../../dom';

class InlineNotification extends DirtyComponent {
constructor(props){
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/notification/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DataComponent from '../data-component';
import h from 'react-hyperscript';

import InlineNotification from './inline';
import { makeClassList } from '../../../util';
import { makeClassList } from '../../dom';

// WIP
class NotificationPanel extends DataComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react';
import Document from '../../model/document';
import { ENTITY_TYPE } from '../../model/element/entity-type';
import { BASE_URL } from '../../config';
import { makeClassList } from '../../util';
import { makeClassList } from '../dom';
import { NativeShare, isNativeShareSupported } from './native-share';

const eleEvts = [ 'rename', 'complete', 'uncomplete', 'associate' ];
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/twitter-share.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ReactDOM from 'react-dom';
import _ from 'lodash';
import TextareaAutosize from 'react-autosize-textarea';

import { focusDomElement, makeClassList } from '../../util';
import { focusDomElement, makeClassList } from '../dom';
import { TWITTER_ACCOUNT_NAME, MAX_TWEET_LENGTH, DEMO_CAN_BE_SHARED, DEMO_ID, DEMO_CAN_BE_SHARED_MULTIPLE_TIMES } from '../../config';

class TwitterShare extends DataComponent {
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Router from './router';
import ReactDom from 'react-dom';
import h from 'react-hyperscript';
import hh from 'hyperscript';
import { $, regCyExts } from '../util';
import { regCyExts } from '../util';
import { $ } from './dom';
import smoothscroll from 'smoothscroll-polyfill';

smoothscroll.polyfill(); // enable smooth scroll on safari
Expand Down
4 changes: 2 additions & 2 deletions src/util/document.js → src/server/document-util.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetch from 'node-fetch';

import { tryPromise } from './promise';
import { checkHTTPStatus } from './fetch';
import { tryPromise } from '../util/promise';
import { checkHTTPStatus } from '../util/fetch';

function convertDocumentToBiopax(docId, baseUrl = '') {
let SERVER_URL = baseUrl + `/api/document/biopax/${docId}`;
Expand Down
4 changes: 2 additions & 2 deletions src/util/email.js → src/server/email.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** N.b. this can only be run on the server */

import _ from 'lodash';
import { tryPromise } from './promise';
import logger from '../server/logger';
import { tryPromise } from '../util/promise';
import logger from './logger';

import {
BASE_URL,
Expand Down
5 changes: 3 additions & 2 deletions src/server/routes/api/document/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import Document from '../../../../model/document';

import { convertDocumentToBiopax,
convertDocumentToJson,
convertDocumentToSbgn,
checkHTTPStatus } from '../../../../util';
convertDocumentToSbgn } from '../../../document-util';

import { checkHTTPStatus } from '../../../../util';

const DOCUMENT_STATUS_FIELDS = Document.statusFields();
const CHUNK_SIZE = 20;
Expand Down
3 changes: 2 additions & 1 deletion src/server/routes/api/document/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import emailRegex from 'email-regex';
import fs from 'fs';

import { exportToZip, EXPORT_TYPES } from './export';
import { tryPromise, makeStaticStylesheet, makeCyEles, msgFactory, updateCorrespondence, EmailError, truncateString } from '../../../../util';
import { tryPromise, makeStaticStylesheet, makeCyEles, truncateString } from '../../../../util';
import { msgFactory, updateCorrespondence, EmailError } from '../../../email';
import sendMail from '../../../email-transport';
import Document from '../../../../model/document';
import db from '../../../db';
Expand Down
3 changes: 0 additions & 3 deletions src/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ export * from './obj';
export * from './promise';
export * from './is';
export * from './assert';
export * from './dom';
export * from './cy';
export * from './memoize';
export * from './strings';
export * from './cache';
export * from './email';
export * from './fetch';
export * from './document';