Skip to content

Commit

Permalink
Merge pull request #140 from International-Data-Spaces-Association/de…
Browse files Browse the repository at this point in the history
…velop

Version 9.3.0
  • Loading branch information
BastianWel authored May 4, 2022
2 parents 524bc3e + e062262 commit 9e88926
Show file tree
Hide file tree
Showing 21 changed files with 316 additions and 64 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
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] - 2022-05-04 (compatible with DSC 7.x)

### Added
- Add IDS/Non-IDS subscription to requested resource
- Delete associated routes of generic endpoint on delete
- Keystore/Truststore alias on settings page

### Fixes
- Removed route selection for IDS subscription
- Breadcrumbs: remove null links
- Docker Image with Non-Root-User
- Delete representation & artifact when requested resource is deleted

## [9.2.0] - 2022-04-08 (compatible with DSC 7.0.0)

### Added
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 13 additions & 0 deletions src/components/infobox/InfoBox.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,17 @@
Running apps cannot be deleted and must be stopped first.
</v-card-text>
</v-card-text>
<v-card-text v-if="currentRoute == 'subscriptions'">
<v-card-text>
Overview of all currently active subscriptions.
<br>
<br>
Subscriptions can be deleted.
</v-card-text>
</v-card-text>
<v-card-text v-if="currentRoute == 'subscriberesource'">
<v-card-text>
Subscribe to resources as IDS or non-IDS system
</v-card-text>
</v-card-text>
</v-card>
20 changes: 17 additions & 3 deletions src/datamodel/clientDataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {

createConnectorConfig(id, title, description, endpoint, version, curator, maintainer, inboundModelVersion, outboundModelVersion,
useProxy, proxyUrl, proxyUsername, proxyPassword, noProxyArray, logLevel, connectorStatus, connectorDeployMode, trustStoreUrl, trustStorePassword,
keyStoreUrl, keyStorePassword) {
trustStoreAlias, keyStoreUrl, keyStorePassword, keyStoreAlias) {
let configuration = {};
if (id === undefined) {
configuration.id = "";
Expand Down Expand Up @@ -216,6 +216,11 @@ export default {
} else {
configuration.trustStorePassword = trustStorePassword;
}
if (trustStoreAlias === undefined) {
configuration.trustStoreAlias = "";
} else {
configuration.trustStoreAlias = trustStoreAlias;
}
if (keyStoreUrl === undefined) {
configuration.keyStoreUrl = "";
} else {
Expand All @@ -226,6 +231,11 @@ export default {
} else {
configuration.keyStorePassword = keyStorePassword;
}
if (keyStoreAlias === undefined) {
configuration.keyStoreAlias = "";
} else {
configuration.keyStoreAlias = keyStoreAlias;
}

return configuration;
},
Expand Down Expand Up @@ -379,8 +389,10 @@ export default {
let connectorDeployMode = "";
let trustStoreUrl = "";
let trustStorePassword = "";
let trustStoreAlias = "";
let keyStoreUrl = "";
let keyStorePassword = "";
let keyStoreAlias = "";

if (idsConfiguration !== undefined) {
id = dataUtils.getIdOfConnectorResponse(idsConfiguration);
Expand All @@ -406,11 +418,13 @@ export default {
logLevel = idsConfiguration.logLevel;
connectorDeployMode = idsConfiguration.deployMode;
trustStoreUrl = idsConfiguration.trustStore.location;
trustStoreAlias = idsConfiguration.trustStore.alias;
keyStoreUrl = idsConfiguration.keyStore.location;
keyStoreAlias = idsConfiguration.keyStore.alias;
}

return this.createConnectorConfig(id, title, description, endpoint, version, curator, maintainer, inboundModelVersion, outboundModelVersion,
useProxy, proxyUrl, username, password, noProxyArray, logLevel, connectorStatus, connectorDeployMode, trustStoreUrl, trustStorePassword,
keyStoreUrl, keyStorePassword);
useProxy, proxyUrl, username, password, noProxyArray, logLevel, connectorStatus, connectorDeployMode, trustStoreUrl, trustStorePassword, trustStoreAlias,
keyStoreUrl, keyStorePassword, keyStoreAlias);
}
}
9 changes: 8 additions & 1 deletion src/pages/PageStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/pages/backendconnections/BackendConnectionsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,19 @@ export default {
},
deleteItem(item) {
this.$refs.confirmationDialog.title = "Delete Backend Connection";
this.$refs.confirmationDialog.text = "Are you sure you want to delete the Backend Connection '" + item.url + "'?";
this.$refs.confirmationDialog.text = "Are you sure you want to delete the Backend Connection '" + item.accessUrl + "'?";
this.$refs.confirmationDialog.text2 = "Associated routes will be deleted.";
this.$refs.confirmationDialog.callbackData = {
item: item
};
this.$refs.confirmationDialog.callback = this.deleteCallback;
this.$refs.confirmationDialog.dialog = true;
},
deleteCallback(choice, callbackData) {
async deleteCallback(choice, callbackData) {
if (choice == "yes") {
this.$root.$emit('showBusyIndicator', true);
this.deleteBackendConnection(callbackData.item.id, callbackData.item.dataSource.id);
await dataUtils.deleteAllRoutesOfGenericEndpoint(callbackData.item.id);
await this.deleteBackendConnection(callbackData.item.id, callbackData.item.dataSource.id);
}
},
async deleteBackendConnection(id, dataSourceId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -306,19 +307,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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ <h4 class="data-consumption-page-dialog-title">Rules:</h4>
<h4 class="data-consumption-page-dialog-title">License:</h4>
{{ license }}
<v-checkbox v-model="subscribe" label="Subscribe"></v-checkbox>
<v-row no-gutters>
<v-col cols="12" md="1">
</v-col>
<v-col cols="12" md="11">
<v-select class="artifact-dialog-location" v-model="subscriptionLocation"
:items="subscriptionLocations" label="Subscription location" :disabled="!subscribe"
item-text="display" item-value="value">
</v-select>
</v-col>
</v-row>
</v-card-text>

<v-divider></v-divider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import PolicyLine from "@/components/policy/PolicyLine.vue";
import dataUtils from "@/utils/dataUtils";

export default {
components: {
Expand All @@ -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);
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
</template>
<span>Show details</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon class="mr-2" @click="subscribeItem(item)" v-bind="attrs" v-on="on">
mdi-rss
</v-icon>
</template>
<span>Subscribe</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon class="mr-2" @click="deleteItem(item)" v-bind="attrs" v-on="on">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
value: 'actions',
sortable: false,
align: 'right',
width: 100
width: 130
}
],
resources: [],
Expand All @@ -59,7 +59,7 @@ export default {
for (let resource of this.$data.resources) {
resource.hasSubscription = false;
for (let subscription of this.$data.subscriptions) {
if (subscription.target.includes(resource.remoteId)) {
if (subscription.target.includes(resource.remoteId) || subscription.target.includes(resource.selfLink)) {
resource.hasSubscription = true;
break;
}
Expand Down Expand Up @@ -87,6 +87,9 @@ export default {
showItem(item) {
this.$refs.resourceDetailsDialog.showRequest(item.id);
},
subscribeItem(item) {
this.$router.push('subscriberesource?id=' + item.id);
},
deleteItem(item) {
this.$refs.confirmationDialog.title = "Delete Requested Resource";
this.$refs.confirmationDialog.text = "Are you sure you want to delete the requested resource '" + item.title + "'?";
Expand Down
2 changes: 2 additions & 0 deletions src/pages/settings/SettingsPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
:type="showPasswordTrustStore ? 'text' : 'password'" :append-icon="showPasswordTrustStore ?
'mdi-eye' :
'mdi-eye-off'" @click:append="showPasswordTrustStore = !showPasswordTrustStore"> </v-text-field>
<v-text-field label="TrustStore Alias" v-model="trustStoreAlias"> </v-text-field>
</v-col>
</v-row>
<v-row class="settings-row" no-gutters>
Expand All @@ -110,6 +111,7 @@
<v-text-field label="KeyStore Password" v-model="keyStorePassword"
:type="showPasswordKeyStore ? 'text' : 'password'" :append-icon="showPasswordKeyStore ? 'mdi-eye' :
'mdi-eye-off'" @click:append="showPasswordKeyStore = !showPasswordKeyStore"> </v-text-field>
<v-text-field label="KeyStore Alias" v-model="keyStoreAlias"> </v-text-field>
</v-col>
</v-row>
</v-form>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/settings/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export default {
connectorDeployMode: "",
trustStoreUrl: "",
trustStorePassword: "",
trustStoreAlias: "",
keyStoreUrl: "",
keyStorePassword: "",
keyStoreAlias: "",
showPasswordTrustStore: false,
showPasswordKeyStore: false,
connectorTitle: "",
Expand Down Expand Up @@ -92,11 +94,13 @@ export default {
this.$data.connectorStatus = configuration.connectorStatus;
this.$data.connectorDeployMode = configuration.connectorDeployMode;
this.$data.trustStoreUrl = configuration.trustStoreUrl;
this.$data.trustStoreAlias = configuration.trustStoreAlias;
this.$data.trustStorePassword = configuration.trustStorePassword;
this.$data.trustStorePasswordOriginal = configuration.trustStorePassword;
this.$data.keyStoreUrl = configuration.keyStoreUrl;
this.$data.keyStorePassword = configuration.keyStorePassword;
this.$data.keyStorePasswordOriginal = configuration.keyStorePassword;
this.$data.keyStoreAlias = configuration.keyStoreAlias;
}
catch (error) {
errorUtils.showError(error, "Get connector settings");
Expand Down Expand Up @@ -158,7 +162,7 @@ export default {
await dataUtils.changeConnectorConfiguration(this.$data.configId, this.$data.connectorTitle,
this.$data.connectorDescription, this.$data.connectorCurator, this.$data.connectorMaintainer, this.$data.useProxy === 'true',
this.$data.proxyUrl, noProxy, useAuthentication, proxyUsername, proxyPassword, this.$data.logLevel, this.$data.connectorDeployMode,
this.$data.trustStoreUrl, trustStorePassword, this.$data.keyStoreUrl, keyStorePassword);
this.$data.trustStoreUrl, trustStorePassword, this.$data.trustStoreAlias, this.$data.keyStoreUrl, keyStorePassword, this.$data.keyStoreAlias);
}
catch (error) {
errorUtils.showError(error, "Save connector settings");
Expand Down
13 changes: 13 additions & 0 deletions src/pages/subscriptions/subscribe/SubscribeResourcePage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.subscribe-id {
font-weight: bold;
font-size: 20px;
margin-top: 30px;
}

.subscribe-tab-div {
margin-top: 30px;
}

.subscribe-tab {
margin-top: 20px;
}
Loading

0 comments on commit 9e88926

Please sign in to comment.