Commit ebf18e52 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Extract helpers from util

Extract modules from the `util` directory that are specific to
the application domain or have application dependencies
parent 02c32fab
...@@ -6,8 +6,8 @@ import { useStoreProxy } from '../store/use-store'; ...@@ -6,8 +6,8 @@ import { useStoreProxy } from '../store/use-store';
import { import {
sharingEnabled, sharingEnabled,
annotationSharingLink, annotationSharingLink,
} from '../util/annotation-sharing'; } from '../helpers/annotation-sharing';
import { isPrivate, permits } from '../util/permissions'; import { isPrivate, permits } from '../helpers/permissions';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import AnnotationShareControl from './annotation-share-control'; import AnnotationShareControl from './annotation-share-control';
......
...@@ -3,9 +3,9 @@ import { useState } from 'preact/hooks'; ...@@ -3,9 +3,9 @@ import { useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { isHidden } from '../util/annotation-metadata'; import { isHidden } from '../helpers/annotation-metadata';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
import Button from './button'; import Button from './button';
import Excerpt from './excerpt'; import Excerpt from './excerpt';
......
import { createElement } from 'preact'; import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import * as annotationMetadata from '../util/annotation-metadata'; import * as annotationMetadata from '../helpers/annotation-metadata';
/** @typedef {import("../../types/api").Annotation} Annotation */ /** @typedef {import("../../types/api").Annotation} Annotation */
......
...@@ -4,7 +4,7 @@ import propTypes from 'prop-types'; ...@@ -4,7 +4,7 @@ import propTypes from 'prop-types';
import { normalizeKeyName } from '../../shared/browser-compatibility-utils'; import { normalizeKeyName } from '../../shared/browser-compatibility-utils';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import AnnotationLicense from './annotation-license'; import AnnotationLicense from './annotation-license';
......
...@@ -7,8 +7,8 @@ import { ...@@ -7,8 +7,8 @@ import {
isHighlight, isHighlight,
isReply, isReply,
hasBeenEdited, hasBeenEdited,
} from '../util/annotation-metadata'; } from '../helpers/annotation-metadata';
import { isPrivate } from '../util/permissions'; import { isPrivate } from '../helpers/permissions';
import AnnotationDocumentInfo from './annotation-document-info'; import AnnotationDocumentInfo from './annotation-document-info';
import AnnotationShareInfo from './annotation-share-info'; import AnnotationShareInfo from './annotation-share-info';
......
...@@ -2,10 +2,10 @@ import { createElement } from 'preact'; ...@@ -2,10 +2,10 @@ import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { isNew, isReply } from '../util/annotation-metadata'; import { isNew, isReply } from '../helpers/annotation-metadata';
import { isShared } from '../util/permissions'; import { isShared } from '../helpers/permissions';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
import Button from './button'; import Button from './button';
import Menu from './menu'; import Menu from './menu';
......
...@@ -2,9 +2,9 @@ import classnames from 'classnames'; ...@@ -2,9 +2,9 @@ import classnames from 'classnames';
import { createElement } from 'preact'; import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { isOrphan, quote } from '../util/annotation-metadata'; import { isOrphan, quote } from '../helpers/annotation-metadata';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
import Excerpt from './excerpt'; import Excerpt from './excerpt';
......
...@@ -2,9 +2,9 @@ import { createElement } from 'preact'; ...@@ -2,9 +2,9 @@ import { createElement } from 'preact';
import { useEffect, useRef, useState } from 'preact/hooks'; import { useEffect, useRef, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { isShareableURI } from '../util/annotation-sharing'; import { isShareableURI } from '../helpers/annotation-sharing';
import { copyText } from '../util/copy-to-clipboard'; import { copyText } from '../util/copy-to-clipboard';
import { isPrivate } from '../util/permissions'; import { isPrivate } from '../helpers/permissions';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import Button from './button'; import Button from './button';
......
...@@ -2,7 +2,7 @@ import { createElement } from 'preact'; ...@@ -2,7 +2,7 @@ import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { isPrivate } from '../util/permissions'; import { isPrivate } from '../helpers/permissions';
import SvgIcon from '../../shared/components/svg-icon'; import SvgIcon from '../../shared/components/svg-icon';
......
import { createElement } from 'preact'; import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { isThirdPartyUser, username } from '../util/account-id'; import { isThirdPartyUser, username } from '../helpers/account-id';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
/** /**
......
...@@ -3,7 +3,7 @@ import { createElement } from 'preact'; ...@@ -3,7 +3,7 @@ import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { isReply, quote } from '../util/annotation-metadata'; import { isReply, quote } from '../helpers/annotation-metadata';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import AnnotationActionBar from './annotation-action-bar'; import AnnotationActionBar from './annotation-action-bar';
......
...@@ -5,7 +5,7 @@ import propTypes from 'prop-types'; ...@@ -5,7 +5,7 @@ import propTypes from 'prop-types';
import observeElementSize from '../util/observe-element-size'; import observeElementSize from '../util/observe-element-size';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
/** /**
* @typedef InlineControlsProps * @typedef InlineControlsProps
......
...@@ -2,7 +2,7 @@ import { createElement } from 'preact'; ...@@ -2,7 +2,7 @@ import { createElement } from 'preact';
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { countVisible } from '../util/thread'; import { countVisible } from '../helpers/thread';
import Button from './button'; import Button from './button';
...@@ -10,7 +10,7 @@ import useRootThread from './hooks/use-root-thread'; ...@@ -10,7 +10,7 @@ import useRootThread from './hooks/use-root-thread';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
/** /**
* @typedef {import('../util/build-thread').Thread} Thread * @typedef {import('../helpers/build-thread').Thread} Thread
*/ */
/** /**
......
...@@ -3,7 +3,7 @@ import propTypes from 'prop-types'; ...@@ -3,7 +3,7 @@ import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { copyText } from '../util/copy-to-clipboard'; import { copyText } from '../util/copy-to-clipboard';
import { orgName } from '../util/group-list-item-common'; import { orgName } from '../helpers/group-list-item-common';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import MenuItem from './menu-item'; import MenuItem from './menu-item';
......
...@@ -4,10 +4,10 @@ import propTypes from 'prop-types'; ...@@ -4,10 +4,10 @@ import propTypes from 'prop-types';
import serviceConfig from '../service-config'; import serviceConfig from '../service-config';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { isThirdPartyUser } from '../util/account-id'; import { isThirdPartyUser } from '../helpers/account-id';
import { orgName } from '../util/group-list-item-common'; import { orgName } from '../helpers/group-list-item-common';
import groupsByOrganization from '../util/group-organizations'; import groupsByOrganization from '../helpers/group-organizations';
import isThirdPartyService from '../util/is-third-party-service'; import isThirdPartyService from '../helpers/is-third-party-service';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import GroupListSection from './group-list-section'; import GroupListSection from './group-list-section';
......
...@@ -5,7 +5,7 @@ import propTypes from 'prop-types'; ...@@ -5,7 +5,7 @@ import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import uiConstants from '../ui-constants'; import uiConstants from '../ui-constants';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import VersionData from '../util/version-data'; import VersionData from '../helpers/version-data';
import SidebarPanel from './sidebar-panel'; import SidebarPanel from './sidebar-panel';
import SvgIcon from '../../shared/components/svg-icon'; import SvgIcon from '../../shared/components/svg-icon';
......
...@@ -21,7 +21,7 @@ describe('sidebar/components/hooks/use-root-thread', () => { ...@@ -21,7 +21,7 @@ describe('sidebar/components/hooks/use-root-thread', () => {
$imports.$mock({ $imports.$mock({
'../../store/use-store': { useStoreProxy: () => fakeStore }, '../../store/use-store': { useStoreProxy: () => fakeStore },
'../../util/thread-annotations': fakeThreadAnnotations, '../../helpers/thread-annotations': fakeThreadAnnotations,
}); });
// Mount a dummy component to be able to use the `useRootThread` hook // Mount a dummy component to be able to use the `useRootThread` hook
......
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import { useStoreProxy } from '../../store/use-store'; import { useStoreProxy } from '../../store/use-store';
import { username } from '../../util/account-id'; import { username } from '../../helpers/account-id';
/** @typedef {import('../../store/modules/filters').FilterOption} FilterOption */ /** @typedef {import('../../store/modules/filters').FilterOption} FilterOption */
......
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import { useStoreProxy } from '../../store/use-store'; import { useStoreProxy } from '../../store/use-store';
import threadAnnotations from '../../util/thread-annotations'; import threadAnnotations from '../../helpers/thread-annotations';
/** @typedef {import('../../util/build-thread').Thread} Thread */ /** @typedef {import('../../helpers/build-thread').Thread} Thread */
/** /**
* Gather together state relevant to building a root thread of annotations and * Gather together state relevant to building a root thread of annotations and
......
...@@ -7,9 +7,9 @@ import bridgeEvents from '../../shared/bridge-events'; ...@@ -7,9 +7,9 @@ import bridgeEvents from '../../shared/bridge-events';
import serviceConfig from '../service-config'; import serviceConfig from '../service-config';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import uiConstants from '../ui-constants'; import uiConstants from '../ui-constants';
import { parseAccountID } from '../util/account-id'; import { parseAccountID } from '../helpers/account-id';
import { shouldAutoDisplayTutorial } from '../util/session'; import { shouldAutoDisplayTutorial } from '../helpers/session';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import AnnotationView from './annotation-view'; import AnnotationView from './annotation-view';
......
...@@ -3,7 +3,7 @@ import { createElement } from 'preact'; ...@@ -3,7 +3,7 @@ import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import * as annotationMetadata from '../util/annotation-metadata'; import * as annotationMetadata from '../helpers/annotation-metadata';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
/** /**
......
...@@ -4,7 +4,7 @@ import propTypes from 'prop-types'; ...@@ -4,7 +4,7 @@ import propTypes from 'prop-types';
import uiConstants from '../ui-constants'; import uiConstants from '../ui-constants';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
import Button from './button'; import Button from './button';
......
...@@ -2,7 +2,7 @@ import { createElement } from 'preact'; ...@@ -2,7 +2,7 @@ import { createElement } from 'preact';
import useRootThread from './hooks/use-root-thread'; import useRootThread from './hooks/use-root-thread';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { countVisible } from '../util/thread'; import { countVisible } from '../helpers/thread';
import Spinner from './spinner'; import Spinner from './spinner';
......
...@@ -3,7 +3,7 @@ import propTypes from 'prop-types'; ...@@ -3,7 +3,7 @@ import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import uiConstants from '../ui-constants'; import uiConstants from '../ui-constants';
import { pageSharingLink } from '../util/annotation-sharing'; import { pageSharingLink } from '../helpers/annotation-sharing';
import { copyText } from '../util/copy-to-clipboard'; import { copyText } from '../util/copy-to-clipboard';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { notNull } from '../util/typing'; import { notNull } from '../util/typing';
......
...@@ -5,7 +5,7 @@ import { useEffect, useRef } from 'preact/hooks'; ...@@ -5,7 +5,7 @@ import { useEffect, useRef } from 'preact/hooks';
import useRootThread from './hooks/use-root-thread'; import useRootThread from './hooks/use-root-thread';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { tabForAnnotation } from '../util/tabs'; import { tabForAnnotation } from '../helpers/tabs';
import FilterStatus from './filter-status'; import FilterStatus from './filter-status';
import LoggedOutMessage from './logged-out-message'; import LoggedOutMessage from './logged-out-message';
......
...@@ -2,7 +2,7 @@ import { createElement } from 'preact'; ...@@ -2,7 +2,7 @@ import { createElement } from 'preact';
import { useMemo } from 'preact/hooks'; import { useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { isThirdPartyUser } from '../util/account-id'; import { isThirdPartyUser } from '../helpers/account-id';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
/** @typedef {import('../../types/api').Annotation} Annotation */ /** @typedef {import('../../types/api').Annotation} Annotation */
......
...@@ -90,11 +90,11 @@ describe('AnnotationActionBar', () => { ...@@ -90,11 +90,11 @@ describe('AnnotationActionBar', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/annotation-sharing': { '../helpers/annotation-sharing': {
sharingEnabled: fakeSharingEnabled, sharingEnabled: fakeSharingEnabled,
annotationSharingLink: fakeAnnotationSharingLink, annotationSharingLink: fakeAnnotationSharingLink,
}, },
'../util/permissions': { permits: fakePermits }, '../helpers/permissions': { permits: fakePermits },
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
}); });
sinon.stub(window, 'confirm').returns(false); sinon.stub(window, 'confirm').returns(false);
......
...@@ -54,7 +54,7 @@ describe('AnnotationBody', () => { ...@@ -54,7 +54,7 @@ describe('AnnotationBody', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/theme': { applyTheme: fakeApplyTheme }, '../helpers/theme': { applyTheme: fakeApplyTheme },
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
}); });
}); });
......
...@@ -27,7 +27,7 @@ describe('AnnotationDocumentInfo', () => { ...@@ -27,7 +27,7 @@ describe('AnnotationDocumentInfo', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/annotation-metadata': fakeMetadata, '../helpers/annotation-metadata': fakeMetadata,
}); });
}); });
......
...@@ -55,7 +55,7 @@ describe('AnnotationEditor', () => { ...@@ -55,7 +55,7 @@ describe('AnnotationEditor', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/theme': { applyTheme: fakeApplyTheme }, '../helpers/theme': { applyTheme: fakeApplyTheme },
}); });
}); });
......
...@@ -41,12 +41,12 @@ describe('AnnotationHeader', () => { ...@@ -41,12 +41,12 @@ describe('AnnotationHeader', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/annotation-metadata': { '../helpers/annotation-metadata': {
isHighlight: fakeIsHighlight, isHighlight: fakeIsHighlight,
isReply: fakeIsReply, isReply: fakeIsReply,
hasBeenEdited: fakeHasBeenEdited, hasBeenEdited: fakeHasBeenEdited,
}, },
'../util/permissions': { '../helpers/permissions': {
isPrivate: fakeIsPrivate, isPrivate: fakeIsPrivate,
}, },
}); });
......
...@@ -59,8 +59,8 @@ describe('AnnotationPublishControl', () => { ...@@ -59,8 +59,8 @@ describe('AnnotationPublishControl', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/annotation-metadata': fakeMetadata, '../helpers/annotation-metadata': fakeMetadata,
'../util/theme': { '../helpers/theme': {
applyTheme: fakeApplyTheme, applyTheme: fakeApplyTheme,
}, },
}); });
......
...@@ -33,7 +33,7 @@ describe('AnnotationQuote', () => { ...@@ -33,7 +33,7 @@ describe('AnnotationQuote', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/annotation-metadata': { '../helpers/annotation-metadata': {
quote: fakeQuote, quote: fakeQuote,
isOrphan: fakeIsOrphan, isOrphan: fakeIsOrphan,
}, },
......
...@@ -89,9 +89,9 @@ describe('AnnotationShareControl', () => { ...@@ -89,9 +89,9 @@ describe('AnnotationShareControl', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/annotation-sharing': { isShareableURI: fakeIsShareableURI }, '../helpers/annotation-sharing': { isShareableURI: fakeIsShareableURI },
'../util/copy-to-clipboard': fakeCopyToClipboard, '../util/copy-to-clipboard': fakeCopyToClipboard,
'../util/permissions': { isPrivate: fakeIsPrivate }, '../helpers/permissions': { isPrivate: fakeIsPrivate },
'./hooks/use-element-should-close': sinon.stub(), './hooks/use-element-should-close': sinon.stub(),
'../../shared/user-agent': { isIOS: fakeIsIOS }, '../../shared/user-agent': { isIOS: fakeIsIOS },
}); });
......
...@@ -38,7 +38,7 @@ describe('AnnotationShareInfo', () => { ...@@ -38,7 +38,7 @@ describe('AnnotationShareInfo', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/permissions': { isPrivate: fakeIsPrivate }, '../helpers/permissions': { isPrivate: fakeIsPrivate },
}); });
}); });
......
...@@ -61,7 +61,7 @@ describe('Annotation', () => { ...@@ -61,7 +61,7 @@ describe('Annotation', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/annotation-metadata': fakeMetadata, '../helpers/annotation-metadata': fakeMetadata,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
}); });
}); });
......
...@@ -38,7 +38,7 @@ describe('AnnotationUser', () => { ...@@ -38,7 +38,7 @@ describe('AnnotationUser', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/account-id': { '../helpers/account-id': {
isThirdPartyUser: fakeIsThirdPartyUser, isThirdPartyUser: fakeIsThirdPartyUser,
username: fakeUsername, username: fakeUsername,
}, },
......
...@@ -55,7 +55,7 @@ describe('FilterStatus', () => { ...@@ -55,7 +55,7 @@ describe('FilterStatus', () => {
$imports.$mock({ $imports.$mock({
'./hooks/use-root-thread': fakeUseRootThread, './hooks/use-root-thread': fakeUseRootThread,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/thread': fakeThreadUtil, '../helpers/thread': fakeThreadUtil,
}); });
}); });
......
...@@ -71,7 +71,7 @@ describe('GroupListItem', () => { ...@@ -71,7 +71,7 @@ describe('GroupListItem', () => {
'../util/copy-to-clipboard': { '../util/copy-to-clipboard': {
copyText: fakeCopyText, copyText: fakeCopyText,
}, },
'../util/group-list-item-common': fakeGroupListItemCommon, '../helpers/group-list-item-common': fakeGroupListItemCommon,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
}); });
......
...@@ -119,7 +119,7 @@ describe('GroupList', () => { ...@@ -119,7 +119,7 @@ describe('GroupList', () => {
const fakeGroupOrganizations = groups => const fakeGroupOrganizations = groups =>
groups.sort((a, b) => a.id.localeCompare(b.id)); groups.sort((a, b) => a.id.localeCompare(b.id));
$imports.$mock({ $imports.$mock({
'../util/group-organizations': fakeGroupOrganizations, '../helpers/group-organizations': fakeGroupOrganizations,
}); });
const wrapper = createGroupList(); const wrapper = createGroupList();
...@@ -171,7 +171,7 @@ describe('GroupList', () => { ...@@ -171,7 +171,7 @@ describe('GroupList', () => {
context('when `isThirdPartyService` is true', () => { context('when `isThirdPartyService` is true', () => {
beforeEach(() => { beforeEach(() => {
$imports.$mock({ $imports.$mock({
'../util/is-third-party-service': () => true, '../helpers/is-third-party-service': () => true,
}); });
}); });
......
...@@ -38,7 +38,7 @@ describe('HelpPanel', function () { ...@@ -38,7 +38,7 @@ describe('HelpPanel', function () {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/version-data': fakeVersionData, '../helpers/version-data': fakeVersionData,
}); });
}); });
......
...@@ -82,10 +82,10 @@ describe('HypothesisApp', () => { ...@@ -82,10 +82,10 @@ describe('HypothesisApp', () => {
$imports.$mock({ $imports.$mock({
'../service-config': fakeServiceConfig, '../service-config': fakeServiceConfig,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/session': { '../helpers/session': {
shouldAutoDisplayTutorial: fakeShouldAutoDisplayTutorial, shouldAutoDisplayTutorial: fakeShouldAutoDisplayTutorial,
}, },
'../util/theme': { applyTheme: fakeApplyTheme }, '../helpers/theme': { applyTheme: fakeApplyTheme },
}); });
}); });
......
...@@ -31,7 +31,7 @@ describe('NotebookResultCount', () => { ...@@ -31,7 +31,7 @@ describe('NotebookResultCount', () => {
$imports.$mock({ $imports.$mock({
'./hooks/use-root-thread': fakeUseRootThread, './hooks/use-root-thread': fakeUseRootThread,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/thread': { countVisible: fakeCountVisible }, '../helpers/thread': { countVisible: fakeCountVisible },
}); });
}); });
......
...@@ -58,7 +58,7 @@ describe('ShareAnnotationsPanel', () => { ...@@ -58,7 +58,7 @@ describe('ShareAnnotationsPanel', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/annotation-sharing': { '../helpers/annotation-sharing': {
pageSharingLink: fakePageSharingLink, pageSharingLink: fakePageSharingLink,
}, },
'../util/copy-to-clipboard': fakeCopyToClipboard, '../util/copy-to-clipboard': fakeCopyToClipboard,
......
...@@ -68,7 +68,7 @@ describe('SidebarView', () => { ...@@ -68,7 +68,7 @@ describe('SidebarView', () => {
$imports.$mock({ $imports.$mock({
'./hooks/use-root-thread': fakeUseRootThread, './hooks/use-root-thread': fakeUseRootThread,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/tabs': fakeTabsUtil, '../helpers/tabs': fakeTabsUtil,
}); });
}); });
......
...@@ -32,7 +32,7 @@ describe('TagList', function () { ...@@ -32,7 +32,7 @@ describe('TagList', function () {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/account-id': { '../helpers/account-id': {
isThirdPartyUser: fakeIsThirdPartyUser, isThirdPartyUser: fakeIsThirdPartyUser,
}, },
}); });
......
...@@ -69,9 +69,9 @@ describe('ThreadList', () => { ...@@ -69,9 +69,9 @@ describe('ThreadList', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/annotation-metadata': fakeMetadata, '../helpers/annotation-metadata': fakeMetadata,
'../util/dom': fakeDomUtil, '../util/dom': fakeDomUtil,
'../util/visible-threads': fakeVisibleThreadsUtil, '../helpers/visible-threads': fakeVisibleThreadsUtil,
}); });
}); });
...@@ -231,7 +231,7 @@ describe('ThreadList', () => { ...@@ -231,7 +231,7 @@ describe('ThreadList', () => {
// For these tests, don't mock element height or visible thread calculation. // For these tests, don't mock element height or visible thread calculation.
$imports.$restore({ $imports.$restore({
'../util/dom': true, '../util/dom': true,
'../util/visible-threads': true, '../helpers/visible-threads': true,
}); });
}); });
...@@ -240,7 +240,7 @@ describe('ThreadList', () => { ...@@ -240,7 +240,7 @@ describe('ThreadList', () => {
const renderedThreads = wrapper.find('ThreadCard'); const renderedThreads = wrapper.find('ThreadCard');
// "7" is the current expected value given the thread heights, scroll // "7" is the current expected value given the thread heights, scroll
// container size and constants in `../util/visible-threads`. // container size and constants in `../helpers/visible-threads`.
assert.equal(renderedThreads.length, 7); assert.equal(renderedThreads.length, 7);
}); });
......
...@@ -31,7 +31,7 @@ const addChildThread = parent => { ...@@ -31,7 +31,7 @@ const addChildThread = parent => {
return childThread; return childThread;
}; };
// NB: This logic lifted from `util/build-thread.js` // NB: This logic lifted from `helpers/build-thread.js`
function countRepliesAndDepth(thread, depth) { function countRepliesAndDepth(thread, depth) {
const children = thread.children.map(child => { const children = thread.children.map(child => {
return countRepliesAndDepth(child, depth + 1); return countRepliesAndDepth(child, depth + 1);
...@@ -96,7 +96,7 @@ describe('Thread', () => { ...@@ -96,7 +96,7 @@ describe('Thread', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/thread': fakeThreadUtil, '../helpers/thread': fakeThreadUtil,
}); });
}); });
......
...@@ -41,7 +41,7 @@ describe('TopBar', () => { ...@@ -41,7 +41,7 @@ describe('TopBar', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../util/is-third-party-service': fakeIsThirdPartyService, '../helpers/is-third-party-service': fakeIsThirdPartyService,
'../service-config': fakeServiceConfig, '../service-config': fakeServiceConfig,
}); });
}); });
......
...@@ -19,7 +19,7 @@ describe('Tutorial', function () { ...@@ -19,7 +19,7 @@ describe('Tutorial', function () {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/is-third-party-service': fakeIsThirdPartyService, '../helpers/is-third-party-service': fakeIsThirdPartyService,
}); });
}); });
......
...@@ -57,7 +57,7 @@ describe('UserMenu', () => { ...@@ -57,7 +57,7 @@ describe('UserMenu', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../util/account-id': { '../helpers/account-id': {
isThirdPartyUser: fakeIsThirdPartyUser, isThirdPartyUser: fakeIsThirdPartyUser,
}, },
'../service-config': fakeServiceConfig, '../service-config': fakeServiceConfig,
......
...@@ -4,16 +4,16 @@ import propTypes from 'prop-types'; ...@@ -4,16 +4,16 @@ import propTypes from 'prop-types';
import debounce from 'lodash.debounce'; import debounce from 'lodash.debounce';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { isHighlight } from '../util/annotation-metadata'; import { isHighlight } from '../helpers/annotation-metadata';
import { getElementHeightWithMargins } from '../util/dom'; import { getElementHeightWithMargins } from '../util/dom';
import { import {
calculateVisibleThreads, calculateVisibleThreads,
THREAD_DIMENSION_DEFAULTS, THREAD_DIMENSION_DEFAULTS,
} from '../util/visible-threads'; } from '../helpers/visible-threads';
import ThreadCard from './thread-card'; import ThreadCard from './thread-card';
/** @typedef {import('../util/build-thread').Thread} Thread */ /** @typedef {import('../helpers/build-thread').Thread} Thread */
// The precision of the `scrollPosition` value in pixels; values will be rounded // The precision of the `scrollPosition` value in pixels; values will be rounded
// down to the nearest multiple of this scale value // down to the nearest multiple of this scale value
......
...@@ -5,13 +5,13 @@ import { useMemo } from 'preact/hooks'; ...@@ -5,13 +5,13 @@ import { useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { countHidden, countVisible } from '../util/thread'; import { countHidden, countVisible } from '../helpers/thread';
import Annotation from './annotation'; import Annotation from './annotation';
import Button from './button'; import Button from './button';
import ModerationBanner from './moderation-banner'; import ModerationBanner from './moderation-banner';
/** @typedef {import('../util/build-thread').Thread} Thread */ /** @typedef {import('../helpers/build-thread').Thread} Thread */
/** /**
* @typedef ThreadProps * @typedef ThreadProps
......
...@@ -5,9 +5,9 @@ import bridgeEvents from '../../shared/bridge-events'; ...@@ -5,9 +5,9 @@ import bridgeEvents from '../../shared/bridge-events';
import serviceConfig from '../service-config'; import serviceConfig from '../service-config';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import uiConstants from '../ui-constants'; import uiConstants from '../ui-constants';
import isThirdPartyService from '../util/is-third-party-service'; import isThirdPartyService from '../helpers/is-third-party-service';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import { applyTheme } from '../util/theme'; import { applyTheme } from '../helpers/theme';
import Button from './button'; import Button from './button';
import GroupList from './group-list'; import GroupList from './group-list';
......
import { createElement } from 'preact'; import { createElement } from 'preact';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import isThirdPartyService from '../util/is-third-party-service'; import isThirdPartyService from '../helpers/is-third-party-service';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
import SvgIcon from '../../shared/components/svg-icon'; import SvgIcon from '../../shared/components/svg-icon';
......
...@@ -3,7 +3,7 @@ import propTypes from 'prop-types'; ...@@ -3,7 +3,7 @@ import propTypes from 'prop-types';
import bridgeEvents from '../../shared/bridge-events'; import bridgeEvents from '../../shared/bridge-events';
import serviceConfig from '../service-config'; import serviceConfig from '../service-config';
import { isThirdPartyUser } from '../util/account-id'; import { isThirdPartyUser } from '../helpers/account-id';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { withServices } from '../util/service-context'; import { withServices } from '../util/service-context';
......
...@@ -8,7 +8,7 @@ import Button from './button'; ...@@ -8,7 +8,7 @@ import Button from './button';
/** /**
* @typedef VersionInfoProps * @typedef VersionInfoProps
* @prop {import('../util/version-data').default} versionData - Object with version information * @prop {import('../helpers/version-data').default} versionData - Object with version information
* @prop {Object} toastMessenger - Injected service * @prop {Object} toastMessenger - Injected service
*/ */
......
import immutable from './immutable'; import immutable from '../util/immutable';
/** /**
* @typedef {import('../../types/api').Group} Group * @typedef {import('../../types/api').Group} Group
......
// Functions that determine which tab an annotation should be displayed in. // Functions that determine which tab an annotation should be displayed in.
import * as metadata from './annotation-metadata'; import * as metadata from '../helpers/annotation-metadata';
/** /**
* @typedef {import('../../types/api').Annotation} Annotation * @typedef {import('../../types/api').Annotation} Annotation
......
import { parseAccountID, username, isThirdPartyUser } from '../account-id'; import { parseAccountID, username, isThirdPartyUser } from '../account-id';
describe('sidebar.util.account-id', function () { describe('sidebar/helpers/account-id', function () {
const term = 'acct:hacker@example.com'; const term = 'acct:hacker@example.com';
describe('parseAccountID', function () { describe('parseAccountID', function () {
......
...@@ -4,7 +4,7 @@ import * as annotationMetadata from '../annotation-metadata'; ...@@ -4,7 +4,7 @@ import * as annotationMetadata from '../annotation-metadata';
const documentMetadata = annotationMetadata.documentMetadata; const documentMetadata = annotationMetadata.documentMetadata;
const domainAndTitle = annotationMetadata.domainAndTitle; const domainAndTitle = annotationMetadata.domainAndTitle;
describe('sidebar/util/annotation-metadata', () => { describe('sidebar/helpers/annotation-metadata', () => {
const fakeAnnotation = (props = {}) => { const fakeAnnotation = (props = {}) => {
return { return {
document: {}, document: {},
......
import * as sharingUtil from '../annotation-sharing'; import * as sharingUtil from '../annotation-sharing';
describe('sidebar.util.annotation-sharing', () => { describe('sidebar/helpers/annotation-sharing', () => {
let fakeAnnotation; let fakeAnnotation;
let fakeServiceConfig; let fakeServiceConfig;
let fakeServiceSettings; let fakeServiceSettings;
......
import buildThread from '../build-thread'; import buildThread from '../build-thread';
import * as metadata from '../annotation-metadata'; import * as metadata from '../../helpers/annotation-metadata';
// Fixture with two top level annotations, one note and one reply // Fixture with two top level annotations, one note and one reply
const SIMPLE_FIXTURE = [ const SIMPLE_FIXTURE = [
...@@ -69,9 +69,9 @@ function createThread(fixture, options, keys) { ...@@ -69,9 +69,9 @@ function createThread(fixture, options, keys) {
return rootThread.children; return rootThread.children;
} }
describe('sidebar/util/build-thread', () => { describe('sidebar/helpers/build-thread', function () {
describe('threading', () => { describe('threading', function () {
it('arranges parents and children as a thread', () => { it('arranges parents and children as a thread', function () {
const thread = createThread(SIMPLE_FIXTURE); const thread = createThread(SIMPLE_FIXTURE);
assert.deepEqual(thread, [ assert.deepEqual(thread, [
{ {
......
import * as groupListItemCommon from '../group-list-item-common'; import * as groupListItemCommon from '../group-list-item-common';
describe('sidebar/util/groupListItemCommon', () => { describe('sidebar/helpers/group-list-item-common', () => {
describe('orgName', () => { describe('orgName', () => {
it('returns the organization name if it exists', () => { it('returns the organization name if it exists', () => {
const fakeGroup = { id: 'groupid', organization: { name: 'org' } }; const fakeGroup = { id: 'groupid', organization: { name: 'org' } };
......
import * as orgFixtures from '../../test/group-fixtures'; import * as orgFixtures from '../../test/group-fixtures';
import groupsByOrganization from '../group-organizations'; import groupsByOrganization from '../group-organizations';
describe('group-organizations', function () { describe('sidebar/helpers/group-organizations', function () {
context('when sorting organizations and their contained groups', function () { context('when sorting organizations and their contained groups', function () {
it('should put the default organization groups last', function () { it('should put the default organization groups last', function () {
const defaultOrg = orgFixtures.defaultOrganization(); const defaultOrg = orgFixtures.defaultOrganization();
......
import { combineGroups, $imports } from '../groups'; import { combineGroups, $imports } from '../groups';
describe('sidebar.util.groups', () => { describe('sidebar/helpers/groups', () => {
let fakeServiceConfig; let fakeServiceConfig;
describe('combineGroups', () => { describe('combineGroups', () => {
beforeEach(() => { beforeEach(() => {
......
import isThirdPartyService from '../is-third-party-service'; import isThirdPartyService from '../is-third-party-service';
import { $imports } from '../is-third-party-service'; import { $imports } from '../is-third-party-service';
describe('sidebar.util.isThirdPartyService', () => { describe('sidebar/helpers/is-third-party-service', () => {
let fakeServiceConfig; let fakeServiceConfig;
let fakeSettings; let fakeSettings;
......
...@@ -2,7 +2,7 @@ import * as permissions from '../permissions'; ...@@ -2,7 +2,7 @@ import * as permissions from '../permissions';
const userid = 'acct:flash@gord.on'; const userid = 'acct:flash@gord.on';
describe('sidebar/util/permissions', () => { describe('sidebar/helpers/permissions', () => {
describe('#privatePermissions', () => { describe('#privatePermissions', () => {
it('only allows the user to read the annotation', () => { it('only allows the user to read the annotation', () => {
assert.deepEqual(permissions.privatePermissions(userid), { assert.deepEqual(permissions.privatePermissions(userid), {
......
import * as sessionUtil from '../session'; import * as sessionUtil from '../session';
describe('sidebar/util/session', () => { describe('sidebar/helpers/session', () => {
describe('#shouldShowSidebarTutorial', () => { describe('#shouldShowSidebarTutorial', () => {
it('shows sidebar tutorial if the settings object has the show_sidebar_tutorial key set', function () { it('shows sidebar tutorial if the settings object has the show_sidebar_tutorial key set', function () {
const sessionState = { const sessionState = {
......
...@@ -2,7 +2,7 @@ import * as fixtures from '../../test/annotation-fixtures'; ...@@ -2,7 +2,7 @@ import * as fixtures from '../../test/annotation-fixtures';
import uiConstants from '../../ui-constants'; import uiConstants from '../../ui-constants';
import * as tabs from '../tabs'; import * as tabs from '../tabs';
describe('tabs', function () { describe('sidebar/helpers/tabs', function () {
describe('tabForAnnotation', function () { describe('tabForAnnotation', function () {
[ [
{ {
......
import { applyTheme } from '../theme'; import { applyTheme } from '../theme';
describe('sidebar/util/theme/applyTheme', () => { describe('sidebar/helpers/theme', () => {
let fakeSettings; let fakeSettings;
beforeEach(() => { beforeEach(() => {
......
...@@ -3,7 +3,7 @@ import uiConstants from '../../ui-constants'; ...@@ -3,7 +3,7 @@ import uiConstants from '../../ui-constants';
import threadAnnotations from '../thread-annotations'; import threadAnnotations from '../thread-annotations';
import { sorters } from '../thread-sorters'; import { sorters } from '../thread-sorters';
import { $imports } from '../thread-annotations'; import { $imports } from '../thread-annotations';
import immutable from '../immutable'; import immutable from '../../util/immutable';
const fixtures = immutable({ const fixtures = immutable({
emptyThread: { emptyThread: {
...@@ -17,7 +17,7 @@ const fixtures = immutable({ ...@@ -17,7 +17,7 @@ const fixtures = immutable({
}, },
}); });
describe('sidebar/utils/thread-annotations', () => { describe('sidebar/helpers/thread-annotations', () => {
let fakeBuildThread; let fakeBuildThread;
let fakeFilterAnnotations; let fakeFilterAnnotations;
let fakeSearchFilter; let fakeSearchFilter;
...@@ -46,7 +46,7 @@ describe('sidebar/utils/thread-annotations', () => { ...@@ -46,7 +46,7 @@ describe('sidebar/utils/thread-annotations', () => {
$imports.$mock({ $imports.$mock({
'./build-thread': fakeBuildThread, './build-thread': fakeBuildThread,
'./search-filter': fakeSearchFilter, '../util/search-filter': fakeSearchFilter,
'./view-filter': fakeFilterAnnotations, './view-filter': fakeFilterAnnotations,
}); });
}); });
......
import * as threadUtil from '../thread'; import * as threadUtil from '../thread';
describe('sidebar/util/thread', () => { describe('sidebar/helpers/thread', () => {
const fakeThread = () => { const fakeThread = () => {
return { return {
annotation: {}, annotation: {},
......
import VersionData from '../version-data'; import VersionData from '../version-data';
describe('VersionData', () => { describe('sidebar/helpers/version-data', () => {
let clock; let clock;
beforeEach(() => { beforeEach(() => {
......
...@@ -17,7 +17,7 @@ const poem = { ...@@ -17,7 +17,7 @@ const poem = {
Only this and nothing more.”`, Only this and nothing more.”`,
}; };
describe('sidebar/util/view-filter', () => { describe('sidebar/helpers/view-filter', () => {
let fakeUnicode; let fakeUnicode;
beforeEach(() => { beforeEach(() => {
...@@ -27,7 +27,7 @@ describe('sidebar/util/view-filter', () => { ...@@ -27,7 +27,7 @@ describe('sidebar/util/view-filter', () => {
}; };
$imports.$mock({ $imports.$mock({
'./unicode': fakeUnicode, '../util/unicode': fakeUnicode,
}); });
}); });
......
import { calculateVisibleThreads } from '../visible-threads'; import { calculateVisibleThreads } from '../visible-threads';
describe('sidebar/util/visible-threads', () => { describe('sidebar/helpers/visible-threads', () => {
let fakeThreads; let fakeThreads;
let fakeThreadHeights; let fakeThreadHeights;
let fakeWindowHeight; let fakeWindowHeight;
......
import buildThread from './build-thread'; import buildThread from './build-thread';
import memoize from './memoize';
import { generateFacetedFilter } from './search-filter'; import memoize from '../util/memoize';
import { generateFacetedFilter } from '../util/search-filter';
import filterAnnotations from './view-filter'; import filterAnnotations from './view-filter';
import { shouldShowInTab } from './tabs'; import { shouldShowInTab } from './tabs';
import { sorters } from './thread-sorters'; import { sorters } from './thread-sorters';
......
import { notNull } from './typing'; import { notNull } from '../util/typing';
/** @typedef {import('../../types/api').Annotation} Annotation */ /** @typedef {import('../../types/api').Annotation} Annotation */
/** @typedef {import('../util/build-thread').Thread} Thread */ /** @typedef {import('./build-thread').Thread} Thread */
/** /**
* Count the number of annotations/replies in the `thread` whose `visible` * Count the number of annotations/replies in the `thread` whose `visible`
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
*/ */
import { quote } from './annotation-metadata'; import { quote } from './annotation-metadata';
import * as unicodeUtils from './unicode'; import * as unicodeUtils from '../util/unicode';
/** /**
* @typedef Filter * @typedef Filter
......
/** /**
* @typedef {import('../util/build-thread').Thread} Thread * @typedef {import('../helpers/build-thread').Thread} Thread
*/ */
export const THREAD_DIMENSION_DEFAULTS = { export const THREAD_DIMENSION_DEFAULTS = {
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
* application-store representations. Interacts with API services as needed. * application-store representations. Interacts with API services as needed.
*/ */
import * as metadata from '../util/annotation-metadata'; import * as metadata from '../helpers/annotation-metadata';
import { import {
defaultPermissions, defaultPermissions,
privatePermissions, privatePermissions,
sharedPermissions, sharedPermissions,
} from '../util/permissions'; } from '../helpers/permissions';
import { generateHexString } from '../util/random'; import { generateHexString } from '../util/random';
import uiConstants from '../ui-constants'; import uiConstants from '../ui-constants';
......
...@@ -3,7 +3,7 @@ import debounce from 'lodash.debounce'; ...@@ -3,7 +3,7 @@ import debounce from 'lodash.debounce';
import bridgeEvents from '../../shared/bridge-events'; import bridgeEvents from '../../shared/bridge-events';
import Discovery from '../../shared/discovery'; import Discovery from '../../shared/discovery';
import uiConstants from '../ui-constants'; import uiConstants from '../ui-constants';
import * as metadata from '../util/annotation-metadata'; import * as metadata from '../helpers/annotation-metadata';
import { watch } from '../util/watch'; import { watch } from '../util/watch';
/** /**
......
import serviceConfig from '../service-config'; import serviceConfig from '../service-config';
import { isReply } from '../util/annotation-metadata'; import { isReply } from '../helpers/annotation-metadata';
import { combineGroups } from '../util/groups'; import { combineGroups } from '../helpers/groups';
import { awaitStateChange } from '../util/state'; import { awaitStateChange } from '../util/state';
import { watch } from '../util/watch'; import { watch } from '../util/watch';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
import SearchClient from '../search-client'; import SearchClient from '../search-client';
import { isReply } from '../util/annotation-metadata'; import { isReply } from '../helpers/annotation-metadata';
// @inject // @inject
export default function loadAnnotationsService( export default function loadAnnotationsService(
......
...@@ -54,8 +54,8 @@ describe('annotationsService', () => { ...@@ -54,8 +54,8 @@ describe('annotationsService', () => {
}; };
$imports.$mock({ $imports.$mock({
'../util/annotation-metadata': fakeMetadata, '../helpers/annotation-metadata': fakeMetadata,
'../util/permissions': { '../helpers/permissions': {
defaultPermissions: fakeDefaultPermissions, defaultPermissions: fakeDefaultPermissions,
privatePermissions: fakePrivatePermissions, privatePermissions: fakePrivatePermissions,
sharedPermissions: fakeSharedPermissions, sharedPermissions: fakeSharedPermissions,
......
...@@ -124,7 +124,7 @@ describe('groups', function () { ...@@ -124,7 +124,7 @@ describe('groups', function () {
fakeSettings = { group: null }; fakeSettings = { group: null };
$imports.$mock({ $imports.$mock({
'../util/annotation-metadata': fakeMetadata, '../helpers/annotation-metadata': fakeMetadata,
}); });
}); });
......
/** /**
* @typedef {import('../util/build-thread').Thread} Thread * @typedef {import('../helpers/build-thread').Thread} Thread
*/ */
// @inject // @inject
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import * as metadata from '../../util/annotation-metadata'; import * as metadata from '../../helpers/annotation-metadata';
import { countIf, toTrueMap, trueKeys } from '../../util/collections'; import { countIf, toTrueMap, trueKeys } from '../../util/collections';
import * as util from '../util'; import * as util from '../util';
import { storeModule } from '../create-store'; import { storeModule } from '../create-store';
......
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import * as metadata from '../../util/annotation-metadata'; import * as metadata from '../../helpers/annotation-metadata';
import * as util from '../util'; import * as util from '../util';
import { storeModule } from '../create-store'; import { storeModule } from '../create-store';
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import uiConstants from '../../ui-constants'; import uiConstants from '../../ui-constants';
import * as metadata from '../../util/annotation-metadata'; import * as metadata from '../../helpers/annotation-metadata';
import { countIf, trueKeys, toTrueMap } from '../../util/collections'; import { countIf, trueKeys, toTrueMap } from '../../util/collections';
import * as util from '../util'; import * as util from '../util';
import { storeModule } from '../create-store'; import { storeModule } from '../create-store';
......
import * as fixtures from '../../../test/annotation-fixtures'; import * as fixtures from '../../../test/annotation-fixtures';
import * as metadata from '../../../util/annotation-metadata'; import * as metadata from '../../../helpers/annotation-metadata';
import createStore from '../../create-store'; import createStore from '../../create-store';
import annotations from '../annotations'; import annotations from '../annotations';
import route from '../route'; import route from '../route';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment