Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
3bcb6981
Commit
3bcb6981
authored
Jan 22, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Jan 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move `fetch-config` to `config`
parent
921bbff2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
fetch-config.js
src/sidebar/config/fetch-config.js
+5
-5
fetch-config-test.js
src/sidebar/config/test/fetch-config-test.js
+5
-5
index.js
src/sidebar/index.js
+1
-1
No files found.
src/sidebar/fetch-config.js
→
src/sidebar/
config/
fetch-config.js
View file @
3bcb6981
import
getApiUrl
from
'./
config/
get-api-url'
;
import
getApiUrl
from
'./get-api-url'
;
import
hostConfig
from
'./host-config'
;
import
hostConfig
from
'.
.
/host-config'
;
import
*
as
postMessageJsonRpc
from
'./util/postmessage-json-rpc'
;
import
*
as
postMessageJsonRpc
from
'.
.
/util/postmessage-json-rpc'
;
/**
/**
* @typedef {import('../types/config').SidebarConfig} SidebarConfig
* @typedef {import('../
../
types/config').SidebarConfig} SidebarConfig
* @typedef {import('../types/config').MergedConfig} MergedConfig
* @typedef {import('../
../
types/config').MergedConfig} MergedConfig
*/
*/
/**
/**
...
...
src/sidebar/test/fetch-config-test.js
→
src/sidebar/
config/
test/fetch-config-test.js
View file @
3bcb6981
import
{
fetchConfig
,
$imports
}
from
'../fetch-config'
;
import
{
fetchConfig
,
$imports
}
from
'../fetch-config'
;
describe
(
'sidebar/fetch-config'
,
()
=>
{
describe
(
'sidebar/
config/
fetch-config'
,
()
=>
{
let
fakeHostConfig
;
let
fakeHostConfig
;
let
fakeJsonRpc
;
let
fakeJsonRpc
;
let
fakeWindow
;
let
fakeWindow
;
...
@@ -14,9 +14,9 @@ describe('sidebar/fetch-config', () => {
...
@@ -14,9 +14,9 @@ describe('sidebar/fetch-config', () => {
};
};
fakeApiUrl
=
sinon
.
stub
().
returns
(
'https://dev.hypothes.is/api/'
);
fakeApiUrl
=
sinon
.
stub
().
returns
(
'https://dev.hypothes.is/api/'
);
$imports
.
$mock
({
$imports
.
$mock
({
'./host-config'
:
fakeHostConfig
,
'.
.
/host-config'
:
fakeHostConfig
,
'./util/postmessage-json-rpc'
:
fakeJsonRpc
,
'.
.
/util/postmessage-json-rpc'
:
fakeJsonRpc
,
'./
config/
get-api-url'
:
fakeApiUrl
,
'./get-api-url'
:
fakeApiUrl
,
});
});
// By default, embedder provides no custom config.
// By default, embedder provides no custom config.
...
@@ -39,7 +39,7 @@ describe('sidebar/fetch-config', () => {
...
@@ -39,7 +39,7 @@ describe('sidebar/fetch-config', () => {
$imports
.
$restore
();
$imports
.
$restore
();
});
});
describe
(
'
fetchC
onfig'
,
()
=>
{
describe
(
'
config/fetch-c
onfig'
,
()
=>
{
context
(
'direct embed'
,
()
=>
{
context
(
'direct embed'
,
()
=>
{
// no `requestConfigFromFrame` variable
// no `requestConfigFromFrame` variable
//
//
...
...
src/sidebar/index.js
View file @
3bcb6981
...
@@ -9,7 +9,7 @@ import {
...
@@ -9,7 +9,7 @@ import {
}
from
'./cross-origin-rpc.js'
;
}
from
'./cross-origin-rpc.js'
;
import
addAnalytics
from
'./ga'
;
import
addAnalytics
from
'./ga'
;
import
disableOpenerForExternalLinks
from
'./util/disable-opener-for-external-links'
;
import
disableOpenerForExternalLinks
from
'./util/disable-opener-for-external-links'
;
import
{
fetchConfig
}
from
'./fetch-config'
;
import
{
fetchConfig
}
from
'./
config/
fetch-config'
;
import
*
as
sentry
from
'./util/sentry'
;
import
*
as
sentry
from
'./util/sentry'
;
// Read settings rendered into sidebar app HTML by service/extension.
// Read settings rendered into sidebar app HTML by service/extension.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment