From cfbd29927708b8e00a27ffd9e504dd216ae19905 Mon Sep 17 00:00:00 2001 From: Alex Sorafumo Date: Mon, 14 May 2018 09:29:12 +1000 Subject: [PATCH] [Booking UI] Update to the latest version Former-commit-id: 09f8ce617025e08fcaa6de7aa1f4766dcac049b3 --- bookings/3rdpartylicenses.txt | 34 ++++----- bookings/assets/settings.json | 2 +- bookings/index.html | 2 +- ...54c5191d449ff34c1.bundle.js.REMOVED.git-id | 1 + ...6d96f9580484b4b22.bundle.js.REMOVED.git-id | 1 - bookings/ngsw-worker.js | 72 +++++++++++-------- bookings/ngsw.json | 10 +-- bookings/oauth-resp.html | 2 +- .../polyfills.62ff759e7517db1c0938.bundle.js | 1 + .../polyfills.80d207f3a6c753ebf1b1.bundle.js | 1 - 10 files changed, 70 insertions(+), 56 deletions(-) create mode 100644 bookings/main.59d54c5191d449ff34c1.bundle.js.REMOVED.git-id delete mode 100644 bookings/main.b806d96f9580484b4b22.bundle.js.REMOVED.git-id create mode 100644 bookings/polyfills.62ff759e7517db1c0938.bundle.js delete mode 100644 bookings/polyfills.80d207f3a6c753ebf1b1.bundle.js diff --git a/bookings/3rdpartylicenses.txt b/bookings/3rdpartylicenses.txt index 6ebb5c0f7..464cdaa27 100644 --- a/bookings/3rdpartylicenses.txt +++ b/bookings/3rdpartylicenses.txt @@ -1,4 +1,4 @@ -@angular/common@5.2.9 +@angular/core@5.2.10 MIT MIT @@ -49,23 +49,27 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -@angular/platform-browser@5.2.9 +faker@4.1.0 MIT MIT -@angular/router@5.2.9 +@angular/common@5.2.10 MIT MIT -@acaprojects/ngx-composer@0.8.13 +@angular/platform-browser@5.2.10 MIT MIT -faker@4.1.0 +@angular/router@5.2.10 +MIT +MIT + +@acaprojects/ngx-composer@0.8.17 MIT MIT -moment@2.21.0 +moment@2.22.1 MIT Copyright (c) JS Foundation and other contributors @@ -90,27 +94,23 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -@angular/core@5.2.9 -MIT -MIT - -@angular/forms@5.2.9 +@angular/forms@5.2.10 MIT MIT -@acaprojects/ngx-widgets@0.14.24 +@acaprojects/ngx-widgets@0.14.34 MIT MIT -@angular/service-worker@5.2.9 +@angular/service-worker@5.2.10 MIT MIT -@angular/animations@5.2.9 +@angular/animations@5.2.10 MIT MIT -cropperjs@1.3.4 +cropperjs@1.3.5 MIT The MIT License (MIT) @@ -134,7 +134,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -@angular/platform-browser-dynamic@5.2.9 +@angular/platform-browser-dynamic@5.2.10 MIT MIT @@ -218,7 +218,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -core-js@2.5.5 +core-js@2.5.6 MIT Copyright (c) 2014-2018 Denis Pushkarev diff --git a/bookings/assets/settings.json b/bookings/assets/settings.json index 73661e264..d1b76241e 100644 --- a/bookings/assets/settings.json +++ b/bookings/assets/settings.json @@ -1 +1 @@ -{"version":"0.2.0","build":"2018-04-12T06:03:45.018Z","env":"prod","debug":true,"composer":{"domain":"demo.aca.im","route":"/bookings","protocol":"https:","use_domain":true,"local_login":false},"app":{"title":"Booking Panel","name":"Room Booking Panel","description":"ACA Room Booking Panel written with Angular Framework","short_name":"BOOKINGS","code":"BOOK","logo_type":"img","logo":"staff-app-latitude"},"disable":{"user_search":false}} +{"version":"0.9.0","build":"2018-05-13T23:25:54.250Z","env":"prod","debug":true,"composer":{"domain":"demo.aca.im","route":"/bookings","protocol":"https:","use_domain":true,"local_login":false},"app":{"title":"Booking Panel","name":"Room Booking Panel","description":"ACA Room Booking Panel written with Angular Framework","short_name":"BOOKINGS","code":"BOOK","logo_type":"img","logo":"staff-app-latitude"},"disable":{"user_search":false}} diff --git a/bookings/index.html b/bookings/index.html index 562a2e8ed..710f867fc 100644 --- a/bookings/index.html +++ b/bookings/index.html @@ -1 +1 @@ -Booking Panel
\ No newline at end of file +Booking Panel
\ No newline at end of file diff --git a/bookings/main.59d54c5191d449ff34c1.bundle.js.REMOVED.git-id b/bookings/main.59d54c5191d449ff34c1.bundle.js.REMOVED.git-id new file mode 100644 index 000000000..7ab166d30 --- /dev/null +++ b/bookings/main.59d54c5191d449ff34c1.bundle.js.REMOVED.git-id @@ -0,0 +1 @@ +d30cccbcdec81a15be9ebc5d19c2007041d168d4 \ No newline at end of file diff --git a/bookings/main.b806d96f9580484b4b22.bundle.js.REMOVED.git-id b/bookings/main.b806d96f9580484b4b22.bundle.js.REMOVED.git-id deleted file mode 100644 index 46c117932..000000000 --- a/bookings/main.b806d96f9580484b4b22.bundle.js.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a6ba1c06250f2e15c58d6521af1fae2d2c1a1b73 \ No newline at end of file diff --git a/bookings/ngsw-worker.js b/bookings/ngsw-worker.js index 0d2630574..0856cf414 100644 --- a/bookings/ngsw-worker.js +++ b/bookings/ngsw-worker.js @@ -862,24 +862,7 @@ class LruList { return null; } const url = this.state.tail; - // Special case if this is the last node. - if (this.state.head === this.state.tail) { - // When removing the last node, both head and tail pointers become null. - this.state.head = null; - this.state.tail = null; - } - else { - // Normal node removal. All that needs to be done is to clear the next pointer - // of the previous node and make it the new tail. - const block = this.state.map[url]; - const previous = this.state.map[block.previous]; - this.state.tail = previous.url; - previous.next = block.next; - } - // In any case, this URL is no longer tracked, so remove it from the count and the - // map of tracked URLs. - delete this.state.map[url]; - this.state.count--; + this.remove(url); // This URL has been successfully evicted. return url; } @@ -903,6 +886,8 @@ class LruList { const next = this.state.map[node.next]; next.previous = null; this.state.head = next.url; + node.next = null; + delete this.state.map[url]; this.state.count--; return true; } @@ -922,6 +907,9 @@ class LruList { // There is no next node - the accessed node must be the tail. Move the tail pointer. this.state.tail = node.previous; } + node.next = null; + node.previous = null; + delete this.state.map[url]; // Count the removal. this.state.count--; return true; @@ -1687,8 +1675,8 @@ function isMsgActivateUpdate(msg) { const IDLE_THRESHOLD = 5000; const SUPPORTED_CONFIG_VERSION = 1; const NOTIFICATION_OPTION_NAMES = [ - 'actions', 'body', 'dir', 'icon', 'lang', 'renotify', 'requireInteraction', 'tag', 'vibrate', - 'data' + 'actions', 'badge', 'body', 'dir', 'icon', 'lang', 'renotify', 'requireInteraction', 'tag', + 'vibrate', 'data' ]; var DriverReadyState; (function (DriverReadyState) { @@ -1741,6 +1729,11 @@ class Driver { * Whether there is a check for updates currently scheduled due to navigation. */ this.scheduledNavUpdateCheck = false; + /** + * Keep track of whether we have logged an invalid `only-if-cached` request. + * (See `.onFetch()` for details.) + */ + this.loggedInvalidOnlyIfCachedRequest = false; // The install event is triggered when the service worker is first installed. this.scope.addEventListener('install', (event) => { // SW code updates are separate from application updates, so code updates are @@ -1785,12 +1778,12 @@ class Driver { * asynchronous execution that eventually resolves for respondWith() and waitUntil(). */ onFetch(event) { + const req = event.request; // The only thing that is served unconditionally is the debug page. - if (this.adapter.parseUrl(event.request.url, this.scope.registration.scope).path === - '/ngsw/state') { + if (this.adapter.parseUrl(req.url, this.scope.registration.scope).path === '/ngsw/state') { // Allow the debugger to handle the request, but don't affect SW state in any // other way. - event.respondWith(this.debugger.handleFetch(event.request)); + event.respondWith(this.debugger.handleFetch(req)); return; } // If the SW is in a broken state where it's not safe to handle requests at all, @@ -1804,6 +1797,21 @@ class Driver { event.waitUntil(this.idle.trigger()); return; } + // When opening DevTools in Chrome, a request is made for the current URL (and possibly related + // resources, e.g. scripts) with `cache: 'only-if-cached'` and `mode: 'no-cors'`. These request + // will eventually fail, because `only-if-cached` is only allowed to be used with + // `mode: 'same-origin'`. + // This is likely a bug in Chrome DevTools. Avoid handling such requests. + // (See also https://github.com/angular/angular/issues/22362.) + // TODO(gkalpak): Remove once no longer necessary (i.e. fixed in Chrome DevTools). + if (req.cache === 'only-if-cached' && req.mode !== 'same-origin') { + // Log the incident only the first time it happens, to avoid spamming the logs. + if (!this.loggedInvalidOnlyIfCachedRequest) { + this.loggedInvalidOnlyIfCachedRequest = true; + this.debugger.log(`Ignoring invalid request: 'only-if-cached' can be set only with 'same-origin' mode`, `Driver.fetch(${req.url}, cache: ${req.cache}, mode: ${req.mode})`); + } + return; + } // Past this point, the SW commits to handling the request itself. This could still // fail (and result in `state` being set to `SAFE_MODE`), but even in that case the // SW will still deliver a response. @@ -2174,17 +2182,17 @@ class Driver { return this.lookupVersionByHash(this.latestHash, 'assignVersion'); } } - /** - * Retrieve a copy of the latest manifest from the server. - */ - async fetchLatestManifest() { + async fetchLatestManifest(ignoreOfflineError = false) { const res = await this.safeFetch(this.adapter.newRequest('ngsw.json?ngsw-cache-bust=' + Math.random())); if (!res.ok) { if (res.status === 404) { await this.deleteAllCaches(); await this.scope.registration.unregister(); } - throw new Error('Manifest fetch failed!'); + else if (res.status === 504 && ignoreOfflineError) { + return null; + } + throw new Error(`Manifest fetch failed! (status: ${res.status})`); } this.lastUpdateCheck = this.adapter.time; return res.json(); @@ -2281,7 +2289,13 @@ class Driver { async checkForUpdate() { let hash = '(unknown)'; try { - const manifest = await this.fetchLatestManifest(); + const manifest = await this.fetchLatestManifest(true); + if (manifest === null) { + // Client or server offline. Unable to check for updates at this time. + // Continue to service clients (existing and new). + this.debugger.log('Check for update aborted. (Client or server offline.)'); + return false; + } hash = hashManifest(manifest); // Check whether this is really an update. if (this.versions.has(hash)) { diff --git a/bookings/ngsw.json b/bookings/ngsw.json index c1e2e15ec..f1894a3aa 100644 --- a/bookings/ngsw.json +++ b/bookings/ngsw.json @@ -10,8 +10,8 @@ "/bookings/favicon.ico", "/bookings/index.html", "/bookings/inline.318b50c57b4eba3d437b.bundle.js", - "/bookings/main.b806d96f9580484b4b22.bundle.js", - "/bookings/polyfills.80d207f3a6c753ebf1b1.bundle.js", + "/bookings/main.59d54c5191d449ff34c1.bundle.js", + "/bookings/polyfills.62ff759e7517db1c0938.bundle.js", "/bookings/styles.f8b6e07b67a7afb58ea6.bundle.css" ], "patterns": [] @@ -61,10 +61,10 @@ ], "hashTable": { "/bookings/inline.318b50c57b4eba3d437b.bundle.js": "998c6060446975e566fd17509558ddc68d72eec3", - "/bookings/main.b806d96f9580484b4b22.bundle.js": "3c758220506e8a388a13ad71fecc1cf16254d7f4", - "/bookings/polyfills.80d207f3a6c753ebf1b1.bundle.js": "1efb43b628f58146c7d7c98e11c9b496244802da", + "/bookings/main.59d54c5191d449ff34c1.bundle.js": "59f939d31644219fe27dd61c33fb7026f9751e3d", + "/bookings/polyfills.62ff759e7517db1c0938.bundle.js": "12c1dead6505867b7219c4eb6ef8ecc0e5ca51be", "/bookings/styles.f8b6e07b67a7afb58ea6.bundle.css": "d7eeff26b814be04503b77a2608a0f7f059a62cc", "/bookings/favicon.ico": "5459953711ed224a36cb49b93710b540ee18a79e", - "/bookings/index.html": "94a221ce7aad6b0a46602933bd47fb5bb05e73d3" + "/bookings/index.html": "2426efa82955195e80e7b7a3938271243fc20898" } } \ No newline at end of file diff --git a/bookings/oauth-resp.html b/bookings/oauth-resp.html index c05c18d68..ee55b5575 100644 --- a/bookings/oauth-resp.html +++ b/bookings/oauth-resp.html @@ -47,7 +47,7 @@ console.log(oauth_data); if(oauth_data){ for(var i = 0; i < oauth_data.length; i++) { - let parts = oauth_data[i].split('='); + var parts = oauth_data[i].split('='); if(parts.length > 1){ oauth_resp[parts[0]] = parts[1]; } diff --git a/bookings/polyfills.62ff759e7517db1c0938.bundle.js b/bookings/polyfills.62ff759e7517db1c0938.bundle.js new file mode 100644 index 000000000..92cf8ac36 --- /dev/null +++ b/bookings/polyfills.62ff759e7517db1c0938.bundle.js @@ -0,0 +1 @@ +webpackJsonp([1],{"/whu":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"0Rih":function(t,e,n){"use strict";var r=n("OzIq"),o=n("Ds5P"),i=n("R3AP"),a=n("A16L"),u=n("1aA0"),c=n("vmSO"),s=n("9GpA"),l=n("UKM+"),f=n("zgIt"),p=n("qkyc"),h=n("yYvK"),v=n("kic5");t.exports=function(t,e,n,d,g,y){var k=r[t],_=k,m=g?"set":"add",b=_&&_.prototype,w={},T=function(t){var e=b[t];i(b,t,"delete"==t?function(t){return!(y&&!l(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!l(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof _&&(y||b.forEach&&!f(function(){(new _).entries().next()}))){var E=new _,O=E[m](y?{}:-0,1)!=E,S=f(function(){E.has(1)}),D=p(function(t){new _(t)}),x=!y&&f(function(){for(var t=new _,e=5;e--;)t[m](e,e);return!t.has(-0)});D||((_=e(function(e,n){s(e,_,t);var r=v(new k,e,_);return void 0!=n&&c(n,g,r[m],r),r})).prototype=b,b.constructor=_),(S||x)&&(T("delete"),T("has"),g&&T("get")),(x||O)&&T(m),y&&b.clear&&delete b.clear}else _=d.getConstructor(e,t,g,m),a(_.prototype,n),u.NEED=!0;return h(_,t),w[t]=_,o(o.G+o.W+o.F*(_!=k),w),y||d.setStrong(_,t,g),_}},1:function(t,e,n){t.exports=n("XS25")},"1aA0":function(t,e,n){var r=n("ulTY")("meta"),o=n("UKM+"),i=n("WBcL"),a=n("lDLk").f,u=0,c=Object.isExtensible||function(){return!0},s=!n("zgIt")(function(){return c(Object.preventExtensions({}))}),l=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},f=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[r].w},onFreeze:function(t){return s&&f.NEED&&c(t)&&!i(t,r)&&l(t),t}}},"2p1q":function(t,e,n){var r=n("lDLk"),o=n("fU25");t.exports=n("bUqO")?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},"3q4u":function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=r.key,a=r.map,u=r.store;r.exp({deleteMetadata:function(t,e){var n=arguments.length<3?void 0:i(arguments[2]),r=a(o(e),n,!1);if(void 0===r||!r.delete(t))return!1;if(r.size)return!0;var c=u.get(e);return c.delete(n),!!c.size||u.delete(e)}})},"7gX0":function(t,e){var n=t.exports={version:"2.5.6"};"number"==typeof __e&&(__e=n)},"7ylX":function(t,e,n){var r=n("DIVP"),o=n("twxM"),i=n("QKXm"),a=n("mZON")("IE_PROTO"),u=function(){},c=function(){var t,e=n("jhxf")("iframe"),r=i.length;for(e.style.display="none",n("d075").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("