Skip to content

Commit

Permalink
Merge branch 'release/1.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
devAsadNur committed May 19, 2022
2 parents 92a4462 + 2d5f933 commit 7379079
Show file tree
Hide file tree
Showing 19 changed files with 205 additions and 87 deletions.
59 changes: 54 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
**Donate Link:** http://tareq.co/donate/
**Tags:** WooCommerce POS, point of sale, free pos, pos plugin, woocommerce point of sale
**Requires at least:** 4.4
**Tested up to:** 5.9.2
**Tested up to:** 5.9.3
**WC requires at least:** 3.0
**WC tested up to:** 6.3.1
**WC tested up to:** 6.5.1
**Requires PHP:** 5.6
**Stable tag:** 1.2.1
**Stable tag:** 1.2.2
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -60,12 +60,61 @@ No FAQ

## Changelog ##

### v1.1.4 -> 21 December, 2020 ###
### v1.2.2 -> 19 May, 2022 ###
- **Enhancement:** Added keyboard accessibility support to the payment and print receipt options
- **Fix:** Scrollbar broken style issue on frontend view
- **Fix:** Customer selection dropdown selecting wrong customer by pressing enter/return key on frontend
- **Fix:** Pressing enter/return key results product addition to the cart, even the product search dropdown closed on frontend

### v1.2.1 -> 15 March, 2022 ###
- **Feature:** Remote promotion notice

### v1.2.0 -> 27 January, 2022 ###
- **Compatibility:** Compatibility for WordPress 5.9
- **Fix:** Fixed an issue where wePOS frontend is not loading

### v1.1.12 -> 31 December, 2021 ###
- **Feature:** Stock support for the pos product, out-of-stock products will be shown but can not be added into the cart
- **Enhancement:** Codebase optimization & various page i18n support
- **Fix:** Z index mismatch for components, some components were not displaying properly with modal
- **Fix:** Variation product's all variations can not be seen
- **Fix:** Variation products attributes UX issue
- **Fix:** Double payment can be done by double-clicking the process payment button
- **Fix:** You already logged in to any other counter or outlet
- **Fix:** Product images not shown on POS

### v1.1.11 -> 19 November, 2021 ###
- **Enhancement:** PSR-4 class autoloading for Admin namespace

### v1.1.10 -> 19 November, 2021 ###
- **Feature:** Admin dependency notice for WooCommerce
- **Feature:** Support for other decimal separator character
- **Enhancement:** Black friday 2021 promotion
- **Enhancement:** Tab view responsiveness support for POS cart content
- **Enhancement:** Support for Composer 2
- **Enhancement:** Codebase optimization and restructure
- **Fix:** The price rounding does not work for discounts
- **Fix:** Fixed an issue where POS admin panel does not have the correct font family
- **Fix:** Thermal printer text is unclear for receipt
- **Fix:** Product Tax is not showing properly on the receipt
- **Fix:** NPM vulnerabilities

### v1.1.8 -> 19 October, 2021 ###
- **Enhancement:** Added halloween sale 2021 limited promotion banner

### v1.1.7 -> 13 July, 2021 ###
- **Enhancement:** Added summer sale 2021 limited promotion banner

### v1.1.6 -> 08 May, 2021 ###
- **Enhancement:** Added limited promotion banner

### v1.1.5 -> 15 March, 2021 ###
- **Enhancement:** Added limited promotion banner

### v1.1.3 -> 23 November, 2020 ###
### v1.1.4 -> 21 December, 2020 ###
- **Enhancement:** Added limited promotion banner

### v1.1.3 -> 23 November, 2020 ###
- **Enhancement:** Added limited promotion banner

### v1.1.2 -> 28 October, 2020 ###
Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions assets/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,23 @@ pluginWebpack([2],{

data() {
return {};
},

methods: {
handleModalSubmit() {
let self = this;

document.addEventListener("keypress", function (evt) {
if ("Enter" === evt.code) {
self.$emit('enterpressed');
}
});
}
},

mounted() {
this.$emit('open');
this.handleModalSubmit();
}
});

Expand Down
2 changes: 1 addition & 1 deletion assets/js/bootstrap.min.js

Large diffs are not rendered by default.

