-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin-ui): Improve layout of OrderDetailComponent
- Loading branch information
1 parent
fa7203d
commit c1d8664
Showing
13 changed files
with
220 additions
and
157 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
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
246 changes: 106 additions & 140 deletions
246
admin-ui/src/app/order/components/order-detail/order-detail.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 |
---|---|---|
@@ -1,154 +1,120 @@ | ||
<vdr-action-bar> | ||
<vdr-ab-left></vdr-ab-left> | ||
<vdr-action-bar *ngIf="entity$ | async as order"> | ||
<vdr-ab-left> | ||
<div class="clr-row clr-flex-column"> | ||
<vdr-order-state-label [state]="order.state"></vdr-order-state-label> | ||
<div class="date-detail"> | ||
<clr-icon shape="calendar"></clr-icon> | ||
{{ 'common.updated' | translate }}: | ||
<strong>{{ order.updatedAt | date: 'medium' }}</strong> | ||
</div> | ||
</div> | ||
</vdr-ab-left> | ||
|
||
<vdr-ab-right></vdr-ab-right> | ||
</vdr-action-bar> | ||
|
||
<div *ngIf="entity$ | async as order"> | ||
<div class="clr-row"> | ||
<div class="clr-col-md-4"> | ||
<table class="table table-vertical"> | ||
<tbody> | ||
<tr> | ||
<th>{{ 'order.order-code' | translate }}</th> | ||
<td>{{ order.code }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ 'order.state' | translate }}</th> | ||
<td>{{ order.state }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ 'common.created' | translate }}</th> | ||
<td>{{ order.createdAt | date: 'medium' }}</td> | ||
</tr> | ||
<div class="clr-col-lg-8"> | ||
<table class="order-lines table"> | ||
<thead> | ||
<tr> | ||
<th>{{ 'common.updated' | translate }}</th> | ||
<td>{{ order.updatedAt | date: 'medium' }}</td> | ||
<th></th> | ||
<th>{{ 'order.product-name' | translate }}</th> | ||
<th>{{ 'order.product-sku' | translate }}</th> | ||
<th>{{ 'order.unit-price' | translate }}</th> | ||
<th>{{ 'order.quantity' | translate }}</th> | ||
<th>{{ 'order.total' | translate }}</th> | ||
</tr> | ||
</tbody> | ||
</thead> | ||
<tr *ngFor="let line of order.lines" class="order-line"> | ||
<td class="thumb"><img [src]="line.featuredAsset.preview + '?preset=tiny'" /></td> | ||
<td class="name">{{ line.productVariant.name }}</td> | ||
<td class="sku">{{ line.productVariant.sku }}</td> | ||
<td class="unit-price"> | ||
{{ line.unitPriceWithTax / 100 | currency: order.currencyCode }} | ||
</td> | ||
<td class="quantity">{{ line.quantity }}</td> | ||
<td class="total">{{ line.totalPrice / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="sub-total"> | ||
<td class="left">{{ 'order.sub-total' | translate }}</td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td>{{ order.subTotal / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="order-ajustment" *ngFor="let adjustment of order.adjustments"> | ||
<td colspan="5" class="left">{{ adjustment.description }}</td> | ||
<td>{{ adjustment.amount / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="shipping"> | ||
<td class="left">{{ 'order.shipping' | translate }}</td> | ||
<td>{{ order.shippingMethod?.description }}</td> | ||
<td colspan="3"></td> | ||
<td>{{ order.shipping / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="total"> | ||
<td class="left">{{ 'order.total' | translate }}</td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td>{{ order.total / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<div class="clr-col-md-4"> | ||
<table class="table table-vertical"> | ||
<tbody> | ||
<tr> | ||
<th>{{ 'order.customer' | translate }}</th> | ||
<td><vdr-customer-label [customer]="order.customer"></vdr-customer-label></td> | ||
</tr> | ||
<tr> | ||
<th>{{ 'order.shipping-address' | translate }}</th> | ||
<td> | ||
<div | ||
class="address-line" | ||
*ngFor="let line of getShippingAddressLines(order.shippingAddress)" | ||
> | ||
<div class="clr-col-lg-4 order-cards"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
{{ 'order.customer' | translate }} | ||
</div> | ||
<div class="card-block"> | ||
<div class="card-text"> | ||
<vdr-customer-label [customer]="order.customer"></vdr-customer-label> | ||
<h6 *ngIf="getShippingAddressLines(order.shippingAddress).length"> | ||
{{ 'order.shipping-address' | translate }} | ||
</h6> | ||
<ul class="shipping-address"> | ||
<li *ngFor="let line of getShippingAddressLines(order.shippingAddress)"> | ||
{{ line }} | ||
</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="clr-col-md-4" *ngIf="order.payments && order.payments.length"> | ||
<table class="table table-vertical"> | ||
<tbody> | ||
<ng-container *ngFor="let payment of order.payments"> | ||
<tr> | ||
<th>{{ 'order.payment-state' | translate }}</th> | ||
<td> | ||
{{ payment.state }} | ||
<ng-container *ngIf="payment.state === 'Authorized'"> | ||
<vdr-dropdown> | ||
<button class="icon-button" vdrDropdownTrigger> | ||
<clr-icon shape="ellipsis-vertical"></clr-icon> | ||
</button> | ||
<vdr-dropdown-menu vdrPosition="bottom-right"> | ||
<button | ||
type="button" | ||
vdrDropdownItem | ||
[disabled]="i === 0" | ||
(click)="settlePayment(payment)" | ||
> | ||
{{ 'order.settle-payment' | translate }} | ||
</button> | ||
</vdr-dropdown-menu> | ||
</vdr-dropdown> | ||
</ng-container> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>{{ 'order.payment-method' | translate }}</th> | ||
<td>{{ payment.method }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ 'order.amount' | translate }}</th> | ||
<td>{{ payment.amount / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ 'order.transaction-id' | translate }}</th> | ||
<td>{{ payment.transactionId }}</td> | ||
</tr> | ||
<tr> | ||
<th>{{ 'order.payment-metadata' | translate }}</th> | ||
<td> | ||
<ul class="payment-metadata"> | ||
<li *ngFor="let entry of getPaymentMetadata(payment)"> | ||
<strong>{{ entry[0] }}</strong> | ||
: {{ entry[1] }} | ||
</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
</ng-container> | ||
</tbody> | ||
</table> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<ng-container *ngIf="order.payments && order.payments.length"> | ||
<div class="card" *ngFor="let payment of order.payments"> | ||
<div class="card-header"> | ||
{{ 'order.payment' | translate }} | ||
</div> | ||
<div class="card-block"> | ||
<h6>{{ 'order.payment-state' | translate }}</h6> | ||
{{ payment.state }} | ||
<h6>{{ 'order.payment-method' | translate }}</h6> | ||
{{ payment.method }} | ||
<h6>{{ 'order.amount' | translate }}</h6> | ||
{{ payment.amount / 100 | currency: order.currencyCode }} | ||
<h6>{{ 'order.transaction-id' | translate }}</h6> | ||
{{ payment.transactionId }} | ||
<h6>{{ 'order.payment-metadata' | translate }}</h6> | ||
<ul class="payment-metadata"> | ||
<li *ngFor="let entry of getPaymentMetadata(payment)"> | ||
<span class="metadata-prop">{{ entry[0] }}:</span> | ||
{{ entry[1] }} | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="card-footer"> | ||
<ng-container *ngIf="payment.state === 'Authorized'"> | ||
<button class="btn btn-sm btn-link" (click)="settlePayment(payment)"> | ||
{{ 'order.settle-payment' | translate }} | ||
</button> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</div> | ||
|
||
<table class="order-lines table"> | ||
<thead> | ||
<tr> | ||
<th></th> | ||
<th>{{ 'order.product-name' | translate }}</th> | ||
<th>{{ 'order.product-sku' | translate }}</th> | ||
<th>{{ 'order.unit-price' | translate }}</th> | ||
<th>{{ 'order.quantity' | translate }}</th> | ||
<th>{{ 'order.total' | translate }}</th> | ||
</tr> | ||
</thead> | ||
<tr *ngFor="let line of order.lines" class="order-line"> | ||
<td class="thumb"><img [src]="line.featuredAsset.preview + '?preset=tiny'" /></td> | ||
<td class="name">{{ line.productVariant.name }}</td> | ||
<td class="sku">{{ line.productVariant.sku }}</td> | ||
<td class="unit-price">{{ line.unitPriceWithTax / 100 | currency: order.currencyCode }}</td> | ||
<td class="quantity">{{ line.quantity }}</td> | ||
<td class="total">{{ line.totalPrice / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="sub-total"> | ||
<td class="left">{{ 'order.sub-total' | translate }}</td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td>{{ order.subTotal / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="order-ajustment" *ngFor="let adjustment of order.adjustments"> | ||
<td colspan="5" class="left">{{ adjustment.description }}</td> | ||
<td>{{ adjustment.amount / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="shipping"> | ||
<td class="left">{{ 'order.shipping' | translate }}</td> | ||
<td>{{ order.shippingMethod?.description }}</td> | ||
<td colspan="3"></td> | ||
<td>{{ order.shipping / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
<tr class="total"> | ||
<td class="left">{{ 'order.total' | translate }}</td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td>{{ order.total / 100 | currency: order.currencyCode }}</td> | ||
</tr> | ||
</table> | ||
</div> |
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
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
1 change: 1 addition & 0 deletions
1
admin-ui/src/app/shared/components/order-state-label/order-state-label.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 @@ | ||
<vdr-chip [ngClass]="state">{{ stateToken | translate }}</vdr-chip> |
Oops, something went wrong.