make shop name a link on /account

This commit is contained in:
Eduardo
2020-04-05 20:58:52 -03:00
parent fde2aac366
commit e7b780f963
3 changed files with 12 additions and 2 deletions

View File

@@ -13,7 +13,8 @@
%tr.order-row
%td.order1
%a{"ng-href" => "{{::order.path}}", "ng-bind" => "::order.number"}
%td.order2{"ng-bind" => "::Orders.shopsByID[order.shop_id].name"}
%td.order2
%a{"ng-href" => "{{::Orders.shopsByID[order.shop_id].hash}}#{main_app.shop_path}", "ng-bind" => "::Orders.shopsByID[order.shop_id].name"}
%td.order3.show-for-large-up{"ng-bind" => "::order.changes_allowed_until"}
%td.order4.show-for-large-up{"ng-bind" => "::order.item_count"}
%td.order5.text-right{"ng-class" => "{'credit' : order.total < 0, 'debit' : order.total > 0, 'paid' : order.total == 0}","ng-bind" => "::order.total | localizeCurrency"}

View File

@@ -13,7 +13,8 @@
%tr.order-row
%td.order1
%a{"ng-href" => "{{::order.path}}", "ng-bind" => "::order.number"}
%td.order2{"ng-bind" => "::Orders.shopsByID[order.shop_id].name"}
%td.order2
%a{"ng-href" => "{{::Orders.shopsByID[order.shop_id].hash}}#{main_app.shop_path}", "ng-bind" => "::Orders.shopsByID[order.shop_id].name"}
%td.order3.show-for-large-up{"ng-bind" => "::order.completed_at"}
%td.order4.show-for-large-up{"ng-bind" => "::order.item_count"}
%td.order5.text-right{"ng-class" => "{'debit': order.payment_state != 'paid', 'credit': order.payment_state == 'paid'}","ng-bind" => "::order.total | localizeCurrency"}

View File

@@ -42,8 +42,14 @@ feature '
# Lists all other orders
expect(page).to have_content d1o1.number.to_s
expect(page).to have_content d1o2.number.to_s
expect(page).to have_link(distributor1.name,
href: "#{distributor1.permalink}/shop", count: 2)
expect(page).to have_content d2o1.number.to_s
expect(page).to have_link(distributor2.name,
href: "#{distributor2.permalink}/shop", count: 1)
expect(page).to have_content credit_order.number.to_s
expect(page).to have_link(distributor_credit.name,
href: "#{distributor_credit.permalink}/shop", count: 1)
# Viewing transaction history
click_link I18n.t('spree.users.show.tabs.transactions')
@@ -75,6 +81,8 @@ feature '
expect(page).to have_link d1o1.number, href: spree.order_path(d1o1)
expect(page).to have_link d1o2.number, href: spree.order_path(d1o2)
expect(page).to have_link(distributor1.name,
href: "#{distributor1.permalink}/shop", count: 2)
expect(page).to have_link I18n.t('spree.users.open_orders.cancel'), href: spree.cancel_order_path(d1o1)
expect(page).to have_link I18n.t('spree.users.open_orders.cancel'), href: spree.cancel_order_path(d1o2)
end