visualizer-on-tabs 2.0.0 → 2.0.1
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/README.md +7 -10
- package/package.json +2 -2
- package/src/components/App.js +0 -1
- package/src/components/Login.js +6 -5
- package/src/main/visualizerConfig.js +0 -7
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ const config = {
|
|
|
22
22
|
url: 'https://demo.scipeaks.com/roc',
|
|
23
23
|
// Redirect after login
|
|
24
24
|
redirect: 'https://demo.scipeaks.com/',
|
|
25
|
+
// If true, automatically redirects to the login page if not logged in
|
|
26
|
+
auto: true,
|
|
25
27
|
},
|
|
26
28
|
// List of default views to load
|
|
27
29
|
possibleViews: {
|
|
@@ -50,20 +52,15 @@ const config = {
|
|
|
50
52
|
// When false, only the selected tab is loaded.
|
|
51
53
|
loadHidden: false,
|
|
52
54
|
|
|
53
|
-
// Options
|
|
55
|
+
// Options passed to makeVisualizerPage
|
|
56
|
+
// See https://github.com/cheminfo/react-visualizer
|
|
54
57
|
visualizer: {
|
|
55
|
-
/**
|
|
56
|
-
* Options to generate the visualizer html page
|
|
57
|
-
*/
|
|
58
58
|
loadversion: 'exact',
|
|
59
59
|
fallbackVersion: 'latest',
|
|
60
60
|
cdn: 'https://www.lactame.com/visualizer',
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*/
|
|
65
|
-
// Visualizer config.json
|
|
66
|
-
config: undefined,
|
|
61
|
+
// Can be a URL string or an object
|
|
62
|
+
// Example of config object: https://github.com/NPellet/visualizer/blob/master/src/usr/config/default.json
|
|
63
|
+
config: '',
|
|
67
64
|
},
|
|
68
65
|
};
|
|
69
66
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visualizer-on-tabs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "visualizer-on-tabs webpack builder",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react": "^18.3.1",
|
|
40
40
|
"react-bootstrap": "^3.0.0-beta.3",
|
|
41
41
|
"react-dom": "^18.3.1",
|
|
42
|
-
"react-visualizer": "^5.
|
|
42
|
+
"react-visualizer": "^5.3.0",
|
|
43
43
|
"webpack": "^5.105.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
package/src/components/App.js
CHANGED
package/src/components/Login.js
CHANGED
|
@@ -24,16 +24,17 @@ class Login extends React.Component {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async session() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const response = await fetch(`${
|
|
27
|
+
const rocLogin = this.props.config.rocLogin;
|
|
28
|
+
if (!rocLogin) return;
|
|
29
|
+
const response = await fetch(`${rocLogin.url}/auth/session`, {
|
|
30
30
|
credentials: 'include',
|
|
31
31
|
});
|
|
32
32
|
if (response.ok) {
|
|
33
33
|
const body = await response.json();
|
|
34
34
|
if (
|
|
35
|
-
|
|
36
|
-
(!body.authenticated ||
|
|
35
|
+
rocLogin.auto &&
|
|
36
|
+
(!body.authenticated ||
|
|
37
|
+
(rocLogin.user && body.username !== rocLogin.user))
|
|
37
38
|
) {
|
|
38
39
|
window.location.href = this.loginUrl;
|
|
39
40
|
}
|