Skip to content

Commit

Permalink
Merge branch 'main' into 106-fix-chart-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier authored Jul 4, 2023
2 parents d6cc1e7 + 188f2b1 commit 8c27de7
Show file tree
Hide file tree
Showing 59 changed files with 1,294 additions and 449 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ the detailed section referring to by linking pull requests or issues.

#### Added

- Parameterization of Http Data Sources.
- Enteprise Edition (Basic): Added support for consuming contract agreement
limits.

#### Changed

#### Removed
Expand Down
4 changes: 4 additions & 0 deletions fake-backend/json/connectorLimits.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"numActiveConsumingContractAgreements": 2,
"maxActiveConsumingContractAgreements": 1
}
8 changes: 7 additions & 1 deletion fake-backend/json/contractAgreementPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@
"assetId": "urn:artifact:my-test-asset-2",
"createdAt": "2023-04-24T12:32:28.492Z",
"properties": {
"asset:prop:id": "urn:artifact:my-test-asset-2"
"asset:prop:id": "urn:artifact:my-test-asset-2",
"asset:prop:datasource:http:hints:proxyMethod": "true",
"asset:prop:datasource:http:hints:proxyPath": "true",
"asset:prop:datasource:http:hints:proxyQueryParams": "true",
"asset:prop:datasource:http:hints:proxyBody": "true",
"asset:prop:datasource:http:hints:defaultMethod": "GET",
"asset:prop:datasource:http:hints:defaultPath": "/"
}
},
"contractPolicy": {
Expand Down
6 changes: 6 additions & 0 deletions fake-backend/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ app.get('/api/v1/data/wrapper/ui/pages/contract-agreement-page', (_, res) => {
res.json(contractAgreementPage);
});

// Connector Limits
const connectorLimits = json('json/connectorLimits.json');
app.get('/api/v1/data/wrapper/ee/connector-limits', (_, res) => {
res.json(connectorLimits);
});

// Broker API Wrapper
const brokerCatalogPage = json('json/brokerCatalogPage.json');
app.post('/api/v1/data/wrapper/broker/catalog-page', (_, res) => {
Expand Down
218 changes: 104 additions & 114 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"@angular/router": "^14.3.0",
"@ng-apimock/core": "^3.6.0",
"@ngxs/store": "^3.8.1",
"@sovity.de/edc-client": "0.20230531.73811-main-e140ef56",
"@sovity.de/broker-server-client": "0.20230703.152001-main-d1ec5276",
"@sovity.de/edc-client": "0.20230629.150330-main-aaa2fa41",
"clean-deep": "^3.4.0",
"date-fns": "^2.29.3",
"dotenv": "^16.0.3",
Expand All @@ -40,11 +41,11 @@
"zone.js": "^0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.2.11",
"@angular/cli": "^14.2.11",
"@angular-devkit/build-angular": "^14.2.12",
"@angular/cli": "^14.2.12",
"@angular/compiler-cli": "^14.3.0",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/jasmine": "^4.3.4",
"@types/jasmine": "^4.3.5",
"@types/node": "^18.15.13",
"jasmine-core": "^4.6.0",
"karma": "^6.4.2",
Expand All @@ -62,7 +63,7 @@
"typescript": "^4.8.4"
},
"resolutions": {
"@angular-devkit/build-angular": "14.2.11",
"@angular-devkit/build-angular": "14.2.12",
"@angular-devkit/core": "14.3.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
"
mat-raised-button
color="primary"
[matTooltip]="data.contractAgreement?.statusTooltipText ?? ''"
[disabled]="!data.contractAgreement?.canTransfer"
(click)="onTransferClick()">
Transfer
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class AssetDetailDialogComponent implements OnDestroy {
onTransferClick() {
const data: ContractAgreementTransferDialogData = {
contractId: this.data.contractAgreement?.contractAgreementId!!,
asset: this.data.asset,
};
this.matDialog.open(ContractAgreementTransferDialogComponent, {
data,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Injectable} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {DataOfferListEntryContractOffer} from '@sovity.de/edc-client';
import {CatalogContractOffer} from '@sovity.de/broker-server-client';
import {ActiveFeatureSet} from '../../../core/config/active-feature-set';
import {Policy} from '../../../core/services/api/legacy-managent-api-client';
import {AssetProperties} from '../../../core/services/asset-properties';
Expand Down Expand Up @@ -174,7 +174,7 @@ export class AssetPropertyGridGroupBuilder {

buildContractOfferGroup(
asset: Asset,
contractOffer: DataOfferListEntryContractOffer,
contractOffer: CatalogContractOffer,
i: number,
total: number,
) {
Expand Down Expand Up @@ -236,63 +236,72 @@ export class AssetPropertyGridGroupBuilder {
}

buildContractAgreementGroup(contractAgreement: ContractAgreementCardMapped) {
return {
groupLabel: 'Contract Agreement',
properties: [
{
icon: 'category',
label: 'Signed',
...this.propertyGridUtils.guessValue(
this.propertyGridUtils.formatDate(
contractAgreement.contractSigningDate,
),
),
},
{
icon: 'category',
label: 'Valid From',
...this.propertyGridUtils.guessValue(
this.propertyGridUtils.formatDate(
contractAgreement.contractStartDate,
),
),
},
{
icon: 'category',
label: 'Valid To',
...this.propertyGridUtils.guessValue(
this.propertyGridUtils.formatDate(
contractAgreement.contractEndDate,
),
),
},
{
icon: 'policy',
label: 'Direction',
...this.propertyGridUtils.guessValue(contractAgreement.direction),
},
{
icon: 'link',
label: 'Other Connector Endpoint',
...this.propertyGridUtils.guessValue(
contractAgreement.counterPartyAddress,
),
},
{
icon: 'link',
label: 'Other Connector ID',
...this.propertyGridUtils.guessValue(
contractAgreement.counterPartyId,
let properties: PropertyGridField[] = [
{
icon: 'category',
label: 'Signed',
...this.propertyGridUtils.guessValue(
this.propertyGridUtils.formatDate(
contractAgreement.contractSigningDate,
),
},
{
icon: 'category',
label: 'Contract Agreement ID',
...this.propertyGridUtils.guessValue(
contractAgreement.contractAgreementId,
),
},
{
icon: 'category',
label: 'Valid From',
...this.propertyGridUtils.guessValue(
this.propertyGridUtils.formatDate(
contractAgreement.contractStartDate,
),
},
],
),
},
{
icon: 'category',
label: 'Valid To',
...this.propertyGridUtils.guessValue(
this.propertyGridUtils.formatDate(contractAgreement.contractEndDate),
),
},
{
icon: 'policy',
label: 'Direction',
...this.propertyGridUtils.guessValue(contractAgreement.direction),
},
{
icon: 'link',
label: 'Other Connector Endpoint',
...this.propertyGridUtils.guessValue(
contractAgreement.counterPartyAddress,
),
},
{
icon: 'link',
label: 'Other Connector ID',
...this.propertyGridUtils.guessValue(contractAgreement.counterPartyId),
},
{
icon: 'category',
label: 'Contract Agreement ID',
...this.propertyGridUtils.guessValue(
contractAgreement.contractAgreementId,
),
},
];

if (contractAgreement.isConsumingLimitsEnforced) {
properties.push({
icon: contractAgreement.canTransfer ? 'sync' : 'sync_disabled',
label: 'Status',
tooltip: contractAgreement.statusTooltipText,
textIconAfter: contractAgreement.statusTooltipText ? 'help' : null,
text: contractAgreement.statusText,
additionalClasses: 'text-warn',
});
}

return {
groupLabel: 'Contract Agreement',
properties,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@ import {DataAddressTypeSelectMode} from './data-address-type-select-mode';

export const dataAddressTypeSelectItems = (
type: DataAddressTypeSelectMode,
): DataAddressTypeSelectItem[] => [
{
id: 'Http',
label: 'REST-API Endpoint',
},
{
id: 'Custom-Data-Address-Json',
label: `Custom ${type} Config (JSON)`,
},
];
): DataAddressTypeSelectItem[] => {
let items: DataAddressTypeSelectItem[] = [
{
id: 'Http',
label: 'REST-API Endpoint',
},
{
id: 'Custom-Data-Address-Json',
label: `Custom ${type} Config (JSON)`,
},
];

if (type === 'Datasink') {
items.push({
id: 'Custom-Transfer-Process-Request',
label: 'Custom Transfer Process Request (JSON)',
});
}

return items;
};
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export type DataAddressType = 'Custom-Data-Address-Json' | 'Http';
export type DataAddressType =
| 'Custom-Data-Address-Json'
| 'Custom-Transfer-Process-Request'
| 'Http';
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ export interface PropertyGridField {
additionalClasses?: string;

copyButton?: boolean;
tooltip?: string | null;
textIconAfter?: string | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
class=""
emptyMessage="No properties."></empty-state>
<div
*ngFor="let prop of props"
*ngFor="let prop of props; trackBy: trackByIndex"
class="flex flex-row space-x-[10px] overflow-hidden"
[style.width]="'calc(100% / ' + columns + ' - ' + (columns - 1) * 10 + 'px)'">
<!-- Property Icon -->
<mat-icon
style="flex-shrink: 0; margin-top: 6px"
[matTooltip]="prop.tooltip!"
[attr.title]="prop.labelTitle"
>{{ prop.icon }}</mat-icon
>
<div class="flex flex-col">
<!-- Property Label -->
<div
class="uppercase text-slate text-sm break-all"
[matTooltip]="prop.tooltip!"
[attr.title]="prop.labelTitle">
{{ prop.label }}
</div>
Expand All @@ -41,12 +43,16 @@
>{{ prop.text }}</a
>

<!-- Property Value (Text) -->
<!-- Property Value (Text) with tooltip -->
<span
*ngIf="!(prop.url || prop.onclick)"
[matTooltip]="prop.tooltip!"
[ngClass]="prop.additionalClasses"
>{{ prop.text }}</span
>
>{{ prop.text }}
<mat-icon *ngIf="prop.textIconAfter" class="mat-icon-[12px]">
{{ prop.textIconAfter }}
</mat-icon>
</span>
</div>
<button
*ngIf="prop.copyButton"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, HostBinding, Input} from '@angular/core';
import {Component, HostBinding, Input, TrackByFunction} from '@angular/core';
import {PropertyGridField} from './property-grid-field';

@Component({
Expand All @@ -17,4 +17,6 @@ export class PropertyGridComponent {
@HostBinding('class.gap-[10px]')
@HostBinding('class.justify-start')
cls = true;

trackByIndex: TrackByFunction<any> = (index: number) => index;
}
4 changes: 4 additions & 0 deletions src/app/core/config/active-feature-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export class ActiveFeatureSet {
return this.has('mds-fields');
}

hasConnectorLimits(): boolean {
return this.has('connector-limits');
}

has(feature: EdcUiFeature): boolean {
return this.config.features.has(feature);
}
Expand Down
5 changes: 4 additions & 1 deletion src/app/core/config/profiles/edc-ui-feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ export type EdcUiFeature =
| 'logout-button'

// Enables marketing for sovity in open-source variants
| 'open-source-marketing';
| 'open-source-marketing'

// Enterprise Edition specific attribute to view limits enforced on consuming contract agreements
| 'connector-limits';
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {EdcUiFeature} from '../edc-ui-feature';

export const ENTERPRISE_EDITION_FEATURES: EdcUiFeature[] = [
'sovity-zammad-integration',
'logout-button',
'connector-limits',
'sovity-zammad-integration',
];
Loading

0 comments on commit 8c27de7

Please sign in to comment.