Skip to content

Commit

Permalink
0.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mikerodonnell89 committed Oct 6, 2015
1 parent cbd4fdc commit 6555af8
Show file tree
Hide file tree
Showing 31 changed files with 306 additions and 168 deletions.
5 changes: 4 additions & 1 deletion config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module.exports = function(config){
'public/js/app/shared/services/cookie-svc.js',
'public/js/app/shared/services/site-settings-rest.js',
'public/js/app/shared/filters/filters.js',
'public/js/app/shared/filters/show-number-of-items-filter.js',
'public/js/app/shared/filters/sum-by-key-filter.js',
'public/js/app/shared/services/global-data.js',
'public/js/app/shared/services/site-settings-rest.js',
'public/js/app/shared/services/configuration-service.js',
Expand Down Expand Up @@ -155,7 +157,8 @@ module.exports = function(config){
'test/unit/orders/*.js',
'test/unit/products/*.js',
'test/unit/search/*.js',
'test/unit/shared/*.js'
'test/unit/shared/*.js',
'test/unit/shared/*/*.js'

],

Expand Down
5 changes: 3 additions & 2 deletions config/protractor-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var ScreenShotReporter = require('protractor-screenshot-reporter');

exports.config = {
allScriptsTimeout: 45000,
//comment out keys to run locally
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,

Expand All @@ -19,7 +20,7 @@ exports.config = {
'browserName': 'chrome',
'maxInstances': 6,
'shardTestFiles': true,
//comment out the following capabilities to run locally
//comment out the following Saucelabs capabilities to run locally
'platform': 'OS X 10.8',
'screen-resolution': '1280x1024',
'record-video': false,
Expand All @@ -28,7 +29,7 @@ exports.config = {

// not currently using phantomjs
// 'browserName': 'phantomjs',
'phantomjs.cli.args': ['--ignore-ssl-errors=true', '--web-security=false', '--ssl-protocol=any']
// 'phantomjs.cli.args': ['--ignore-ssl-errors=true', '--web-security=false', '--ssl-protocol=any']

},

Expand Down
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
<script src="js/app/shared/controllers/sidebar-navigation-ctrl.js"></script>
<script src="js/app/shared/controllers/top-navigation-ctrl.js"></script>
<script src="js/app/shared/filters/filters.js"></script>
<script src="js/app/shared/filters/show-number-of-items-filter.js"></script>
<script src="js/app/shared/filters/sum-by-key-filter.js"></script>
<script src="js/app/shared/i18n/i18-index.js"></script>
<script src="js/app/shared/i18n/i18-constants.js"></script>
<script src="js/app/shared/i18n/lang/en.js"></script>
Expand Down
14 changes: 1 addition & 13 deletions public/js/app/account/controllers/account-ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,8 @@ angular.module('ds.account')
$scope.showAllOrdersButton = true;
$scope.showOrderButtons = ($scope.orders.length >= $scope.showOrdersDefault);
$scope.showOrdersFilter = $scope.showOrdersDefault;

$scope.titles = [];
var titlesToTranslate = ['MR', 'MS', 'MRS', 'DR'];

/*
need to translate titles on page load
*/
angular.forEach(titlesToTranslate, function (title) {
$translate(title).then(function (translatedValue) {
$scope.titles.push(translatedValue);
});
});
$scope.titles = GlobalData.getUserTitles();

$scope.editAccountInfo = function(mtype){
$scope.mtype = mtype;
Expand Down Expand Up @@ -227,8 +217,6 @@ angular.module('ds.account')
// show filtered list or show all orders. Hide if all data is shown within filter.
$scope.showOrdersFilter = $scope.showAllOrdersButton ? $scope.showOrdersDefault : $scope.orders.length;
$scope.showOrderButtons = ($scope.orders.length > $scope.showOrdersDefault);


});
};

Expand Down
53 changes: 29 additions & 24 deletions public/js/app/account/templates/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ <h1>
<div>
<img src="./img/user-icon_big.png" class="img-circle"/>
</div>
<span class="welcomeTxt pull-left">{{'WELCOME' | translate}} <span ng-if="account.firstName">{{account.firstName}}</span></span>
<span class="welcomeTxt pull-left">{{'WELCOME' | translate}} <span ng-if="account.firstName">{{account.firstName}}</span></span>
</h1>
</div>
</div>

<!-- desktop display -->
<div class="row userInfoRow hidden-xs desktopUserInfo">

Expand Down Expand Up @@ -64,7 +64,7 @@ <h1>
<div class="col-xs-12">
<span class="titleRow visible-xs hidden-md hidden-lg">
{{'ACCOUNT_DETAILS' | translate}}
</span>
</span>
</div>
<div class="col-xs-8">
<div class="mobileDataSection">
Expand All @@ -78,27 +78,27 @@ <h1>
<div class="col-xs-8">
<div class="mobileDataSection">
<span class="dataLabel locale">{{'EMAIL' | translate}}</span>
{{showLanguageLocale()}}
{{showLanguageLocale()}}
</div>
</div>
<div class="col-xs-4">
<button class="btn btn-secondary btn-md pull-right" ng-click="editAccountInfo('email')">{{'EDIT' | translate}}</button>
<button class="btn btn-secondary btn-md pull-right" ng-click="editAccountInfo('email')">{{'EDIT' | translate}}</button>
</div>
<div class="col-xs-8">
<div class="mobileDataSection">
<span class="dataLabel">{{'PASSWORD' | translate}}</span>
&#9679;&#9679;&#9679;&#9679;&#9679;&#9679;&#9679;
</div>
<span class="dataLabel">{{'PASSWORD' | translate}}</span>
&#9679;&#9679;&#9679;&#9679;&#9679;&#9679;&#9679;
</div>
</div>
<div class="col-xs-4">
<button class="btn btn-secondary btn-md pull-right" ng-click="updatePassword()">{{'EDIT' | translate}}</button>
<button class="btn btn-secondary btn-md pull-right" ng-click="updatePassword()">{{'EDIT' | translate}}</button>
</div>

</div>
<!-- /mobile display -->



</div>
</section>
<section class="lightgray" ng-cloak>
Expand All @@ -116,7 +116,7 @@ <h2 class="pull-left">{{'ADDRESSBOOK' | translate}}</h2>
<div class="row">
<div ng-include="'./js/app/account/templates/addresses.html'"></div>
</div>

<div class="text-center" ng-if="showAddressButtons">
<button class="btn btn-link" ng-show="showAllAddressButton" ng-click="showAllAddresses()">{{'SHOW_ALL' | translate}} <span class="glyphicon glyphicon-chevron-down"/></button>
<button class="btn btn-link" ng-show="!showAllAddressButton" ng-click="showAllAddresses()">{{'SHOW_LESS' | translate}} <span class="glyphicon glyphicon-chevron-up"/></button>
Expand All @@ -128,7 +128,7 @@ <h2 class="pull-left">{{'ADDRESSBOOK' | translate}}</h2>
<div class="section-headline clearfix">
<h2>{{'ORDER_HISTORY' | translate}}</h2>
</div>

<div class="hidden-md hidden-lg row">
<div ng-repeat="m_order in orders | limitTo: showOrdersFilter" class="col-sm-4 col-xs-12 orderHistoryCard" ng-class="{'green': order.status == 'CREATED' || order.status == 'CONFIRMED' || order.status == 'SHIPPED', 'red': order.status == 'DECLINED', 'blue': order.status == 'COMPLETED' }">
<div class="cardStatusIdentifier pull-left" ></div>
Expand All @@ -144,6 +144,10 @@ <h2>{{'ORDER_HISTORY' | translate}}</h2>
<strong>{{'ORDER_NUMBER'|translate}}</strong></br>
<a ui-sref="base.orderDetail({orderId: m_order.id})">{{m_order.id}}</a>
</p>
<p>
<strong>{{'ITEMS_IN_ORDER'|translate}}</strong></br>
<td>{{m_order.entries|sumByKey:'amount'|showNoOfItems}}</td>
</p>
<p>{{m_order.totalPrice | currency: m_order.currencySymbol}}</p>
</div>
<div class="col-sm-4 col-xs-4">
Expand All @@ -154,29 +158,30 @@ <h2>{{'ORDER_HISTORY' | translate}}</h2>
</div>
</div>
</div>



<div class="table-responsive hidden-sm hidden-xs">
<table class="table">
<thead>
<tr>
<th>{{'DATE' | translate}}</th>
<th>{{'ORDER_NUMBER' | translate}}</th>
<th>{{'ITEMS_IN_ORDER' | translate}}</ht>
<th>{{'ORDER_TOTAL' | translate}}</th>
<th>{{'ORDER_STATUS' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="xrder in orders | limitTo: showOrdersFilter ">
<td>{{xrder.created | date: 'medium'}}</td>
<td><a ui-sref="base.orderDetail({orderId: xrder.id})">{{xrder.id}}</a></td>
<td>{{xrder.totalPrice | currency: xrder.currencySymbol}}</td>
<td><strong>{{xrder.status}}</strong></td>
</tr>
<tr ng-repeat="xrder in orders | limitTo: showOrdersFilter ">
<td>{{xrder.created | date: 'medium'}}</td>
<td><a ui-sref="base.orderDetail({orderId: order.id})">{{xrder.id}}</a></td>
<td>{{xrder.entries|sumByKey:'amount'|showNoOfItems}}</td>
<td>{{xrder.totalPrice | currency: xrder.currencySymbol}}</td>
<td><strong>{{xrder.status}}</strong></td>
</tr>
</tbody>
</table>
</div>

<div class="text-center" ng-if="showOrderButtons">
<button class="btn btn-link" ng-show="showAllOrdersButton" ng-click="showAllOrders()">{{'SHOW_ALL' | translate}} <span class="glyphicon glyphicon-chevron-down"/></button>
<button class="btn btn-link" ng-show="!showAllOrdersButton" ng-click="showAllOrders()">{{'SHOW_LESS' | translate}} <span class="glyphicon glyphicon-chevron-up"/></button>
Expand Down
7 changes: 1 addition & 6 deletions public/js/app/account/templates/editUser-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ <h4 class="modal-title" id="EditAccountModalLabel">{{'UPDATE' | translate}}
<div class="col-lg-12">
<div class="form-group input-group">
<label class="input-group-addon control-label" for="titleAccount">{{'TITLE' | translate}}</label>
<select class="form-control" ng-model="account.title" id="titleAccount" name="title">
<option value="Mr.">{{'MR' | translate}}</option>
<option value="Ms.">{{'MS' | translate}}</option>
<option value="Mrs.">{{'MRS' | translate}}</option>
<option value="Dr.">{{'DR' | translate}}</option>
</select>
<select class="form-control" ng-model="account.title" id="titleAccount" name="title" ng-options="title | translate for title in titles"></select>
</div>
</div>
<div class="col-lg-12 col">
Expand Down
2 changes: 2 additions & 0 deletions public/js/app/checkout/controllers/checkout-ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ angular.module('ds.checkout')

$scope.order = order;

$scope.titles = GlobalData.getUserTitles();

//Resolve in the ui.router state returns cart object, problem is when the user is loged in
//Then in the configuration service the CartSvc.refreshCartAfterLogin(account.id); is called, and
//this method changes cart. That is the reason cart was empty on refresh
Expand Down
9 changes: 2 additions & 7 deletions public/js/app/checkout/templates/checkout-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ <h2> {{'STEP_1_MY_DETAILS' | translate}} <span ng-show="wiz.step1Done" class="gl
<div class="form-group input-group"
ng-class="{'has-error': billToForm.titleAccount.$invalid && ( billToForm.titleAccount.$dirty || showPristineErrors) }">
<label class="input-group-addon control-label" for="titleAccount">{{'TITLE' | translate}}</label>
<select class="form-control" ng-model="order.account.title" id="titleAccount" name="title">
<option value="Mr.">{{'MR' | translate}}</option>
<option value="Ms.">{{'MS' | translate}}</option>
<option value="Mrs.">{{'MRS' | translate}}</option>
<option value="Dr.">{{'DR' | translate}}</option>
</select>
</div>
<select class="form-control" ng-model="order.account.title" id="titleAccount" name="title" ng-options="title | translate for title in titles"></select>
</div>
</div>
<div class="col-lg-6 col">
<div class="form-group input-group"
Expand Down
6 changes: 3 additions & 3 deletions public/js/app/confirmation/templates/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>
<h2 ng-if="isAuthenticated" class="orderNumber">{{'ORDER' | translate}} # <a ui-sref="base.orderDetail({orderId: orderInfo.orderId})" class="highlight">{{ orderInfo.orderId }}</a></h2>
<h2 ng-if="!isAuthenticated" class="orderNumber">{{'ORDER' | translate}}# {{ orderInfo.orderId }}</h2>

<p class="orderEmailedTo">{{'A_COPY_OF_YOUR_ORDER_DETAILS_HAS_BEEN_SENT_TO' | translate}} <span ng-cloak><strong>{{confirmationDetails.emailAddress}}</strong></span></p>
<div translate="A_COPY_OF_YOUR_ORDER_DETAILS_HAS_BEEN_SENT_TO" translate-compile translate-values="{emailAddress: '{{confirmationDetails.emailAddress}}'}" class="orderEmailedTo"></div>

<div>
<p>{{'THE_SHIPMENT_IS_SCHEDULED_TO_ARRIVE_AT_THE_FOLLOWING_LOCATION' | translate}}:</p>
Expand All @@ -34,7 +34,7 @@ <h2 ng-if="!isAuthenticated" class="orderNumber">{{'ORDER' | translate}}# {{ ord
<div create-account class="create-account" ng-if="!isAuthenticated">
<div class="text-center centered-content">
<h2 class="creatAccountHeader">Create An Account</h2>
<p class="createAccountTagLine"><span ng-bind-html="'ONE_MORE_STEP' | translate"/> <span ng-bind-html="'ONE_MORE_STEP_MESSAGE' | translate" /></p>
<p class="createAccountTagLine"><span ng-bind-html="'ONE_MORE_STEP' | translate"/></p>

<div ng-if="fbAppId || googleClientId" class="socialMediaSigninContainer centered-content row">
<div ng-if="fbAppId" class="fbLogin col-sm-6 col-xs-12" ng-click="fbLogin()">
Expand Down Expand Up @@ -158,7 +158,7 @@ <h3>{{'ENJOY_YOUR_ITEMS' | translate}}</h3>
{{'RETURN_TO_SHOPPING' | translate}}
</button>
</div>
<div translate="QUESTIONS" translate-compile translate-values="{contactInfo: '{{questionsContactInfo}}'"></div>
<div translate="QUESTIONS" translate-compile translate-values="{contactInfo: '{{questionsContactInfo}}'}"></div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/coupons/templates/coupon-apply.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<a class="highlight" ng-click="couponCollapsed = !couponCollapsed" ng-show="!cart.discounts.length">{{'COUPON_CODE' | translate}}</a>

<div ng-show="!couponCollapsed && !cart.discounts.length">
<div ng-show="!couponCollapsed && !cart.discounts.length" class="couponContainer">
<div ng-if="coupon.restrictions.minOrderValue.amount > cart.totalPrice.amount" class="error">
{{'COUPON_MINIMUM_NOT_MET' | translate}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/search/templates/search-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>
<div class="row">
<div class="text-center">
<div translate="FOUND_FOR" translate-compile translate-values="{searchString: '{{searchString}}'"></div>
<div translate="FOUND_FOR" translate-compile translate-values="{total: '{{total}}', searchString: '{{searchString}}'"></div>
</div>
</div>
<div class="row continueShoppingBtn">
Expand Down
4 changes: 2 additions & 2 deletions public/js/app/shared/filters/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

'use strict';

angular.module('ds.shared').filter('encodeURIComponent', function() {
angular.module('ds.shared').filter('encodeURIComponent', function () {
return window.encodeURIComponent;
});
});
28 changes: 28 additions & 0 deletions public/js/app/shared/filters/show-number-of-items-filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* [y] hybris Platform
*
* Copyright (c) 2000-2015 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*/

'use strict';

angular.module('ds.shared')
.filter('showNoOfItems', ['$translate', function ($translate) {
return function (data) {
if (typeof (data) === 'undefined') {
return $translate.instant('ORDER_ITEM_COUNT', { number: 0 });
}

if (data > 1) {
return $translate.instant('ORDER_ITEMS_COUNT', { number: data });
} else {
return $translate.instant('ORDER_ITEM_COUNT', { number: data });
}
};
}]);
31 changes: 31 additions & 0 deletions public/js/app/shared/filters/sum-by-key-filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* [y] hybris Platform
*
* Copyright (c) 2000-2015 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*/

'use strict';

angular.module('ds.shared')
.filter('sumByKey', function () {
return function (data, key) {
if (typeof (data) === 'undefined' || typeof (key) === 'undefined') {
return 0;
}

var sum = 0;
for (var i = data.length - 1; i >= 0; i--) {
if (!!data[i][key] && !isNaN(data[i][key])) {
sum += parseInt(data[i][key]);
}
}

return sum;
};
});
Loading

0 comments on commit 6555af8

Please sign in to comment.