Skip to content

Commit

Permalink
Merge pull request #98 from International-Data-Spaces-Association/dev…
Browse files Browse the repository at this point in the history
…elop

Version 8.4.0
  • Loading branch information
BastianWel authored Aug 20, 2021
2 parents ac1d8e7 + 6caa6ba commit f9486e7
Show file tree
Hide file tree
Showing 29 changed files with 482 additions and 132 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
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)

## [8.4.0] - 2021-08-20

### Added
- Data Consumption: Show list of requested resources
- Backend Connections: API-Key authentication
- Resources: Set payment method
- Resources: Set referenced resources

### Fixes
- Data Consumption: Show download link to artifact of own connector

## [8.3.2] - 2021-08-17

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sudo docker-compose up
```
Access: [localhost:8083](http://localhost:8083)

### Change host/port & authentification of Dataspace Connector & UI backend on docker start
### Change host/port & authentification of Dataspace Connector on docker start

Change in `docker-compose.yml`:
```bash
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": "8.3.2",
"version": "8.4.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open --port 8082",
Expand Down
6 changes: 6 additions & 0 deletions src/components/infobox/InfoBox.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,10 @@
General settings of the DataSpaceConnector.
</v-card-text>
</v-card-text>
<v-card-text v-if="currentRoute == 'requestresourceconsumption'">
<v-card-text>
Request an IDS resource from the given connector URL.<br>
When requesting a Dataspace Connector the "/api/ids/data" endpoint should be used.
</v-card-text>
</v-card-text>
</v-card>
36 changes: 29 additions & 7 deletions src/datamodel/clientDataModel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import dataUtils from "@/utils/dataUtils";

