Skip to content

Commit

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

Version 9.0.0
  • Loading branch information
BastianWel authored Feb 7, 2022
2 parents 4c70652 + 555b3ff commit c774782
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 198 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.0.0] - 2022-02-07 (compatible with DSC 7.0.0)

### Added
- Data Offering: Add local file

### Changes
- Use new DSC v.7 API
- Brokers / App Stores: On edit show URL as label (instead of textfield)

### Fixes
- Data Consumption: No validation on resource meta data dialog
- Data Consumption: Show correct rules in contract dialog

## [8.8.1] - 2022-02-03 (compatible with DSC 6.5.3)

### Fixes
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.8.1",
"version": "9.0.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open --port 8082",
Expand Down
2 changes: 1 addition & 1 deletion src/datamodel/clientDataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default {
let id = dataUtils.getIdOfConnectorResponse(genericEndpoint);
let accessUrl = undefined;
accessUrl = genericEndpoint.location;
let dataSourceId = dataUtils.getIdOfLink(genericEndpoint, "dataSource");
let dataSourceId = dataUtils.getIdOfLink(genericEndpoint, "datasource");
let username = undefined;
let password = undefined;
let apiKey = undefined;
Expand Down
21 changes: 0 additions & 21 deletions src/pages/PageStructure.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import DashboardPage from "@/pages/dashboard/DashboardPage.vue";
import IDSResourcesPage from "@/pages/dataoffering/resources/IDSResourcesPage.vue";
import AddResourcePage from "@/pages/dataoffering/resources/addresource/AddResourcePage.vue";
import RoutesPage from "@/pages/dataoffering/routes/RoutesPage.vue";
import AddRoutePage from "@/pages/dataoffering/routes/addroute/AddRoutePage.vue";
import IDSDataConsumptionPage from "@/pages/dataconsumption/dataconsumption/IDSDataConsumptionPage.vue";
import IDSResourcesPageConsumption from "@/pages/dataconsumption/resources/IDSResourcesPageConsumption.vue";
import BrokersPage from "@/pages/brokers/BrokersPage.vue";
Expand Down Expand Up @@ -46,21 +44,6 @@ export default {
path: "backendconnectionsoffering",
name: "Backend Connections (Offering)",
component: BackendConnectionsPage
}, {
path: "routesoffering",
name: "Routes (Offering)",
component: RoutesPage,
subpages: [{
path: "addroute",
name: "Add Route",
component: AddRoutePage,
subpages: []
}, {
path: "showroute",
name: "Show Route",
component: AddRoutePage,
subpages: []
}]
}, {
path: "catalogsoffering",
name: "Catalogs (Offering)",
Expand All @@ -86,10 +69,6 @@ export default {
path: "backendconnectionsconsumption",
name: "Backend Connections (Consumation)",
component: null
}, {
path: "routesconsumption",
name: "Routes (Consumation)",
component: null
}]
}, {
path: "brokers",
Expand Down
3 changes: 2 additions & 1 deletion src/pages/appstores/dialog/AddAppStoreDialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

<v-card-text>
<v-text-field label="Title" v-model="appstoreTitle" :rules="defaultRule"> </v-text-field>
<v-text-field label="URL" v-model="url" :rules="urlRule" :readonly="urlReadOnly">
<p v-if="urlReadOnly">URL: {{url}}</p>
<v-text-field label="URL" v-model="url" :rules="urlRule" :readonly="urlReadOnly" v-if="!urlReadOnly">
</v-text-field>
</v-card-text>

Expand Down
3 changes: 2 additions & 1 deletion src/pages/brokers/dialog/AddBrokerDialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

<v-card-text>
<v-text-field label="Title" v-model="brokerTitle" :rules="defaultRule"> </v-text-field>
<v-text-field label="URL" v-model="url" :rules="urlRule" :readonly="urlReadOnly">
<p v-if="urlReadOnly">URL: {{url}}</p>
<v-text-field label="URL" v-model="url" :rules="urlRule" v-if="!urlReadOnly">
</v-text-field>
</v-card-text>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ export default {
}
},

