Skip to content

Commit

Permalink
fix: data address built wrongly, prepare release (#345)
Browse files Browse the repository at this point in the history
* fix: data address built wrongly

* chore: prepare release
  • Loading branch information
richardtreier committed Jul 7, 2023
1 parent 8d364c3 commit a592ff4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ the detailed section referring to by linking pull requests or issues.

#### Fixed

## [v0.0.1-milestone-8-sovity10] 07.07.2023

### Overview

Bugfix Release

### Detailed Changes

#### Fixed

- Fixed a bug causing data address dtos to be built wrongly.

## [v0.0.1-milestone-8-sovity9] 04.07.2023

### Overview
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/services/data-address-mapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Injectable} from '@angular/core';
import {AssetDatasourceFormValue} from '../../routes/connector-ui/asset-page/asset-create-dialog/model/asset-datasource-form-model';
import {ContractAgreementTransferDialogFormValue} from '../../routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-form-model';
import {DataAddressDto} from './api/legacy-managent-api-client';
import {HttpRequestParamsMapper} from './http-params-mapper.service';

@Injectable({providedIn: 'root'})
Expand All @@ -12,7 +13,7 @@ export class DataAddressMapper {
| AssetDatasourceFormValue
| ContractAgreementTransferDialogFormValue
| undefined,
): Record<string, string> {
): DataAddressDto {
switch (formValue?.dataAddressType) {
case 'Custom-Data-Address-Json':
return JSON.parse(formValue.dataDestination?.trim()!!);
Expand Down
5 changes: 3 additions & 2 deletions src/app/core/services/http-params-mapper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {HttpDatasourceQueryParamFormValue} from '../../routes/connector-ui/asset
import {ContractAgreementTransferDialogFormValue} from '../../routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-form-model';
import {removeNullValues} from '../utils/record-utils';
import {everythingAfter, everythingBefore} from '../utils/string-utils';
import {DataAddressDto} from './api/legacy-managent-api-client';
import {Asset} from './models/asset';
import {HttpRequestParams} from './models/http-request-params';

Expand All @@ -15,9 +16,9 @@ export class HttpRequestParamsMapper {
| AssetDatasourceFormValue
| ContractAgreementTransferDialogFormValue
| undefined,
): Record<string, string> {
): DataAddressDto {
const params = this.buildHttpRequestParams(formValue);
return this.encodeHttpRequestParams(params);
return {properties: this.encodeHttpRequestParams(params)};
}

encodeHttpProxyTransferRequestProperties(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h1 mat-dialog-title>Create New Asset</h1>
<mat-label>Custom Datasource Config (JSON)</mat-label>
<textarea
matInput
placeholder='{"type": "HttpData", ...}'
placeholder='{"properties": {"type": "HttpData", ...}}'
[formControl]="ctrl"></textarea>
<mat-error *ngIf="ctrl.invalid && ctrl.errors?.jsonInvalid">
{{ validationMessages.invalidJsonMessage }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 mat-dialog-title>Initiate Transfer</h1>
<mat-label>Custom Datasink Config (JSON)</mat-label>
<textarea
matInput
placeholder='{"type": "HttpData", ...}'
placeholder='{"properties": {"type": "HttpData", ...}}'
[formControl]="ctrl"></textarea>
<mat-error *ngIf="ctrl.invalid && ctrl.errors?.jsonInvalid">
{{ validationMessages.invalidJsonMessage }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ export class ContractAgreementTransferDialogComponent implements OnDestroy {
value,
);

let dataAddressProperties =
this.dataAddressMapper.buildDataAddressProperties(value);
let dataSinkProperties =
this.dataAddressMapper.buildDataAddressProperties(value).properties ?? {};

return {
type: 'PARAMS_ONLY',
params: {
contractAgreementId: this.data.contractId,
properties: transferRequestProperties,
dataSinkProperties: dataAddressProperties,
dataSinkProperties,
},
};
}
Expand Down

0 comments on commit a592ff4

Please sign in to comment.