Skip to content

Commit

Permalink
fix(admin-ui): Do not expose internal entity IDs
Browse files Browse the repository at this point in the history
Closes #178
  • Loading branch information
michaelbromley committed Oct 4, 2019
1 parent d50d488 commit 2ca9cc1
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/admin-ui/src/app/catalog/catalog.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function productVariantEditorBreadcrumb(data: any, params: any) {
link: ['../', 'products'],
},
{
label: `#${params.id} (${entity.name})`,
label: `${entity.name}`,
link: ['../', 'products', params.id, { tab: 'variants' }],
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-ui/src/app/common/detail-breadcrumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function detailBreadcrumb<T>(options: {
if (options.id === 'create') {
label = 'common.create';
} else {
label = `#${options.id} (${options.getName(entity)})`;
label = `${options.getName(entity)}`;
}
return [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@
(pageChange)="setPageNumber($event)"
(itemsPerPageChange)="setItemsPerPage($event)"
>
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column [expand]="true">{{ 'customer.name' | translate }}</vdr-dt-column>
<vdr-dt-column [expand]="true">{{ 'customer.email-address' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'customer.customer-type' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-customer="item">
<td class="left align-middle">{{ customer.id }}</td>
<td class="left align-middle">
{{ customer.title }} {{ customer.firstName }} {{ customer.lastName }}
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
(pageChange)="setPageNumber($event)"
(itemsPerPageChange)="setItemsPerPage($event)"
>
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.name' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.created-at' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.updated-at' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-promotion="item">
<td class="left align-middle">{{ promotion.id }}</td>
<td class="left align-middle">{{ promotion.name }}</td>
<td class="left align-middle">{{ promotion.createdAt | date: 'longDate' }}</td>
<td class="left align-middle">{{ promotion.updatedAt | date: 'longDate' }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h4>{{ 'order.order-history' | translate }}</h4>
*ngIf="entry.data.to === 'Settled'; else regularPaymentTransition"
>
<div class="title">
{{ 'order.history-payment-settled' | translate: { id: entry.data.paymentId } }}
{{ 'order.history-payment-settled' | translate }}
</div>
{{ 'order.transaction-id' | translate }}: {{ getPayment(entry)?.transactionId }}
<vdr-history-entry-detail *ngIf="getPayment(entry) as payment">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@
(pageChange)="setPageNumber($event)"
(itemsPerPageChange)="setItemsPerPage($event)"
>
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'order.customer' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'order.state' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'order.total' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.updated-at' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-order="item">
<td class="left align-middle">{{ order.id }}</td>
<td class="left align-middle">{{ order.code }}</td>
<td class="left align-middle">
<vdr-customer-label [customer]="order.customer"></vdr-customer-label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="card">
<div class="card-header payment-header">
<div>{{ 'order.payment' | translate }} #{{ payment.id }}</div>
<div>{{ 'order.payment' | translate }} #{{ payment.transactionId }}</div>
<div class="payment-state">
<vdr-payment-state-label [state]="payment.state"></vdr-payment-state-label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
(pageChange)="setPageNumber($event)"
(itemsPerPageChange)="setItemsPerPage($event)"
>
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'settings.first-name' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'settings.last-name' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'settings.email-address' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-administrator="item">
<td class="left align-middle">{{ administrator.id }}</td>
<td class="left align-middle">{{ administrator.firstName }}</td>
<td class="left align-middle">{{ administrator.lastName }}</td>
<td class="left align-middle">{{ administrator.emailAddress }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
</vdr-action-bar>

<vdr-data-table [items]="channels$ | async">
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-channel="item">
<td class="left align-middle">{{ channel.id }}</td>
<td class="left align-middle">{{ channel.code }}</td>
<td class="right align-middle">
<vdr-table-row-action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
(pageChange)="setPageNumber($event)"
(itemsPerPageChange)="setItemsPerPage($event)"
>
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.description' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'settings.permissions' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-role="item">
<td class="left align-middle">{{ role.id }}</td>
<td class="left align-middle">{{ role.code }}</td>
<td class="left align-middle">{{ role.description }}</td>
<td class="left align-middle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
</vdr-action-bar>

<vdr-data-table [items]="taxCategories$ | async">
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.name' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-taxCategory="item">
<td class="left align-middle">{{ taxCategory.id }}</td>
<td class="left align-middle">{{ taxCategory.name }}</td>
<td class="right align-middle">
<vdr-table-row-action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
(pageChange)="setPageNumber($event)"
(itemsPerPageChange)="setItemsPerPage($event)"
>
<vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'common.name' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'settings.tax-category' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'settings.zone' | translate }}</vdr-dt-column>
<vdr-dt-column>{{ 'settings.tax-rate' | translate }}</vdr-dt-column>
<vdr-dt-column></vdr-dt-column>
<ng-template let-taxRate="item">
<td class="left align-middle">{{ taxRate.id }}</td>
<td class="left align-middle">{{ taxRate.name }}</td>
<td class="left align-middle">{{ taxRate.category.name }}</td>
<td class="left align-middle">{{ taxRate.zone.name }}</td>
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-ui/src/i18n-messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
"history-order-cancelled": "Order cancelled",
"history-order-fulfilled": "Order fulfilled",
"history-order-transition": "Order transitioned from {from} to {to}",
"history-payment-settled": "Payment #{id} settled",
"history-payment-settled": "Payment settled",
"history-payment-transition": "Payment #{id} transitioned from {from} to {to}",
"history-refund-transition": "Refund #{id} transitioned from {from} to {to}",
"item-count": "{count} {count, plural, one {item} other {items}}",
Expand Down

0 comments on commit 2ca9cc1

Please sign in to comment.