showRepresentations(item) {
this.$data.resources.forEach(element => {
async showRepresentations(item) {
for (let element of this.$data.resources) {
if (element.id == item.id) {
let idsResource = element.idsResource;
this.$data.selectedRepresentations = [];
Expand All @@ -240,12 +240,15 @@ export default {
}
this.$data.selectedResource = idsResource;
for (let ruleJson of this.$data.selectedResource["ids:contractOffer"][0]["ids:permission"]) {
let ruleDescription = ruleJson["ids:description"][0]["@value"];
let ruleName = dataUtils.convertDescriptionToPolicyName(ruleDescription);
ruleJson.type = dataUtils.convertPolicyNameToType(ruleName);
ruleJson["@context"] = {
"xsd": "http://www.w3.org/2001/XMLSchema#",
"ids": "https://w3id.org/idsa/core/",
"idsc": "https://w3id.org/idsa/code/"
};
ruleJson.type = await dataUtils.getPolicyNameByPattern(JSON.stringify(ruleJson));
}
}
});
}
this.$data.selectedRepresentation = {};
this.$data.selectedArtifacts = [];
this.$data.selectedIdsArtifact = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

<v-card-text>
<h4 class="data-consumption-page-dialog-title">Rules:</h4>
<policy-line v-for='rule in rules' :ruleJson="rule" :policyName="rule.type" :readonly=true>
<policy-line v-for='rule in rules' :key="rule['@id']" :ruleJson="rule" :policyName="rule.type"
:readonly=true>
</policy-line>
<h4 class="data-consumption-page-dialog-title">License:</h4>
{{ license }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export default {
mounted: function () { },
methods: {
show(rules, license, artifact, callback) {
this.$data.dialog = true;
this.$data.rules = rules;
this.$data.license = license;
this.$data.artifact = artifact;
this.$data.callback = callback;
this.$data.dialog = true;
},
clickAcceptContract() {
this.$data.dialog = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
<v-form v-model="valid" ref="form">
<v-text-field ref="tfURL" label="URL" v-model="url" :rules="urlRule"> </v-text-field>
<v-select label="Source Type" v-model="sourceType" :items="sourceTypes"></v-select>
<v-text-field v-if="sourceType === 'Database'" label="Driver class name" v-model="driverClassName"
:rules="requiredRule">
</v-text-field>
<v-tabs class="pagestab" v-model="active_tab" ref="pagestab">
<v-tab>Basic</v-tab>
<v-tab>API-Key</v-tab>
<v-tab v-if="sourceType === 'REST'">API-Key</v-tab>
<v-tab-item :eager="true">
<v-text-field label="Username" v-model="username"> </v-text-field>
<v-text-field label="Password" v-model="password" :type="showPassword ? 'text' : 'password'"
Expand All @@ -26,7 +29,8 @@
</v-text-field>
</v-tab-item>
<v-tab-item :eager="true">
<v-text-field label="API-Key" v-model="apiKey"> </v-text-field>
<v-text-field label="Header name" v-model="authHeaderName"> </v-text-field>
<v-text-field label="Header value" v-model="authHeaderValue"> </v-text-field>
</v-tab-item>
</v-tabs>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ export default {
url: null,
sourceType: "Database",
sourceTypes: ["Database", "REST"],
driverClassName: null,
username: null,
password: null,
apiKey: null,
authHeaderName: null,
authHeaderValue: null,
showPassword: false,
valid: false,
requiredRule: validationUtils.getRequiredRule(),
urlRule: validationUtils.getUrlRequiredRule()
};
},
mounted: function () { },
mounted: function () {
},
// watch: {
// dialog() {
// console.log("SHOW: ", this.$data.dialog);
Expand All @@ -37,36 +41,42 @@ export default {
this.$data.currentEndpoint = null;
this.$data.url = "";
this.$data.sourceType = this.$data.sourceTypes[0];
this.$data.driverClassName = "";
this.$data.username = "";
this.$data.password = "";
this.$data.apiKey = "";
this.$data.authHeaderName = "";
this.$data.authHeaderValue = "";
this.$nextTick(() => {
this.$refs.form.resetValidation();
});
},
cancelBackendConnection() {
this.$data.dialog = false;
},
async saveBackendConnection() {
this.$root.$emit('showBusyIndicator', true);
this.$data.dialog = false;
if (this.$data.active_tab == 0) {
this.$data.authHeaderName = null;
this.$data.authHeaderValue = null;
} else {
this.$data.username = null;
this.$data.password = null;
}
if (this.$data.currentEndpoint == null) {
this.$root.$emit('showBusyIndicator', true);
this.$data.dialog = false;
try {
if (this.$data.active_tab == 0) {
this.$data.apiKey = null;
} else {
this.$data.username = null;
this.$data.password = null;
}
await dataUtils.createGenericEndpoint(this.$data.url, this.$data.username, this.$data.password, this.$data.apiKey, this.$data.sourceType);
await dataUtils.createGenericEndpoint(this.$data.url, this.$data.username, this.$data.password, this.$data.authHeaderName,
this.$data.authHeaderValue, this.$data.sourceType.toUpperCase(), this.$data.driverClassName);
} catch (error) {
console.log("Error on saveBackendConnection(): ", error);
this.$root.$emit('error', "Create backend connection failed.");
}
this.$emit('backendConnectionSaved');
} else {
this.$root.$emit('showBusyIndicator', true);
this.$data.dialog = false;
try {
await dataUtils.updateGenericEndpoint(this.currentEndpoint.id, this.currentEndpoint.dataSourceId, this.$data.url,
this.$data.username, this.$data.password, this.$data.sourceType);
this.$data.username, this.$data.password, this.$data.authHeaderName,
this.$data.authHeaderValue, this.$data.sourceType.toUpperCase(), this.$data.driverClassName);
} catch (error) {
console.log("Error on saveBackendConnection(): ", error);
this.$root.$emit('error', "Update backend connection failed.");
Expand All @@ -78,10 +88,13 @@ export default {
this.$data.title = "Edit Backend Connection"
this.$data.currentEndpoint = endpoint;
this.$data.url = endpoint.accessUrl;
this.$data.sourceType = (await dataUtils.getDataSource(endpoint.dataSourceId)).type;
let dataSource = await dataUtils.getDataSource(endpoint.dataSourceId);
this.$data.sourceType = dataSource.type;
this.$data.driverClassName = "";
this.$data.username = endpoint.username;
this.$data.password = endpoint.password;
this.$data.apiKey = endpoint.apiKey;
this.$data.authHeaderName = "";
this.$data.authHeaderValue = "";
this.$data.dialog = true;
}
}
Expand Down
12 changes: 4 additions & 8 deletions src/pages/dataoffering/resources/addresource/AddResourcePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ export default {
this.$refs.brokersPage.readonly = readonly;
},
async save() {
let genericEndpoint = null;
if (this.$refs.representationPage.selected.length > 0) {
genericEndpoint = this.$refs.representationPage.selected[0];
}

let title = this.$refs.metaDataPage.title;
let description = this.$refs.metaDataPage.description;
let language = this.$refs.metaDataPage.language;
Expand All @@ -146,6 +141,7 @@ export default {
let policyDescriptions = this.$refs.policyPage.getDescriptions();
let contractPeriodFromValue = this.$refs.policyPage.getContractPeriodFromValue();
let contractPeriodToValue = this.$refs.policyPage.getContractPeriodToValue();
let fileData = this.$refs.representationPage.fileData;
let filetype = this.$refs.representationPage.filetype;
let brokerList = this.$refs.brokersPage.getSelectedBrokerList()
let brokerDeleteList = this.$refs.brokersPage.getBrokerDeleteList();
Expand All @@ -160,15 +156,15 @@ export default {
this.$root.$emit('showBusyIndicator', true);
this.$root.$emit('blockNavigationMenu', true);
if (this.$data.currentResource == null) {
await dataUtils.createResourceWithMinimalRoute(catalogIds, title, description, language, paymentMethod, keywords, standardlicense, publisher,
policyDescriptions, contractPeriodFromValue, contractPeriodToValue, filetype, brokerList, genericEndpoint);
await dataUtils.createResourceAndUpdateAtBroker(catalogIds, title, description, language, paymentMethod, keywords, standardlicense, publisher,
policyDescriptions, contractPeriodFromValue, contractPeriodToValue, filetype, brokerList, fileData);
this.$router.push('idsresourcesoffering');
this.$root.$emit('showBusyIndicator', false);
this.$root.$emit('blockNavigationMenu', false);
} else {
await dataUtils.editResource(this.$data.currentResource.id, this.$data.currentResource.representationId, catalogIds, deletedCatalogIds,
title, description, language, paymentMethod, keywords, standardlicense, publisher, samples, policyDescriptions, contractPeriodFromValue,
contractPeriodToValue, filetype, brokerList, brokerDeleteList, genericEndpoint, this.$data.currentResource.ruleId,
contractPeriodToValue, filetype, brokerList, brokerDeleteList, fileData, this.$data.currentResource.ruleId,
this.$data.currentResource.artifactId);
this.$router.push('idsresourcesoffering');
this.$root.$emit('showBusyIndicator', false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<v-select label="Language" v-model="language" :items="languageItems" item-text="displayName"
item-value="originalName" readonly>
</v-select>
<v-select label="Payment Modality" v-model="paymentMethod" :items="paymentMethods"
item-text="representation" item-value="displayName" readonly>
<v-select label="Payment Modality" v-model="paymentMethod" :items="paymentMethods" item-text="displayName"
item-value="jsonInput" readonly>
</v-select>
<v-btn color="primary" @click.native="nextPage" v-show="!onlyMetaData">
Next</v-btn>
Expand All @@ -34,8 +34,8 @@
<v-select label="Language" v-model="language" :items="languageItems" item-text="displayName"
item-value="originalName" :rules="defaultRule" required>
</v-select>
<v-select label="Payment Modality" v-model="paymentMethod" :items="paymentMethods"
item-text="representation" item-value="displayName" :rules="defaultRule" required>
<v-select label="Payment Modality" v-model="paymentMethod" :items="paymentMethods" item-text="displayName"
item-value="jsonInput" :rules="defaultRule" required>
</v-select>
<v-btn color="primary" @click.native="nextPage" :disabled="!valid" v-show="!onlyMetaData">
Next</v-btn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default {
"ruleJson": resource.ruleJsons[i],
"policyName": resource.policyNames[i]
};

this.$data.policyLines.push(policyLine);
}
} else if (resource.policyDescriptions !== undefined) {
Expand All @@ -72,6 +73,8 @@ export default {
let agreements = await dataUtils.getArtifactAgreements(resource.artifactId);
if (agreements.length > 0) {
let agreement = JSON.parse(agreements[0].value);
this.$data.contractPeriodFromValue = agreement["ids:contractStart"]["@value"].substring(0, 10);
this.$data.contractPeriodToValue = agreement["ids:contractEnd"]["@value"].substring(0, 10);
let i = 0;
for (let permission of agreement["ids:permission"]) {
permission["@context"] = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
<div>
<div v-if="fromRoutePage === undefined && !hideBackendConnections"
style="height: min-content; border-style: dashed; margin-top: 20px; padding: 10px; color: #239b7e; margin-bottom: 30px;">
<v-row v-if="fromRoutePage === undefined && !readonly" no-gutters>
<v-col cols="12" md="6" sm="12">
<add-backend-connection-dialog ref="addBackendConnectionDialog"
@backendConnectionSaved="backendConnectionSaved">
</add-backend-connection-dialog>
<v-text-field v-model="search" append-icon="mdi-magnify" label="Search" single-line hide-details></v-text-field>
</v-col>
</v-row>
<v-row v-if="fromRoutePage === undefined && !readonly" no-gutters>
<v-col cols="12" md="11" sm="12">
<v-data-table v-model="selected" :headers="headers" :items="backendConnections" :items-per-page="5"
:search="search" show-select :single-select=true item-key="id"
no-data-text="No backend connections available">
</v-data-table>
</v-col>
</v-row>
<v-row v-if="fromRoutePage === undefined && readonly" no-gutters>
<v-col cols="12" md="11" sm="12">
<v-data-table :headers="headers" :items="selected" :items-per-page="5" :search="search" :single-select=true
item-key="id" no-data-text="No backend connections set">
</v-data-table>
</v-col>
</v-row>
</div>

<v-row no-gutters>
<v-col cols="12" md="11">
<v-form v-model="valid" ref="form">
<v-file-input label="File input" show-size @change="fileChange" :rules="defaultRule"
v-if="!readonly && !editMode"> </v-file-input>
<v-file-input label="File input" show-size @change="fileChange" v-if="editMode">
</v-file-input>
<v-text-field label="File type" v-model="filetype" :rules="defaultRule" :readonly="readonly"> </v-text-field>
</v-form>

Expand Down
Loading

0 comments on commit c774782

Please sign in to comment.