Skip to content

Commit

Permalink
Merge pull request #513 from iShafayet/sprint-0.1.2
Browse files Browse the repository at this point in the history
Sprint 0.1.2
  • Loading branch information
iLGunners authored Nov 22, 2018
2 parents 4b01874 + e3f4bbe commit 3816c06
Show file tree
Hide file tree
Showing 46 changed files with 1,179 additions and 150 deletions.
5 changes: 3 additions & 2 deletions client/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.2",
"paper-spinner": "PolymerElements/paper-spinner#^2.1.0",
"font-roboto": "PolymerElements/font-roboto-local#^1.1.0",
"paper-toggle-button": "PolymerElements/paper-toggle-button#^2.1.0"
"paper-toggle-button": "PolymerElements/paper-toggle-button#^2.1.0",
"good-map": "keanulee/good-map#^0.0.1"
},
"resolutions": {
"polymer": "^2.0.0"
Expand All @@ -47,4 +48,4 @@
"web-component-tester": "Polymer/web-component-tester#^6.0.0"
},
"private": true
}
}
20 changes: 19 additions & 1 deletion client/src/lang-bn-bd.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,20 @@
"damagedInventoryName": "ক্ষতিগ্রস্ত",
"noOutletFound": "আপনার সংস্থার কোনো দোকান তৈরি করা হয়নি।",
"manageOutletServicesTitle": "সেবা পরিচালনা",
"manageOutletServices": "এই দোকানে প্রদত্ত সেবা গুলো পরিচালনা করুন"
"manageOutletServices": "এই দোকানে প্রদত্ত সেবা গুলো পরিচালনা করুন",

"categoryCodeDropdown": "দোকানের ধরন",

