From eb091809f33b2d2826378c21f669a50e2631826b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Pailharey?= <rpailharey@grandlyon.com> Date: Mon, 11 Sep 2023 15:36:59 +0200 Subject: [PATCH] publish: Merge branch 'placeholder-consumption-bars' into 'dev' generated from commit 45f4ab8912d382b6a86eb47c3e2ab0f8c273b259 --- ...7f6a.js => ecolyo.8c887e1b5a6784f21688.js} | 73 ++++++++++--------- index.html | 2 +- 2 files changed, 40 insertions(+), 35 deletions(-) rename app/{ecolyo.c43e0b3052afb2ec7f6a.js => ecolyo.8c887e1b5a6784f21688.js} (99%) diff --git a/app/ecolyo.c43e0b3052afb2ec7f6a.js b/app/ecolyo.8c887e1b5a6784f21688.js similarity index 99% rename from app/ecolyo.c43e0b3052afb2ec7f6a.js rename to app/ecolyo.8c887e1b5a6784f21688.js index 8b8c76fb5..709c5a3c9 100644 --- a/app/ecolyo.c43e0b3052afb2ec7f6a.js +++ b/app/ecolyo.8c887e1b5a6784f21688.js @@ -39251,7 +39251,7 @@ var InitializationService = /*#__PURE__*/function () { key: "initFluidPrices", value: function () { var _initFluidPrices = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(client) { - var startTime, fpService, loadedPrices, fluidTypes, allPrices, env, remoteUrl, _i, _fluidTypes, fluid, prices, _i2, _allPrices, price, triggerQuery, _yield$client$query, _yield$client$query$d, trigger, errorMessage; + var startTime, fpService, loadedPrices, fluidTypes, allPrices, env, remoteUrl, _i, _fluidTypes, fluid, prices, _i2, _allPrices, price, errorMessage, triggerQuery, _yield$client$query, _yield$client$query$d, trigger; return _regenerator.default.wrap(function _callee4$(_context4) { while (1) { @@ -39267,69 +39267,85 @@ var InitializationService = /*#__PURE__*/function () { loadedPrices = _context4.sent; if (!(loadedPrices !== null && loadedPrices !== void 0 && loadedPrices.length)) { - _context4.next = 10; + _context4.next = 9; break; } (0, _duration.logDuration)('[Initialization] FluidPrices db already created', startTime); - return _context4.abrupt("return", true); + _context4.next = 42; + break; - case 10: - _context4.prev = 10; + case 9: + _context4.prev = 9; fluidTypes = [_enums.FluidType.ELECTRICITY, _enums.FluidType.WATER, _enums.FluidType.GAS]; allPrices = []; env = new _environment.default(); remoteUrl = env.isProduction() ? _doctypes.REMOTE_ORG_ECOLYO_AGENT_PRICES : _doctypes.REMOTE_ORG_ECOLYO_AGENT_PRICES_REC; _i = 0, _fluidTypes = fluidTypes; - case 16: + case 15: if (!(_i < _fluidTypes.length)) { - _context4.next = 25; + _context4.next = 24; break; } fluid = _fluidTypes[_i]; - _context4.next = 20; + _context4.next = 19; return this._client.getStackClient().fetchJSON('GET', "".concat(remoteUrl, "?fluidtype=").concat(fluid)); - case 20: + case 19: prices = _context4.sent; allPrices.push.apply(allPrices, (0, _toConsumableArray2.default)(prices)); - case 22: + case 21: _i++; - _context4.next = 16; + _context4.next = 15; break; - case 25: + case 24: _i2 = 0, _allPrices = allPrices; - case 26: + case 25: if (!(_i2 < _allPrices.length)) { - _context4.next = 33; + _context4.next = 32; break; } price = _allPrices[_i2]; - _context4.next = 30; + _context4.next = 29; return fpService.createPrice(price); - case 30: + case 29: _i2++; - _context4.next = 26; + _context4.next = 25; break; - case 33: - (0, _duration.logDuration)('[Initialization] FluidPrices db created', startTime); // Launching fluidPrices service to apply new price to latest data + case 32: + (0, _duration.logDuration)('[Initialization] FluidPrices db created', startTime); + _context4.next = 42; + break; + + case 35: + _context4.prev = 35; + _context4.t0 = _context4["catch"](9); + errorMessage = "Initialization error - initFluidPrices: ".concat(JSON.stringify(_context4.t0)); + logStack('error', errorMessage); + + _logger.default.error(errorMessage); + + Sentry.captureException(errorMessage); + return _context4.abrupt("return", false); + case 42: + // Launching fluidPrices service to apply new price to latest data (0, _duration.logDuration)('[Initialization] Launching fluidPrices service pouet', startTime); triggerQuery = (0, _cozyClient.Q)('io.cozy.triggers').where({ 'message.name': 'fluidsPrices' }); - _context4.next = 38; + _context4.next = 46; return client.query(triggerQuery); - case 38: + case 46: _yield$client$query = _context4.sent; _yield$client$query$d = (0, _slicedToArray2.default)(_yield$client$query.data, 1); trigger = _yield$client$query$d[0]; @@ -39343,23 +39359,12 @@ var InitializationService = /*#__PURE__*/function () { return _context4.abrupt("return", true); - case 45: - _context4.prev = 45; - _context4.t0 = _context4["catch"](10); - errorMessage = "Initialization error - initFluidPrices: ".concat(JSON.stringify(_context4.t0)); - logStack('error', errorMessage); - - _logger.default.error(errorMessage); - - Sentry.captureException(errorMessage); - return _context4.abrupt("return", false); - - case 52: + case 51: case "end": return _context4.stop(); } } - }, _callee4, this, [[10, 45]]); + }, _callee4, this, [[9, 35]]); })); function initFluidPrices(_x) { diff --git a/index.html b/index.html index 9fbf09d05..05f719cc8 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.dba9a33a322e0a4bb98e.js"></script><script src="app/ecolyo.c43e0b3052afb2ec7f6a.js"></script></div></body></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.dba9a33a322e0a4bb98e.js"></script><script src="app/ecolyo.8c887e1b5a6784f21688.js"></script></div></body></html> \ No newline at end of file -- GitLab