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';
import { useMemo, useState } from 'preact/hooks';
import propTypes from 'prop-types';
import serviceConfig from '../service-config';
import serviceConfig from '../config/service-config';
import { useStoreProxy } from '../store/use-store';
import { isThirdPartyUser } from '../helpers/account-id';
import { orgName } from '../helpers/group-list-item-common';
......
......@@ -4,7 +4,7 @@ import { useEffect, useMemo } from 'preact/hooks';
import propTypes from 'prop-types';
import bridgeEvents from '../../shared/bridge-events';
import serviceConfig from '../service-config';
import serviceConfig from '../config/service-config';
import { useStoreProxy } from '../store/use-store';
import uiConstants from '../ui-constants';
import { parseAccountID } from '../helpers/account-id';
......
......@@ -64,7 +64,7 @@ describe('GroupList', () => {
$imports.$mock(mockImportedComponents());
$imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore },
'../service-config': fakeServiceConfig,
'../config/service-config': fakeServiceConfig,
});
});
......
......@@ -80,7 +80,7 @@ describe('HypothesisApp', () => {
$imports.$mock(mockImportedComponents());
$imports.$mock({
'../service-config': fakeServiceConfig,
'../config/service-config': fakeServiceConfig,
'../store/use-store': { useStoreProxy: () => fakeStore },
'../helpers/session': {
shouldAutoDisplayTutorial: fakeShouldAutoDisplayTutorial,
......
......@@ -42,7 +42,7 @@ describe('TopBar', () => {
$imports.$mock({
'../store/use-store': { useStoreProxy: () => fakeStore },
'../helpers/is-third-party-service': fakeIsThirdPartyService,
'../service-config': fakeServiceConfig,
'../config/service-config': fakeServiceConfig,
});
});
......
......@@ -60,7 +60,7 @@ describe('UserMenu', () => {
'../helpers/account-id': {
isThirdPartyUser: fakeIsThirdPartyUser,
},
'../service-config': fakeServiceConfig,
'../config/service-config': fakeServiceConfig,
'../store/use-store': { useStoreProxy: () => fakeStore },
});
});
......
......@@ -2,7 +2,7 @@ import { Fragment, createElement } from 'preact';
import propTypes from 'prop-types';
import bridgeEvents from '../../shared/bridge-events';
import serviceConfig from '../service-config';
import serviceConfig from '../config/service-config';
import { useStoreProxy } from '../store/use-store';
import uiConstants from '../ui-constants';
import isThirdPartyService from '../helpers/is-third-party-service';
......
......@@ -2,7 +2,7 @@ import { createElement } from 'preact';
import propTypes from 'prop-types';
import bridgeEvents from '../../shared/bridge-events';
import serviceConfig from '../service-config';
import serviceConfig from '../config/service-config';
import { isThirdPartyUser } from '../helpers/account-id';
import { useStoreProxy } from '../store/use-store';
import { withServices } from '../service-context';
......
import serviceConfig from '../service-config';
import serviceConfig from './service-config';
/**
* Function that returns apiUrl from the settings object.
......
/**
* @typedef {import('../types/config').HostConfig} HostConfig
* @typedef {import('../types/config').Service} Service
* @typedef {import('../../types/config').HostConfig} HostConfig
* @typedef {import('../../types/config').Service} Service
*/
/**
......
import serviceConfig from '../service-config';
describe('serviceConfig', function () {
it('returns null if services is not an array', function () {
describe('config/service-config', () => {
it('returns null if services is not an array', () => {
const settings = {
services: 'someString',
};
......@@ -9,7 +9,7 @@ describe('serviceConfig', function () {
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 = {
services: [],
};
......@@ -17,7 +17,7 @@ describe('serviceConfig', function () {
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 = {
services: [
{
......
......@@ -3,7 +3,7 @@
* @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.
......
......@@ -4,7 +4,7 @@
*/
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
......
......@@ -2,7 +2,7 @@
* @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.
......
import serviceConfig from '../service-config';
import serviceConfig from '../config/service-config';
/**
* @typedef {import('../../types/config').HostConfig} HostConfig
......
......@@ -17,7 +17,7 @@ describe('sidebar/helpers/annotation-sharing', () => {
};
sharingUtil.$imports.$mock({
'../service-config': fakeServiceConfig,
'../config/service-config': fakeServiceConfig,
});
});
......
......@@ -6,7 +6,7 @@ describe('sidebar/helpers/groups', () => {
beforeEach(() => {
fakeServiceConfig = sinon.stub().returns(null);
$imports.$mock({
'../service-config': fakeServiceConfig,
'../config/service-config': fakeServiceConfig,
});
});
......
......@@ -10,7 +10,7 @@ describe('sidebar/helpers/is-third-party-service', () => {
fakeSettings = { authDomain: 'hypothes.is' };
$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 { combineGroups } from '../helpers/groups';
import { awaitStateChange } from '../store/util';
......
import { TinyEmitter } from 'tiny-emitter';
import serviceConfig from '../service-config';
import serviceConfig from '../config/service-config';
import OAuthClient from '../util/oauth-client';
import { resolve } from '../util/url';
......
import serviceConfig from '../service-config';
import serviceConfig from '../config/service-config';
import * as retryUtil from '../util/retry';
import * as sentry from '../util/sentry';
......
......@@ -56,7 +56,7 @@ describe('sidebar/services/session', function () {
fakeToastMessenger = { error: sandbox.spy() };
$imports.$mock({
'../service-config': fakeServiceConfig,
'../config/service-config': fakeServiceConfig,
'../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