@jbrowse/plugin-config 2.3.1 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +2 -1
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js.map +1 -1
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +2 -1
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js.map +1 -1
- package/package.json +3 -3
- package/src/ConfigurationEditorWidget/components/ColorEditor.test.tsx +8 -10
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.test.tsx +0 -1
- package/src/FromConfigAdapter/FromConfigAdapter.test.ts +3 -2
- package/src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.test.ts +5 -4
- package/src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.ts +4 -1
- package/src/__snapshots__/{index.test.js.snap → index.test.ts.snap} +0 -0
- package/src/{index.test.js → index.test.ts} +1 -4
|
@@ -8,6 +8,7 @@ const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
|
9
9
|
// locals
|
|
10
10
|
const FromConfigAdapter_1 = __importDefault(require("../FromConfigAdapter/FromConfigAdapter"));
|
|
11
|
+
const rxjs_2 = require("rxjs");
|
|
11
12
|
class FromConfigSequenceAdapter extends FromConfigAdapter_1.default {
|
|
12
13
|
/**
|
|
13
14
|
* Fetch features for a certain region
|
|
@@ -16,7 +17,7 @@ class FromConfigSequenceAdapter extends FromConfigAdapter_1.default {
|
|
|
16
17
|
*/
|
|
17
18
|
getFeatures(region) {
|
|
18
19
|
return (0, rxjs_1.ObservableCreate)(async (observer) => {
|
|
19
|
-
const feats = await super.getFeatures(region).pipe((0, operators_1.toArray)())
|
|
20
|
+
const feats = await (0, rxjs_2.firstValueFrom)(super.getFeatures(region).pipe((0, operators_1.toArray)()));
|
|
20
21
|
const feat = feats[0];
|
|
21
22
|
observer.next(new simpleFeature_1.default({
|
|
22
23
|
...feat.toJSON(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromConfigSequenceAdapter.js","sourceRoot":"","sources":["../../src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.ts"],"names":[],"mappings":";;;;;AAAA,qFAAyE;AACzE,kDAA0D;AAE1D,8CAAwC;AAGxC,SAAS;AACT,+FAAsE;
|
|
1
|
+
{"version":3,"file":"FromConfigSequenceAdapter.js","sourceRoot":"","sources":["../../src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.ts"],"names":[],"mappings":";;;;;AAAA,qFAAyE;AACzE,kDAA0D;AAE1D,8CAAwC;AAGxC,SAAS;AACT,+FAAsE;AACtE,+BAAqC;AAErC,MAAqB,yBACnB,SAAQ,2BAAiB;IAGzB;;;;OAIG;IACH,WAAW,CAAC,MAAwB;QAClC,OAAO,IAAA,uBAAgB,EAAU,KAAK,EAAC,QAAQ,EAAC,EAAE;YAChD,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAc,EAChC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAA,mBAAO,GAAE,CAAC,CAC1C,CAAA;YACD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YACrB,QAAQ,CAAC,IAAI,CACX,IAAI,uBAAa,CAAC;gBAChB,GAAG,IAAI,CAAC,MAAM,EAAE;gBAChB,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,EAAE;gBACtD,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,GAAG,EAAE,IAAI;qBACN,GAAG,CAAC,KAAK,CAAC;qBACV,KAAK,CACJ,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CA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
3
3
|
import { toArray } from 'rxjs/operators';
|
|
4
4
|
// locals
|
|
5
5
|
import FromConfigAdapter from '../FromConfigAdapter/FromConfigAdapter';
|
|
6
|
+
import { firstValueFrom } from 'rxjs';
|
|
6
7
|
export default class FromConfigSequenceAdapter extends FromConfigAdapter {
|
|
7
8
|
/**
|
|
8
9
|
* Fetch features for a certain region
|
|
@@ -11,7 +12,7 @@ export default class FromConfigSequenceAdapter extends FromConfigAdapter {
|
|
|
11
12
|
*/
|
|
12
13
|
getFeatures(region) {
|
|
13
14
|
return ObservableCreate(async (observer) => {
|
|
14
|
-
const feats = await super.getFeatures(region).pipe(toArray())
|
|
15
|
+
const feats = await firstValueFrom(super.getFeatures(region).pipe(toArray()));
|
|
15
16
|
const feat = feats[0];
|
|
16
17
|
observer.next(new SimpleFeature({
|
|
17
18
|
...feat.toJSON(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromConfigSequenceAdapter.js","sourceRoot":"","sources":["../../src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,aAA0B,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,SAAS;AACT,OAAO,iBAAiB,MAAM,wCAAwC,CAAA;
|
|
1
|
+
{"version":3,"file":"FromConfigSequenceAdapter.js","sourceRoot":"","sources":["../../src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,aAA0B,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,SAAS;AACT,OAAO,iBAAiB,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAA;AAErC,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BACb,aAAa,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;oBACzC,aAAa,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EACzC;oBACA,aAAa,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;iBACvC;qBAAM;oBACL,IAAI,aAAa,EAAE;wBACjB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;qBAC5B;oBACD,aAAa,GAAG;wBACd,OAAO;wBACP,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;wBAC3B,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;qBACxB,CAAA;iBACF;aACF;YACD,IAAI,aAAa,EAAE;gBACjB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;aAC5B;SACF;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;;;OAIG;IACH,aAAa,EAAC,gBAAgB,IAAS,CAAC;CACzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-config",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "JBrowse 2 config utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"mobx-state-tree": "^5.0.0",
|
|
49
49
|
"react": ">=16.8.0",
|
|
50
50
|
"react-dom": ">=16.8.0",
|
|
51
|
-
"rxjs": "^
|
|
51
|
+
"rxjs": "^7.0.0",
|
|
52
52
|
"tss-react": "^4.0.0"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"distModule": "esm/index.js",
|
|
58
58
|
"srcModule": "src/index.ts",
|
|
59
59
|
"module": "esm/index.js",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "283e0387ccd5acc9f092cf00804d1fcac212e68d"
|
|
61
61
|
}
|
|
@@ -3,14 +3,12 @@ import { render, fireEvent } from '@testing-library/react'
|
|
|
3
3
|
|
|
4
4
|
import { ColorSlot } from './ColorEditor'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
expect(myfn).toHaveBeenCalledWith('red')
|
|
15
|
-
})
|
|
6
|
+
test('can change value via the text field', () => {
|
|
7
|
+
const myfn = jest.fn()
|
|
8
|
+
const { getByDisplayValue } = render(
|
|
9
|
+
<ColorSlot value="green" onChange={myfn} />,
|
|
10
|
+
)
|
|
11
|
+
const ret = getByDisplayValue('green')
|
|
12
|
+
fireEvent.change(ret, { target: { value: 'red' } })
|
|
13
|
+
expect(myfn).toHaveBeenCalledWith('red')
|
|
16
14
|
})
|
|
@@ -82,7 +82,6 @@ describe('ConfigurationEditor widget', () => {
|
|
|
82
82
|
})
|
|
83
83
|
|
|
84
84
|
it('renders with defaults of the PileupTrack schema', () => {
|
|
85
|
-
console.warn = jest.fn()
|
|
86
85
|
const pluginManager = new PluginManager([new Alignments(), new SVG()])
|
|
87
86
|
pluginManager.createPluggableElements()
|
|
88
87
|
pluginManager.configure()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toArray } from 'rxjs/operators'
|
|
2
|
+
import { firstValueFrom } from 'rxjs'
|
|
2
3
|
import Adapter from './FromConfigAdapter'
|
|
3
4
|
import configSchema from './configSchema'
|
|
4
5
|
|
|
@@ -14,7 +15,7 @@ test('adapter can fetch features', async () => {
|
|
|
14
15
|
end: 20000,
|
|
15
16
|
})
|
|
16
17
|
|
|
17
|
-
const featuresArray = await result.pipe(toArray())
|
|
18
|
+
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
18
19
|
expect(featuresArray.length).toBe(1)
|
|
19
20
|
expect(featuresArray[0].toJSON()).toEqual(features[0])
|
|
20
21
|
})
|
|
@@ -50,6 +51,6 @@ test('adapter can fetch features with subfeatures', async () => {
|
|
|
50
51
|
end: 20000,
|
|
51
52
|
})
|
|
52
53
|
|
|
53
|
-
const featuresArray = await result.pipe(toArray())
|
|
54
|
+
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
54
55
|
expect(featuresArray.length).toBe(1)
|
|
55
56
|
})
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toArray } from 'rxjs/operators'
|
|
2
|
+
import { firstValueFrom } from 'rxjs'
|
|
2
3
|
import Adapter from './FromConfigSequenceAdapter'
|
|
3
4
|
import sequenceConfigSchema from './configSchema'
|
|
4
5
|
|
|
@@ -18,7 +19,7 @@ test('adapter can fetch sequences when there is just one feature representing wh
|
|
|
18
19
|
start: 0,
|
|
19
20
|
end: 50,
|
|
20
21
|
})
|
|
21
|
-
const featuresArray = await result.pipe(toArray())
|
|
22
|
+
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
22
23
|
expect(featuresArray.length).toBe(1)
|
|
23
24
|
expect(featuresArray[0].get('seq')).toBe(features[0].seq.slice(0, 50))
|
|
24
25
|
|
|
@@ -27,7 +28,7 @@ test('adapter can fetch sequences when there is just one feature representing wh
|
|
|
27
28
|
start: 100,
|
|
28
29
|
end: 150,
|
|
29
30
|
})
|
|
30
|
-
const featuresArray2 = await result2.pipe(toArray())
|
|
31
|
+
const featuresArray2 = await firstValueFrom(result2.pipe(toArray()))
|
|
31
32
|
expect(featuresArray2.length).toBe(1)
|
|
32
33
|
expect(featuresArray2[0].get('seq')).toBe(features[0].seq.slice(100, 150))
|
|
33
34
|
})
|
|
@@ -48,7 +49,7 @@ test("adapter can fetch sequences when the config's sequence doesn't start at 0"
|
|
|
48
49
|
start: 4950,
|
|
49
50
|
end: 5050,
|
|
50
51
|
})
|
|
51
|
-
const featuresArray = await result.pipe(toArray())
|
|
52
|
+
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
52
53
|
expect(featuresArray.length).toBe(1)
|
|
53
54
|
expect(featuresArray[0].get('seq')).toBe(features[0].seq.slice(0, 50))
|
|
54
55
|
|
|
@@ -57,7 +58,7 @@ test("adapter can fetch sequences when the config's sequence doesn't start at 0"
|
|
|
57
58
|
start: 5050,
|
|
58
59
|
end: 5150,
|
|
59
60
|
})
|
|
60
|
-
const featuresArray2 = await result2.pipe(toArray())
|
|
61
|
+
const featuresArray2 = await firstValueFrom(result2.pipe(toArray()))
|
|
61
62
|
expect(featuresArray2.length).toBe(1)
|
|
62
63
|
expect(featuresArray2[0].get('seq')).toBe(features[0].seq.slice(50, 150))
|
|
63
64
|
})
|
|
@@ -6,6 +6,7 @@ import { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
|
6
6
|
|
|
7
7
|
// locals
|
|
8
8
|
import FromConfigAdapter from '../FromConfigAdapter/FromConfigAdapter'
|
|
9
|
+
import { firstValueFrom } from 'rxjs'
|
|
9
10
|
|
|
10
11
|
export default class FromConfigSequenceAdapter
|
|
11
12
|
extends FromConfigAdapter
|
|
@@ -18,7 +19,9 @@ export default class FromConfigSequenceAdapter
|
|
|
18
19
|
*/
|
|
19
20
|
getFeatures(region: NoAssemblyRegion) {
|
|
20
21
|
return ObservableCreate<Feature>(async observer => {
|
|
21
|
-
const feats = await
|
|
22
|
+
const feats = await firstValueFrom(
|
|
23
|
+
super.getFeatures(region).pipe(toArray()),
|
|
24
|
+
)
|
|
22
25
|
const feat = feats[0]
|
|
23
26
|
observer.next(
|
|
24
27
|
new SimpleFeature({
|
|
File without changes
|
|
@@ -3,15 +3,12 @@ import { getSnapshot } from 'mobx-state-tree'
|
|
|
3
3
|
import ThisPlugin from '.'
|
|
4
4
|
|
|
5
5
|
describe('Config editing', () => {
|
|
6
|
-
let pluginManager
|
|
6
|
+
let pluginManager: PluginManager
|
|
7
7
|
|
|
8
8
|
beforeAll(() => {
|
|
9
|
-
const originalConsoleWarn = console.warn
|
|
10
|
-
console.warn = jest.fn()
|
|
11
9
|
pluginManager = new PluginManager([new ThisPlugin()])
|
|
12
10
|
pluginManager.createPluggableElements()
|
|
13
11
|
pluginManager.configure()
|
|
14
|
-
console.warn = originalConsoleWarn
|
|
15
12
|
})
|
|
16
13
|
|
|
17
14
|
it("won't add if already added", () => {
|