From de62ba69408b6ac08c68807ccccc846deb8802e5 Mon Sep 17 00:00:00 2001 From: Bastian Weltjen Date: Wed, 27 Apr 2022 15:22:17 +0200 Subject: [PATCH 01/10] fix(data consumption): remove route selection for subscription --- .../dataconsumption/IDSDataConsumptionPage.js | 14 +------------- .../artifactdialog/ArtifactDialog.html | 10 ---------- .../artifactdialog/ArtifactDialog.js | 16 ++++++---------- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js b/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js index f82a5a6f..3eee9756 100644 --- a/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js +++ b/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js @@ -306,19 +306,7 @@ export default { }, async requestArtifact(item) { - let configuration = await dataUtils.getConnectorConfiguration(); - let subscriptionLocations = []; - subscriptionLocations.push({ - display: configuration.endpoint, - value: configuration.endpoint - }); - for (let route of this.$data.routes) { - subscriptionLocations.push({ - display: route.description, - value: route.selfLink - }); - } - this.$refs.artifactDialog.show(this.$data.selectedResource["ids:contractOffer"][0]["ids:permission"], this.$data.selectedResource["ids:standardLicense"]["@id"], item, subscriptionLocations, this.clickAcceptContract); + this.$refs.artifactDialog.show(this.$data.selectedResource["ids:contractOffer"][0]["ids:permission"], this.$data.selectedResource["ids:standardLicense"]["@id"], item, this.clickAcceptContract); }, clickAcceptContract(artifact, subscribe, subscriptionLocation) { diff --git a/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.html b/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.html index d0eda070..ccd08f88 100644 --- a/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.html +++ b/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.html @@ -12,16 +12,6 @@

Rules:

License:

{{ license }} - - - - - - - - diff --git a/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.js b/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.js index 4eb0febd..f731ae2a 100644 --- a/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.js +++ b/src/pages/dataconsumption/dataconsumption/artifactdialog/ArtifactDialog.js @@ -1,4 +1,5 @@ import PolicyLine from "@/components/policy/PolicyLine.vue"; +import dataUtils from "@/utils/dataUtils"; export default { components: { @@ -11,28 +12,23 @@ export default { license: "", artifact: null, callback: null, - subscribe: false, - subscriptionLocations: [], - subscriptionLocation: null + subscribe: false }; }, mounted: function () { }, methods: { - show(rules, license, artifact, subscriptionLocations, callback) { + show(rules, license, artifact, callback) { this.$data.rules = rules; this.$data.license = license; this.$data.artifact = artifact; this.$data.subscribe = false; - this.$data.subscriptionLocations = subscriptionLocations; - if (subscriptionLocations !== undefined && subscriptionLocations != null && subscriptionLocations.length > 0) { - this.$data.subscriptionLocation = subscriptionLocations[0].value; - } this.$data.callback = callback; this.$data.dialog = true; }, - clickAcceptContract() { + async clickAcceptContract() { this.$data.dialog = false; - this.$data.callback(this.$data.artifact, this.$data.subscribe, this.$data.subscriptionLocation); + let configuration = await dataUtils.getConnectorConfiguration(); + this.$data.callback(this.$data.artifact, this.$data.subscribe, configuration.endpoint); } } }; From 1fd620069d6c555891064a6c12ed039b10821590 Mon Sep 17 00:00:00 2001 From: Bastian Weltjen Date: Thu, 28 Apr 2022 11:47:27 +0200 Subject: [PATCH 02/10] docs: README: test backend --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 63915071..9e2424c9 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ let connectorUrl = "https://localhost:8080" You can change the main colors of the user interface in `src/theme/default.js` +### Test backend + +The UI backend provides an endpoint (http://[localhost:8083]/testdata) that can be used as backend connection (type: REST) in the DSC for testing purposes. +This can process POST and GET requests. + ## Start with Docker Build docker image: From d6da4ca622b8b157e2fbef1591c9b82d6911485e Mon Sep 17 00:00:00 2001 From: Bastian Weltjen Date: Thu, 28 Apr 2022 11:49:17 +0200 Subject: [PATCH 03/10] fix: breadcrumbs: remove null links --- src/routes/routes.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/routes/routes.js b/src/routes/routes.js index 8712c0cb..bd0ad710 100644 --- a/src/routes/routes.js +++ b/src/routes/routes.js @@ -19,10 +19,13 @@ function getRoutes() { function generateRoutes(pageStructure, routes, currentBreadcrumb, parent) { for (let page of pageStructure) { - currentBreadcrumb.push({ - text: PageStructure.getDisplayName(page.name), - href: page.path - }); + let breadCrumb = { + text: PageStructure.getDisplayName(page.name) + }; + if (page.path != null) { + breadCrumb.href = "#/" + page.path + } + currentBreadcrumb.push(breadCrumb); if (page.path != null) { routes.push({ path: page.path, From b3188f8ad33cfec75e5a416773b82b13a80be924 Mon Sep 17 00:00:00 2001 From: Bastian Weltjen Date: Fri, 29 Apr 2022 17:29:33 +0200 Subject: [PATCH 04/10] fix: docker image with nonroot user docs: changelog & version --- CHANGELOG.md | 9 +++++++++ Dockerfile | 2 ++ package.json | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aa367d4..c9fedaf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. (Skipped major version 1, 2 and 3 to match versioning of IDS DataSpaceConnector) +## [9.3.0] - XXXX-XX-XX (compatible with DSC 7.0.0) + +### Added +- + +### Fixes +- Removed route selection for IDS subscription +- Breadcrumbs: remove null links + ## [9.2.0] - 2022-04-08 (compatible with DSC 7.0.0) ### Added diff --git a/Dockerfile b/Dockerfile index 00fbc183..4914d4f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,6 @@ RUN npm run-script build RUN npm prune --production RUN rm -r .git RUN sed -i "s@http://localhost:8083@@g" dist/js/*.js +RUN groupadd -r nonroot && useradd -r -g nonroot nonroot +USER nonroot ENTRYPOINT ["./entryPoint.sh"] diff --git a/package.json b/package.json index f4bbc6a0..28ef94ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dataspaceconnector-ui", - "version": "9.2.0", + "version": "9.3.0", "private": true, "scripts": { "serve": "vue-cli-service serve --open --port 8082", From 6502fa3113581d4d08c37ba0c43cce7c96c4731a Mon Sep 17 00:00:00 2001 From: Bastian Weltjen Date: Mon, 2 May 2022 14:02:14 +0200 Subject: [PATCH 05/10] feat: add IDS subscription to requested resource --- src/components/infobox/InfoBox.html | 13 ++++ src/pages/PageStructure.js | 9 ++- .../dataconsumption/IDSDataConsumptionPage.js | 3 +- .../IDSResourcesPageConsumption.html | 8 ++ .../resources/IDSResourcesPageConsumption.js | 5 +- .../subscribe/SubscribeResourcePage.css | 13 ++++ .../subscribe/SubscribeResourcePage.html | 48 ++++++++++++ .../subscribe/SubscribeResourcePage.js | 76 +++++++++++++++++++ .../subscribe/SubscribeResourcePage.vue | 3 + src/utils/dataUtils.js | 11 +-- 10 files changed, 181 insertions(+), 8 deletions(-) create mode 100644 src/pages/subscriptions/subscribe/SubscribeResourcePage.css create mode 100644 src/pages/subscriptions/subscribe/SubscribeResourcePage.html create mode 100644 src/pages/subscriptions/subscribe/SubscribeResourcePage.js create mode 100644 src/pages/subscriptions/subscribe/SubscribeResourcePage.vue diff --git a/src/components/infobox/InfoBox.html b/src/components/infobox/InfoBox.html index bee6873d..25ea6c2d 100644 --- a/src/components/infobox/InfoBox.html +++ b/src/components/infobox/InfoBox.html @@ -138,4 +138,17 @@ Running apps cannot be deleted and must be stopped first. + + + Overview of all currently active subscriptions. +
+
+ Subscriptions can be deleted. +
+
+ + + Subscribe to resources as IDS or non-IDS system + + \ No newline at end of file diff --git a/src/pages/PageStructure.js b/src/pages/PageStructure.js index ba3c9920..77233371 100644 --- a/src/pages/PageStructure.js +++ b/src/pages/PageStructure.js @@ -12,6 +12,7 @@ import InstallAppsPage from "@/pages/appstores/installapps/InstallAppsPage.vue"; import SettingsPage from "@/pages/settings/SettingsPage.vue"; import BackendConnectionsPage from "@/pages/backendconnections/BackendConnectionsPage.vue"; import SubscriptionsPage from "@/pages/subscriptions/SubscriptionsPage.vue"; +import SubscribeResourcePage from "@/pages/subscriptions/subscribe/SubscribeResourcePage.vue"; import ResourceCatalogsPage from "@/pages/dataoffering/resources/addresource/catalog/ResourceCatalogsPage.vue"; export default { @@ -104,7 +105,13 @@ export default { path: "subscriptions", name: "Subscriptions", icon: "mdi-rss", - component: SubscriptionsPage + component: SubscriptionsPage, + subpages: [{ + path: "subscriberesource", + name: "Subscribe Resource", + component: SubscribeResourcePage, + showInMenu: false + }] }, { path: "brokers", name: "Brokers", diff --git a/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js b/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js index 3eee9756..242b7c75 100644 --- a/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js +++ b/src/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.js @@ -183,6 +183,7 @@ export default { }, async requestSearchResult(item) { this.$root.$emit('showBusyIndicator', true); + console.trace(); this.$data.recipientId = item.accessUrl; await this.receiveCatalogs(); let filterdResources = []; @@ -254,7 +255,7 @@ export default { async subscribeToResource(subscriptionLocation) { try { - this.$data.subscribeToResourceResponse = await dataUtils.subscribeToResource(this.$data.recipientId, this.$data.selectedResource["@id"], subscriptionLocation); + this.$data.subscribeToResourceResponse = await dataUtils.subscribeToResource(this.$data.recipientId, this.$data.selectedResource["@id"], subscriptionLocation, true); } catch (error) { errorUtils.showError(error, "subscribe to Resource"); } diff --git a/src/pages/dataconsumption/resources/IDSResourcesPageConsumption.html b/src/pages/dataconsumption/resources/IDSResourcesPageConsumption.html index 08697b6d..b705cdb1 100644 --- a/src/pages/dataconsumption/resources/IDSResourcesPageConsumption.html +++ b/src/pages/dataconsumption/resources/IDSResourcesPageConsumption.html @@ -21,6 +21,14 @@ Show details + + + Subscribe +