From 91d3b3ffe2265c477140a70cca13acd3b9e6275a Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Fri, 16 Apr 2021 03:22:44 +0530 Subject: [PATCH 01/41] Added changes for templates of timer function --- app/styles/_error.scss | 4 ++++ app/styles/templates/_index.scss | 5 +++++ app/templates/authenticate.hbs | 16 ++++++++++------ app/templates/login.hbs | 7 ++++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/styles/_error.scss b/app/styles/_error.scss index 5b1bf5497..102dce4f5 100644 --- a/app/styles/_error.scss +++ b/app/styles/_error.scss @@ -19,6 +19,10 @@ background: $light-pitch !important; } } +.otp-resend-pin { + text-align: center; + margin-top: -1rem; +} .error input { border-color: $coral-red !important; diff --git a/app/styles/templates/_index.scss b/app/styles/templates/_index.scss index 07a686d90..5e3f6e6b3 100644 --- a/app/styles/templates/_index.scss +++ b/app/styles/templates/_index.scss @@ -5,6 +5,11 @@ } } +.already_sent_pin{ + pointer-events: none; + opacity: 0.4; +} + .order_detail { text-align: center; padding-bottom: 0.8rem; diff --git a/app/templates/authenticate.hbs b/app/templates/authenticate.hbs index 39a2069da..d04f4c6b6 100644 --- a/app/templates/authenticate.hbs +++ b/app/templates/authenticate.hbs @@ -31,13 +31,17 @@ {{/validatable-form}}
-
- - -
-
diff --git a/app/templates/login.hbs b/app/templates/login.hbs index e0a02cf88..81e419d41 100644 --- a/app/templates/login.hbs +++ b/app/templates/login.hbs @@ -30,7 +30,12 @@
- + +
+ {{#if pinAlreadySent}} + {{t "_resend.please_wait" timer=timer}} + {{/if}} +
From 93172baaf506a8138e5136ce1e35fff89f1c6c87 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Fri, 16 Apr 2021 03:24:04 +0530 Subject: [PATCH 02/41] Added changes for templates of timer function --- app/controllers/authenticate.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/controllers/authenticate.js b/app/controllers/authenticate.js index 08dea6746..29cf0d080 100644 --- a/app/controllers/authenticate.js +++ b/app/controllers/authenticate.js @@ -11,12 +11,28 @@ export default GoodcityController.extend(preloadDataMixin, { authService: Ember.inject.service(), attemptedTransition: null, pin: "", + otpResendTime: config.APP.OTP_RESEND_TIME, + pinAlreadySent: false, isMobileApp: config.cordova.enabled, mobile: Ember.computed("mobilePhone", function() { return config.APP.HK_COUNTRY_CODE + this.get("mobilePhone"); }), + timerFunction() { + let waitTime = this.get("otpResendTime"); + if (waitTime == 0) { + this.set("pinAlreadySent", false); + this.set("otpResendTime", config.APP.OTP_RESEND_TIME); + return false; + } + this.set("timer", waitTime); + this.set("otpResendTime", waitTime - 1); + return setTimeout(() => { + this.timerFunction(); + }, 1000); + }, + actions: { authenticateUser() { let pin = this.get("pin"); @@ -26,6 +42,7 @@ export default GoodcityController.extend(preloadDataMixin, { this.get("authService") .verify(pin, otpAuthKey) .then(({ jwt_token, user }) => { + this.set("otpResendTime", 0); this.set("pin", null); this.set("session.authToken", jwt_token); this.set("session.otpAuthKey", null); @@ -61,6 +78,8 @@ export default GoodcityController.extend(preloadDataMixin, { this.set("session.otpAuthKey", data.otp_auth_key); this.set("pin", null); this.transitionToRoute("/authenticate"); + this.set("pinAlreadySent", true); + this.timerFunction(); }) .catch(error => { if ([401].includes(error.status)) { From 76a536e4f6401d25af56fb6e147615398f4c8b00 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Fri, 16 Apr 2021 03:25:00 +0530 Subject: [PATCH 03/41] Added constant of timer seconds in config file --- config/environment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config/environment.js b/config/environment.js index 9653f3c4d..2f82b0d6f 100755 --- a/config/environment.js +++ b/config/environment.js @@ -63,6 +63,7 @@ module.exports = function(environment) { IMAGE_PATH: "http://res.cloudinary.com/ddoadcjjl/image/upload/", NAMESPACE: "api/v1", + OTP_RESEND_TIME: 60, HK_COUNTRY_CODE: "+852", HK_TIME_ZONE: "Asia/Hong_Kong", DEFAULT_COUNTRY: "China - Hong Kong (Special Administrative Region)", From e70630610ebc883b13940eb905ec5b43142bb8aa Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Fri, 16 Apr 2021 09:25:21 +0530 Subject: [PATCH 04/41] Add locales for resend pin with timer function --- app/locales/en/translations.js | 4 ++-- app/locales/zh-tw/translations.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index 9c3e33387..d3a59d438 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -231,8 +231,8 @@ export default { input_code: "Input Code" }, _resend: { - no_sms: "Haven't received SMS code?", - please_wait: "Please wait 5 minutes...", + try_again: "Try again in {{timer}} seconds", + please_wait: "Please wait {{timer}} seconds before requesting a pin again", resend: "Resend" }, _verification_pin: { diff --git a/app/locales/zh-tw/translations.js b/app/locales/zh-tw/translations.js index 327c1347d..990c320d3 100644 --- a/app/locales/zh-tw/translations.js +++ b/app/locales/zh-tw/translations.js @@ -223,8 +223,8 @@ export default { input_code: "請輸入驗證碼" }, _resend: { - no_sms: "收不到短訊(SMS)?", - please_wait: "請稍等五分鐘...", + try_again: "Try again in {{timer}} seconds", + please_wait: "Please wait {{timer}} seconds before requesting a pin again", resend: "重新發送" }, _verification_pin: { From 69e0a5072b5e18f4313cd4d0be4361a9dd9ba1f2 Mon Sep 17 00:00:00 2001 From: saunmanoj888 Date: Thu, 22 Apr 2021 12:47:51 +0530 Subject: [PATCH 05/41] GCW-3424 - Close search overlay when browser or mobile back button is clicked --- app/components/goodcity/code-search-overlay.js | 3 +++ app/components/goodcity/item-search-overlay.js | 7 +++++++ app/components/goodcity/offers-search-overlay.js | 7 +++++++ app/components/goodcity/organisation-search-overlay.js | 7 +++++++ 4 files changed, 24 insertions(+) diff --git a/app/components/goodcity/code-search-overlay.js b/app/components/goodcity/code-search-overlay.js index cef2b954f..61bd81006 100644 --- a/app/components/goodcity/code-search-overlay.js +++ b/app/components/goodcity/code-search-overlay.js @@ -22,6 +22,9 @@ export default Ember.Component.extend(SearchMixin, AsyncMixin, { init() { this._super("code-search-overlay"); + this.get("router").addObserver("currentRouteName", () => + this.closeOverlay() + ); }, recentPackageTypes: Ember.computed("open", function() { diff --git a/app/components/goodcity/item-search-overlay.js b/app/components/goodcity/item-search-overlay.js index 4ae341bd7..028028ba3 100644 --- a/app/components/goodcity/item-search-overlay.js +++ b/app/components/goodcity/item-search-overlay.js @@ -19,6 +19,13 @@ export default Ember.Component.extend(SearchMixin, AsyncMixin, { i18n: Ember.inject.service(), requireFocus: false, + init() { + this._super(...arguments); + this.get("router").addObserver("currentRouteName", () => + this.closeOverlay() + ); + }, + inputmode: Ember.computed("searchMode", function() { if (this.get("searchMode") === "numeric") { return "numeric"; diff --git a/app/components/goodcity/offers-search-overlay.js b/app/components/goodcity/offers-search-overlay.js index 7c77cc135..f7559f3d8 100644 --- a/app/components/goodcity/offers-search-overlay.js +++ b/app/components/goodcity/offers-search-overlay.js @@ -26,6 +26,13 @@ export default Ember.Component.extend(SearchMixin, { }, searchText: "", + init() { + this._super(...arguments); + this.get("router").addObserver("currentRouteName", () => + this.send("closeOverlay") + ); + }, + actions: { clearSearch() { this.set("searchText", ""); diff --git a/app/components/goodcity/organisation-search-overlay.js b/app/components/goodcity/organisation-search-overlay.js index c6b9dda75..dd7a8b537 100644 --- a/app/components/goodcity/organisation-search-overlay.js +++ b/app/components/goodcity/organisation-search-overlay.js @@ -9,6 +9,13 @@ export default Ember.Component.extend(SearchMixin, { displayResults: false, store: Ember.inject.service(), + init() { + this._super(...arguments); + this.get("router").addObserver("currentRouteName", () => + this.send("cancelSearch") + ); + }, + onSearchTextChange: Ember.observer("searchText", function() { this.hideResults(); From 6e4a68bb37e82218d65de19c58f39c4b23e84e48 Mon Sep 17 00:00:00 2001 From: saunmanoj888 Date: Fri, 23 Apr 2021 15:03:28 +0530 Subject: [PATCH 06/41] GCW-3061 - Resolve live update issues related to Box pallet item addition/removal --- app/controllers/items/detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/items/detail.js b/app/controllers/items/detail.js index cb57d5e3e..361912569 100644 --- a/app/controllers/items/detail.js +++ b/app/controllers/items/detail.js @@ -106,7 +106,7 @@ export default GoodcityController.extend( function() { return ( this.get("settings.disableBoxPalletItemAddition") || - !this.get("item.onHandQuantity") + !this.get("model.onHandQuantity") ); } ), From bc1a694c565dd47584469c112656d74447b508e5 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Mon, 3 May 2021 22:47:16 +0530 Subject: [PATCH 07/41] Upgrade x-code --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index befcfbda8..f8d9cbcff 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -294,7 +294,7 @@ jobs: ios_build_and_deploy: macos: - xcode: "11.0.0" + xcode: "12.0.0" working_directory: ~/code shell: /bin/bash --login -eo pipefail environment: @@ -456,4 +456,4 @@ workflows: - test_cases filters: branches: - only: /^(master|live)$/ + only: /^(master|live|Upgrade-xcode)$/ From 4b065ea30decf8553f1c16ef7324e3e28fb95f86 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Mon, 3 May 2021 23:14:19 +0530 Subject: [PATCH 08/41] Comment test cases --- .circleci/config.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8d9cbcff..879e02b1b 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -337,6 +337,12 @@ jobs: echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV ;; + Upgrade-xcode) + echo 'export ENVIRONMENT=preview' >> $BASH_ENV + echo 'export CERTIFICATE=hk.goodcity.dev.p12' >> $BASH_ENV + echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV + echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV + ;; live) echo 'export ENVIRONMENT=production' >> $BASH_ENV echo 'export CERTIFICATE=hk.goodcity.p12' >> $BASH_ENV @@ -417,9 +423,9 @@ workflows: - package_dependencies: requires: - checkout_code - - test_cases: - requires: - - package_dependencies + # - test_cases: + # requires: + # - package_dependencies # - upload-coverage: # requires: # - package_dependencies @@ -452,8 +458,8 @@ workflows: branches: only: /^(master|live)$/ - ios_build_and_deploy: - requires: - - test_cases + # requires: + # - test_cases filters: branches: only: /^(master|live|Upgrade-xcode)$/ From 9dd38b2e9b921b9374f6dcd3a055596a4c956961 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Mon, 3 May 2021 23:16:52 +0530 Subject: [PATCH 09/41] Remove test cases from android-build --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 879e02b1b..f2c03291d 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -434,8 +434,8 @@ workflows: # branches: # only: /^(master|live)$/ - www_build: - requires: - - test_cases + # requires: + # - test_cases filters: branches: only: /^(master|live|preview)$/ @@ -446,8 +446,8 @@ workflows: branches: only: /^(master|live|preview)$/ - ember_cordova_build: - requires: - - test_cases + # requires: + # - test_cases filters: branches: only: /^(master|live)$/ From 8fb7cf19b559732e1eb3b5215384c910a60de305 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Mon, 3 May 2021 23:40:25 +0530 Subject: [PATCH 10/41] Update gems bundler --- .circleci/config.yml | 23 +++++++++++++---------- .ruby-version | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f2c03291d..624c942a9 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,7 +146,7 @@ jobs: www-deploy: <<: *defaults docker: - - image: circleci/ruby:2.5.5 + - image: circleci/ruby:2.7.1 steps: - restore-cache: *restore-repo-cache - restore-cache: *restore-bundle-cache @@ -423,9 +423,12 @@ workflows: - package_dependencies: requires: - checkout_code - # - test_cases: - # requires: - # - package_dependencies + - test_cases: + requires: + - package_dependencies + filters: + branches: + only: /^(master|live|preview)$/ # - upload-coverage: # requires: # - package_dependencies @@ -434,8 +437,8 @@ workflows: # branches: # only: /^(master|live)$/ - www_build: - # requires: - # - test_cases + requires: + - test_cases filters: branches: only: /^(master|live|preview)$/ @@ -446,8 +449,8 @@ workflows: branches: only: /^(master|live|preview)$/ - ember_cordova_build: - # requires: - # - test_cases + requires: + - test_cases filters: branches: only: /^(master|live)$/ @@ -458,8 +461,8 @@ workflows: branches: only: /^(master|live)$/ - ios_build_and_deploy: - # requires: - # - test_cases + requires: + - package_dependencies filters: branches: only: /^(master|live|Upgrade-xcode)$/ diff --git a/.ruby-version b/.ruby-version index f967d3c13..bff6ce5c1 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.5.5 \ No newline at end of file +ruby-2.7.1 From 7315e37eb41205add45e6ffac16cd6246e6b1c5e Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 00:04:13 +0530 Subject: [PATCH 11/41] Increase x-code version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 624c942a9..c35bb12d7 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -294,7 +294,7 @@ jobs: ios_build_and_deploy: macos: - xcode: "12.0.0" + xcode: "12.0.1" working_directory: ~/code shell: /bin/bash --login -eo pipefail environment: From b8ff540b3aa267835477cbeab398b7788dea1d31 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 01:18:44 +0530 Subject: [PATCH 12/41] Upgrade gemfile --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6db836cbe..9e8712fb0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,7 +223,7 @@ GEM rouge (2.0.7) ruby-macho (1.4.0) ruby2_keywords (0.0.4) - rubyzip (2.3.0) + rubyzip (2.3.1) security (0.1.3) signet (0.15.0) addressable (~> 2.3) From a2ab08780199976e3691b40f5335f989a97e5099 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 01:45:14 +0530 Subject: [PATCH 13/41] Revert Upgrade gemfile --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9e8712fb0..6db836cbe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,7 +223,7 @@ GEM rouge (2.0.7) ruby-macho (1.4.0) ruby2_keywords (0.0.4) - rubyzip (2.3.1) + rubyzip (2.3.0) security (0.1.3) signet (0.15.0) addressable (~> 2.3) From 08c032f168b526db6f3f645c70a19ad7b2e9ddc2 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 13:13:30 +0530 Subject: [PATCH 14/41] Revert xcode version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c35bb12d7..6430f45e9 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -294,7 +294,7 @@ jobs: ios_build_and_deploy: macos: - xcode: "12.0.1" + xcode: "11.0.0" working_directory: ~/code shell: /bin/bash --login -eo pipefail environment: From beb090f44e4e576188d9417e9571e96f2c7a583d Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 13:17:01 +0530 Subject: [PATCH 15/41] Revert ruby version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index bff6ce5c1..80d02f910 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.1 +ruby-2.5.5 From 7c642129d71e438db2a19b29d8c576e4f9b0d95d Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 14:21:37 +0530 Subject: [PATCH 16/41] Changes xcode version to 12 --- .circleci/config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6430f45e9..631b51346 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -212,6 +212,10 @@ jobs: ENVIRONMENT=staging SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING ;; + Upgrade-xcode) + ENVIRONMENT=staging + SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING + ;; preview) ENVIRONMENT=preview SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING @@ -294,7 +298,7 @@ jobs: ios_build_and_deploy: macos: - xcode: "11.0.0" + xcode: "12.0.1" working_directory: ~/code shell: /bin/bash --login -eo pipefail environment: @@ -450,10 +454,10 @@ workflows: only: /^(master|live|preview)$/ - ember_cordova_build: requires: - - test_cases + - package_dependencies filters: branches: - only: /^(master|live)$/ + only: /^(master|live|Upgrade-xcode)$/ - android_build_and_deploy: requires: - ember_cordova_build From 5bd3cd4214b7ead2dc865a84d67e6fe78cadc016 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 15:50:33 +0530 Subject: [PATCH 17/41] Add changes to android build --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 631b51346..fe1f3e9d8 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -463,7 +463,7 @@ workflows: - ember_cordova_build filters: branches: - only: /^(master|live)$/ + only: /^(master|live|Upgrade-xcode)$/ - ios_build_and_deploy: requires: - package_dependencies From 36d8b166b12c14840ee33b47ce45efd72181b01f Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 19:05:15 +0530 Subject: [PATCH 18/41] Updated bundler version --- .ruby-version | 2 +- Gemfile.lock | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.ruby-version b/.ruby-version index 80d02f910..bff6ce5c1 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.5.5 +ruby-2.7.1 diff --git a/Gemfile.lock b/Gemfile.lock index 6db836cbe..8c21cb91b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,13 +9,13 @@ GEM tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.4) + algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.1.1) - aws-partitions (1.446.0) + aws-partitions (1.451.0) aws-sdk-core (3.114.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) @@ -24,7 +24,7 @@ GEM aws-sdk-kms (1.43.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.93.1) + aws-sdk-s3 (1.94.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) @@ -75,7 +75,7 @@ GEM colored2 (3.1.2) commander-fastlane (4.4.6) highline (~> 1.7.2) - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.8) declarative (0.0.20) digest-crc (0.6.3) rake (>= 12.0.0, < 14.0.0) @@ -84,7 +84,7 @@ GEM dotenv (2.7.6) emoji_regex (3.2.2) escape (0.0.4) - excon (0.80.1) + excon (0.81.0) faraday (1.4.1) faraday-excon (~> 1.1) faraday-net_http (~> 1.0) @@ -177,7 +177,7 @@ GEM google-cloud-core (~> 1.2) googleauth (~> 0.9) mini_mime (~> 1.0) - googleauth (0.16.1) + googleauth (0.16.2) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -196,23 +196,25 @@ GEM memoist (0.16.2) mini_magick (4.11.0) mini_mime (1.1.0) - mini_portile2 (2.4.0) - minitest (5.14.2) + mini_portile2 (2.5.1) + minitest (5.14.4) molinillo (0.6.6) multi_json (1.15.0) multipart-post (2.0.0) nanaimo (0.3.0) nap (1.1.0) naturally (2.2.1) - net-scp (2.0.0) - net-ssh (>= 2.6.5, < 6.0.0) - net-ssh (5.2.0) + net-scp (3.0.0) + net-ssh (>= 2.6.5, < 7.0.0) + net-ssh (6.1.0) netrc (0.11.0) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) + nokogiri (1.11.3) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) os (1.1.1) plist (3.6.0) public_suffix (4.0.6) + racc (1.5.2) rake (13.0.3) representable (3.1.1) declarative (< 0.1.0) @@ -234,7 +236,7 @@ GEM CFPropertyList naturally slack-notifier (2.3.2) - sshkit (1.18.2) + sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) terminal-notifier (2.0.0) @@ -246,7 +248,7 @@ GEM tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) - tzinfo (1.2.7) + tzinfo (1.2.9) thread_safe (~> 0.1) uber (0.1.0) unf (0.1.4) @@ -278,4 +280,4 @@ DEPENDENCIES rake BUNDLED WITH - 1.17.3 + 2.1.4 From 0b0242a0dec65e269526f728e34f38dac753e4e4 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 19:20:30 +0530 Subject: [PATCH 19/41] Adding staging reference to the current branch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe1f3e9d8..c42d07746 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -342,7 +342,7 @@ jobs: echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV ;; Upgrade-xcode) - echo 'export ENVIRONMENT=preview' >> $BASH_ENV + echo 'export ENVIRONMENT=staging' >> $BASH_ENV echo 'export CERTIFICATE=hk.goodcity.dev.p12' >> $BASH_ENV echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV From ef3cd494bc5de7a9197cef5b543ec714c9b3b869 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 4 May 2021 19:52:37 +0530 Subject: [PATCH 20/41] :fire: Remove branch from android and ios build Remove branch from android and ios build --- .circleci/config.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c42d07746..fc5348f65 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -212,10 +212,6 @@ jobs: ENVIRONMENT=staging SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING ;; - Upgrade-xcode) - ENVIRONMENT=staging - SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING - ;; preview) ENVIRONMENT=preview SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING @@ -341,12 +337,6 @@ jobs: echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV ;; - Upgrade-xcode) - echo 'export ENVIRONMENT=staging' >> $BASH_ENV - echo 'export CERTIFICATE=hk.goodcity.dev.p12' >> $BASH_ENV - echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV - echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV - ;; live) echo 'export ENVIRONMENT=production' >> $BASH_ENV echo 'export CERTIFICATE=hk.goodcity.p12' >> $BASH_ENV @@ -430,9 +420,6 @@ workflows: - test_cases: requires: - package_dependencies - filters: - branches: - only: /^(master|live|preview)$/ # - upload-coverage: # requires: # - package_dependencies @@ -454,19 +441,19 @@ workflows: only: /^(master|live|preview)$/ - ember_cordova_build: requires: - - package_dependencies + - test_cases filters: branches: - only: /^(master|live|Upgrade-xcode)$/ + only: /^(master|live)$/ - android_build_and_deploy: requires: - ember_cordova_build filters: branches: - only: /^(master|live|Upgrade-xcode)$/ + only: /^(master|live)$/ - ios_build_and_deploy: requires: - - package_dependencies + - test_cases filters: branches: - only: /^(master|live|Upgrade-xcode)$/ + only: /^(master|live)$/ From 3ee37c445827af2b5cd27a8cacc03fcd99ba00e1 Mon Sep 17 00:00:00 2001 From: saunmanoj888 Date: Thu, 6 May 2021 00:40:50 +0530 Subject: [PATCH 21/41] GCW-3424 - Fix pop up issue for the 'Process', 'Recycle', 'Trash', 'Gain (increase)', and 'Loss (decrease)' --- app/routes/items/detail.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/routes/items/detail.js b/app/routes/items/detail.js index 2b31c5f00..4cdb78f9d 100644 --- a/app/routes/items/detail.js +++ b/app/routes/items/detail.js @@ -81,6 +81,7 @@ export default AuthorizeRoute.extend({ controller.set("showExtendedFooterMenu", false); controller.set("displayResults", true); controller.set("containerQuantity", null); + controller.set("readyForAction", false); const defaultValue = await this.get("packageService").getItemValuation({ donorConditionId: model.get("donorCondition.id"), From 452378bc99aa1fb649588b753e79cd1d544cbe74 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Thu, 6 May 2021 03:33:52 +0530 Subject: [PATCH 22/41] Add code for clearinterval and remove otpresend code --- app/controllers/authenticate.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/controllers/authenticate.js b/app/controllers/authenticate.js index 29cf0d080..b23dc11a2 100644 --- a/app/controllers/authenticate.js +++ b/app/controllers/authenticate.js @@ -4,14 +4,14 @@ import config from "../config/environment"; import preloadDataMixin from "../mixins/preload_data"; import GoodcityController from "./goodcity_controller"; import _ from "lodash"; -const { getOwner } = Ember; +let timeout; export default GoodcityController.extend(preloadDataMixin, { messageBox: Ember.inject.service(), authService: Ember.inject.service(), attemptedTransition: null, pin: "", - otpResendTime: config.APP.OTP_RESEND_TIME, + timer: config.APP.OTP_RESEND_TIME, pinAlreadySent: false, isMobileApp: config.cordova.enabled, @@ -20,19 +20,22 @@ export default GoodcityController.extend(preloadDataMixin, { }), timerFunction() { - let waitTime = this.get("otpResendTime"); - if (waitTime == 0) { - this.set("pinAlreadySent", false); - this.set("otpResendTime", config.APP.OTP_RESEND_TIME); + let waitTime = this.get("timer"); + if (waitTime === 0) { + this.resetTimerParameters(); return false; } - this.set("timer", waitTime); - this.set("otpResendTime", waitTime - 1); - return setTimeout(() => { + this.set("timer", waitTime - 1); + timeout = setTimeout(() => { this.timerFunction(); }, 1000); }, + resetTimerParameters() { + this.set("pinAlreadySent", false); + this.set("timer", config.APP.OTP_RESEND_TIME); + }, + actions: { authenticateUser() { let pin = this.get("pin"); @@ -42,7 +45,8 @@ export default GoodcityController.extend(preloadDataMixin, { this.get("authService") .verify(pin, otpAuthKey) .then(({ jwt_token, user }) => { - this.set("otpResendTime", 0); + clearTimeout(timeout); + this.resetTimerParameters(); this.set("pin", null); this.set("session.authToken", jwt_token); this.set("session.otpAuthKey", null); From 048c99759178a9cd164fe5a2393b3ef02f51395a Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Mon, 10 May 2021 22:53:10 +0530 Subject: [PATCH 23/41] GCW-1957-Fixing tab issue for resend pin button --- app/templates/authenticate.hbs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/templates/authenticate.hbs b/app/templates/authenticate.hbs index d04f4c6b6..0e4d0b1d9 100644 --- a/app/templates/authenticate.hbs +++ b/app/templates/authenticate.hbs @@ -32,16 +32,13 @@
- {{t "_resend.resend"}} - {{#if pinAlreadySent}} - - {{/if}} - - +
- - -
From bdadf20708610a98d7f805122471d80d3e557e29 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Mon, 10 May 2021 23:25:56 +0530 Subject: [PATCH 24/41] Update fastlane --- Gemfile.lock | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8c21cb91b..8052cdb78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.1.1) - aws-partitions (1.451.0) + aws-partitions (1.452.0) aws-sdk-core (3.114.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) @@ -24,7 +24,7 @@ GEM aws-sdk-kms (1.43.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.94.0) + aws-sdk-s3 (1.94.1) aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) @@ -73,8 +73,8 @@ GEM cocoapods-try (1.2.0) colored (1.2) colored2 (3.1.2) - commander-fastlane (4.4.6) - highline (~> 1.7.2) + commander (4.6.0) + highline (~> 2.0.0) concurrent-ruby (1.1.8) declarative (0.0.20) digest-crc (0.6.3) @@ -100,7 +100,7 @@ GEM faraday_middleware (1.0.0) faraday (~> 1.0) fastimage (2.2.3) - fastlane (2.181.0) + fastlane (2.182.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) artifactory (~> 3.0) @@ -108,7 +108,7 @@ GEM babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored - commander-fastlane (>= 4.4.6, < 5.0.0) + commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) @@ -119,7 +119,7 @@ GEM gh_inspector (>= 1.1.2, < 2.0.0) google-api-client (>= 0.37.0, < 0.39.0) google-cloud-storage (>= 1.15.0, < 2.0.0) - highline (>= 1.7.2, < 2.0.0) + highline (~> 2.0) json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) @@ -129,7 +129,6 @@ GEM rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) - slack-notifier (>= 2.0.0, < 3.0.0) terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (>= 1.4.5, < 2.0.0) tty-screen (>= 0.6.3, < 1.0.0) @@ -184,7 +183,7 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (~> 0.14) - highline (1.7.10) + highline (2.0.3) http-cookie (1.0.3) domain_name (~> 0.5) httpclient (2.8.3) @@ -235,7 +234,6 @@ GEM simctl (1.6.8) CFPropertyList naturally - slack-notifier (2.3.2) sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) From aa752cecb7bf015d5697f5c539940d3cf0d02886 Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 11 May 2021 11:34:12 +0530 Subject: [PATCH 25/41] GCW-1957-fix scandit failure --- .circleci/config.yml | 25 +++++++++++++++++++------ .ruby-version | 2 +- Gemfile.lock | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fc5348f65..12b72de91 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,7 +146,7 @@ jobs: www-deploy: <<: *defaults docker: - - image: circleci/ruby:2.7.1 + - image: cimg/ruby:2.7.3 steps: - restore-cache: *restore-repo-cache - restore-cache: *restore-bundle-cache @@ -212,6 +212,10 @@ jobs: ENVIRONMENT=staging SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING ;; + GCW-1957-enter-error-fix) + ENVIRONMENT=staging + SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING + ;; preview) ENVIRONMENT=preview SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING @@ -331,6 +335,12 @@ jobs: echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV ;; + GCW-1957-enter-error-fix) + echo 'export ENVIRONMENT=staging' >> $BASH_ENV + echo 'export CERTIFICATE=hk.goodcity.dev.p12' >> $BASH_ENV + echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV + echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV + ;; preview) echo 'export ENVIRONMENT=preview' >> $BASH_ENV echo 'export CERTIFICATE=hk.goodcity.dev.p12' >> $BASH_ENV @@ -420,6 +430,9 @@ workflows: - test_cases: requires: - package_dependencies + filters: + branches: + only: /^(master|live|preview)$/ # - upload-coverage: # requires: # - package_dependencies @@ -441,19 +454,19 @@ workflows: only: /^(master|live|preview)$/ - ember_cordova_build: requires: - - test_cases + - package_dependencies filters: branches: - only: /^(master|live)$/ + only: /^(master|live|GCW-1957-enter-error-fix)$/ - android_build_and_deploy: requires: - ember_cordova_build filters: branches: - only: /^(master|live)$/ + only: /^(master|live|GCW-1957-enter-error-fix)$/ - ios_build_and_deploy: requires: - - test_cases + - package_dependencies filters: branches: - only: /^(master|live)$/ + only: /^(master|live|GCW-1957-enter-error-fix)$/ diff --git a/.ruby-version b/.ruby-version index bff6ce5c1..c0013a89c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.1 +ruby-2.7.3 diff --git a/Gemfile.lock b/Gemfile.lock index 8052cdb78..9f38cc61d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.1.1) - aws-partitions (1.452.0) + aws-partitions (1.453.0) aws-sdk-core (3.114.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) From 2de30c3486ca2e37d552e603a6e60221fea6301b Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 11 May 2021 20:21:38 +0530 Subject: [PATCH 26/41] GCW-1957-Add pinalready sent in proper area --- app/controllers/authenticate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/authenticate.js b/app/controllers/authenticate.js index b23dc11a2..944677650 100644 --- a/app/controllers/authenticate.js +++ b/app/controllers/authenticate.js @@ -75,6 +75,7 @@ export default GoodcityController.extend(preloadDataMixin, { }, resendPin() { + this.set("pinAlreadySent", true); this.showLoadingSpinner(); this.get("authService") .sendPin(this.get("mobile")) @@ -82,10 +83,10 @@ export default GoodcityController.extend(preloadDataMixin, { this.set("session.otpAuthKey", data.otp_auth_key); this.set("pin", null); this.transitionToRoute("/authenticate"); - this.set("pinAlreadySent", true); this.timerFunction(); }) .catch(error => { + this.set("pinAlreadySent", false); if ([401].includes(error.status)) { this.get("messageBox").alert("You are not authorized.", () => { this.transitionToRoute("/"); From bde22ba856a1b2cf8f2ca8d5cafc59c4559661ef Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 11 May 2021 21:11:38 +0530 Subject: [PATCH 27/41] Fix scandit error in gradle --- cordova/config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cordova/config.xml b/cordova/config.xml index 660cb763c..659826dd3 100644 --- a/cordova/config.xml +++ b/cordova/config.xml @@ -115,7 +115,7 @@ - - + + From ebe5e22bb478d582af37c4fa4d05943adf10486e Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Tue, 11 May 2021 21:44:03 +0530 Subject: [PATCH 28/41] Revert changes and remove testing branch --- .circleci/config.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 12b72de91..7fae85f54 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -212,10 +212,6 @@ jobs: ENVIRONMENT=staging SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING ;; - GCW-1957-enter-error-fix) - ENVIRONMENT=staging - SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING - ;; preview) ENVIRONMENT=preview SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_ANDROID_STAGING @@ -335,12 +331,6 @@ jobs: echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV ;; - GCW-1957-enter-error-fix) - echo 'export ENVIRONMENT=staging' >> $BASH_ENV - echo 'export CERTIFICATE=hk.goodcity.dev.p12' >> $BASH_ENV - echo 'export PROVISIONING_PROFILE=GoodCityStockStaging.mobileprovision' >> $BASH_ENV - echo 'export SCANDIT_LICENSE_KEY=$SCANDIT_LICENSE_KEY_IOS_STAGING' >> $BASH_ENV - ;; preview) echo 'export ENVIRONMENT=preview' >> $BASH_ENV echo 'export CERTIFICATE=hk.goodcity.dev.p12' >> $BASH_ENV @@ -430,9 +420,6 @@ workflows: - test_cases: requires: - package_dependencies - filters: - branches: - only: /^(master|live|preview)$/ # - upload-coverage: # requires: # - package_dependencies @@ -454,19 +441,19 @@ workflows: only: /^(master|live|preview)$/ - ember_cordova_build: requires: - - package_dependencies + - test_cases filters: branches: - only: /^(master|live|GCW-1957-enter-error-fix)$/ + only: /^(master|live)$/ - android_build_and_deploy: requires: - ember_cordova_build filters: branches: - only: /^(master|live|GCW-1957-enter-error-fix)$/ + only: /^(master|live)$/ - ios_build_and_deploy: requires: - - package_dependencies + - test_cases filters: branches: - only: /^(master|live|GCW-1957-enter-error-fix)$/ + only: /^(master|live)$/ From 7f84a7400b9e51ef2678487be62e9b79357cc8e9 Mon Sep 17 00:00:00 2001 From: swatijadhav Date: Thu, 13 May 2021 12:35:01 +0530 Subject: [PATCH 29/41] GCW-3629 merge users UI --- app/controllers/users/details.js | 43 ++++++++ app/controllers/users/merge_user.js | 36 +++++++ app/locales/en/translations.js | 3 + app/locales/zh-tw/translations.js | 4 + app/models/user_profile.js | 7 ++ app/router.js | 3 + app/routes/application.js | 11 ++ app/routes/users/details.js | 5 + app/routes/users/merge_user.js | 33 ++++++ app/services/user-service.js | 13 +++ app/styles/templates/_user_details.scss | 39 ++++++- app/templates/manage_users.hbs | 16 +-- app/templates/users/_disable_user_popup.hbs | 2 +- app/templates/users/_user_row.hbs | 11 ++ app/templates/users/details.hbs | 56 ++++++++++ app/templates/users/merge_user.hbs | 107 ++++++++++++++++++++ 16 files changed, 372 insertions(+), 17 deletions(-) create mode 100644 app/controllers/users/merge_user.js create mode 100644 app/routes/users/merge_user.js create mode 100644 app/templates/users/_user_row.hbs create mode 100644 app/templates/users/merge_user.hbs diff --git a/app/controllers/users/details.js b/app/controllers/users/details.js index 141e56e24..bb8dea80c 100644 --- a/app/controllers/users/details.js +++ b/app/controllers/users/details.js @@ -12,6 +12,7 @@ export default Ember.Controller.extend(OrganisationMixin, AsyncMixin, { enableUserPopupVisible: false, updateUserMessagePopupVisible: false, isDisabledUser: Ember.computed.alias("user.disabled"), + minSearchTextLength: 3, canDisableUsers: Ember.computed("user.id", function() { return ( @@ -20,6 +21,13 @@ export default Ember.Controller.extend(OrganisationMixin, AsyncMixin, { ); }), + canMergeUsers: Ember.computed("user.id", function() { + return ( + this.get("session.currentUser.canMergeUsers") && + +this.get("session.currentUser.id") !== +this.get("user.id") + ); + }), + showEnableUserMessage: Ember.computed.and( "canDisableUsers", "isDisabledUser" @@ -82,7 +90,42 @@ export default Ember.Controller.extend(OrganisationMixin, AsyncMixin, { } }, + onSearchTextChange: Ember.observer("searchText", function() { + this.hideResults(); + if (this.get("searchText").trim().length >= 3) { + Ember.run.debounce(this, this.showResults, 500); + } + }), + + hideResults() { + this.set("displayResults", false); + }, + + showResults() { + this.set("displayResults", true); + }, + actions: { + searchUsers(page) { + const params = { + page: page, + per_page: 25, + searchText: this.get("searchText"), + stockRequest: true + }; + + return this.get("store").query("user", params); + }, + + cancelMerge() { + this.set("searchUser", false); + this.set("searchText", ""); + }, + + searchUserToMerge() { + this.set("searchUser", true); + }, + disableUser() { this.toggleUserAccount({ disabled: true }); }, diff --git a/app/controllers/users/merge_user.js b/app/controllers/users/merge_user.js new file mode 100644 index 000000000..bfdf82b53 --- /dev/null +++ b/app/controllers/users/merge_user.js @@ -0,0 +1,36 @@ +import Ember from "ember"; +import AsyncMixin, { ERROR_STRATEGIES } from "stock/mixins/async"; + +export default Ember.Controller.extend(AsyncMixin, { + user: Ember.computed.alias("model.user"), + otherUser: Ember.computed.alias("model.otherUser"), + userService: Ember.inject.service(), + + masterUserId: Ember.computed("user.id", { + get() { + return this.get("user.id"); + }, + set(_, value) { + return value; + } + }), + + actions: { + mergeUser() { + const targetUserId = this.get("masterUserId"); + let sourceUserId; + + if (targetUserId === this.get("user.id")) { + sourceUserId = this.get("otherUser.id"); + } else { + sourceUserId = this.get("user.id"); + } + + this.get("userService") + .mergeUser(sourceUserId, targetUserId) + .then(() => { + this.transitionToRoute("users.details", targetUserId); + }); + } + } +}); diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index d3a59d438..a2767ad33 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -2,6 +2,8 @@ export default { offline_error: "Unable to complete action, please check your internet connection.", unexpected_error: "Something went wrong", + unavailable_record: + "Unfortunately, the details that you are looking for are not here.", okay: "Okay", "language.en": "English", "language.zh": "中文", @@ -1068,6 +1070,7 @@ export default { stock_app: "Stock App", admin_app: "Admin App", disable_user_account: "Disable User Account", + merge_user_account: "Merge with another User Account", disable_user: "Disable User", disabled_user_info: "User will be denied access to all apps including donor app.", diff --git a/app/locales/zh-tw/translations.js b/app/locales/zh-tw/translations.js index 990c320d3..f01714840 100644 --- a/app/locales/zh-tw/translations.js +++ b/app/locales/zh-tw/translations.js @@ -1,6 +1,9 @@ export default { offline_error: "無法加載,請檢查網絡連線", unexpected_error: "錯誤", + unavailable_record: + "Unfortunately, the details that you are looking for are not here.", + okay: "Okay", okay: "確定", add_inventory_item: "Add item to inventory", loading: "正在加載...", @@ -1019,6 +1022,7 @@ export default { stock_app: "倉儲程式", admin_app: "管理程式", disable_user_account: "停用用戶帳號", + merge_user_account: "Merge with another User Account", disable_user: "停用用戶", disabled_user_info: "用戶會被禁止使用所有程式,包括捐贈程式。", disabled_user_note: diff --git a/app/models/user_profile.js b/app/models/user_profile.js index feff2acfb..22eac34bf 100644 --- a/app/models/user_profile.js +++ b/app/models/user_profile.js @@ -113,6 +113,13 @@ export default Addressable.extend({ ); }), + canMergeUsers: Ember.computed("roles", function() { + const roles = this.get("roles"); + return roles.find( + r => r.get("permissionNames").indexOf("can_merge_users") >= 0 + ); + }), + mobileWithCountryCode: Ember.computed("mobile", function() { return this.get("mobile") ? "+852" + this.get("mobile") : ""; }), diff --git a/app/router.js b/app/router.js index d69ccca7b..cbdd8771e 100644 --- a/app/router.js +++ b/app/router.js @@ -96,6 +96,9 @@ Router.map(function() { this.route("charity_position", { path: "/:user_id/charity_position" }); + this.route("merge_user", { + path: "/:user_id/merge_user" + }); }); this.route("not-found", { path: "/*path" }); diff --git a/app/routes/application.js b/app/routes/application.js index 92d986069..c9c7d5512 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -71,6 +71,15 @@ export default Ember.Route.extend(AsyncMixin, preloadDataMixin, { }); }, + showRecordIsNotAvailable() { + this.get("messageBox").alert( + this.get("i18n").t("unavailable_record"), + () => { + this.transitionTo("/"); + } + ); + }, + showOrderIsNotAvailable() { this.get("messageBox").alert( this.get("i18n").t("unavailable_order"), @@ -164,6 +173,8 @@ export default Ember.Route.extend(AsyncMixin, preloadDataMixin, { reason.message.indexOf("404") >= 0 ) { this.showOrderIsNotAvailable(); + } else if (status === 404) { + this.showRecordIsNotAvailable(); } else { this.showErrorPopup(reason); } diff --git a/app/routes/users/details.js b/app/routes/users/details.js index acce19c09..862fb9862 100644 --- a/app/routes/users/details.js +++ b/app/routes/users/details.js @@ -3,5 +3,10 @@ import AuthorizeRoute from "../authorize"; export default AuthorizeRoute.extend({ model(params) { return this.loadIfAbsent("user", params.user_id); + }, + + setupController(controller, model) { + this._super(controller, model); + controller.set("searchUser", false); } }); diff --git a/app/routes/users/merge_user.js b/app/routes/users/merge_user.js new file mode 100644 index 000000000..30e51e5cd --- /dev/null +++ b/app/routes/users/merge_user.js @@ -0,0 +1,33 @@ +import AuthorizeRoute from "../authorize"; + +export default AuthorizeRoute.extend({ + queryParams: { + otherUserId: null + }, + + beforeModel({ queryParams = {}, params = {} }) { + this._super(...arguments); + + const hasotherUserId = !!queryParams.otherUserId; + const userId = params["users.merge_user"].user_id; + + if ( + !hasotherUserId || + (hasotherUserId && queryParams.otherUserId === userId) + ) { + this.replaceWith("users.details", userId); + } + }, + + model(params) { + return Ember.RSVP.hash({ + user: this.loadIfAbsent("user", params.user_id), + otherUser: this.loadIfAbsent("user", params.otherUserId) + }); + }, + + setupController(controller, model) { + this._super(controller, model); + // controller.set("searchUser", false); + } +}); diff --git a/app/services/user-service.js b/app/services/user-service.js index 3669cbfc0..256a6fa34 100644 --- a/app/services/user-service.js +++ b/app/services/user-service.js @@ -191,5 +191,18 @@ export default ApiBaseService.extend({ } }); } + }, + + mergeUser(sourceUserId, targetUserId) { + return this.PUT(`/users/merge_users`, { + master_user_id: targetUserId, + merged_user_id: sourceUserId + }) + .then(data => this.get("store").pushPayload(data)) + .catch(jqXHR => { + this.get("messageBox").alert( + _.get(jqXHR, "responseJSON.errors[0].message.error") + ); + }); } }); diff --git a/app/styles/templates/_user_details.scss b/app/styles/templates/_user_details.scss index 8989b9d97..25d43c29b 100644 --- a/app/styles/templates/_user_details.scss +++ b/app/styles/templates/_user_details.scss @@ -32,7 +32,11 @@ } } - .last-online-time { + .merge-user-info { + margin-bottom: 2rem; + } + + .last-online-time, .merge-user-info { text-align: center; div { @@ -150,7 +154,15 @@ } .disable-user-link { - padding: 4rem 1rem; + padding: 2rem 1rem 1rem; + text-align: center; + text-decoration: underline; + color: $white; + font-size: 0.8rem; + } + + .merge-user-link { + padding: 1rem; text-align: center; text-decoration: underline; color: $white; @@ -262,8 +274,29 @@ margin-top: 0.5rem; } +.user-details-block { + border: 1px solid $medium-blue; + padding: 1rem; + margin: 1rem; + + .row { + line-height: 2; + font-size: 0.8rem; + } + + .user-info { + color: $white; + font-weight: bold; + } + + .user-detail-heading { + + } +} + // Roles Access Details Page -.role-access-form { +.role-access-form, +.user-details-block { margin: 0.5rem; .access-heading, diff --git a/app/templates/manage_users.hbs b/app/templates/manage_users.hbs index e1d45d4a5..93afb212c 100644 --- a/app/templates/manage_users.hbs +++ b/app/templates/manage_users.hbs @@ -28,20 +28,10 @@ {{#if displayResults}} {{#infinite-list height="75vh" loadMore=(action "loadMoreUsers") as |items| }}
    - {{#each items as |user|}} + {{#each items as |record|}}
  • - {{#link-to 'users.details' user.id tagName='div' href=false}} -
    -
    - {{user.fullName}} -
    -
    - {{user.mobile}} -
    -
    -
    - {{user.organisationsUsers.firstObject.organisation.nameEn}} -
    + {{#link-to 'users.details' record.id tagName='div' href=false}} + {{partial 'users/user_row'}} {{/link-to}}
  • {{/each}} diff --git a/app/templates/users/_disable_user_popup.hbs b/app/templates/users/_disable_user_popup.hbs index 8d7c8d9ab..0becfcec0 100644 --- a/app/templates/users/_disable_user_popup.hbs +++ b/app/templates/users/_disable_user_popup.hbs @@ -5,7 +5,7 @@ btn2Text=(t "users.details.disable_user") btn2Callback=(action "disableUser") isVisible=disableUserPopupVisible - classNames="popupOverlay ui disable-user-popup" + classNames="popupOverlay disable-user-popup" }}
    {{t "users.details.disable_user"}}?
    diff --git a/app/templates/users/_user_row.hbs b/app/templates/users/_user_row.hbs new file mode 100644 index 000000000..6975268d8 --- /dev/null +++ b/app/templates/users/_user_row.hbs @@ -0,0 +1,11 @@ +
    +
    + {{record.fullName}} +
    +
    + {{record.mobile}} +
    +
    +
    + {{record.organisationsUsers.firstObject.organisation.nameEn}} +
    diff --git a/app/templates/users/details.hbs b/app/templates/users/details.hbs index c704ebd4e..c21df061e 100644 --- a/app/templates/users/details.hbs +++ b/app/templates/users/details.hbs @@ -148,4 +148,60 @@ {{partial 'users/disable_user_popup'}} {{/if}} + {{#if canMergeUsers}} + + {{/if}} + +
    + {{#popup-overlay open=searchUser}} + + {{/popup-overlay}} +
    diff --git a/app/templates/users/merge_user.hbs b/app/templates/users/merge_user.hbs new file mode 100644 index 000000000..abd5530dd --- /dev/null +++ b/app/templates/users/merge_user.hbs @@ -0,0 +1,107 @@ + + +
    + + +
    + +
    + {{radio-button + name="selectMasterUser" + id=user.id + value=user.id + selection=masterUserId + required='true'}} + +
    + +
    +
    First Name:
    + +
    +
    +
    Last Name:
    + +
    +
    +
    Mobile:
    + +
    +
    +
    Email:
    + +
    +
    +
    UserId:
    + +
    +
    + +
    + +
    + {{radio-button + name="selectMasterUser" + id=otherUser.id + value=otherUser.id + selection=masterUserId + required='true'}} + +
    + +
    +
    First Name:
    + +
    +
    +
    Last Name:
    + +
    +
    +
    Mobile:
    + +
    +
    +
    Email:
    + +
    +
    +
    UserId:
    + +
    +
    + +
    +
    + +
    +
    + +
    + From d3139d00fa9fee5a541af8a940026916ad8c4109 Mon Sep 17 00:00:00 2001 From: swatijadhav Date: Mon, 17 May 2021 15:02:26 +0530 Subject: [PATCH 30/41] GCW-3629 updated translations --- app/locales/en/translations.js | 14 +++++++++++++ app/locales/zh-tw/translations.js | 15 +++++++++++++- app/routes/users/merge_user.js | 1 - app/templates/users/merge_user.hbs | 32 +++++++++++++++--------------- 4 files changed, 44 insertions(+), 18 deletions(-) diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index a2767ad33..b89e71548 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -1134,5 +1134,19 @@ export default { "You have successfully Logged in! However, you need permission to start working on stock.", manager_msg: "Ask your manager to grant permissions and then try again", try_again: "Try again" + }, + + merge_user: { + merge: "Merge", + keep_details: "Keep these details", + user_id: "User ID", + email: "Email", + mobile: "Mobile", + first_name: "First Name", + last_name: "Last Name", + choose_user: "Choose which user to keep.", + merge_user_info: + "The resulting user will have all the rights, ownership, group memberships etc. of both users combined.", + merge_user: "Merge User" } }; diff --git a/app/locales/zh-tw/translations.js b/app/locales/zh-tw/translations.js index f01714840..513e473d6 100644 --- a/app/locales/zh-tw/translations.js +++ b/app/locales/zh-tw/translations.js @@ -3,7 +3,6 @@ export default { unexpected_error: "錯誤", unavailable_record: "Unfortunately, the details that you are looking for are not here.", - okay: "Okay", okay: "確定", add_inventory_item: "Add item to inventory", loading: "正在加載...", @@ -1093,5 +1092,19 @@ export default { "You have successfully Logged in! However, you need permission to start working on stock.", manager_msg: "Ask your manager to grant permissions and then try again", try_again: "Try again" + }, + + merge_user: { + merge: "Merge", + keep_details: "Keep these details", + user_id: "User ID", + email: "Email", + mobile: "Mobile", + first_name: "First Name", + last_name: "Last Name", + choose_user: "Choose which user to keep.", + merge_user_info: + "The resulting user will have all the rights, ownership, group memberships etc. of both users combined.", + merge_user: "Merge User" } }; diff --git a/app/routes/users/merge_user.js b/app/routes/users/merge_user.js index 30e51e5cd..5ba3f6fba 100644 --- a/app/routes/users/merge_user.js +++ b/app/routes/users/merge_user.js @@ -28,6 +28,5 @@ export default AuthorizeRoute.extend({ setupController(controller, model) { this._super(controller, model); - // controller.set("searchUser", false); } }); diff --git a/app/templates/users/merge_user.hbs b/app/templates/users/merge_user.hbs index abd5530dd..9f99ef542 100644 --- a/app/templates/users/merge_user.hbs +++ b/app/templates/users/merge_user.hbs @@ -8,15 +8,15 @@

    - Merge User + {{t "merge_user.merge_user"}}

    @@ -30,29 +30,29 @@ required='true'}}
    -
    First Name:
    +
    {{t "merge_user.first_name"}}:
    -
    Last Name:
    +
    {{t "merge_user.last_name"}}:
    -
    Mobile:
    +
    {{t "merge_user.mobile"}}:
    -
    Email:
    +
    {{t "merge_user.email"}}:
    -
    UserId:
    +
    {{t "merge_user.user_id"}}:
    @@ -68,29 +68,29 @@ required='true'}}
    -
    First Name:
    +
    {{t "merge_user.first_name"}}:
    -
    Last Name:
    +
    {{t "merge_user.last_name"}}:
    -
    Mobile:
    +
    {{t "merge_user.mobile"}}:
    -
    Email:
    +
    {{t "merge_user.email"}}:
    -
    UserId:
    +
    {{t "merge_user.user_id"}}:
    @@ -98,7 +98,7 @@
    From 3f9f845bfc225b781a63509c25a132127d994efa Mon Sep 17 00:00:00 2001 From: Swati Jadhav Date: Mon, 17 May 2021 16:37:04 +0530 Subject: [PATCH 31/41] Update app/controllers/users/details.js Co-authored-by: Shreyash --- app/controllers/users/details.js | 8 +++++++- app/styles/templates/_user_details.scss | 8 ++++---- app/templates/users/details.hbs | 4 ++-- app/templates/users/merge_user.hbs | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/controllers/users/details.js b/app/controllers/users/details.js index bb8dea80c..5737e8b68 100644 --- a/app/controllers/users/details.js +++ b/app/controllers/users/details.js @@ -92,7 +92,9 @@ export default Ember.Controller.extend(OrganisationMixin, AsyncMixin, { onSearchTextChange: Ember.observer("searchText", function() { this.hideResults(); - if (this.get("searchText").trim().length >= 3) { + if ( + this.get("searchText").trim().length >= this.get("minSearchTextLength") + ) { Ember.run.debounce(this, this.showResults, 500); } }), @@ -117,6 +119,10 @@ export default Ember.Controller.extend(OrganisationMixin, AsyncMixin, { return this.get("store").query("user", params); }, + clearSearch() { + this.set("searchText", ""); + }, + cancelMerge() { this.set("searchUser", false); this.set("searchText", ""); diff --git a/app/styles/templates/_user_details.scss b/app/styles/templates/_user_details.scss index 25d43c29b..37cb3a4e3 100644 --- a/app/styles/templates/_user_details.scss +++ b/app/styles/templates/_user_details.scss @@ -274,6 +274,10 @@ margin-top: 0.5rem; } +.clear-users-search.pinned-right { + top: 0.8rem !important; +} + .user-details-block { border: 1px solid $medium-blue; padding: 1rem; @@ -288,10 +292,6 @@ color: $white; font-weight: bold; } - - .user-detail-heading { - - } } // Roles Access Details Page diff --git a/app/templates/users/details.hbs b/app/templates/users/details.hbs index c21df061e..34de94a45 100644 --- a/app/templates/users/details.hbs +++ b/app/templates/users/details.hbs @@ -175,8 +175,8 @@ placeholder=(t "search_min") value=searchText }} - {{#if hasSearchText}} - {{fa-icon 'times-circle' size='lg'}} + {{#if searchText}} + {{fa-icon 'times-circle' size='lg'}} {{/if}} diff --git a/app/templates/users/merge_user.hbs b/app/templates/users/merge_user.hbs index 9f99ef542..1472b4e0a 100644 --- a/app/templates/users/merge_user.hbs +++ b/app/templates/users/merge_user.hbs @@ -97,7 +97,7 @@
    -
    From 405c0e1c62247894d85e4762ed33a7a8f98b7faa Mon Sep 17 00:00:00 2001 From: swatijadhav Date: Mon, 17 May 2021 17:59:32 +0530 Subject: [PATCH 32/41] GCW-3629 addressed suggestions --- app/controllers/users/merge_user.js | 17 +++++++++-------- app/services/user-service.js | 8 +------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/controllers/users/merge_user.js b/app/controllers/users/merge_user.js index bfdf82b53..03797c03c 100644 --- a/app/controllers/users/merge_user.js +++ b/app/controllers/users/merge_user.js @@ -18,19 +18,20 @@ export default Ember.Controller.extend(AsyncMixin, { actions: { mergeUser() { const targetUserId = this.get("masterUserId"); - let sourceUserId; + let sourceUserId = this.get("user.id"); if (targetUserId === this.get("user.id")) { sourceUserId = this.get("otherUser.id"); - } else { - sourceUserId = this.get("user.id"); } - this.get("userService") - .mergeUser(sourceUserId, targetUserId) - .then(() => { - this.transitionToRoute("users.details", targetUserId); - }); + this.runTask( + this.get("userService") + .mergeUser(sourceUserId, targetUserId) + .then(() => { + this.transitionToRoute("users.details", targetUserId); + }), + ERROR_STRATEGIES.MODAL + ); } } }); diff --git a/app/services/user-service.js b/app/services/user-service.js index 256a6fa34..ef68fc43f 100644 --- a/app/services/user-service.js +++ b/app/services/user-service.js @@ -197,12 +197,6 @@ export default ApiBaseService.extend({ return this.PUT(`/users/merge_users`, { master_user_id: targetUserId, merged_user_id: sourceUserId - }) - .then(data => this.get("store").pushPayload(data)) - .catch(jqXHR => { - this.get("messageBox").alert( - _.get(jqXHR, "responseJSON.errors[0].message.error") - ); - }); + }).then(data => this.get("store").pushPayload(data)); } }); From aeec247d0e63ddc6070cdaee77708b7198be31b1 Mon Sep 17 00:00:00 2001 From: Swati Jadhav Date: Tue, 18 May 2021 11:35:24 +0530 Subject: [PATCH 33/41] Apply suggestions from code review Co-authored-by: Shreyash --- app/templates/users/details.hbs | 4 ++-- app/templates/users/merge_user.hbs | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/templates/users/details.hbs b/app/templates/users/details.hbs index 34de94a45..63557c678 100644 --- a/app/templates/users/details.hbs +++ b/app/templates/users/details.hbs @@ -176,7 +176,7 @@ value=searchText }} {{#if searchText}} - {{fa-icon 'times-circle' size='lg'}} + {{fa-icon 'times-circle' size='lg'}} {{/if}}
    @@ -191,7 +191,7 @@ {{#if (is-not-equal record.id user.id)}}
  • {{#link-to 'users.merge_user' user.id (query-params otherUserId=record.id) tagName='div' }} - {{partial 'users/user_row'}} + {{partial 'users/user_row'}} {{/link-to}}
  • {{/if}} diff --git a/app/templates/users/merge_user.hbs b/app/templates/users/merge_user.hbs index 1472b4e0a..d06626fd4 100644 --- a/app/templates/users/merge_user.hbs +++ b/app/templates/users/merge_user.hbs @@ -6,7 +6,6 @@
    -

    {{t "merge_user.merge_user"}}

    @@ -104,4 +103,3 @@
    - From 99a173f250ccbeee485e28cb43e5fcaa3a519c45 Mon Sep 17 00:00:00 2001 From: swatijadhav Date: Tue, 18 May 2021 12:54:09 +0530 Subject: [PATCH 34/41] GCW-3629 updated translations --- app/locales/zh-tw/translations.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/app/locales/zh-tw/translations.js b/app/locales/zh-tw/translations.js index 513e473d6..f43001326 100644 --- a/app/locales/zh-tw/translations.js +++ b/app/locales/zh-tw/translations.js @@ -1,8 +1,7 @@ export default { offline_error: "無法加載,請檢查網絡連線", unexpected_error: "錯誤", - unavailable_record: - "Unfortunately, the details that you are looking for are not here.", + unavailable_record: "很抱歉,我們未有找到相關資料", okay: "確定", add_inventory_item: "Add item to inventory", loading: "正在加載...", @@ -1021,7 +1020,7 @@ export default { stock_app: "倉儲程式", admin_app: "管理程式", disable_user_account: "停用用戶帳號", - merge_user_account: "Merge with another User Account", + merge_user_account: "與另一帳戶合併", disable_user: "停用用戶", disabled_user_info: "用戶會被禁止使用所有程式,包括捐贈程式。", disabled_user_note: @@ -1095,16 +1094,16 @@ export default { }, merge_user: { - merge: "Merge", - keep_details: "Keep these details", - user_id: "User ID", - email: "Email", - mobile: "Mobile", - first_name: "First Name", - last_name: "Last Name", - choose_user: "Choose which user to keep.", + merge: "合併", + keep_details: "保留這些資料", + user_id: "使用者帳號", + email: "電郵地址", + mobile: "手提電話號碼", + first_name: "名字", + last_name: "姓氏", + choose_user: "選擇需要保留的使用者", merge_user_info: - "The resulting user will have all the rights, ownership, group memberships etc. of both users combined.", - merge_user: "Merge User" + "合併後的帳戶會獲得兩個帳戶的所有權利、擁有權及團體職員身份等。", + merge_user: "合併使用者" } }; From 5d3ca6d0fb91819d0b1f6c2ccb7e911bf4a4bb45 Mon Sep 17 00:00:00 2001 From: saunmanoj888 Date: Wed, 19 May 2021 13:46:17 +0530 Subject: [PATCH 35/41] GCW-3061 - Fix live update issue on mobile app when User logs in first time --- app/controllers/application.js | 4 ++++ app/controllers/authenticate.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/controllers/application.js b/app/controllers/application.js index c9b8b6ec0..6db36dc22 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -44,6 +44,10 @@ export default Ember.Controller.extend({ this.get("session").unloadSessionData(); this.session.clearCache(); this.transitionToRoute("login"); + }, + + setSubscription() { + this.get("subscription").wire(); } } }); diff --git a/app/controllers/authenticate.js b/app/controllers/authenticate.js index 944677650..608f7bc73 100644 --- a/app/controllers/authenticate.js +++ b/app/controllers/authenticate.js @@ -9,6 +9,7 @@ let timeout; export default GoodcityController.extend(preloadDataMixin, { messageBox: Ember.inject.service(), authService: Ember.inject.service(), + application: Ember.inject.controller(), attemptedTransition: null, pin: "", timer: config.APP.OTP_RESEND_TIME, @@ -51,6 +52,7 @@ export default GoodcityController.extend(preloadDataMixin, { this.set("session.authToken", jwt_token); this.set("session.otpAuthKey", null); this.store.pushPayload(user); + Ember.run(() => this.get("application").send("setSubscription")); return this.preloadData(); }) .then(() => { From 7a826a44b839a5108a5460a9de6715fa6987cca4 Mon Sep 17 00:00:00 2001 From: saunmanoj888 Date: Wed, 19 May 2021 17:39:37 +0530 Subject: [PATCH 36/41] GCW-3061 - Use subscription service for setting socket connection --- app/controllers/application.js | 4 ---- app/controllers/authenticate.js | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/application.js b/app/controllers/application.js index 6db36dc22..c9b8b6ec0 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -44,10 +44,6 @@ export default Ember.Controller.extend({ this.get("session").unloadSessionData(); this.session.clearCache(); this.transitionToRoute("login"); - }, - - setSubscription() { - this.get("subscription").wire(); } } }); diff --git a/app/controllers/authenticate.js b/app/controllers/authenticate.js index 608f7bc73..1ef51e3cb 100644 --- a/app/controllers/authenticate.js +++ b/app/controllers/authenticate.js @@ -9,7 +9,7 @@ let timeout; export default GoodcityController.extend(preloadDataMixin, { messageBox: Ember.inject.service(), authService: Ember.inject.service(), - application: Ember.inject.controller(), + subscription: Ember.inject.service(), attemptedTransition: null, pin: "", timer: config.APP.OTP_RESEND_TIME, @@ -52,7 +52,7 @@ export default GoodcityController.extend(preloadDataMixin, { this.set("session.authToken", jwt_token); this.set("session.otpAuthKey", null); this.store.pushPayload(user); - Ember.run(() => this.get("application").send("setSubscription")); + Ember.run(() => this.get("subscription").wire()); return this.preloadData(); }) .then(() => { From e1a421ef806d110fe3a1479b9f47a75b8b2cef76 Mon Sep 17 00:00:00 2001 From: saunmanoj888 Date: Fri, 21 May 2021 12:10:13 +0530 Subject: [PATCH 37/41] GCW-3061 - Remove Ember.run method for setting subscription --- app/controllers/authenticate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/authenticate.js b/app/controllers/authenticate.js index 1ef51e3cb..5f5c1f9ba 100644 --- a/app/controllers/authenticate.js +++ b/app/controllers/authenticate.js @@ -52,7 +52,7 @@ export default GoodcityController.extend(preloadDataMixin, { this.set("session.authToken", jwt_token); this.set("session.otpAuthKey", null); this.store.pushPayload(user); - Ember.run(() => this.get("subscription").wire()); + this.get("subscription").wire(); return this.preloadData(); }) .then(() => { From e6ca666434904c087b06733e3feb3ee83f0ff420 Mon Sep 17 00:00:00 2001 From: swatijadhav Date: Sat, 22 May 2021 21:28:28 +0530 Subject: [PATCH 38/41] GCW-3611 fixed issue with sending same messsage multiple times --- app/mixins/messages_base.js | 6 +++++- app/templates/orders/_message_template.hbs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/mixins/messages_base.js b/app/mixins/messages_base.js index c61409543..b76e0779b 100644 --- a/app/mixins/messages_base.js +++ b/app/mixins/messages_base.js @@ -7,6 +7,7 @@ export default Ember.Mixin.create({ store: Ember.inject.service(), subscription: Ember.inject.service(), messagesUtil: Ember.inject.service("messages"), + messageInProgress: false, sortProperties: ["createdAt: asc"], sortedMessages: Ember.computed.sort("messages", "sortProperties"), @@ -38,6 +39,8 @@ export default Ember.Mixin.create({ if (!values) { return; } + this.set("messageInProgress", true); + var message = this.store.createRecord("message", values); message .save() @@ -49,7 +52,8 @@ export default Ember.Mixin.create({ .catch(error => { this.store.unloadRecord(message); throw error; - }); + }) + .finally(() => this.set("messageInProgress", false)); }, prepareMessageObject: function(messageableType) { diff --git a/app/templates/orders/_message_template.hbs b/app/templates/orders/_message_template.hbs index b7db03af6..3fba4c590 100644 --- a/app/templates/orders/_message_template.hbs +++ b/app/templates/orders/_message_template.hbs @@ -60,7 +60,7 @@ containerClass='message-textbar-container'}}
    - {{#online-button classNames="button" onClick=(action "sendMessage") actionArgs=true}} + {{#online-button classNames="button" onClick=(action "sendMessage") disabled=messageInProgress actionArgs=true}} {{t 'messages.send'}} {{/online-button}}
    From 915297676bc0078d6dd3ea15dc0edc0ee812a97a Mon Sep 17 00:00:00 2001 From: shreyas098 Date: Mon, 24 May 2021 15:52:12 +0530 Subject: [PATCH 39/41] fastlane update --- Gemfile.lock | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9f38cc61d..5c3a6020d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.1.1) - aws-partitions (1.453.0) + aws-partitions (1.461.0) aws-sdk-core (3.114.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) @@ -24,7 +24,7 @@ GEM aws-sdk-kms (1.43.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.94.1) + aws-sdk-s3 (1.95.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) @@ -85,7 +85,9 @@ GEM emoji_regex (3.2.2) escape (0.0.4) excon (0.81.0) - faraday (1.4.1) + faraday (1.4.2) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) faraday-net_http (~> 1.0) faraday-net_http_persistent (~> 1.1) @@ -94,13 +96,15 @@ GEM faraday-cookie_jar (0.0.7) faraday (>= 0.8.0) http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-net_http (1.0.1) faraday-net_http_persistent (1.1.0) faraday_middleware (1.0.0) faraday (~> 1.0) fastimage (2.2.3) - fastlane (2.182.0) + fastlane (2.184.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) artifactory (~> 3.0) @@ -117,8 +121,9 @@ GEM faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.37.0, < 0.39.0) - google-cloud-storage (>= 1.15.0, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.1) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) highline (~> 2.0) json (< 3.0.0) jwt (>= 2.1.0, < 3) @@ -140,14 +145,8 @@ GEM fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - google-api-client (0.38.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (~> 0.9) - httpclient (>= 2.8.1, < 3.0) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.0) - signet (~> 0.12) + google-apis-androidpublisher_v3 (0.4.0) + google-apis-core (~> 0.1) google-apis-core (0.3.0) addressable (~> 2.5, >= 2.5.1) googleauth (~> 0.14) @@ -158,9 +157,11 @@ GEM rexml signet (~> 0.14) webrick - google-apis-iamcredentials_v1 (0.3.0) + google-apis-iamcredentials_v1 (0.4.0) + google-apis-core (~> 0.1) + google-apis-playcustomapp_v1 (0.3.0) google-apis-core (~> 0.1) - google-apis-storage_v1 (0.3.0) + google-apis-storage_v1 (0.4.0) google-apis-core (~> 0.1) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) @@ -168,7 +169,7 @@ GEM google-cloud-env (1.5.0) faraday (>= 0.17.3, < 2.0) google-cloud-errors (1.1.0) - google-cloud-storage (1.31.0) + google-cloud-storage (1.31.1) addressable (~> 2.5) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) From 9ab647eef4a11bf99136b13d3efceb6b26f72ea9 Mon Sep 17 00:00:00 2001 From: swatijadhav Date: Wed, 26 May 2021 10:14:10 +0530 Subject: [PATCH 40/41] GCW-3629 fixed back link UI issue at user-merge --- app/styles/_search.scss | 4 ++++ app/templates/manage_users.hbs | 2 +- app/templates/users/details.hbs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/styles/_search.scss b/app/styles/_search.scss index 33c6da7de..f561b93d9 100644 --- a/app/styles/_search.scss +++ b/app/styles/_search.scss @@ -247,6 +247,10 @@ padding-left: 0.2rem; padding-top: 0.3rem; } + + .back_icon_link { + text-decoration: none !important; + } } .user_search_result, diff --git a/app/templates/manage_users.hbs b/app/templates/manage_users.hbs index 93afb212c..19cbe2b82 100644 --- a/app/templates/manage_users.hbs +++ b/app/templates/manage_users.hbs @@ -1,6 +1,6 @@