forked from eclipse-edc/DataDashboard
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/main' into 2024-01-09-ed…
…itable-assets # Conflicts: # CHANGELOG.md
- Loading branch information
Showing
25 changed files
with
383 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/app/component-library/catalog/asset-card-tag-list/asset-card-tag-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<mat-chip-list aria-label="Tags"> | ||
<mat-chip *ngIf="version" color="primary" selected>{{ version }}</mat-chip> | ||
<mat-chip | ||
*ngFor="let keyword of keywords | slice : 0 : numberOfKeywordsDisplayed" | ||
>{{ keyword }}</mat-chip | ||
> | ||
<mat-chip *ngIf="(keywords ?? []).length > numberOfKeywordsDisplayed"> | ||
+{{ keywords!.length - numberOfKeywordsDisplayed }} | ||
</mat-chip> | ||
</mat-chip-list> |
12 changes: 12 additions & 0 deletions
12
src/app/component-library/catalog/asset-card-tag-list/asset-card-tag-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Component, HostBinding, Input} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'asset-card-tag-list', | ||
templateUrl: './asset-card-tag-list.component.html', | ||
}) | ||
export class AssetCardTagListComponent { | ||
@HostBinding('class.block') cls = true; | ||
@Input() numberOfKeywordsDisplayed: number = 3; | ||
@Input() keywords: string[] | undefined; | ||
@Input() version: string | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...alog/small-icon-with-online-status-text/small-icon-with-online-status-text.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="flex items-center gap-2 text-[12px]" [ngClass]="color"> | ||
<mat-icon class="mat-icon-[16px]" [ngClass]="color">{{ icon }}</mat-icon> | ||
{{ text }} | ||
</div> |
27 changes: 27 additions & 0 deletions
27
...atalog/small-icon-with-online-status-text/small-icon-with-online-status-text.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {capitalize} from 'src/app/core/utils/string-utils'; | ||
import { | ||
ConnectorOnlineStatus, | ||
getOnlineStatusColor, | ||
getOnlineStatusSmallIcon, | ||
} from '../icon-with-online-status/online-status-utils'; | ||
|
||
@Component({ | ||
selector: 'small-icon-with-online-status-text', | ||
templateUrl: 'small-icon-with-online-status-text.component.html', | ||
}) | ||
export class SmallIconWithOnlineStatusText { | ||
@Input() onlineStatus!: ConnectorOnlineStatus; | ||
|
||
get text(): string { | ||
return capitalize(this.onlineStatus.toLowerCase()); | ||
} | ||
|
||
get color(): string { | ||
return getOnlineStatusColor(this.onlineStatus); | ||
} | ||
|
||
get icon(): string { | ||
return getOnlineStatusSmallIcon(this.onlineStatus); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/app/component-library/catalog/view-selection/view-mode-enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum ViewModeEnum { | ||
GRID, | ||
LIST, | ||
} |
16 changes: 16 additions & 0 deletions
16
src/app/component-library/catalog/view-selection/view-selection.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="flex flex-row items-center"> | ||
<button | ||
mat-icon-button | ||
matTooltip="Grid View" | ||
[class.!bg-[#EDEDED]]="selected === viewModeEnum.GRID" | ||
(click)="onSelection(viewModeEnum.GRID)"> | ||
<mat-icon class="mat-icon-[22px]">apps</mat-icon> | ||
</button> | ||
<button | ||
mat-icon-button | ||
matTooltip="List View" | ||
[class.!bg-[#EDEDED]]="selected === viewModeEnum.LIST" | ||
(click)="onSelection(viewModeEnum.LIST)"> | ||
<mat-icon>view_headline</mat-icon> | ||
</button> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
src/app/component-library/catalog/view-selection/view-selection.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {Component, EventEmitter, Input, Output} from '@angular/core'; | ||
import {ViewModeEnum} from './view-mode-enum'; | ||
|
||
@Component({ | ||
selector: 'view-selection', | ||
templateUrl: './view-selection.component.html', | ||
}) | ||
export class ViewSelectionComponent { | ||
viewModeEnum = ViewModeEnum; | ||
@Input() selected!: ViewModeEnum; | ||
@Output() selectedChange = new EventEmitter<ViewModeEnum>(); | ||
|
||
onSelection(view: ViewModeEnum) { | ||
this.selectedChange.emit(view); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export class LocalStorageUtils { | ||
saveData<T>(key: string, value: T) { | ||
localStorage.setItem(key, JSON.stringify(value)); | ||
} | ||
|
||
getData<T>(key: string): T | null { | ||
const storedItem = localStorage.getItem(key); | ||
|
||
return storedItem == null ? null : JSON.parse(storedItem); | ||
} | ||
|
||
removeData(key: string) { | ||
localStorage.removeItem(key); | ||
} | ||
|
||
clearData() { | ||
localStorage.clear(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {LocalStorageUtils} from './local-storage-utils'; | ||
|
||
export class LocalStoredValue<T> { | ||
localStorageUtils = new LocalStorageUtils(); | ||
|
||
constructor(private cachedValue: T, private key: string) { | ||
this.cachedValue = | ||
this.localStorageUtils.getData(this.key) ?? this.cachedValue; | ||
} | ||
|
||
get value(): T { | ||
return this.cachedValue; | ||
} | ||
|
||
set value(value: T) { | ||
if (this.cachedValue != value) { | ||
this.cachedValue = value; | ||
this.localStorageUtils.saveData(this.key, value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...outes/broker-ui/catalog-page/broker-data-offer-list/broker-data-offer-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<table mat-table [dataSource]="dataOffers"> | ||
<ng-container matColumnDef="status"> | ||
<th *matHeaderCellDef class="status-column" mat-header-cell>Status</th> | ||
<td *matCellDef="let offer" class="status-column" mat-cell> | ||
<small-icon-with-online-status-text | ||
[onlineStatus]=" | ||
offer.connectorOnlineStatus | ||
"></small-icon-with-online-status-text> | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="name"> | ||
<th *matHeaderCellDef class="name-column" mat-header-cell>Name</th> | ||
<td *matCellDef="let offer" class="name-column" mat-cell> | ||
{{ offer.asset.title }} | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="organizationName"> | ||
<th *matHeaderCellDef class="organization-column" mat-header-cell> | ||
Organization | ||
</th> | ||
<td *matCellDef="let offer" class="organization-column" mat-cell> | ||
{{ offer.asset.creatorOrganizationName }} | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="description"> | ||
<th *matHeaderCellDef class="description-column" mat-header-cell> | ||
Description | ||
</th> | ||
<td *matCellDef="let offer" class="description-column" mat-cell> | ||
{{ offer.asset.descriptionShortText }} | ||
</td> | ||
</ng-container> | ||
|
||
<tr *matHeaderRowDef="columnsToDisplay" mat-header-row></tr> | ||
<tr | ||
*matRowDef="let rowData; columns: columnsToDisplay" | ||
class="cursor-pointer hover:bg-gray-50" | ||
mat-row | ||
(click)="onRowClick(rowData)"></tr> | ||
</table> |
Oops, something went wrong.