Skip to content

Commit

Permalink
Merge pull request #273 from crossroads/master
Browse files Browse the repository at this point in the history
#January2019Release1
  • Loading branch information
namrataukirde authored Jan 9, 2019
2 parents 21900e8 + e9da291 commit bd0fe96
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ jobs:

ios_build_and_deploy:
macos:
xcode: "9.2.0"
xcode: "10.1.0"
working_directory: ~/code
shell: /bin/bash --login -eo pipefail
environment:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.4.2
ruby-2.5.3
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def ios_build_config
opts = {}
opts["developmentTeam"] = mobile_provisioning_plist["TeamIdentifier"].first
opts["automaticProvisionin"] = false
opts["buildFlag"] = '-UseModernBuildSystem=0'
opts["provisioningProfile"] = mobile_provisioning_plist["UUID"]
if production_env?
opts["codeSignIdentity"] = "\'iPhone Distribution\'"
Expand Down
34 changes: 26 additions & 8 deletions app/controllers/receive_package.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';
const { getOwner } = Ember;
import AjaxPromise from 'goodcity/utils/ajax-promise';

export default Ember.Controller.extend({

Expand Down Expand Up @@ -133,11 +134,24 @@ export default Ember.Controller.extend({
if(this.get("hasErrors")) {
this.get("package").rollbackAttributes();
}
this.transitionToRoute("review_offer.receive");
var _this = this;
var loadingView = getOwner(this).lookup('component:loading').append();
var pkg = this.get("package");
var inventoryNumber = pkg.get('inventoryNumber');
pkg.set('inventoryNumber', null);
pkg.save()
.then(() => {
new AjaxPromise("/inventory_numbers/remove_number", "PUT", _this.get('session.authToken'), { code: inventoryNumber }).then(() => {
_this.transitionToRoute("review_offer.receive");
});
})
.catch(() => {
_this.send('pkgUpdateError', pkg);
})
.finally(() => loadingView.destroy());
},

receivePackage() {
var _this = this;
var pkgData = this.get("packageForm");

this.set("invalidQuantity", (pkgData.quantity.toString().length === 0));
Expand Down Expand Up @@ -178,15 +192,19 @@ export default Ember.Controller.extend({
})
.catch(() => {
loadingView.destroy();
var errorMessage = pkg.get("errors.firstObject.message") || pkg.get('adapterError.errors.firstObject.title');
if(errorMessage === "Adapter Error" || errorMessage.indexOf("Connection error") >= 0) {
this.get("messageBox").alert("could not contact Stockit, try again later.", () => pkg.rollbackAttributes());
} else {
_this.set("hasErrors", true);
}
this.send('pkgUpdateError', pkg);
});
},

pkgUpdateError(pkg) {
var errorMessage = pkg.get("errors.firstObject.message") || pkg.get('adapterError.errors.firstObject.title');
if(errorMessage === "Adapter Error" || errorMessage.indexOf("Connection error") >= 0) {
this.get("messageBox").alert("could not contact Stockit, try again later.", () => pkg.rollbackAttributes());
} else {
this.set("hasErrors", true);
}
},

resetInputs() {
this.set("invalidQuantity", false);
this.set("invalidInventoryNo", false);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "goodcity",
"version": "0.15.2",
"version": "0.15.3",
"description": "The GoodCity Admin app enables administrators to process donated goods.",
"private": true,
"directories": {
Expand Down

0 comments on commit bd0fe96

Please sign in to comment.