Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemanja Popovic committed Apr 27, 2016
1 parent 554e91c commit 6a9a4b0
Show file tree
Hide file tree
Showing 109 changed files with 2,903 additions and 1,535 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public/css/vendor
*.iml
public/css/app/style.css
public/css/app/style.css.map
public/js/app/shared/app-config.js
public/js/app/shared/app-config.
public/js/app/shared/i18n/lang/*.json
.idea
coverage/
config/config.js
Expand Down
12 changes: 11 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ This will launch a storefront for an existing project against the "prod" environ
Now, let's create a new project for your specific site so that you can modify your store and product offering as you see fit.

### 1. Sign up for your a new store and configure it
If you haven't done so already, create a new storefront project and obtain subscriptions for the services.
If you haven't done so already, create a new storefront project and obtain subscriptions to all the commerce packages in order to enable and ensure that the storefront works end to end.
The commerce packages are:

- **Cart**
- **Checkout**
- **Coupon Management**
- **Customer Accounts**
- **Order Management**
- **Product Content**
- **Site Management**

Follow the steps outlined in the [Dev Portal](https://devportal.yaas.io/gettingstarted/setupastorefront/index.html).

### 2. Replace the default project id in the code base with your own (see project adminstration settings in the Builder).
Expand Down
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
"angular-bootstrap": "~0.11.0",
"angular-xeditable": "~0.1.8",
"angular-directive.g-signin": "~0.1.2",
"angular-ui-select": "~0.8.2",
"angular-ui-select": "~0.13.2",
"angular-sanitize": "~1.3.0",
"angular-touch": "~1.3.0",
"algoliasearch": "2.9.2",
"yamm3": "1.1.0"
"yamm3": "1.1.0",
"angular-ui-notification": "^0.2.0"
},
"install": {
"path": {
Expand Down
6 changes: 6 additions & 0 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = function(config){
'public/js/vendor/angular-xeditable/dist/js/xeditable.js',
'public/js/vendor/angular-sanitize/angular-sanitize.js',
'public/js/vendor/angular-ui-select/dist/select.min.js',
'public/js/vendor/angular-ui-notification/dist/angular-ui-notification.min.js',
'public/js/vendor/angular-directive.g-signin/google-plus-signin.js',
'public/js/vendor/algoliasearch/dist/algoliasearch.angular.js',

Expand Down Expand Up @@ -65,6 +66,9 @@ module.exports = function(config){
'public/js/app/shared/directives/y-inputs-dir.js',
'public/js/app/shared/directives/force-scroll.js',

'public/js/app/shared/media/main-media-extractor.js',
'public/js/app/shared/media/committed-media-filter.js',

'public/js/app/home/home-index.js',
'public/js/app/home/controllers/home-ctrl.js',
'public/js/app/home/services/home-svc.js',
Expand All @@ -83,9 +87,11 @@ module.exports = function(config){

'public/js/app/cart/cart-index.js',
'public/js/app/cart/controllers/cart-ctrl.js',
'public/js/app/cart/controllers/cart-note-mixin-ctrl.js',
'public/js/app/cart/directives/cart-auto-toggle.js',
'public/js/app/cart/services/cart-service.js',
'public/js/app/cart/services/cart-rest.js',
'public/js/app/cart/services/cart-note-mixin-service.js',

'public/js/app/checkout/checkout-index.js',
'public/js/app/checkout/controllers/checkout-ctrl.js',
Expand Down
4 changes: 3 additions & 1 deletion manifest-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
applications:
- name: teststore
command: npm run-script multiProd
buildpack: https://github.com/ddollar/heroku-buildpack-multi.git
buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
memory: 1024M
disk_quota: 1024M
disk: 1024M
instances: 1
path: dist/
4 changes: 3 additions & 1 deletion manifest-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
applications:
- name: shops
command: npm run-script multiTest
buildpack: https://github.com/ddollar/heroku-buildpack-multi.git
buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
memory: 1024M
disk_quota: 1024M
disk: 1024M
host: shops
domain: dev.cf.hybris.com
instances: 1
Expand Down
4 changes: 3 additions & 1 deletion manifest-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
applications:
- name: shops
command: npm run-script multiStage
buildpack: https://github.com/ddollar/heroku-buildpack-multi.git
buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
memory: 1024M
disk_quota: 1024M
disk: 1024M
host: shops
domain: stage.yaas.io
instances: 1
Expand Down
4 changes: 3 additions & 1 deletion manifest-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
applications:
- name: bsdtestproject
command: npm run-script startServer
buildpack: https://github.com/ddollar/heroku-buildpack-multi.git
buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
memory: 1024M
disk_quota: 1024M
disk: 1024M
instances: 1
path: dist/
4 changes: 3 additions & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
applications:
- name: shops-green
command: npm run-script multiProd
buildpack: https://github.com/ddollar/heroku-buildpack-multi.git
buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
memory: 1024M
disk_quota: 1024M
disk: 1024M
instances: 1
path: dist
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"bower": "latest",
"compression": "1.4.1",
"express": "~4.4.2",
"grunt": "latest",
"grunt": "0.4.5",
"grunt-angular-templates": "0.5.7",
"grunt-cli": "latest",
"grunt-cli": "1.2.0",
"grunt-concurrent": "~0.4.3",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compass": "~0.7.2",
Expand All @@ -53,7 +53,6 @@
"jade": "~1.3.1",
"load-grunt-tasks": "~0.2.0",
"request": "~2.36.0"

},
"devDependencies": {
"grunt-contrib-watch": "^0.5.3",
Expand Down
Binary file added public/img/fb_signInLogo-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/g_signInLogo-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
10 changes: 10 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<!-- dynamic optimized style sheet resources -->
<!-- build:css css/app/storefront.css -->
<link rel="stylesheet" href="js/vendor/angular-ui-select/dist/select.min.css">
<link rel="stylesheet" href="js/vendor/angular-ui-notification/dist/angular-ui-notification.min.css">
<link rel="stylesheet" href="css/app/style.css" type="text/css" media="screen, projection">
<link href="js/vendor/angular-xeditable/dist/css/xeditable.css" rel="stylesheet">
<!-- endbuild -->
Expand Down Expand Up @@ -56,13 +57,15 @@
<script src="js/vendor/angular-sanitize/angular-sanitize.min.js"></script>
<script src="js/vendor/angular-ui-select/dist/select.min.js"></script>
<script src="js/vendor/algoliasearch/dist/algoliasearch.angular.js"></script>
<script src="js/vendor/angular-ui-notification/dist/angular-ui-notification.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/vendor/spin.js/spin.js"></script>
<script src="js/app/shared/shared-index.js"></script>
<script src="js/app/shared/settings.js"></script>
<script src="js/app/shared/app-config.js"></script>
<script src="js/app/shared/site-config.js"></script>
<script src="js/app/shared/http-proxy.js"></script>
<script src="js/app/shared/countries.js"></script>
<script src="js/app/shared/directives/quantity-input.js"></script>
<script src="js/app/shared/directives/menu-aim.js"></script>
<script src="js/app/shared/directives/match-background.js"></script>
Expand Down Expand Up @@ -95,6 +98,10 @@
<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/providers/translation-provider.js"></script>

<script src="js/app/shared/media/main-media-extractor.js"></script>
<script src="js/app/shared/media/committed-media-filter.js"></script>

<script src="js/app/orders/orders-index.js"></script>
<script src="js/app/orders/services/order-list-service.js"></script>
<script src="js/app/orders/services/orders-rest.js"></script>
Expand All @@ -116,9 +123,11 @@
<script src="js/app/errors/controllers/errors-ctrl.js"></script>
<script src="js/app/cart/cart-index.js"></script>
<script src="js/app/cart/controllers/cart-ctrl.js"></script>
<script src="js/app/cart/controllers/cart-note-mixin-ctrl.js"></script>
<script src="js/app/cart/directives/cart-auto-toggle.js"></script>
<script src="js/app/cart/services/cart-rest.js"></script>
<script src="js/app/cart/services/cart-service.js"></script>
<script src="js/app/cart/services/cart-note-mixin-service.js"></script>
<script src="js/app/checkout/checkout-index.js"></script>
<script src="js/app/checkout/controllers/checkout-base-ctrl.js"></script>
<script src="js/app/checkout/controllers/checkout-ctrl.js"></script>
Expand Down Expand Up @@ -146,6 +155,7 @@
<script src="js/app/account/account-index.js"></script>
<script src="js/app/account/controllers/account-ctrl.js"></script>
<script src="js/app/account/controllers/account-order-detail-ctrl.js"></script>
<script src="js/app/account/controllers/change-email-confirmation-ctrl.js"></script>
<script src="js/app/account/controllers/dialogs/address-remove-dialog-ctrl.js"></script>
<script src="js/app/account/controllers/modals/edit-user-name-dialog-ctrl.js"></script>
<script src="js/app/account/controllers/modals/edit-user-email-dialog-ctrl.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* [y] hybris Platform
*
* Copyright (c) 2000-2016 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.account')
.controller('ChangeEmailConfirmationCtrl', ['$scope', '$stateParams', 'AccountSvc', 'AuthSvc', '$translate',
function ($scope, $stateParams, AccountSvc, AuthSvc, $translate) {

$scope.token = $stateParams.token;
$scope.confirmed = false;

AccountSvc.confirmEmailUpdate($scope.token)
.then(function () {

//Sign out user
AuthSvc.signOut();

//Message that email is changed successfully
$scope.confirmed = true;
}, function (error) {
console.log(error);
//Message that there is error, and to try again or etc?
$scope.error = $translate.instant('EDIT_EMAIL_SOMETHING_WENT_WRONG');
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,40 @@
'use strict';

angular.module('ds.account')
.controller('EditUserEmailDialogCtrl', ['$scope', 'account', 'AccountSvc', '$modalInstance',
function ($scope, account, AccountSvc, $modalInstance) {
.controller('EditUserEmailDialogCtrl', ['$scope', 'account', 'AccountSvc', '$modalInstance', '$translate',
function ($scope, account, AccountSvc, $modalInstance, $translate) {

$scope.account = angular.copy(account);
$scope.account = account;
$scope.error = '';
$scope.step = 1;

$scope.closeEditUserDialog = function () {
$modalInstance.dismiss('cancel');
};

$scope.updateUserInfo = function () {
var account = angular.copy($scope.account);

//Force sync of email address
$scope.account.syncContactEmail = true;

AccountSvc.updateAccount(account).then(function () {
$modalInstance.close(account);
AccountSvc.updateEmail($scope.account).then(function () {
$scope.step = 2;
}, function (error) {
if (error.status === 401) {
$scope.error = $translate.instant('EDIT_EMAIL_PASSWORD_NOT_CORRECT');
}
else if(error.status === 409) {
$scope.error = $translate.instant('EDIT_EMAIL_ALREADY_IN_USE');
}
else {
$scope.error = $translate.instant('EDIT_EMAIL_SOMETHING_WENT_WRONG');
}
});
};

$scope.confirm = function () {
$modalInstance.close($scope.account);
};

}]);
})();
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,17 @@
};

$scope.editUserEmail = function (account) {
$scope.modalInstance = $modal.open({

$modal.open({
templateUrl: 'js/app/account/templates/modals/edit-user-email-dialog.html',
controller: 'EditUserEmailDialogCtrl',
resolve: {
account: function () {
return account;
return {
email: account.contactEmail
};
}
},
backdrop: 'static'
});

$scope.modalInstance.result.then(function (result) {
$scope.account = result;
}
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>
{{account.title|translate}} {{account.firstName}} {{account.middleName}} {{account.lastName}}
</div>
<div class="col-sm-1 editLinkContainer">
<a ng-click="editUserEmail(account)"><span class="glyphicon glyphicon-pencil"></span></a>
<a ng-click="editUserEmail(account)"><span id="update-email" class="glyphicon glyphicon-pencil"></span></a>
</div>
<div class="col-sm-3">
<span class="dataLabel">{{'EMAIL' | translate}}</span>
Expand Down
21 changes: 21 additions & 0 deletions public/js/app/account/services/account-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,27 @@ angular.module('ds.account')
}
return defAccount.promise;

},

/**
* Expected attribute is account containing email, password and newEmail fields.
* Creates POST request to customer service that will initiate change of email.
* Returns a promise of the result.
*/
updateEmail: function (account) {
return AuthREST.Customers.all('me').all('accounts').all('internal').all('email').customPOST(account, 'change');
},

