@datagrok/compute 1.30.0 → 1.31.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.
- package/CHANGELOG.md +12 -0
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +2 -2
- package/src/package.ts +50 -12
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/compute",
|
|
3
3
|
"friendlyName": "Compute",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.31.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aufar Zakiev",
|
|
7
7
|
"email": "aufar.zakiev@softwarecountry.com"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"rxjs": "^6.6.7",
|
|
17
|
-
"@datagrok-libraries/compute-utils": "^1.
|
|
17
|
+
"@datagrok-libraries/compute-utils": "^1.31.0",
|
|
18
18
|
"cash-dom": "latest",
|
|
19
19
|
"datagrok-api": "^1.17.0",
|
|
20
20
|
"source-map-loader": "^4.0.1",
|
package/src/package.ts
CHANGED
|
@@ -174,23 +174,61 @@ let startUriLoaded = false;
|
|
|
174
174
|
|
|
175
175
|
//name: Model Catalog
|
|
176
176
|
//tags: app
|
|
177
|
-
//
|
|
177
|
+
//output: view v
|
|
178
178
|
export function modelCatalog() {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
179
|
+
// Separately process direct link access
|
|
180
|
+
const startOptionalPart = grok.shell.startUri.indexOf('?');
|
|
181
|
+
const startPathSegments = grok.shell.startUri
|
|
182
|
+
.substring('https://'.length, startOptionalPart > 0 ? startOptionalPart: undefined)
|
|
183
|
+
.split('/');
|
|
184
|
+
|
|
185
|
+
if (!startUriLoaded && startPathSegments.includes('Compute')) {
|
|
186
|
+
const view = ModelCatalogView.findOrCreateCatalogView('Model Catalog', 'modelCatalog', _package);
|
|
187
|
+
|
|
188
|
+
grok.shell.addView(view);
|
|
189
|
+
startUriLoaded = true;
|
|
190
|
+
|
|
191
|
+
if (startPathSegments.length > 3) {
|
|
192
|
+
grok.dapi.functions.filter(`shortName = "${startPathSegments[3]}" and #model`).list().then((lst) => {
|
|
193
|
+
if (lst.length == 1) {
|
|
194
|
+
ModelHandler.openModel(lst[0]);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const optionalPart = window.location.href.indexOf('?');
|
|
203
|
+
const pathSegments = window.location.href
|
|
183
204
|
.substring('https://'.length, optionalPart > 0 ? optionalPart: undefined)
|
|
184
205
|
.split('/');
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
206
|
+
|
|
207
|
+
if (pathSegments.includes('browse')) {
|
|
208
|
+
const view = ModelCatalogView.findModelCatalogView('modelCatalog');
|
|
209
|
+
|
|
210
|
+
// If there is existing view, then switch on it
|
|
211
|
+
if (view) {
|
|
212
|
+
grok.shell.v = view;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Always return new with no subscribtions to show in Browse tree
|
|
216
|
+
const newView = ModelCatalogView.createModelCatalogView('Model Catalog', 'modelCatalog', _package);
|
|
217
|
+
return newView;
|
|
191
218
|
}
|
|
192
219
|
|
|
193
|
-
|
|
220
|
+
// Separately process double-clicking on Model Catalog card
|
|
221
|
+
if (pathSegments.includes('apps')) {
|
|
222
|
+
const view = ModelCatalogView.findModelCatalogView('modelCatalog');
|
|
223
|
+
|
|
224
|
+
// If there is existing view, then switch on it
|
|
225
|
+
if (view) {
|
|
226
|
+
grok.shell.v = view;
|
|
227
|
+
} else {
|
|
228
|
+
const newView = ModelCatalogView.createModelCatalogView('Model Catalog', 'modelCatalog', _package);
|
|
229
|
+
grok.shell.addView(newView);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
194
232
|
}
|
|
195
233
|
|
|
196
234
|
|