We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd52749 commit bf09c36Copy full SHA for bf09c36
packages/core/lib/datasources/Datasource.js
@@ -22,6 +22,9 @@ class Datasource extends EventEmitter {
22
this.title = options.title;
23
this.id = options.id;
24
this.hide = options.hide;
25
+ this.enabled = options.enabled !== false;
26
+ if (this.enabled === false)
27
+ this.hide = true;
28
this.description = options.description;
29
this.path = this._datasourcePath;
30
this.url = urlData.baseURLRoot + this._datasourcePath + '#dataset';
@@ -61,6 +64,11 @@ class Datasource extends EventEmitter {
61
64
62
65
// Initialize the datasource asynchronously
63
66
initialize() {
67
+ if (!this.enabled) {
68
+ this.initialized = true;
69
+ return this.emit('initialized');
70
+ }
71
+
72
try {
73
this._initialize()
74
.then(() => {
0 commit comments