63 changes: 34 additions & 29 deletions assets/js/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,6 @@ let Modal = wepos_get_lib('Modal');
this.$store.dispatch('Order/setCanProcessPaymentAction', canProcess);
},
processPayment(e) {
e.preventDefault();
if (!this.$store.getters['Order/getCanProcessPayment']) {
return;
}
Expand Down Expand Up @@ -1633,6 +1632,11 @@ let Modal = wepos_get_lib('Modal');
wepos.api.get(wepos.rest.root + wepos.rest.wcversion + '/settings/tax').done(response => {
this.taxSettings = response;
});
},

focusCashInput() {
let inputCashAmount = document.querySelector('#input-cash-amount');
inputCashAmount.focus();
}
},

Expand Down Expand Up @@ -1852,15 +1856,6 @@ let Modal = wepos_get_lib('Modal');
this.$refs.productSearch.blur();
},

selectedHandler(selectedIndex) {
var selectedProduct = this.searchableProduct[selectedIndex];
if (selectedProduct.type == 'simple') {
this.addToCartAction(selectedProduct);
} else {
this.selectVariation(selectedProduct);
}
},

onKeyDown() {
jQuery('.product-search-item.selected').next().children('a').focus();
},
Expand Down Expand Up @@ -2074,14 +2069,8 @@ if (false) {(function () {
} else if (key === 40 || key === 9) {
this.handleKeyDown(e);
this.$emit('key-down');
} else if (key === 13) {
this.handleEnter(e);
}
},
handleEnter(e) {
e.preventDefault();
this.$emit("selected", this.selectedIndex);
},
handleKeyUp(e) {
e.preventDefault();
if (this.selectedIndex <= 0) {
Expand Down Expand Up @@ -2369,10 +2358,6 @@ let Modal = wepos_get_lib('Modal');
addNewCustomer() {
this.showNewCustomerModal = true;
},
selectedHandler(selectedIndex) {
var selectedCustomer = this.customers[selectedIndex];
this.selectCustomer(selectedCustomer);
},
onKeyDown() {
jQuery('.customer-search-item.selected').next().children('a').focus();
},
Expand Down Expand Up @@ -2844,12 +2829,28 @@ const Tokens = {

methods: {
printReceipt() {
var self = this;

setTimeout(() => {
window.print();
}, 500);
},
handlePrintingPopup(evt) {
let self = this;

if ("Enter" === evt.code && self.$store.getters['Order/getCanProcessPayment']) {
self.printReceipt();
}
},
handlePrintReceiptSubmit() {
document.addEventListener("keypress", this.handlePrintingPopup);
}
},

mounted() {
this.handlePrintReceiptSubmit();
},

destroyed() {
document.removeEventListener("keypress", this.handlePrintingPopup);
}
});

Expand Down Expand Up @@ -3607,7 +3608,6 @@ var render = function() {
_c("keyboard-control", {
attrs: { listLength: _vm.searchableProduct.length },
on: {
selected: _vm.selectedHandler,
"key-down": _vm.onKeyDown,
"key-up": _vm.onKeyUp
},
Expand Down Expand Up @@ -4206,11 +4206,7 @@ var render = function() {
[
_c("keyboard-control", {
attrs: { listLength: _vm.customers.length },
on: {
selected: _vm.selectedHandler,
"key-down": _vm.onKeyDown,
"key-up": _vm.onKeyUp
},
on: { "key-down": _vm.onKeyDown, "key-up": _vm.onKeyUp },
scopedSlots: _vm._u([
{
key: "default",
Expand Down Expand Up @@ -7858,8 +7854,14 @@ var render = function() {
{
attrs: { width: "98%", height: "95vh" },
on: {
open: function($event) {
_vm.focusCashInput()
},
close: function($event) {
_vm.backToSale()
},
enterpressed: function($event) {
_vm.processPayment()
}
}
},
Expand Down Expand Up @@ -8323,7 +8325,10 @@ var render = function() {
}
],
ref: "cashamount",
attrs: { type: "text" },
attrs: {
id: "input-cash-amount",
type: "text"
},
domProps: { value: _vm.cashAmount },
on: {
input: function($event) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend.min.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions assets/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -1157,3 +1157,27 @@ div:focus, span:focus, button:focus, input:focus {
}
}

#vue-frontend-app {
scrollbar-color: rgba(0,0,0,0.3) rgba(0,0,0,0.07);
scrollbar-width: thin !important;

::-webkit-scrollbar {
width: 10px;
}

::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0.3);
-webkit-border-radius: 5px;
border-radius: 5px;
}

::-webkit-scrollbar-thumb {
-webkit-border-radius: 5px;
border-radius: 5px;
background: rgba(0,0,0,0.07);
}

::-webkit-scrollbar-thumb:window-inactive {
background: rgba(0,0,0,0.07);
}
}
8 changes: 2 additions & 6 deletions assets/src/frontend/components/CustomerSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<span class="add-new-customer flaticon-add" @click.prevent="addNewCustomer()"></span>
<div class="search-result" v-show="showCustomerResults">
<div v-if="customers.length">
<keyboard-control :listLength="customers.length" @selected="selectedHandler" @key-down="onKeyDown" @key-up="onKeyUp">
<keyboard-control :listLength="customers.length" @key-down="onKeyDown" @key-up="onKeyUp">
<template slot-scope="{selectedIndex}">
<li v-for="(customer, index) in customers" class="customer-search-item" :class="{'selected': index === selectedIndex}" :key="index">
<a href="#" class="wepos-clearfix" @click="selectCustomer( customer )">
Expand Down Expand Up @@ -245,10 +245,6 @@ export default {
addNewCustomer() {
this.showNewCustomerModal = true;
},
selectedHandler(selectedIndex) {
var selectedCustomer = this.customers[selectedIndex];
this.selectCustomer( selectedCustomer );
},
onKeyDown() {
jQuery('.customer-search-item.selected').next().children('a').focus();
},
Expand Down Expand Up @@ -407,4 +403,4 @@ export default {
}
}
</style>
</style>
12 changes: 8 additions & 4 deletions assets/src/frontend/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
</template>
</modal>

<modal v-if="showModal" @close="backToSale()" width="98%" height="95vh">
<modal v-if="showModal" @open="focusCashInput()" @close="backToSale()" @enterpressed="processPayment()" width="98%" height="95vh">
<template slot="body">
<div class="wepos-checkout-wrapper">
<div class="left-content">
Expand Down Expand Up @@ -508,7 +508,7 @@
<p>{{ __( 'Cash', 'wepos' ) }}</p>
<div class="input-addon">
<span class="currency">{{ wepos.currency_format_symbol }}</span>
<input type="text" v-model="cashAmount" ref="cashamount">
<input id="input-cash-amount" type="text" v-model="cashAmount" ref="cashamount">
</div>
</div>
</div>
Expand Down Expand Up @@ -782,7 +782,6 @@ export default {
this.$store.dispatch( 'Order/setCanProcessPaymentAction', canProcess );
},
processPayment(e) {
e.preventDefault();
if ( ! this.$store.getters['Order/getCanProcessPayment'] ) {
return;
}
Expand Down Expand Up @@ -1108,7 +1107,12 @@ export default {
.done( response => {
this.taxSettings = response;
});
}
},
focusCashInput() {
let inputCashAmount = document.querySelector('#input-cash-amount');
inputCashAmount.focus();
},
},
async created() {
Expand Down
8 changes: 1 addition & 7 deletions assets/src/frontend/components/KeyboardControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ export default {
} else if (key === 40 || key === 9) {
this.handleKeyDown(e);
this.$emit('key-down');
} else if (key === 13) {
this.handleEnter(e);
}
},
handleEnter(e) {
e.preventDefault();
this.$emit("selected", this.selectedIndex);
},
handleKeyUp(e) {
e.preventDefault();
if (this.selectedIndex <= 0) {
Expand Down Expand Up @@ -84,4 +78,4 @@ export default {
this.removeKeyHandler();
}
};
</script>
</script>
22 changes: 19 additions & 3 deletions assets/src/frontend/components/PrintReceipt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,28 @@ export default {
methods: {
printReceipt() {
var self = this;
setTimeout( () => {
window.print();
}, 500);
}
},
handlePrintingPopup(evt) {
let self = this;
if ( ( "Enter" === evt.code ) && self.$store.getters['Order/getCanProcessPayment'] ) {
self.printReceipt();
}
},
handlePrintReceiptSubmit() {
document.addEventListener( "keypress", this.handlePrintingPopup );
},
},
mounted() {
this.handlePrintReceiptSubmit();
},
destroyed() {
document.removeEventListener( "keypress", this.handlePrintingPopup );
}
};
Expand Down
Loading

0 comments on commit 7379079

Please sign in to comment.