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

Move `service-config` into `config`

parent e4d696a0
...@@ -2,7 +2,7 @@ import { createElement } from 'preact'; ...@@ -2,7 +2,7 @@ import { createElement } from 'preact';
import { useMemo, useState } from 'preact/hooks'; import { useMemo, useState } from 'preact/hooks';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { isThirdPartyUser } from '../helpers/account-id'; import { isThirdPartyUser } from '../helpers/account-id';
import { orgName } from '../helpers/group-list-item-common'; import { orgName } from '../helpers/group-list-item-common';
......
...@@ -4,7 +4,7 @@ import { useEffect, useMemo } from 'preact/hooks'; ...@@ -4,7 +4,7 @@ import { useEffect, useMemo } from 'preact/hooks';
import propTypes from 'prop-types'; 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 '../config/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 '../helpers/account-id'; import { parseAccountID } from '../helpers/account-id';
......
...@@ -64,7 +64,7 @@ describe('GroupList', () => { ...@@ -64,7 +64,7 @@ describe('GroupList', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
}); });
}); });
......
...@@ -80,7 +80,7 @@ describe('HypothesisApp', () => { ...@@ -80,7 +80,7 @@ describe('HypothesisApp', () => {
$imports.$mock(mockImportedComponents()); $imports.$mock(mockImportedComponents());
$imports.$mock({ $imports.$mock({
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../helpers/session': { '../helpers/session': {
shouldAutoDisplayTutorial: fakeShouldAutoDisplayTutorial, shouldAutoDisplayTutorial: fakeShouldAutoDisplayTutorial,
......
...@@ -42,7 +42,7 @@ describe('TopBar', () => { ...@@ -42,7 +42,7 @@ describe('TopBar', () => {
$imports.$mock({ $imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
'../helpers/is-third-party-service': fakeIsThirdPartyService, '../helpers/is-third-party-service': fakeIsThirdPartyService,
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
}); });
}); });
......
...@@ -60,7 +60,7 @@ describe('UserMenu', () => { ...@@ -60,7 +60,7 @@ describe('UserMenu', () => {
'../helpers/account-id': { '../helpers/account-id': {
isThirdPartyUser: fakeIsThirdPartyUser, isThirdPartyUser: fakeIsThirdPartyUser,
}, },
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
'../store/use-store': { useStoreProxy: () => fakeStore }, '../store/use-store': { useStoreProxy: () => fakeStore },
}); });
}); });
......
...@@ -2,7 +2,7 @@ import { Fragment, createElement } from 'preact'; ...@@ -2,7 +2,7 @@ import { Fragment, createElement } from 'preact';
import propTypes from 'prop-types'; 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 '../config/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 '../helpers/is-third-party-service'; import isThirdPartyService from '../helpers/is-third-party-service';
......
...@@ -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 bridgeEvents from '../../shared/bridge-events'; import bridgeEvents from '../../shared/bridge-events';
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
import { isThirdPartyUser } from '../helpers/account-id'; import { isThirdPartyUser } from '../helpers/account-id';
import { useStoreProxy } from '../store/use-store'; import { useStoreProxy } from '../store/use-store';
import { withServices } from '../service-context'; import { withServices } from '../service-context';
......
import serviceConfig from '../service-config'; import serviceConfig from './service-config';
/** /**
* Function that returns apiUrl from the settings object. * Function that returns apiUrl from the settings object.
......
/** /**
* @typedef {import('../types/config').HostConfig} HostConfig * @typedef {import('../../types/config').HostConfig} HostConfig
* @typedef {import('../types/config').Service} Service * @typedef {import('../../types/config').Service} Service
*/ */
/** /**
......
import serviceConfig from '../service-config'; import serviceConfig from '../service-config';
describe('serviceConfig', function () { describe('config/service-config', () => {
it('returns null if services is not an array', function () { it('returns null if services is not an array', () => {
const settings = { const settings = {
services: 'someString', services: 'someString',
}; };
...@@ -9,7 +9,7 @@ describe('serviceConfig', function () { ...@@ -9,7 +9,7 @@ describe('serviceConfig', function () {
assert.isNull(serviceConfig(settings)); assert.isNull(serviceConfig(settings));
}); });
it('returns null if the settings object has no services', function () { it('returns null if the settings object has no services', () => {
const settings = { const settings = {
services: [], services: [],
}; };
...@@ -17,7 +17,7 @@ describe('serviceConfig', function () { ...@@ -17,7 +17,7 @@ describe('serviceConfig', function () {
assert.isNull(serviceConfig(settings)); assert.isNull(serviceConfig(settings));
}); });
it('returns the first service in the settings object', function () { it('returns the first service in the settings object', () => {
const settings = { const settings = {
services: [ services: [
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @typedef {import('../../types/config').HostConfig} HostConfig * @typedef {import('../../types/config').HostConfig} HostConfig
*/ */
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
/** /**
* Retrieve an appropriate sharing link for this annotation. * Retrieve an appropriate sharing link for this annotation.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
import escapeStringRegexp from 'escape-string-regexp'; import escapeStringRegexp from 'escape-string-regexp';
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
/** /**
* Should users be able to leave private groups of which they * Should users be able to leave private groups of which they
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @typedef {import('../../types/config').MergedConfig} MergedConfig * @typedef {import('../../types/config').MergedConfig} MergedConfig
*/ */
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
/** /**
* Return `true` if the first configured service is a "third-party" service. * Return `true` if the first configured service is a "third-party" service.
......
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
/** /**
* @typedef {import('../../types/config').HostConfig} HostConfig * @typedef {import('../../types/config').HostConfig} HostConfig
......
...@@ -17,7 +17,7 @@ describe('sidebar/helpers/annotation-sharing', () => { ...@@ -17,7 +17,7 @@ describe('sidebar/helpers/annotation-sharing', () => {
}; };
sharingUtil.$imports.$mock({ sharingUtil.$imports.$mock({
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
}); });
}); });
......
...@@ -6,7 +6,7 @@ describe('sidebar/helpers/groups', () => { ...@@ -6,7 +6,7 @@ describe('sidebar/helpers/groups', () => {
beforeEach(() => { beforeEach(() => {
fakeServiceConfig = sinon.stub().returns(null); fakeServiceConfig = sinon.stub().returns(null);
$imports.$mock({ $imports.$mock({
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
}); });
}); });
......
...@@ -10,7 +10,7 @@ describe('sidebar/helpers/is-third-party-service', () => { ...@@ -10,7 +10,7 @@ describe('sidebar/helpers/is-third-party-service', () => {
fakeSettings = { authDomain: 'hypothes.is' }; fakeSettings = { authDomain: 'hypothes.is' };
$imports.$mock({ $imports.$mock({
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
}); });
}); });
......
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
import { isReply } from '../helpers/annotation-metadata'; import { isReply } from '../helpers/annotation-metadata';
import { combineGroups } from '../helpers/groups'; import { combineGroups } from '../helpers/groups';
import { awaitStateChange } from '../store/util'; import { awaitStateChange } from '../store/util';
......
import { TinyEmitter } from 'tiny-emitter'; import { TinyEmitter } from 'tiny-emitter';
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
import OAuthClient from '../util/oauth-client'; import OAuthClient from '../util/oauth-client';
import { resolve } from '../util/url'; import { resolve } from '../util/url';
......
import serviceConfig from '../service-config'; import serviceConfig from '../config/service-config';
import * as retryUtil from '../util/retry'; import * as retryUtil from '../util/retry';
import * as sentry from '../util/sentry'; import * as sentry from '../util/sentry';
......
...@@ -56,7 +56,7 @@ describe('sidebar/services/session', function () { ...@@ -56,7 +56,7 @@ describe('sidebar/services/session', function () {
fakeToastMessenger = { error: sandbox.spy() }; fakeToastMessenger = { error: sandbox.spy() };
$imports.$mock({ $imports.$mock({
'../service-config': fakeServiceConfig, '../config/service-config': fakeServiceConfig,
'../util/sentry': fakeSentry, '../util/sentry': fakeSentry,
}); });
......
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