Skip to content

Commit

Permalink
[framework] identify company and user by icon in customer list (#3366)
Browse files Browse the repository at this point in the history
  • Loading branch information
malyMiso committed Aug 26, 2024
2 parents 3841175 + e7d5816 commit b54ce8f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
24 changes: 24 additions & 0 deletions assets/public/admin/svg/company.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions assets/public/admin/svg/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Controller/Admin/CustomerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ protected function manipulateRow(array $row): array
{
$domain = $this->domain->getDomainConfigById($row['domainId']);

$row['showEditBillingAddressLink'] = $domain->isB2b() && $row['isCompanyCustomer'];
$row['isB2bCompany'] = $domain->isB2b() && $row['isCompanyCustomer'];

return $row;
}
Expand Down
18 changes: 12 additions & 6 deletions src/Resources/views/Admin/Content/Customer/listGrid.html.twig
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{% extends '@ShopsysFramework/Admin/Grid/Grid.html.twig' %}

{% block grid_value_cell_id_name %}
{% if not row.showEditBillingAddressLink %}
<a href="{{ url('admin_customer_edit', { id: row.id }) }}">{{ value }}</a>
{% if not row.isB2bCompany %}
<a href="{{ url('admin_customer_edit', { id: row.id }) }}">
<i class="svg svg-user" title="{{ 'User'|trans }}"></i>
{{ value }}
</a>
{% else %}
<a href="{{ url('admin_billing_address_edit', {id: row.billingAddressId}) }}">{{ value }}</a>
<a href="{{ url('admin_billing_address_edit', {id: row.billingAddressId}) }}">
<i class="svg svg-company" title="{{ 'Company'|trans }}"></i>
{{ value }}
</a>
{% endif %}
{% endblock %}

Expand All @@ -26,7 +32,7 @@
{% endblock %}

{% block grid_action_cell_type_edit %}
{% if not row.showEditBillingAddressLink %}
{% if not row.isB2bCompany %}
{{ gridView.renderBlock('grid_action_cell', {actionColumn: actionColumn, row: row}) }}
{% else %}
<a class="in-icon in-icon--edit svg svg-pencil table-action" href="{{ url('admin_billing_address_edit', {id: row.billingAddressId}) }}" title="{{ 'Edit'|trans }}"></a>
Expand All @@ -35,7 +41,7 @@


{% block grid_action_cell_type_delete %}
{% if not row.showEditBillingAddressLink %}
{% if not row.isB2bCompany %}
{{ gridView.renderBlock('grid_action_cell', {actionColumn: actionColumn, row: row}) }}
{% else %}
{% set customerId = row.customerId %}
Expand All @@ -54,7 +60,7 @@
{% endblock %}

{% block grid_action_cell_type_resetPassword %}
{% if not row.showEditBillingAddressLink %}
{% if not row.isB2bCompany %}
{{ gridView.renderBlock('grid_action_cell', {actionColumn: actionColumn, row: row}) }}
{% endif %}
{% endblock %}

0 comments on commit b54ce8f

Please sign in to comment.