Skip to content

Commit

Permalink
minor code quality improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Sep 26, 2023
1 parent 83f31c6 commit 56e6547
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ export class AssetPropertyGridGroupBuilder {
title: `${groupLabel} Contract Policy)`,
subtitle: asset.name,
icon: 'policy',
objectForJson: getLegacyPolicy(contractOffer.contractPolicy)
.policyJsonLd,
objectForJson: getLegacyPolicy(contractOffer.contractPolicy),
}),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@sovity.de/edc-client';
import {TestAssets} from './data/test-assets';

export let assets: UiAsset[] = [TestAssets.full, TestAssets.boring];
let assets: UiAsset[] = [TestAssets.full, TestAssets.boring];

export const assetPage = (): AssetPage => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {UiDataOffer} from '@sovity.de/edc-client';
import {TestAssets} from './data/test-assets';
import {TestPolicies} from './data/test-policies';

export let uiDataOffers: UiDataOffer[] = [
let dataOffers: UiDataOffer[] = [
{
endpoint: 'http://existing-other-connector/api/dsp',
participantId: 'existing-other-connector',
Expand Down Expand Up @@ -34,5 +34,5 @@ export let uiDataOffers: UiDataOffer[] = [
export const getCatalogPageDataOffers = (
connectorEndpoint: string,
): UiDataOffer[] => {
return uiDataOffers.filter((it) => it.endpoint === connectorEndpoint);
return dataOffers.filter((it) => it.endpoint === connectorEndpoint);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {Patcher, patchObj} from '../../../utils/object-utils';
import {TestAssets} from './data/test-assets';
import {TestPolicies} from './data/test-policies';

export let contractAgreements: ContractAgreementCard[] = [
let contractAgreements: ContractAgreementCard[] = [
{
contractAgreementId: 'my-own-asset-cd:f52a5d30-6356-4a55-a75a-3c45d7a88c3e',
contractNegotiationId:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@sovity.de/edc-client';
import {AssetProperty} from '../../models/asset-properties';

export let contractDefinitions: ContractDefinitionEntry[] = [
let contractDefinitions: ContractDefinitionEntry[] = [
{
contractDefinitionId: 'test-contract-definition-1',
contractPolicyId: 'test-policy-definition-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const agreed: ContractNegotiationState = {
simplifiedState: ContractNegotiationStateSimplifiedStateEnum.Agreed,
};

export let negotiations: UiContractNegotiation[] = [
let negotiations: UiContractNegotiation[] = [
{
contractNegotiationId: 'test-contract-negotiation-1',
createdAt: new Date(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@sovity.de/edc-client';
import {TestPolicies} from './data/test-policies';

export let policyDefinitions: PolicyDefinitionDto[] = [
let policyDefinitions: PolicyDefinitionDto[] = [
{
policyDefinitionId: 'test-policy-definition-1',
policy: TestPolicies.connectorRestricted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
TransferHistoryPage,
UiAsset,
} from '@sovity.de/edc-client';
import {assets} from './asset-fake-service';
import {getAssetById} from './asset-fake-service';
import {TestAssets} from './data/test-assets';

export let transferHistoryEntries: TransferHistoryEntry[] = [
let transferHistoryEntries: TransferHistoryEntry[] = [
{
transferProcessId: '339b2a27-3b66-49f5-8b43-6a400d5914b5',
createdDate: new Date('2023-03-20T11:18:59.659Z'),
Expand Down Expand Up @@ -88,7 +88,7 @@ export const transferProcessAsset = (transferProcessId: string): UiAsset => {
TestAssets.dummyAsset(assetId),
);

const assetEntry = assets.find((it) => it.assetId === assetId);
const assetEntry = getAssetById(assetId);

return isProviding && assetEntry
? TestAssets.toAssetDto(assetEntry)
Expand Down

0 comments on commit 56e6547

Please sign in to comment.