Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
akak1977 committed Aug 18, 2020
2 parents 7570057 + acd566b commit 309922c
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 21 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# v1
name: Theme CI
on:
workflow_dispatch:
push:
paths-ignore:
- '.github/**'
- 'docs/**'
- 'build/**'
- 'README.md'
- 'LICENSE'
branches:
[master, dev]
pull_request:
branches:
[master, dev]

jobs:
ci:
runs-on: ubuntu-latest
env:
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
BLOB_SAS: ${{ secrets.BLOB_TOKEN }}

steps:
- uses: actions/checkout@v2

- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v1

- name: Get Image Version
uses: VirtoCommerce/vc-github-actions/get-image-version@dev
id: image

- name: SonarCloud Scan
uses: VirtoCommerce/vc-github-actions/sonar-theme@dev

- name: Build
uses: VirtoCommerce/vc-github-actions/build-theme@dev

- name: Publish
id: publish
uses: VirtoCommerce/vc-github-actions/publish-theme@dev

- name: Create Release
if: github.ref == 'refs/heads/master'
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.image.outputs.tag }}
release_name: ${{ steps.image.outputs.tag }}
draft: false
prerelease: false

- name: Upload Release Asset
if: github.ref == 'refs/heads/master'
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ steps.publish.outputs.artifactPath }}
asset_name: ${{ steps.publish.outputs.artifactName }}
asset_content_type: application/zip
6 changes: 3 additions & 3 deletions assets/js/account/account-password-change.tpl.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@

<vc-labeled-input value="$ctrl.passwordChangeData.oldPassword" name="oldPassword" placeholder="{{ 'customer.change_password.old_password' | t }}" form="detailForm" required="true" type="password" autofocus="true" ng-init="$ctrl.setForm(detailForm)"></vc-labeled-input>
<div class="form-error" ng-if="detailForm.oldPassword.$dirty && detailForm.oldPassword.$invalid">
<span>{{ 'customer.change_password.validation.current-password' | t }}</span>
<span>{{ 'customer.change_password.validation.current_password' | t }}</span>
</div>

<vc-labeled-input value="$ctrl.passwordChangeData.newPassword" name="newPassword" placeholder="{{ 'customer.change_password.new_password' | t }}" form="detailForm" required="true" type="password"></vc-labeled-input>
<div class="form-error" ng-if="$ctrl.error.newPassword && !detailForm.newPassword.$pristine">
<span>{{ 'customer.change_password.validation.new-password' | t }}</span>
<span>{{ 'customer.change_password.validation.new_password' | t }}</span>
</div>

<vc-labeled-input value="$ctrl.passwordChangeData.newPasswordConfirm" name="newPasswordConfirm" placeholder="{{ 'customer.change_password.new_password_confirm' | t }}" form="detailForm" required="true" type="password"></vc-labeled-input>
<div class="form-error" ng-if="!detailForm.newPasswordConfirm.$pristine && $ctrl.error.newPasswordConfirm">
<span>{{ 'customer.change_password.validation.repeat-password' | t }}</span>
<span>{{ 'customer.change_password.validation.repeat_password' | t }}</span>
</div>

<button class="vc-btn" ng-disabled="$ctrl.loader.isLoading" ng-class="{ 'btn--disabled': detailForm.$pristine, 'loading': $ctrl.loader.isLoading }">
Expand Down
2 changes: 1 addition & 1 deletion assets/js/account/account-profile-update.tpl.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span ng-if="phone.$invalid" ng-class="{'form-error': phone.$invalid}">Invalid phone number</span>
</form>
<div>
<button class="vc-btn" ng-if="$ctrl.phoneNumber" ng-click="$ctrl.updatePhoneNumber()">
<button class="vc-btn" ng-if="$ctrl.phoneNumber" ng-disabled="$ctrl.twoFactorEnabled" ng-click="$ctrl.updatePhoneNumber()">
<span class="btn-text">{{ 'customer.edit_profile.submit' | t }}</span>
</button>
<button class="vc-btn" ng-if="$ctrl.phoneNumber" ng-disabled="$ctrl.twoFactorEnabled" ng-click="$ctrl.deletePhoneNumber()">
Expand Down
7 changes: 6 additions & 1 deletion assets/js/checkout/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ angular.module(moduleName, ['credit-cards', 'angular.filter'])
$scope.checkout.billingAddressEqualsShipping = cart.hasPhysicalProducts && !angular.isObject($scope.checkout.payment.billingAddress);

$scope.checkout.canCartBeRecurring = $scope.customer.isRegisteredUser && _.all(cart.items, function(x) { return !x.isReccuring });
$scope.checkout.paymentPlan = cart.paymentPlan && _.findWhere($scope.checkout.availablePaymentPlans, { intervalCount: cart.paymentPlan.intervalCount, interval: cart.paymentPlan.interval }) ||

_.each($scope.checkout.availablePaymentPlans, function(value) {
value.interval = value.interval.toLowerCase();
});