export default {
createResource(id, creationDate, title, description, language, keywords, version, standardlicense,
publisher, fileType, policyNames, ruleIds, ruleJsons, artifactId, representationId, brokerUris) {
createResource(url, id, creationDate, title, description, language, paymentMethod, keywords, version, standardlicense,
publisher, fileType, policyNames, ruleIds, ruleJsons, artifactId, representationId, brokerUris, samples) {
let resource = {};
if (url === undefined) {
resource.url = "";
} else {
resource.url = url;
}
if (id === undefined) {
resource.id = "";
} else {
Expand All @@ -29,6 +34,11 @@ export default {
} else {
resource.language = language;
}
if (paymentMethod === undefined) {
resource.paymentMethod = "";
} else {
resource.paymentMethod = paymentMethod;
}
if (keywords === undefined) {
resource.keywords = "";
} else {
Expand Down Expand Up @@ -84,6 +94,11 @@ export default {
} else {
resource.brokerUris = brokerUris;
}
if (samples === undefined) {
resource.samples = [];
} else {
resource.samples = samples;
}
return resource;
},

Expand Down Expand Up @@ -195,7 +210,7 @@ export default {
return configuration;
},

createGenericEndpoint(id, accessUrl, dataSourceId, username, password, type) {
createGenericEndpoint(id, accessUrl, dataSourceId, username, password, apiKey, type) {
let genericEndpoint = {};

if (id === undefined) {
Expand Down Expand Up @@ -228,6 +243,12 @@ export default {
genericEndpoint.password = password;
}

if (apiKey === undefined) {
genericEndpoint.apiKey = "";
} else {
genericEndpoint.apiKey = apiKey;
}

if (type === undefined) {
genericEndpoint.type = "";
} else {
Expand All @@ -244,7 +265,8 @@ export default {
let dataSourceId = dataUtils.getIdOfLink(genericEndpoint, "dataSource");
let username = undefined;
let password = undefined;
return this.createGenericEndpoint(id, accessUrl, dataSourceId, username, password, genericEndpoint.type);
let apiKey = undefined;
return this.createGenericEndpoint(id, accessUrl, dataSourceId, username, password, apiKey, genericEndpoint.type);
},

createApp(id, title, description, type) {
Expand Down Expand Up @@ -297,9 +319,9 @@ export default {
representationId = dataUtils.getIdOfConnectorResponse(representation);
}

return this.createResource(dataUtils.getIdOfConnectorResponse(idsResource), idsResource.creationDate, title, description,
idsResource.language.replace("https://w3id.org/idsa/code/", ""), idsResource.keywords,
idsResource.version, idsResource.license, idsResource.publisher, fileType, policyNames, ruleIds, ruleJsons, artifactId, representationId, brokerUris);
return this.createResource(idsResource._links.self.href, dataUtils.getIdOfConnectorResponse(idsResource), idsResource.creationDate, title, description,
idsResource.language.replace("https://w3id.org/idsa/code/", ""), idsResource.paymentModality, idsResource.keywords,
idsResource.version, idsResource.license, idsResource.publisher, fileType, policyNames, ruleIds, ruleJsons, artifactId, representationId, brokerUris, idsResource.samples);
},


Expand Down
4 changes: 2 additions & 2 deletions src/pages/PageStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export default {
name: "IDS Resources (Consumption)",
component: IDSResourcesPageConsumption,
subpages: [{
path: "receiveresourcesconsumption",
name: "Receive Resources (Consumption)",
path: "requestresourceconsumption",
name: "Request Resource (Consumption)",
component: IDSDataConsumptionPage,
subpages: []
}, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ <h4 class="data-consumption-page-dialog-title">License:</h4>
</div>
<div v-if="requestContractResponse['confirmed'] == true">
<h3 class="data-consumption-page-title">Download:</h3>
<v-btn color="secondary" :href="downloadLink" target="_blank">{{
selectedIdsArtifact["@id"] }}/data
<v-btn color="secondary" :href="downloadLink" target="_blank">
{{ downloadLink }}
</v-btn>
</div>
</v-col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
downloadLink: "",
dialog: false,
valid: false,
providerUrlRule: validationUtils.getProviderUrlRequiredRule(),
providerUrlRule: validationUtils.getUrlRequiredRule(),
headers: [{
text: 'Creation date',
value: 'creationDate',
Expand Down Expand Up @@ -108,7 +108,7 @@ export default {
try {
this.$data.receivedCatalogs = await dataUtils.receiveCatalogs(this.$data.recipientId);
} catch (error) {
errorUtils.showError(error, "Receive Catalogs");
errorUtils.showError(error, "Request Catalogs");
}
this.$data.noCatalogsFound = this.$data.receivedCatalogs.length == 0;
this.$root.$emit('showBusyIndicator', false);
Expand All @@ -119,8 +119,17 @@ export default {
try {
this.$data.resourcesInSelectedCatalog = await dataUtils.receiveResourcesInCatalog(this.$data.recipientId, catalogID);
} catch (error) {
errorUtils.showError(error, "Receive Resources in Catalog");
errorUtils.showError(error, "Request Resources in Catalog");
}
this.$data.idsResourceCatalog = {};
this.$data.selectedResource = {};
this.$data.selectedRepresentations = [];
this.$data.selectedRepresentation = {};
this.$data.selectedArtifacts = [];
this.$data.selectedIdsArtifact = {};
this.$data.idsContractOffer = {};
this.$data.requestContractResponse = {};
this.$data.downloadLink = "";
this.$root.$emit('showBusyIndicator', false);
},

Expand All @@ -134,7 +143,7 @@ export default {
try {
this.$data.idsResourceCatalog = await dataUtils.receiveIdsResourceCatalog(this.$data.recipientId, catalogId);
} catch (error) {
errorUtils.showError(error, "Receive Resources in Catalog");
errorUtils.showError(error, "Request Resources in Catalog");
}
},

Expand All @@ -150,13 +159,13 @@ export default {
try{
this.$data.selectedIdsArtifact = await dataUtils.receiveIdsArtifact(this.$data.recipientId, artifact["@id"])
} catch (error) {
errorUtils.showError(error, "Receive Artifact");
errorUtils.showError(error, "Request Artifact");
}
try{
this.$data.idsContractOffer = await dataUtils.receiveIdsContractOffer(this.$data.recipientId, artifact["@id"])
} catch (error) {
errorUtils.showError(error, "Receive Contract Offer");
errorUtils.showError(error, "Request Contract Offer");
}
}, */

Expand All @@ -169,8 +178,10 @@ export default {
try {
this.$data.requestContractResponse = await dataUtils.receiveContract(this.$data.recipientId,
this.$data.selectedResource["@id"], this.$data.selectedResource["ids:contractOffer"], this.$data.selectedIdsArtifact, download);
let agreementId = await dataUtils.getIdOfAgreement(this.$data.requestContractResponse._links.artifacts.href);
this.$data.downloadLink = (await dataUtils.getAgreementArtifacts(agreementId))[0]._links.data.href;
} catch (error) {
errorUtils.showError(error, "Receive Contract");
errorUtils.showError(error, "Request Contract");
}
},

Expand All @@ -195,7 +206,12 @@ export default {
}
}
});

this.$data.selectedRepresentation = {};
this.$data.selectedArtifacts = [];
this.$data.selectedIdsArtifact = {};
this.$data.idsContractOffer = {};
this.$data.requestContractResponse = {};
this.$data.downloadLink = "";
},


Expand All @@ -210,7 +226,6 @@ export default {

clickAcceptContract(artifact) {
this.$data.selectedIdsArtifact = artifact;
this.$data.downloadLink = artifact["@id"] + "/data";
this.requestContract();
this.subscribeToResource();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<div class="content">
<div>
<v-btn elevation="1" color="primary" class="buttontext--text addresourcebutton" to="/receiveresourcesconsumption">
Receive Resources
<v-btn elevation="1" color="primary" class="buttontext--text addresourcebutton" to="/requestresourceconsumption">
Request Resource
</v-btn>
<v-row no-gutters>
<v-col cols="12" md="4" sm="5">
<v-select label="Filter by Type" v-model="filterResourceType" @change="filterChanged"
:items="['All', 'File', 'Database', 'HTTP']">
</v-select>
</v-col>
<v-col cols="12" md="1" sm="1">

</v-col>
<v-col cols="12" md="6" sm="6">
<v-text-field v-model="search" append-icon="mdi-magnify" label="Search" single-line hide-details></v-text-field>
</v-col>
Expand All @@ -24,16 +16,11 @@
<v-icon class="mr-2" @click="showItem(item)">
mdi-eye
</v-icon>
<v-icon class="mr-2" @click="editItem(item)">
mdi-pencil
</v-icon>
<v-icon @click="deleteItem(item)">
mdi-delete
</v-icon>
</template>
</v-data-table>
</v-col>
</v-row>
</div>
<resource-details-dialog ref="resourceDetailsDialog"></resource-details-dialog>
<confirmation-dialog ref="confirmationDialog"></confirmation-dialog>
</div>
62 changes: 25 additions & 37 deletions src/pages/dataconsumption/resources/IDSResourcesPageConsumption.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
import dataUtils from "@/utils/dataUtils";
import ConfirmationDialog from "@/components/confirmationdialog/ConfirmationDialog.vue";
import errorUtils from "../../../utils/errorUtils";
import ResourceDetailsDialog from "../../dataoffering/resources/resourcedetailsdialog/ResourceDetailsDialog.vue";


export default {
components: {
ConfirmationDialog
ConfirmationDialog,
ResourceDetailsDialog
},
data() {
return {
search: '',
headers: [{
text: 'Creation date',
value: 'creationDate',
width: 135
}, {
text: 'Title',
value: 'title'
},
{
text: 'Description',
value: 'description'
},
{
text: 'Type',
value: 'sourceType'
}, {
text: 'Policy',
value: 'policyName'
text: 'Keywords',
value: 'keywords'
},
{
text: '',
value: 'actions',
sortable: false,
align: 'right'
align: 'right',
width: 150
}
],
resources: [],
Expand All @@ -40,45 +41,32 @@ export default {
this.getResources();
},
methods: {
getResources() {
// this.$root.$emit('showBusyIndicator', true);
// TODO Get resources
async getResources() {
this.$root.$emit('showBusyIndicator', true);
try {
let response = await dataUtils.getRequestedResources();
this.$data.resources = response;
} catch (error) {
errorUtils.showError(error, "Get resources");
}
this.filterChanged();
this.$forceUpdate();
this.$root.$emit('showBusyIndicator', false);
},
filterChanged() {
if (this.$data.filterResourceType == null | this.$data.filterResourceType == "All") {
this.$data.filteredResources = this.$data.resources;
} else {
this.$data.filteredResources = [];
for (var resource of this.$data.resources) {
if (resource.type == this.$data.filterResourceType) {
if (resource.fileType == this.$data.filterResourceType) {
this.$data.filteredResources.push(resource);
}
}
}
},
deleteItem(item) {
this.$refs.confirmationDialog.title = "Delete Resource";
this.$refs.confirmationDialog.text = "Are you sure you want to delete the resource '" + item.title + "'?";
this.$refs.confirmationDialog.callbackData = {
item: item
};
this.$refs.confirmationDialog.callback = this.deleteCallback;
this.$refs.confirmationDialog.dialog = true;
},
deleteCallback(choice, callbackData) {
if (choice == "yes") {
this.$root.$emit('showBusyIndicator', true);
dataUtils.deleteResource(callbackData.item.id, () => {
this.getResources();
this.$root.$emit('showBusyIndicator', false);
});
}
},
editItem(item) {
this.$router.push('editresource?id=' + item.id);
},
showItem(item) {
this.$refs.resourceDetailsDialog.show(item);
this.$refs.resourceDetailsDialog.showRequest(item.id);
}
},
};
Loading

0 comments on commit f9486e7

Please sign in to comment.