@sumaris-net/ngx-components 1.15.6 → 1.15.9
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/bundles/sumaris-net.ngx-components.umd.js +24 -6
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/form/entity-editor.class.js +5 -2
- package/esm2015/src/app/core/services/base-graphql-service.class.js +7 -3
- package/esm2015/src/app/core/services/network.service.js +3 -3
- package/esm2015/src/app/core/services/platform.service.js +12 -2
- package/fesm2015/sumaris-net.ngx-components.js +24 -7
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/platform.service.d.ts +4 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -12314,7 +12314,7 @@
|
|
|
12314
12314
|
_this.onNetworkStatusChanges = new rxjs.BehaviorSubject(null);
|
|
12315
12315
|
_this.onResetNetworkCache = new i0.EventEmitter(true);
|
|
12316
12316
|
_this._listeners = {};
|
|
12317
|
-
_this._mobile = _this.
|
|
12317
|
+
_this._mobile = _this.settings.mobile;
|
|
12318
12318
|
if (_this._mobile) {
|
|
12319
12319
|
_this._timerRefreshPeriod = NetworkRefreshTimerPeriod.MOBILE;
|
|
12320
12320
|
_this._timerRefreshCondition = function () { return _this.online; }; // Check only when online, and stop when offline
|
|
@@ -12744,7 +12744,7 @@
|
|
|
12744
12744
|
return __generator(this, function (_c) {
|
|
12745
12745
|
switch (_c.label) {
|
|
12746
12746
|
case 0:
|
|
12747
|
-
console.info('[network] Starting network...'
|
|
12747
|
+
console.info('[network] Starting network...');
|
|
12748
12748
|
_b = this._startingPeer;
|
|
12749
12749
|
if (_b) return [3 /*break*/, 2];
|
|
12750
12750
|
return [4 /*yield*/, this.restoreLocally()];
|
|
@@ -15746,7 +15746,9 @@
|
|
|
15746
15746
|
return this._mutableWatchQueries.filter(function (q) { return q.id.startsWith(opts.queryName + '|'); });
|
|
15747
15747
|
}
|
|
15748
15748
|
if (opts.queryNames) {
|
|
15749
|
-
return opts.queryNames.
|
|
15749
|
+
return opts.queryNames.map(function (queryName) { return _this._mutableWatchQueries.filter(function (q) { return q.id.startsWith(queryName + '|'); }); })
|
|
15750
|
+
// flatMap
|
|
15751
|
+
.reduce(function (res, array) { return res.concat.apply(res, __spread(array)); }, []);
|
|
15750
15752
|
}
|
|
15751
15753
|
// Search by query
|
|
15752
15754
|
if (opts.query) {
|
|
@@ -15755,7 +15757,9 @@
|
|
|
15755
15757
|
if (opts.queries) {
|
|
15756
15758
|
return opts.queries
|
|
15757
15759
|
.filter(isNotNil)
|
|
15758
|
-
.
|
|
15760
|
+
.map(function (query) { return _this._mutableWatchQueries.filter(function (q) { return q.query === query; }); })
|
|
15761
|
+
// flatMap
|
|
15762
|
+
.reduce(function (res, array) { return res.concat.apply(res, __spread(array)); }, []);
|
|
15759
15763
|
}
|
|
15760
15764
|
throw Error('Invalid options: only one property must be set');
|
|
15761
15765
|
};
|
|
@@ -17751,6 +17755,10 @@
|
|
|
17751
17755
|
var templateObject_1$3, templateObject_2$3, templateObject_3$2, templateObject_4$2, templateObject_5$1;
|
|
17752
17756
|
|
|
17753
17757
|
var moment$3 = momentImported__namespace;
|
|
17758
|
+
var AndroidOsEnvironment = Object.freeze({
|
|
17759
|
+
DIRECTORY_DOWNLOADS: 'Download',
|
|
17760
|
+
DIRECTORY_DOWNLOADS_OLD: 'Downloads',
|
|
17761
|
+
});
|
|
17754
17762
|
var PlatformService = /** @class */ (function (_super) {
|
|
17755
17763
|
__extends(PlatformService, _super);
|
|
17756
17764
|
function PlatformService(platform, cdkPlatform, toastController, translate, dateAdapter, entitiesStorage, settings, networkService, accountService, configService, cache, storage, audioProvider, environment, statusBar, keyboard, splashScreen, browser, downloader) {
|
|
@@ -17947,7 +17955,7 @@
|
|
|
17947
17955
|
var location$ = this._downloadingJobs.get(request.uri);
|
|
17948
17956
|
if (location$)
|
|
17949
17957
|
return location$;
|
|
17950
|
-
request = Object.assign(Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted, title: request.title || request.filename }, request), { destinationInExternalPublicDir: Object.assign({ dirType:
|
|
17958
|
+
request = Object.assign(Object.assign({ visibleInDownloadsUi: true, notificationVisibility: ngx$6.NotificationVisibility.VisibleNotifyCompleted, title: request.title || request.filename }, request), { destinationInExternalPublicDir: Object.assign({ dirType: AndroidOsEnvironment.DIRECTORY_DOWNLOADS, subPath: request.filename || request.title || '' }, request.destinationInExternalPublicDir) });
|
|
17951
17959
|
console.debug('[platform] Downloading, using request: ' + JSON.stringify(request));
|
|
17952
17960
|
// Start download
|
|
17953
17961
|
location$ = rxjs.from(this.downloader.download(request));
|
|
@@ -17960,9 +17968,15 @@
|
|
|
17960
17968
|
_this._downloadingJobs.delete(request.uri);
|
|
17961
17969
|
return location;
|
|
17962
17970
|
}), operators.catchError(function (err) {
|
|
17971
|
+
var _a;
|
|
17963
17972
|
console.error('[platform] Unable to download: ' + (err && err.message || err));
|
|
17964
17973
|
// Forget the request
|
|
17965
17974
|
_this._downloadingJobs.delete(request.uri);
|
|
17975
|
+
// Retry with another location - issue in older Android version
|
|
17976
|
+
if (((_a = request.destinationInExternalPublicDir) === null || _a === void 0 ? void 0 : _a.dirType) === AndroidOsEnvironment.DIRECTORY_DOWNLOADS) {
|
|
17977
|
+
request.destinationInExternalPublicDir.dirType = AndroidOsEnvironment.DIRECTORY_DOWNLOADS_OLD;
|
|
17978
|
+
return _this.download(request);
|
|
17979
|
+
}
|
|
17966
17980
|
throw err;
|
|
17967
17981
|
}));
|
|
17968
17982
|
}
|
|
@@ -28345,7 +28359,10 @@
|
|
|
28345
28359
|
}
|
|
28346
28360
|
};
|
|
28347
28361
|
AppEntityEditor.prototype.setError = function (err, opts) {
|
|
28348
|
-
if (!err
|
|
28362
|
+
if (!err) {
|
|
28363
|
+
this.error = undefined;
|
|
28364
|
+
}
|
|
28365
|
+
else if (typeof err === 'string') {
|
|
28349
28366
|
console.error('[entity-editor] Error: ' + (err || ''));
|
|
28350
28367
|
this.error = err;
|
|
28351
28368
|
}
|
|
@@ -31223,6 +31240,7 @@
|
|
|
31223
31240
|
exports.AdminModule = AdminModule;
|
|
31224
31241
|
exports.AdminRoutingModule = AdminRoutingModule;
|
|
31225
31242
|
exports.Alerts = Alerts;
|
|
31243
|
+
exports.AndroidOsEnvironment = AndroidOsEnvironment;
|
|
31226
31244
|
exports.AppEditor = AppEditor;
|
|
31227
31245
|
exports.AppEditorOptions = AppEditorOptions;
|
|
31228
31246
|
exports.AppEntityEditor = AppEntityEditor;
|