/**
* Expected attribute is token.
* Creates POST request to customer service that will confirm change of email.
* Returns a promise of the result.
*/
confirmEmailUpdate: function (token) {
var data = {
token: token
};
return AuthREST.Customers.all('me').all('accounts').all('internal').all('email').all('change').customPOST(data, 'confirm');
}

};
Expand Down
4 changes: 2 additions & 2 deletions public/js/app/account/templates/addresses.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div address-decorator ng-class="{ 'col-sm-6 col-md-4 col-lg-4': !isDialog, 'col-xs-12 col-sm-6 col-lg-4': isDialog }" ng-repeat="address in addresses | limitTo: showAddressFilter " ng-cloak>
<div class="panel" ng-class="{'defaultAddress': address.isDefault, disableAddressTest: !isShipToCountry(address.country) && isDialog}">
<div class="panel" ng-class="{'defaultAddress': address.isDefault, disableAddress: disableAddress(address.country)}">
<div class="panel-body" ng-if="!isDialog">
<div class="btn-group-vertical pull-right states-toolbar">
<button id="set-default-btn" class="btn btn-link btn-lg" ng-if="addresses.length > 1 && !address.isDefault" ng-class="{ active: address.isDefault }" ng-click="setAddressAsDefault(address)"><span class="glyphicon glyphicon-star"></span></button>
Expand Down Expand Up @@ -32,7 +32,7 @@
<span>{{address.city}}, {{address.state}} {{address.zipCode}}</span><br>
<span>{{address.country}}</span><br>
<span>{{address.contactPhone}}</span><br>
<span ng-hide="isShipToCountry(address.country)" class="list-unstyled text-danger">{{'CANT_BE_SHIPPED' | translate}}</span><br>
<span ng-show="disableAddress(address.country)" class="list-unstyled text-danger">{{'CANT_BE_SHIPPED' | translate}}</span><br>
</address>
</div>

Expand Down
Loading

0 comments on commit 6a9a4b0

Please sign in to comment.