@jbrowse/plugin-config 1.5.0 → 1.5.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-config",
3
- "version": "1.5.0",
3
+ "version": "1.5.4",
4
4
  "description": "JBrowse 2 config utilities",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@material-ui/icons": "^4.9.1",
39
- "generic-filehandle": "^2.2.0",
39
+ "generic-filehandle": "^2.2.2",
40
40
  "pluralize": "^8.0.0",
41
41
  "react-color": "^2.19.3",
42
42
  "react-simple-code-editor": "0.9.3",
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "542025578a39bd170c8a166f2568ee7edbd54072"
58
+ "gitHead": "0c398214590969168694b4ed8e20b595178b9efd"
59
59
  }
@@ -1,12 +1,14 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import { useDebounce } from '@jbrowse/core/util'
3
3
  import { stringToJexlExpression } from '@jbrowse/core/util/jexlStrings'
4
- import FormControl from '@material-ui/core/FormControl'
5
- import FormHelperText from '@material-ui/core/FormHelperText'
6
- import InputLabel from '@material-ui/core/InputLabel'
7
- import { makeStyles } from '@material-ui/core/styles'
8
- import Tooltip from '@material-ui/core/Tooltip'
9
- import IconButton from '@material-ui/core/IconButton'
4
+ import {
5
+ FormControl,
6
+ FormHelperText,
7
+ InputLabel,
8
+ Tooltip,
9
+ IconButton,
10
+ makeStyles,
11
+ } from '@material-ui/core'
10
12
  import HelpIcon from '@material-ui/icons/Help'
11
13
  import { getEnv } from 'mobx-state-tree'
12
14
  import { observer, PropTypes } from 'mobx-react'
@@ -11,7 +11,7 @@ const ColorPicker = lazy(() => import('./ColorPicker'))
11
11
  function serializeColor(color: Color) {
12
12
  if (color instanceof Object) {
13
13
  const { r, g, b, a } = color as RGBColor
14
- return `rgb(${r},${g},${b},${a})`
14
+ return a === undefined ? `rgb(${r},${g},${b})` : `rgba(${r},${g},${b},${a})`
15
15
  }
16
16
  return color
17
17
  }
@@ -992,13 +992,13 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch
992
992
  </label>
993
993
  <div
994
994
  class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-fullWidth MuiInput-fullWidth MuiInputBase-formControl MuiInput-formControl"
995
- style="color: rgb(200, 200, 200); border-right-width: 25px; border-right-style: solid; border-right-color: #c8c8c8;"
995
+ style="color: rgb(255, 0, 255); border-right-width: 25px; border-right-style: solid; border-right-color: #f0f;"
996
996
  >
997
997
  <input
998
998
  aria-invalid="false"
999
999
  class="MuiInputBase-input MuiInput-input"
1000
1000
  type="text"
1001
- value="#c8c8c8"
1001
+ value="#f0f"
1002
1002
  />
1003
1003
  </div>
1004
1004
  <p
@@ -1,40 +1,20 @@
1
1
  import {
2
2
  BaseRefNameAliasAdapter,
3
- Alias,
4
3
  BaseAdapter,
5
4
  } from '@jbrowse/core/data_adapters/BaseAdapter'
6
5
  import { openLocation } from '@jbrowse/core/util/io'
7
- import { GenericFilehandle } from 'generic-filehandle'
8
6
  import { readConfObject } from '@jbrowse/core/configuration'
9
7
 
10
- import { ConfigurationModel } from '@jbrowse/core/configuration/configurationSchema'
11
- import MyConfigAdapterSchema from './configSchema'
12
- import PluginManager from '@jbrowse/core/PluginManager'
13
- import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache'
14
-
15
8
  export default class RefNameAliasAdapter
16
9
  extends BaseAdapter
17
10
  implements BaseRefNameAliasAdapter
18
11
  {
19
- private location: GenericFilehandle
20
-
21
- private promise: Promise<Alias[]>
22
-
23
- constructor(
24
- config: ConfigurationModel<typeof MyConfigAdapterSchema>,
25
- getSubAdapter?: getSubAdapterType,
26
- pluginManager?: PluginManager,
27
- ) {
28
- super(config, getSubAdapter, pluginManager)
29
- this.location = openLocation(
30
- readConfObject(config, 'location'),
31
- this.pluginManager,
32
- )
33
- this.promise = this.downloadResults()
34
- }
35
-
36
- private async downloadResults() {
37
- const results = (await this.location.readFile('utf8')) as string
12
+ async getRefNameAliases() {
13
+ const loc = readConfObject(this.config, 'location')
14
+ if (loc.uri === '' || loc.uri === '/path/to/my/aliases.txt') {
15
+ return []
16
+ }
17
+ const results = await openLocation(loc).readFile('utf8')
38
18
  return results
39
19
  .trim()
40
20
  .split('\n')
@@ -44,9 +24,5 @@ export default class RefNameAliasAdapter
44
24
  })
45
25
  }
46
26
 
47
- getRefNameAliases() {
48
- return this.promise
49
- }
50
-
51
27
  async freeResources() {}
52
28
  }
package/src/index.ts CHANGED
@@ -35,6 +35,12 @@ export default class extends Plugin {
35
35
  name: 'FromConfigAdapter',
36
36
  configSchema: fromConfigAdapterConfigSchema,
37
37
  AdapterClass: FromConfigAdapterClass,
38
+ adapterMetadata: {
39
+ category: null,
40
+ hiddenFromGUI: true,
41
+ displayName: null,
42
+ description: null,
43
+ },
38
44
  }),
39
45
  )
40
46
  pluginManager.addAdapterType(
@@ -43,6 +49,12 @@ export default class extends Plugin {
43
49
  name: 'FromConfigRegionsAdapter',
44
50
  configSchema: fromConfigRegionsAdapterConfigSchema,
45
51
  AdapterClass: FromConfigRegionsAdapterClass,
52
+ adapterMetadata: {
53
+ category: null,
54
+ hiddenFromGUI: true,
55
+ displayName: null,
56
+ description: null,
57
+ },
46
58
  }),
47
59
  )
48
60
  pluginManager.addAdapterType(
@@ -51,6 +63,12 @@ export default class extends Plugin {
51
63
  name: 'FromConfigSequenceAdapter',
52
64
  configSchema: fromConfigSequenceAdapterConfigSchema,
53
65
  AdapterClass: FromConfigSequenceAdapterClass,
66
+ adapterMetadata: {
67
+ category: null,
68
+ hiddenFromGUI: true,
69
+ displayName: null,
70
+ description: null,
71
+ },
54
72
  }),
55
73
  )
56
74
  pluginManager.addAdapterType(
@@ -59,6 +77,12 @@ export default class extends Plugin {
59
77
  name: 'RefNameAliasAdapter',
60
78
  configSchema: refNameAliasAdapterConfigSchema,
61
79
  AdapterClass: RefNameAliasAdapterClass,
80
+ adapterMetadata: {
81
+ category: null,
82
+ hiddenFromGUI: true,
83
+ displayName: null,
84
+ description: null,
85
+ },
62
86
  }),
63
87
  )
64
88