@jbrowse/product-core 2.7.2 → 2.8.0

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.
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const react_1 = __importStar(require("react"));
30
+ const clone_1 = __importDefault(require("clone"));
30
31
  const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
31
32
  const material_1 = require("@mui/material");
32
33
  const mui_1 = require("tss-react/mui");
@@ -39,6 +40,17 @@ const useStyles = (0, mui_1.makeStyles)()({
39
40
  minWidth: 800,
40
41
  },
41
42
  });
43
+ function removeAttr(obj, attr) {
44
+ for (const prop in obj) {
45
+ if (prop === attr) {
46
+ delete obj[prop];
47
+ }
48
+ else if (typeof obj[prop] === 'object') {
49
+ removeAttr(obj[prop], attr);
50
+ }
51
+ }
52
+ return obj;
53
+ }
42
54
  function AboutContents({ config, }) {
43
55
  const [copied, setCopied] = (0, react_1.useState)(false);
44
56
  const conf = (0, configuration_1.readConfObject)(config);
@@ -58,7 +70,8 @@ function AboutContents({ config, }) {
58
70
  return (react_1.default.createElement("div", { className: classes.content },
59
71
  react_1.default.createElement(BaseFeatureDetail_1.BaseCard, { title: "Configuration" },
60
72
  !hideUris ? (react_1.default.createElement(material_1.Button, { variant: "contained", style: { float: 'right' }, onClick: () => {
61
- (0, copy_to_clipboard_1.default)(JSON.stringify(conf, null, 2));
73
+ const snap = removeAttr((0, clone_1.default)(conf), 'baseUri');
74
+ (0, copy_to_clipboard_1.default)(JSON.stringify(snap, null, 2));
62
75
  setCopied(true);
63
76
  setTimeout(() => setCopied(false), 1000);
64
77
  } }, copied ? 'Copied to clipboard!' : 'Copy config')) : null,
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react';
2
+ import clone from 'clone';
2
3
  import copy from 'copy-to-clipboard';
3
4
  import { Button } from '@mui/material';
4
5
  import { makeStyles } from 'tss-react/mui';
@@ -11,6 +12,17 @@ const useStyles = makeStyles()({
11
12
  minWidth: 800,
12
13
  },
13
14
  });
15
+ function removeAttr(obj, attr) {
16
+ for (const prop in obj) {
17
+ if (prop === attr) {
18
+ delete obj[prop];
19
+ }
20
+ else if (typeof obj[prop] === 'object') {
21
+ removeAttr(obj[prop], attr);
22
+ }
23
+ }
24
+ return obj;
25
+ }
14
26
  export default function AboutContents({ config, }) {
15
27
  const [copied, setCopied] = useState(false);
16
28
  const conf = readConfObject(config);
@@ -30,7 +42,8 @@ export default function AboutContents({ config, }) {
30
42
  return (React.createElement("div", { className: classes.content },
31
43
  React.createElement(BaseCard, { title: "Configuration" },
32
44
  !hideUris ? (React.createElement(Button, { variant: "contained", style: { float: 'right' }, onClick: () => {
33
- copy(JSON.stringify(conf, null, 2));
45
+ const snap = removeAttr(clone(conf), 'baseUri');
46
+ copy(JSON.stringify(snap, null, 2));
34
47
  setCopied(true);
35
48
  setTimeout(() => setCopied(false), 1000);
36
49
  } }, copied ? 'Copied to clipboard!' : 'Copy config')) : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/product-core",
3
- "version": "2.7.2",
3
+ "version": "2.8.0",
4
4
  "sideEffects": false,
5
5
  "description": "JBrowse 2 code shared between products but not used by plugins",
6
6
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@babel/runtime": "^7.16.3",
46
- "@jbrowse/core": "^2.7.2",
46
+ "@jbrowse/core": "^2.8.0",
47
47
  "@mui/icons-material": "^5.0.0",
48
48
  "@mui/material": "^5.10.17",
49
49
  "copy-to-clipboard": "^3.3.1",
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "9052b295f2d322e729254457ed9fe2231fb22cce"
66
+ "gitHead": "ee8c2bdc8bd4f1a70b1eefda984f04a2830d9ca0"
67
67
  }