cignium-hypermedia-client
Advanced tools
Comparing version 1.32.0 to 1.32.1
@@ -76,3 +76,3 @@ { | ||
}, | ||
"version": "1.32.0" | ||
"version": "1.32.1" | ||
} |
@@ -5,3 +5,3 @@ # Cignium Hypermedia Client | ||
[![Build Status](https://travis-ci.org/cignium/hypermedia-client.svg)](https://travis-ci.org/cignium/hypermedia-client) [![npm](https://img.shields.io/npm/v/cignium-hypermedia-client.svg)](https://www.npmjs.com/package/cignium-hypermedia-client) | ||
[![Build Status](https://travis-ci.org/cignium/hypermedia-client.svg)](https://travis-ci.org/cignium/hypermedia-client) [![npm](https://img.shields.io/npm/v/cignium-hypermedia-client.svg)](https://www.npmjs.com/package/cignium-hypermedia-client) <img src='https://www.browserstack.com/automate/badge.svg?badge_key=TWQ1cDZwTFFncHRkdnQ5Yzk3MmxPS1hONlZQdDMza0tWdEJJVG9qSm9tMD0tLS8yamd3cTZibE9vazZka3dhZ0VHeUE9PQ==--9c0df343ec64c0f3041d2ff154d576e90348439c'/> | ||
@@ -188,2 +188,8 @@ ## Install | ||
## UI Testing | ||
<a href='https://www.browserstack.com/'><img src='https://az827402.vo.msecnd.net/assets/browserstack-logo.svg' width=400 /></a> | ||
We are using the awesome service <a href='https://www.browserstack.com/'>Browserstack</a> to ensure we keep a high quality and to minimize the risk of breaking existing behavior for our users. Please check them out! | ||
## Contributing | ||
@@ -190,0 +196,0 @@ |
@@ -5,2 +5,7 @@ import { request } from './http' | ||
const keys = { | ||
current: 'current', | ||
sitemap: 'sitemap', | ||
} | ||
function getAllLeafProperties(data) { | ||
@@ -47,3 +52,3 @@ const properties = [] | ||
else { | ||
state.get().requests.remove('current') | ||
state.get().requests.remove(keys.current) | ||
} | ||
@@ -72,4 +77,6 @@ } | ||
async loadSitemap(resource) { | ||
async updateResourceSitemap(resource) { | ||
if (!resource.links.sitemap) { | ||
this.state.get().resources.remove(keys.sitemap) | ||
return | ||
@@ -84,3 +91,3 @@ } | ||
method: 'get', | ||
resourceKey: 'sitemap', | ||
resourceKey: keys.sitemap, | ||
}) | ||
@@ -94,3 +101,3 @@ | ||
method: 'get', | ||
resourceKey: 'sitemap', | ||
resourceKey: keys.sitemap, | ||
}) | ||
@@ -117,4 +124,7 @@ } | ||
this.draft.reload(href, resource) | ||
await this.loadSitemap(resource) | ||
if (resourceKey != keys.sitemap) { | ||
await this.updateResourceSitemap(resource) | ||
} | ||
this.state.get().resources.set(resource.links.self.href, resource) | ||
@@ -146,3 +156,3 @@ | ||
if (request) { | ||
this.state.get().requests.set('current', request.id) | ||
this.state.get().requests.set(keys.current, request.id) | ||
this.processRequest(request) | ||
@@ -159,3 +169,3 @@ } | ||
executeAction(href) { | ||
this.requestResource({ href, method: 'post', resourceKey: 'current' }) | ||
this.requestResource({ href, method: 'post', resourceKey: keys.current }) | ||
} | ||
@@ -165,7 +175,7 @@ | ||
if (href === null) { | ||
this.state.get().resources.set('current', null) | ||
this.state.get().resources.set(keys.current, null) | ||
return | ||
} | ||
this.requestResource({ href, method: 'get', resourceKey: 'current' }) | ||
this.requestResource({ href, method: 'get', resourceKey: keys.current }) | ||
} | ||
@@ -180,3 +190,3 @@ | ||
method: 'post', | ||
resourceKey: 'current', | ||
resourceKey: keys.current, | ||
}) | ||
@@ -183,0 +193,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
29298333
101
6337
200