// Imports
import UserRoles from '../../core/auth/constants/userRoles';
import WorkshopListController from './workshop-list.controller';
import WorkshopListHeaderController from './workshop-list-header.controller';
import { workshops } from './workshop-list.resolve';

/**
 * @ngInject
 * @param RouterHelper
 */
export default function routing(RouterHelper) {
  const states = [{
    state: 'modules.workshop_list',
    config: {
      url: '/palvelut/:serviceType/:carBrand/:city',
      title: 'Korjaamot',
      data: {
        access: UserRoles.ROLE_ANON,
      },
      views: {
        'content@': {
          template: require('./partials/list.html'),
          controller: WorkshopListController,
          controllerAs: 'vm',
          resolve: {
            _workshops: workshops,
          },
        },
        'header@': {
          template: require('./partials/header.html'),
          controller: WorkshopListHeaderController,
          controllerAs: 'vm',
        },
      },
    },
  }];

  RouterHelper.configureStates(states);
}

@@ -302,16 +302,56 @@
 rHelper%0A
+ * @param WorkshopListSharedDataService%0A
  */%0Aexpo
@@ -390,16 +390,47 @@
 erHelper
+, WorkshopListSharedDataService
 ) %7B%0A  co
@@ -856,16 +856,182 @@
 kshops,%0A
+            _sharedData() %7B%0A              // Set order to distance when coming to page%0A              WorkshopListSharedDataService.order = 'distance';%0A            %7D,%0A
         

Set workshop list order to distance when coming to page