Skip to content

Commit e86714d

Browse files
committed
Merge branch 'bugfix/defects' into 'develop'
bugfix/defects See merge request upm-inesdata/inesdata-connector-interface!49
2 parents 080886e + b6ecde8 commit e86714d

File tree

6 files changed

+34
-69
lines changed

6 files changed

+34
-69
lines changed

src/app/pages/assets/asset-create/asset-create.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export class AssetCreateComponent implements OnInit {
293293
if (this.storageTypeId === DATA_ADDRESS_TYPES.httpData && (!this.httpDataAddress.name || !this.httpDataAddress.baseUrl || !this.validateUrl())) {
294294
return false;
295295
}
296-
if (this.storageTypeId === DATA_ADDRESS_TYPES.amazonS3 && !this.amazonS3DataAddress.region) {
296+
if (this.storageTypeId === DATA_ADDRESS_TYPES.amazonS3 && (!this.amazonS3DataAddress.region || !this.amazonS3DataAddress.accessKeyId || !this.amazonS3DataAddress.secretAccessKey || !this.amazonS3DataAddress.bucketName || !this.amazonS3DataAddress.endpointOverride)) {
297297
return false;
298298
} else if (this.storageTypeId === DATA_ADDRESS_TYPES.inesDataStore && !this.inesDataStoreAddress.file) {
299299
return false;

src/app/pages/contracts/contract-viewer/contract-viewer.component.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnInit } from '@angular/core';
22
import { ContractAgreementService } from "../../../shared/services/contractAgreement.service";
3-
import { firstValueFrom, from, interval, Observable, of, timer } from "rxjs";
3+
import { firstValueFrom, from, interval, Observable, of, timer, Subscription } from "rxjs";
44
import { ContractAgreement, IdResponse, TransferProcessInput } from "../../../shared/models/edc-connector-entities";
55
import { catchError, filter, finalize, first, switchMap, takeUntil, tap } from "rxjs/operators";
66
import { NotificationService } from "../../../shared/services/notification.service";
@@ -32,6 +32,7 @@ export class ContractViewerComponent implements OnInit {
3232
contracts: ContractAgreement[] = [];
3333
private runningTransfers: RunningTransferProcess[] = [];
3434
private pollingHandleTransfer?: any;
35+
private timeoutSubscription?: Subscription;
3536
PARTICIPANT_ID = `${environment.runtime.participantId}`;
3637

3738
// Pagination
@@ -203,22 +204,23 @@ export class ContractViewerComponent implements OnInit {
203204
})
204205
);
205206

207+
this.timeoutSubscription = timeout$.subscribe();
208+
206209
this.runningTransfers.push({
207210
processId: transferProcessId.id,
208211
state: TransferProcessStates.REQUESTED,
209212
contractId: contractId
210213
});
211214

212215
if (!this.pollingHandleTransfer) {
213-
this.pollingHandleTransfer = this.pollRunningTransfers(timeout$)
216+
this.pollingHandleTransfer = this.pollRunningTransfers()
214217
.pipe(finalize(() => this.cleanupPolling()))
215218
.subscribe();
216219
}
217220
}
218221

219-
private pollRunningTransfers(timeout$: Observable<number>) {
222+
private pollRunningTransfers() {
220223
return interval(2000).pipe(
221-
takeUntil(timeout$),
222224
switchMap(() => from([...this.runningTransfers])),
223225
switchMap(runningTransferProcess =>
224226
this.catalogService.getTransferProcessesById(runningTransferProcess.processId).pipe(
@@ -237,6 +239,7 @@ export class ContractViewerComponent implements OnInit {
237239
)
238240
),
239241
tap(transferProcess => {
242+
this.timeoutSubscription?.unsubscribe();
240243
this.removeTransferFromList(transferProcess.id);
241244
this.notificationService.showWarning(
242245
`Transfer [${transferProcess.id}] complete! Check if the process was successful`,
@@ -259,7 +262,6 @@ export class ContractViewerComponent implements OnInit {
259262
private cleanupPolling() {
260263
clearInterval(this.pollingHandleTransfer);
261264
this.pollingHandleTransfer = undefined;
265+
this.timeoutSubscription?.unsubscribe();
262266
}
263-
264-
265267
}

src/app/pages/transfer-history/pipes/replace.pipe.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/app/pages/transfer-history/pipes/safe.pipe.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/app/pages/transfer-history/transfer-history.module.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import { NgModule } from '@angular/core';
22
import { TransferHistoryRoutingModule } from './transfer-history-routing.module'
3-
import {ReplacePipe} from "./pipes/replace.pipe";
4-
import {SafePipe} from "./pipes/safe.pipe";
5-
63
import { TransferHistoryViewerComponent } from './transfer-history-viewer.component';
74
import { SharedModule } from 'src/app/shared/shared.module';
85

96
@NgModule({
107
declarations: [
11-
TransferHistoryViewerComponent,
12-
ReplacePipe,
13-
SafePipe
8+
TransferHistoryViewerComponent
149
],
1510
imports: [
1611
TransferHistoryRoutingModule,

src/app/shared/utils/date-utils.ts

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,34 @@ export function adjustDate(date: Date, operator: OperatorDto): string | null {
55
return null;
66
}
77

8-
if(operator === 'LEQ' || operator === 'LT') {
9-
const adjustedDate = new Date(Date.UTC(
10-
date.getFullYear(),
11-
date.getMonth(),
12-
date.getDate(),
13-
23, 59, 59, 999
14-
));
8+
let adjustedDate: Date;
159

16-
return adjustedDate.toISOString();
17-
} else {
18-
const adjustedDate = new Date(Date.UTC(
19-
date.getFullYear(),
20-
date.getMonth(),
21-
date.getDate(),
22-
0, 0, 0, 0
23-
));
24-
25-
return adjustedDate.toISOString();
10+
switch (operator) {
11+
case 'LT':
12+
case 'GEQ':
13+
adjustedDate = new Date(Date.UTC(
14+
date.getFullYear(),
15+
date.getMonth(),
16+
date.getDate(),
17+
0, 0, 0, 0
18+
));
19+
break;
20+
case 'LEQ':
21+
case 'GT':
22+
adjustedDate = new Date(Date.UTC(
23+
date.getFullYear(),
24+
date.getMonth(),
25+
date.getDate(),
26+
23, 59, 59, 999
27+
));
28+
break;
29+
default:
30+
return null;
2631
}
2732

33+
return adjustedDate.toISOString();
2834
}
35+
2936
export function convertUTCToLocalDate(utcISOString: string): Date {
3037
const utcDate = new Date(utcISOString);
3138

0 commit comments

Comments
 (0)