"selectLocationButton": "মানচিত্রে অবস্থান চিহ্নিত করুন",
"locationInvalidDialog": "মানচিত্রে একটি সঠিক অবস্থান নির্বাচন করুন।",
"showingLocationOnMap": "নীচের মানচিত্রে অবস্থান দেখানো হচ্ছে",
"noLocationOnMap": "এখনো অবস্থান মানচিত্রে চিহ্নিত করা হয়নি।"
},
"selectGeolocation": {
"selectGeolocationTitle": "মানচিত্রে অবস্থান",
"physicalAddress": "ঠিকানা",
"currentLocation": "এখন যেখানে আছেন",
"saveLocation": "অবস্থান নিশ্চিত করুন"
},
"productBlueprint": {
"manageProductBlueprintsTitle": "পণ্যের পরিকল্পনা পরিচালনা",
Expand Down Expand Up @@ -420,6 +433,11 @@
"customerNameInputError": "একটি সঠিক নাম লিখুন",
"customerNumberInput": "যোগাযোগের নম্বর",
"customerNumberInputError": "একটি সঠিক ফোন নম্বর লিখুন",

"emailAddressInput": "ইমেল (ঐচ্ছিক)",
"emailAddressInputError": "বৈধ ইমেইল লিখুন",
"addressInput": "ঠিকানা (ঐচ্ছিক)",

"openingBalance": "প্রার্থমিক ব্যালেন্স",
"openingBalanceError": "প্রার্থমিক ব্যালেন্স হিসাবে একটি পরিমান লিখুন",
"createCustomer": "গ্রাহক যুক্ত করুন",
Expand Down
21 changes: 20 additions & 1 deletion client/src/lang-en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,21 @@
"damagedInventoryName": "Damaged",
"noOutletFound": "No Outlet has been created in your Organization.",
"manageOutletServicesTitle": "Manage Services",
"manageOutletServices": "Manage Services provided in this Outlet"
"manageOutletServices": "Manage Services provided in this Outlet",

"categoryCodeDropdown": "Outlet Category",

"selectLocationButton": "Set Location on Map",
"locationInvalidDialog": "Please select a valid location on the map.",
"showingLocationOnMap": "Showing your location on Map below",
"noLocationOnMap": "Location has not been set on Map yet."

},
"selectGeolocation": {
"selectGeolocationTitle": "Set Map Location",
"physicalAddress": "Physical Address",
"currentLocation": "Current Location",
"saveLocation": "Save Location"
},
"productBlueprint": {
"manageProductBlueprintsTitle": "Manage Product Blueprints",
Expand Down Expand Up @@ -420,6 +434,11 @@
"customerNameInputError": "Enter a valid name",
"customerNumberInput": "Contact Number",
"customerNumberInputError": "Enter a valid phone number",

"emailAddressInput": "Email Address (Optional)",
"emailAddressInputError": "Enter valid email address",
"addressInput": "Physical Address (Optional)",

"openingBalance": "Opening Balance",
"openingBalanceError": "Enter an amount as opening balance",
"createCustomer": "Create Customer",
Expand Down
38 changes: 23 additions & 15 deletions client/src/page-edit-customer.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,27 @@

<dom-module id="page-edit-customer">
<template>
<style include="shared-styles">

</style>
<style include="shared-styles"></style>

<elem-not-ready is-ready="[[isReady]]"></elem-not-ready>

<div class$="page layout vertical [[$if(isReady, '', 'hidden')]]" id="wrapper">
<iron-form id="editCustomerForm" on-keypress="genericFormSubmitionKeypress">
<form>
<div class="card vertical layout">

<paper-input class="editCustomerForm--fullName" value="{{editCustomerForm.fullName}}" required minlength="3" error-message=[[verses.customer.customerNameInputError]] label=[[verses.customer.customerNameInput]]></paper-input>
<paper-input class="editCustomerForm--phone" value="{{editCustomerForm.phone}}" required minlength="11" maxlength="15" error-message=[[verses.customer.customerNumberInputError]] label=[[verses.customer.customerNumberInput]]></paper-input>

<paper-input class="editCustomerForm--email" value="{{editCustomerForm.email}}" pattern="^.+@.+\..+$" minlength="3" error-message=[[verses.customer.emailAddressInputError]] label=[[verses.customer.emailAddressInput]]></paper-input>
<paper-textarea class="editCustomerForm--address" value="{{editCustomerForm.address}}" label=[[verses.customer.addressInput]] rows="3"></paper-textarea>

<div class="horizontal layout button-row end">
<div class="flex"></div>
<paper-button raised class$="primary [[$if(editMode, 'hidden', '')]] editCustomerForm--submit" on-tap="createCustomerTapped">[[verses.customer.createCustomer]]</paper-button>
<paper-button raised class$="primary [[$if(editMode, '', 'hidden')]] editCustomerForm--submit" on-tap="updateCustomerTapped">[[verses.customer.updateCustomer]]</paper-button>
</div>

</div>
</form>
</iron-form>
Expand Down Expand Up @@ -67,12 +71,16 @@
if (mode === 'development') {
return {
fullName: 'Rahim Karim',
phone: '01700000011'
phone: '01700000011',
email: 'rahim@gmail.com',
address: 'house road block code 1213 city country'
};
} else {
return {
fullName: '',
phone: ''
phone: '',
email: null,
address: ''
};
}
}
Expand Down Expand Up @@ -135,15 +143,15 @@
if (err) return;
if (response.hasError) return this.onApiError(response.error);
this.editingCustomer = response.customer;
let { fullName, phone } = this.editingCustomer;
this.editCustomerForm = { fullName, phone };
let { fullName, phone, email, address } = this.editingCustomer;
this.editCustomerForm = { fullName, phone, email, address };
cbfn();
});
}

_processCreateCustomer({ fullName, phone }) {
_processCreateCustomer({ fullName, phone, email, address }) {
let data = {
fullName, phone,
fullName, phone, email, address,
organizationId: this.app.organization.id
};
this.app.callAddCustomerApi(data, (err, response) => {
Expand All @@ -157,9 +165,9 @@
});
}

_processUpdateCustomer({ fullName, phone }) {
_processUpdateCustomer({ fullName, phone, email, address }) {
let data = {
fullName, phone,
fullName, phone, email, address,
customerId: this.editingCustomer.id
};
this.app.callEditCustomerApi(data, (err, response) => {
Expand All @@ -182,16 +190,16 @@
this.elemAll('#editCustomerForm paper-input').forEach(el => el.autoValidate = true);
if (!this.elem('#editCustomerForm').validate()) return;

let { fullName, phone } = this.editCustomerForm;
this._processCreateCustomer({ fullName, phone });
let { fullName, phone, email, address } = this.editCustomerForm;
this._processCreateCustomer({ fullName, phone, email, address });
}

updateCustomerTapped(e = null) {
this.elemAll('#editCustomerForm paper-input').forEach(el => el.autoValidate = true);
if (!this.elem('#editCustomerForm').validate()) return;

let { fullName, phone } = this.editCustomerForm;
this._processUpdateCustomer({ fullName, phone });
let { fullName, phone, email, address } = this.editCustomerForm;
this._processUpdateCustomer({ fullName, phone, email, address });
}

// region: misc =================================
Expand Down
Loading

0 comments on commit 3816c06

Please sign in to comment.