Skip to content

Commit

Permalink
feat: switch icons and increase emphasis after feedback with S.K.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Jul 4, 2023
1 parent 11079e2 commit 8402ee7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"
mat-raised-button
color="primary"
[matTooltip]="data.contractAgreement?.statusTooltipText ?? ''"
[disabled]="!data.contractAgreement?.canTransfer"
(click)="onTransferClick()">
Transfer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ import {Policy} from '../../../core/services/api/legacy-managent-api-client';
import {AssetProperties} from '../../../core/services/asset-properties';
import {Asset} from '../../../core/services/models/asset';
import {BrokerDataOffer} from '../../../routes/broker-ui/catalog-page/catalog-page/mapping/broker-data-offer';
import {
ContractAgreementCardMapped
} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped';
import {ContractAgreementCardMapped} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped';
import {JsonDialogComponent} from '../../json-dialog/json-dialog/json-dialog.component';
import {JsonDialogData} from '../../json-dialog/json-dialog/json-dialog.data';
import {PropertyGridGroup} from '../../property-grid/property-grid-group/property-grid-group';
import {PropertyGridField} from '../../property-grid/property-grid/property-grid-field';
import {PropertyGridFieldService} from '../../property-grid/property-grid/property-grid-field.service';
import {formatDateAgo} from '../../ui-elements/ago/formatDateAgo';


@Injectable()
export class AssetPropertyGridGroupBuilder {
constructor(
private matDialog: MatDialog,
private activeFeatureSet: ActiveFeatureSet,
private propertyGridUtils: PropertyGridFieldService,
) {
}
) {}

buildAssetPropertiesGroup(
asset: Asset,
Expand Down Expand Up @@ -294,10 +290,12 @@ export class AssetPropertyGridGroupBuilder {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ export interface PropertyGridField {

copyButton?: boolean;
tooltip?: string | null;
textIconAfter?: string | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +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!"
[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!"
[matTooltip]="prop.tooltip!"
[attr.title]="prop.labelTitle">
{{ prop.label }}
</div>
Expand Down Expand Up @@ -46,13 +46,13 @@
<!-- Property Value (Text) with tooltip -->
<span
*ngIf="!(prop.url || prop.onclick)"
[matTooltip]="prop.tooltip!"
[matTooltip]="prop.tooltip!"
[ngClass]="prop.additionalClasses"
>{{ prop.text }}
<mat-icon *ngIf="prop.tooltip" class="mat-icon-[10px]"
>{{prop.icon}}
</mat-icon></span
>
<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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@
<div class="text-slate text-sm uppercase tracking-wider text-right">
Status
</div>
<div class="text-right">
<div class="text-right" [class.text-warn]="!card.canTransfer">
{{ card.statusText }}
<mat-icon
*ngIf="!card.canTransfer"
class="mat-icon-[10px]"
>info
<mat-icon *ngIf="!card.canTransfer" class="mat-icon-[12px]">
help
</mat-icon>
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ body {
line-height: 10px !important;
}

.mat-icon-\[12px\] {
font-size: 12px !important;
width: 12px !important;
height: 12px !important;
line-height: 12px !important;
}

.mat-icon-\[28px\] {
font-size: 28px !important;
width: 28px !important;
Expand Down

0 comments on commit 8402ee7

Please sign in to comment.