Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This project is intended to be integrated as a bundle to the installation of your map.apps manager.

## Installation Guide
**Requirement: map.apps 4.14**
**Requirement: map.apps 4.17**

Before you add the Bundle to your manager, please configure the user and the topic property in the manifest.json to point to your GitHub account. Topic can be left empty.
You will have to add a released bundle.jar/zip as a bundle in your map.apps manager.
Expand Down
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
✅ Tested for map.apps 4.20.0 / Linie 4
✅ Tested for map.apps 4.18.3 / Linie 4

#### Release Notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
* limitations under the License.
*/
import Hash from "ct/Hash";
import apprt_request from "apprt-request";
import { apprtFetch, apprtFetchJson } from "apprt-fetch";
import { replace } from "apprt-core/string-replace";
import { sourceId } from "source-info!";
import { loggerForName } from "apprt-core/Logger";
const LOG = loggerForName(sourceId);

export default class BundleDetailsController {
// injected
Expand Down Expand Up @@ -117,8 +120,10 @@ export default class BundleDetailsController {
async _lookupAvailableTags(repositoryName) {
const tagsUrl = "https://api.github.com/repos/conterra/" + repositoryName + "/releases";
try {
const response = await apprt_request(tagsUrl, { jsonp: true });
const releases = response.data.filter((release) => !release.name.includes("SNAPSHOT"));
const data = await apprtFetchJson(tagsUrl, {
proxyMode: "force-off"
});
const releases = data.filter((release) => !release.name.includes("SNAPSHOT"));
releases.sort((a, b) =>
b.name.replace(/\d+/g, (n) => +n + 100000).localeCompare(a.name.replace(/\d+/g, (n) => +n + 100000))
);
Expand Down Expand Up @@ -191,10 +196,10 @@ export default class BundleDetailsController {
}
}

_downloadArchive(url) {
return apprt_request(url, {
handleAs: "blob"
});
async _downloadArchive(url) {
// Currently throws a CORS error (from GitHub) and then uses the map.apps proxy.
const response = await apprtFetch(url, { checkStatus: true });
return await response.blob();
}

async _uploadBundle(blob, itemName) {
Expand All @@ -205,8 +210,11 @@ export default class BundleDetailsController {
formData.append("file", blob, fileName);
formData.append("f", "json");
try {
await apprt_request.post(url, {
data: formData
await apprtFetch(url, {
method: "POST",
body: formData,
checkStatus: true,
proxyMode: "force-off"
});
this.buttonWidget.set("disabled", false);
this.buttonWidget.set("iconClass", "icon-sign-success");
Expand All @@ -216,6 +224,7 @@ export default class BundleDetailsController {
this.detailWindow.close();
}, 1500);
} catch (e) {
LOG.error("Failed to upload bundle", e);
this.detailWindow.set("content", this.i18n.integrationFailed);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/js/bundles/mapapps-github-manager/BundleStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import { AsyncInMemoryStore } from "store-api/InMemoryStore";
import TypeFormat from "ct/util/TypeFormat";
import apprt_request from "apprt-request";
import { apprtFetchJson } from "apprt-fetch";
import stringEscape from "apprt-core/string-escape";

export default class BundleStoreFactory {
Expand Down Expand Up @@ -49,8 +49,8 @@ async function fetchBundlesFromGitHub(target, user, topic) {
}
url = url + "&per_page=100";
try {
const data = await apprt_request(url, {
useProxy: false,
const data = await apprtFetchJson(url, {
proxyMode: "force-off",
headers: {
Accept: "application/vnd.github.mercy-preview+json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
class="hidden-xs-and-down"
>
<v-img
:src="bundle.html_url + '/raw/' + bundle.default_branch + '/' + 'screenshot.JPG'"
:src="bundle.html_url + '/raw/' + bundle.default_branch + '/' + 'screenshot.png'"
height="250px"
@click="openLink(bundle.html_url
+ '/raw/' + bundle.default_branch + '/' + 'screenshot.JPG')"
+ '/raw/' + bundle.default_branch + '/' + 'screenshot.png')"
/>
</v-flex>
</v-layout>
Expand Down
17 changes: 13 additions & 4 deletions src/main/js/bundles/mapapps-github-manager/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dataform": "^4.17.0",
"dataview": "^4.17.0",
"apprt-vue": "^4.17.0",
"apprt-request": "^4.17.0",
"apprt-fetch": "^4.17.0",
"apprt-core": "^4.17.0",
"apprt-vuetify": "^4.17.0",
"store-api": "^4.17.0"
Expand Down Expand Up @@ -111,7 +111,10 @@
{
"name": "GithubBundlesDataView",
"impl": "dataview/DataView",
"provides": ["dijit.Widget", "mapapps-github-manager.GithubBundlesDataView"],
"provides": [
"dijit.Widget",
"mapapps-github-manager.GithubBundlesDataView"
],
"propertiesConstructor": true,
"properties": {
"id": "githubBundlesDataView",
Expand Down Expand Up @@ -181,7 +184,10 @@
{
"name": "BundlesDataViewController",
"impl": "dataview/DataViewController",
"provides": ["ct.framework.api.EventHandler", "mapapps-github-manager.BundlesDataViewController"],
"provides": [
"ct.framework.api.EventHandler",
"mapapps-github-manager.BundlesDataViewController"
],
"properties": {
"Event-Topics": [
{
Expand Down Expand Up @@ -217,7 +223,10 @@
},
{
"name": "BundleDetailsController",
"provides": ["ct.framework.api.EventHandler", "mapapps-github-manager.BundleDetailsController"],
"provides": [
"ct.framework.api.EventHandler",
"mapapps-github-manager.BundleDetailsController"
],
"properties": {
"uploadTarget": "@@applicationURL.noscheme@@/resources/jsregistry/upload",
"Event-Topics": [
Expand Down
Loading