$scope.checkout.paymentPlan = cart.paymentPlan && _.findWhere($scope.checkout.availablePaymentPlans, { intervalCount: cart.paymentPlan.intervalCount, interval: cart.paymentPlan.interval.toLowerCase() }) ||
_.findWhere($scope.checkout.availablePaymentPlans, { intervalCount: 1, interval: 'months' });
}
$scope.validateCheckout($scope.checkout);
Expand Down
12 changes: 9 additions & 3 deletions assets/js/lists/list-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,22 @@ storefrontApp.controller('recentlyCreateNewListDialogController', ['$rootScope',
$scope.selectedList.items = items;
};

$scope.isAnySelected = function () {
return _.find(dialogData.lists, function (item) { return item.delete; }) != undefined;
}

$scope.submitSettings = function () {
var listIds = [];
_.each(dialogData.lists, function (list) {
if (list.delete)
listIds.push(list.id);
});

listService.deleteListsByIds(listIds).then(function (result) {
$uibModalInstance.close();
});
if(listIds.length > 0){
listService.deleteListsByIds(listIds).then(function (result) {
$uibModalInstance.close();
});
}
};

$scope.close = function () {
Expand Down
15 changes: 15 additions & 0 deletions assets/js/quote-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ storefrontApp.controller('quoteRequestController', ['$rootScope', '$scope', '$wi
});
}

$scope.removeAllProductsFromQuoteRequest = function () {
var initialQuoteItems = angular.copy($scope.quoteRequest.items);
quoteRequestService.removeAllProductsFromQuoteRequest($scope.quoteRequest.id).then(function (response) {
getQuoteRequest($scope.quoteRequest.id);
$rootScope.$broadcast('actualQuoteRequestItemsChanged');
}, function (response) {
$scope.quoteRequest.items = initialQuoteItems;
});
}

$scope.setCountry = function (addressType, countryName) {
var country = _.find($scope.countries, function (c) { return c.name == countryName });
if (!country) {
Expand Down Expand Up @@ -129,6 +139,9 @@ storefrontApp.controller('quoteRequestController', ['$rootScope', '$scope', '$wi
$scope.quoteRequest.billingAddress.email = $scope.quoteRequest.email;
if ($scope.quoteRequest.shippingAddress) {
$scope.quoteRequest.shippingAddress.email = $scope.quoteRequest.email;
if ($scope.quoteRequest.shippingAddressEqualsBilling) {
$scope.setShippingAddressEqualsBilling();
}
}
quoteRequestService.submitQuoteRequest($scope.quoteRequest.id, toFormModel($scope.quoteRequest)).then(function (response) {
if ($scope.customer.isRegisteredUser) {
Expand Down Expand Up @@ -173,6 +186,8 @@ storefrontApp.controller('quoteRequestController', ['$rootScope', '$scope', '$wi
$scope.shippingCountry = $scope.billingCountry;
getCountryRegions('Shipping', $scope.quoteRequest.shippingAddress.countryCode);
}
} else {
$scope.quoteRequest.shippingAddress = null;
}
}

Expand Down
3 changes: 3 additions & 0 deletions assets/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ storefrontApp.service('quoteRequestService', ['$http', function ($http) {
removeProductFromQuoteRequest: function (quoteRequestNumber, quoteItemId) {
return $http.delete('storefrontapi/quoterequests/' + quoteRequestNumber + '/items/' + quoteItemId);
},
removeAllProductsFromQuoteRequest: function (quoteRequestNumber) {
return $http.delete('storefrontapi/quoterequests/' + quoteRequestNumber + '/items');
},
submitQuoteRequest: function (quoteRequestNumber, quoteRequest) {
return $http.post('storefrontapi/quoterequests/' + quoteRequestNumber + '/submit', quoteRequest);
},
Expand Down
9 changes: 5 additions & 4 deletions locales/en.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@
"remarks_quote_request": "Do you have a general remark with this Quote Request?",
"shipping_quote": "Request a shipping quote",
"remove": "Remove",
"remove_items": "Remove all items",
"enter_unique_quantities": "Please enter an unique quantities",
"email": "Email:",
"comment": "Comment:",
Expand Down Expand Up @@ -630,9 +631,9 @@
"submit": "Change password",
"changed": "Password was changed successfully!",
"validation": {
"current-password": "Required",
"new-password": "Old and new passwords are the same!",
"repeat-password": "New passwords doesn't match!"
"current_password": "Required",
"new_password": "Old and new passwords are the same!",
"repeat_password": "New passwords doesn't match!"
}
},
"account_lock": {
Expand Down Expand Up @@ -850,6 +851,6 @@
"customer_password_confirmation": "Password confirmation is invalid or required",
"customer_token": "Code is invalid or required",
"customer_email": "Email is invalid or required"

}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.9",
"version": "2.1.10",
"name": "vc-theme-default",
"author": "VirtoCommerce",
"description": "Default theme for Storefront",
Expand Down
2 changes: 1 addition & 1 deletion snippets/list-settings-dialog.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<button class="btn" >
<span ng-click="close()">{{ 'wishlist.general.cancel' | t }}</span>
</button>
<button class="btn" >
<button class="btn" ng-disabled="!isAnySelected()">
<span ng-click="submitSettings()">{{ 'Submit' | t }}</span>
</button>
</div>
Expand Down
3 changes: 2 additions & 1 deletion snippets/product-compare.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
<span ng-if="value.value" ng-bind="value.value"></span>
<span ng-if="!value.value">-</span>
</div>
<i class="fa fa-check" aria-hidden="true" style="margin: 0 auto;" ng-if="value.valueType.toLowerCase() === 'boolean'"></i>
<i class="fa fa-check" aria-hidden="true" style="margin: 0 auto;" ng-if="value.valueType.toLowerCase() === 'boolean' && value.value.toLowerCase() === 'true'"></i>
<i class="fa fa-minus" aria-hidden="true" style="margin: 0 auto;" ng-if="value.valueType.toLowerCase() === 'boolean' && value.value.toLowerCase() === 'false'"></i>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<div class="cart-row">
<div class="grid">
<div class="grid-item text-right">
<button class="btn" ng-controller="actualQuoteRequestBarController" ng-class="{ 'btn-secondary': !dialogData.updated }" ng-disabled="!dialogData.updated" ng-click="redirect(baseUrl + 'quoterequest/#/' + actualQuoteRequest.number)">
<span ng-if="dialogData.updated">{{ 'cart.general.go_request' | t }}</span>
<span ng-if="!dialogData.updated">{{ 'cart.general.update_quote' | t }}</span>
<button class="btn" ng-controller="actualQuoteRequestBarController" ng-class="{ 'btn-secondary': !dialogData.updated || !actualQuoteRequest.number }" ng-disabled="!dialogData.updated || !actualQuoteRequest.number" ng-click="redirect(baseUrl + 'quoterequest/#/' + actualQuoteRequest.number)">
<span ng-if="dialogData.updated && actualQuoteRequest.number">{{ 'cart.general.go_request' | t }}</span>
<span ng-if="!dialogData.updated || !actualQuoteRequest.number">{{ 'cart.general.update_quote' | t }}</span>
</button>
<button class="btn" ng-click="close()">{{ 'dialog.countinue_shop' | t }}</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/customers/register.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
{% include 'form-errors-custom' %}

<label for="first_name" class="hidden-label">{{ 'customer.register.first_name' | t }}</label>
<input type="text" value="{{form.first_name}}" name="customer[first_name]" id="first_name" placeholder="{{ 'customer.register.first_name' | t }}" {% if form.errors contains "first_name" %} class="error" {% endif %} autocapitalize="words" autofocus>
<input type="text" value="{{form.first_name}}" name="customer[first_name]" required id="first_name" placeholder="{{ 'customer.register.first_name' | t }}" {% if form.errors contains "first_name" %} class="error" {% endif %} autocapitalize="words" autofocus>

<label for="last_name" class="hidden-label">{{ 'customer.register.last_name' | t }}</label>
<input type="text" value="{{form.last_name}}" name="customer[last_name]" id="last_name" placeholder="{{ 'customer.register.last_name' | t }}" {% if form.errors contains "last_name" %} class="error" {% endif %} autocapitalize="words">
<input type="text" value="{{form.last_name}}" name="customer[last_name]" required id="last_name" placeholder="{{ 'customer.register.last_name' | t }}" {% if form.errors contains "last_name" %} class="error" {% endif %} autocapitalize="words">

<label for="email" class="hidden-label">{{ 'customer.register.email' | t }}</label>
<input type="email" value="{{form.email}}" name="customer[email]" id="email" placeholder="{{ 'customer.register.email' | t }}" {% if form.errors contains "email" %} class="error" {% endif %} autocorrect="off" autocapitalize="off">
Expand Down
3 changes: 2 additions & 1 deletion templates/quote-request.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
</table>
</div>
</div>
<a class="lists-settings" ng-click="removeAllProductsFromQuoteRequest()">{{ 'quotes.request.remove_items' | t }}</a>
<div class="cart-row quote" ng-repeat="quoteItem in quoteRequest.items">
<div class="grid">
<div class="grid-item large--seven-twelfths">
Expand Down Expand Up @@ -229,7 +230,7 @@
<input id="ShippingAddressEqualsBilling" name="ShippingAddressEqualsBilling" type="checkbox" style="display: inline-block;" ng-model="quoteRequest.shippingAddressEqualsBilling" ng-change="setShippingAddressEqualsBilling()" />
<label for="ShippingAddressEqualsBilling" style="display: inline-block;">{{ 'customer.addresses.same_address' | t }}</label>
<input id="ShippingAddressType" name="ShippingAddressType" type="hidden" value="Shipping" ng-model="quoteRequest.shippingAddress.type" ng-init="quoteRequest.shippingAddress.type = 'Shipping'" />
<div class="grid">
<div class="grid" ng-if="!quoteRequest.shippingAddressEqualsBilling">
<div class="grid-item large--one-half">
<label for="ShippingAddressFirstName" style="float: left;">{{ 'customer.addresses.first_name' | t }}</label>
<span style="color: #ff0000; float: left; margin-left: 5px;">*</span>
Expand Down

0 comments on commit 309922c

Please sign in to comment.