diff --git a/.circleci/config.yml b/.circleci/config.yml index ad87af307..90298d280 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -127,6 +127,9 @@ jobs: - run: name: Run Build command: cd carrier/mobile-ionic && yarn build + - run: + name: Run Ionic Build (Production) + command: cd carrier/mobile-ionic && yarn ionic:build:prod - save_cache: name: Save Yarn Package Cache key: yarn-packages-carrier-mobile-ionic-{{ checksum "yarn.lock" }} @@ -167,6 +170,9 @@ jobs: - run: name: Run Build command: cd shop/mobile-ionic && yarn build + - run: + name: Run Ionic Build (Production) + command: cd shop/mobile-ionic && yarn ionic:build:prod - save_cache: name: Save Yarn Package Cache key: yarn-packages-shop-mobile-ionic-{{ checksum "yarn.lock" }} @@ -247,6 +253,9 @@ jobs: - run: name: Run Build command: cd merchant/tablet-ionic && yarn build + - run: + name: Run Ionic Build (Production) + command: cd merchant/tablet-ionic && yarn ionic:build:prod - save_cache: name: Save Yarn Package Cache key: yarn-packages-merchant-tablet-ionic-{{ checksum "yarn.lock" }} diff --git a/README.md b/README.md index acdbea01c..b02ea1505 100644 --- a/README.md +++ b/README.md @@ -108,13 +108,15 @@ yarn bootstrap This will install required packages in all Platform projects using Lerna +Note: if above command fails for any reason, you can try to install required packages manually by running `yarn` inside every sub-folder with 'package.json' file + ### Lerna (manual installation) We are using [Lerna](https://github.com/lerna/lerna) for mono-repo management. You need to run the following command from working folder where you cloned Ever git repo, which will install Lerna together with other packages: ``` -yarn install +yarn ``` You may instead install Lerna globally: @@ -144,31 +146,50 @@ It is also possible to use [AWS DocumentDB](https://aws.amazon.com/documentdb) o _Note: we currently integrating [Mongo Memory Server](https://github.com/nodkz/mongodb-memory-server) which will allow to test Platform without need to install MongoDB locally._ -### Platform Configuration (optional) +### Platform Configuration + +#### Default + +We created templates & initial configuration files (with reasonable defaults) for each project in the Platform, to save your time and keep things simple. -We created templates & initial configuration files (with reasonable defaults) for each project in the Platform, to save your time and keep things simple: +In the Angular based projects, the "standard" environment configuration files `environment.ts` and `environment.prod.ts` will be auto-generated from .env file (if it's exists) or from default settings on the first app run. -- For _Backend (API)_ configuration, the `./backend/api/.env.template` file should be copied into `./backend/api/.env` and relevant changes should (optionally) be done. +So, the following files will be auto-generated: - **IMPORTANT**: you should have `./backend/api/.env` file in place to be able to run the Platform on developer machine if you want to use different settings to our defaults. +- in Admin UI: `./admin/website-angular/src/environments/environment.ts` and `./admin/website-angular/src/environments/environment.prod.ts`. +- in Mobile Shop: `./shop/mobile-ionic/src/environments/environment.ts` and `./shop/mobile-ionic/src/environments/environment.prod.ts` +- in Web Shop: `./shop/website-angular/src/environments/environment.ts` and `./shop/website-angular/src/environments/environment.prod.ts` +- in Carrier App: `./carrier/mobile-ionic/src/environments/environment.ts` and `./carrier/mobile-ionic/src/environments/environment.prod.ts` +- in Merchant App: `./merchant/tablet-ionic/src/environments/environment.ts` and `./merchant/tablet-ionic/src/environments/environment.prod.ts` -- For _Admin_ Angular App configuration, the `./admin/website-angular/.env.template` file should be copied into `./admin/website-angular/.env` and relevant changes should (optionally) be done. +Note: you should never edit auto-generated files above and instead you should edit relevant .env files for custom configurations, see more details below. - Note: the "Standard" Angular environment configuration files `./admin/website-angular/src/environments/environment.ts` and `./admin/website-angular/src/environments/environment.prod.ts` will be auto-generated from .env file (if it's exists) or from default settings on the first app run +#### Custom / Manual -- For _Merchant_ Ionic App configuration, see `./merchant/tablet-ionic/src/environments/environment.ts` and `./merchant/tablet-ionic/src/environments/environment.prod.ts` files. If you need to run Merchant App using PM2 (as Web app, not Tablet App), needs copy `./merchant/tablet-ionic/.env.template` to `./merchant/tablet-ionic/.env` and make relevant changes (if required) +- For _Backend (API)_ configuration, the `./backend/api/.env.template` file should be copied into `./backend/api/.env` and relevant changes should be done in the `.env` file. + It means you should have `./backend/api/.env` file in place to be able to run the Platform on developer machine if you want to use different settings to our defaults. -- For _Shopping Mobile_ App (Ionic) configuration, see `./shop/mobile-ionic/src/environments/environment.ts` and `./shop/mobile-ionic/src/environments/environment.prod.ts` files +- For _Admin_ Angular App configuration, the `./admin/website-angular/.env.template` file should be copied into `./admin/website-angular/.env` and relevant changes should be done in the `.env` file. -- For _Shopping Website_ configuration, see `./shop/website-angular/src/environments/environment.ts` and `./shop/website-angular/src/environments/environment.prod.ts` files +- For _Merchant_ Ionic App configuration, the `./merchant/tablet-ionic/.env.template` file should be copied into `./merchant/tablet-ionic/.env` and relevant changes should be done in the `.env` file. + If you need to run Merchant App using PM2 (as Web app, not Tablet App), needs copy `./merchant/tablet-ionic/.env.template` to `./merchant/tablet-ionic/.env` and make relevant changes (if required) -- For _Carrier Mobile_ App (Ionic) configuration, see `./carrier/mobile-ionic/src/environments/environment.ts` and `./carrier/mobile-ionic/src/environments/environment.prod.ts` files +- For _Shopping Mobile_ App (Ionic) configuration, the `./shop/mobile-ionic/.env.template` file should be copied into `./shop/mobile-ionic/.env` and relevant changes should be done in the `.env` file. + +- For _Shopping Website_ configuration, the `./shop/website-angular/.env.template` file should be copied into `./shop/website-angular/.env` and relevant changes should be done in the `.env` file. + +- For _Carrier Mobile_ App (Ionic) configuration, the `./carrier/mobile-ionic/.env.template` file should be copied into `./carrier/mobile-ionic/.env` and relevant changes should be done in the `.env` file. Notes: -- for initial development run no changes required in the `.env` or `environment.ts` files in the projects, unless some manual changes were done to the Backend (API) configuration. However, to enable some of the Platform features, you may need to change relevant configurations at corresponding files. +- For initial development no changes required in the `.env` files in the projects, unless some manual changes were done to the Backend (API) configuration. However, to enable some of the Platform features, you may need to change relevant configurations in corresponding `.env` files. + +- As a general rule, files `.env` are configurations you should never make public (and of course never commit to Git repo), unless you removed all private/secure parameters from them. + In addition, for Angular based projects, you should never put any secure settings (e.g. Secret Keys, API Keys, etc) in `environment.ts` and `environment.prod.ts` files because all of them will be loaded into the browser and made public. + Because we are using auto-generated `environment.ts` and `environment.prod.ts` files, it means you should never put any secure settings into `.env` files in our Angular projects. + The only safe place to put your secure settings is `.env` file on the backend API/Server project! -- files `.env`, `environment.ts`, `environment.prod.ts` are configurations you should never make public, unless you removed all private/secure parameters from them. +- We are using dotenv (.env) in Angular based projects for consistency with configuration between all our Platform projects only. ### Run Platform Projects diff --git a/admin/website-angular/scripts/configure.ts b/admin/website-angular/scripts/configure.ts index 736b3193d..df3593a96 100644 --- a/admin/website-angular/scripts/configure.ts +++ b/admin/website-angular/scripts/configure.ts @@ -72,6 +72,9 @@ try { } catch {} const envFileDest: string = isProd ? 'environment.prod.ts' : 'environment.ts'; +const envFileDestOther: string = !isProd + ? 'environment.prod.ts' + : 'environment.ts'; writeFile(`./src/environments/${envFileDest}`, envFileContent, function(err) { if (err) { @@ -80,3 +83,13 @@ writeFile(`./src/environments/${envFileDest}`, envFileContent, function(err) { console.log(`Generated Angular environment file: ${envFileDest}`); } }); + +writeFile(`./src/environments/${envFileDestOther}`, '', function(err) { + if (err) { + console.log(err); + } else { + console.log( + `Generated Second Empty Angular environment file: ${envFileDestOther}` + ); + } +}); diff --git a/admin/website-angular/tsconfig.json b/admin/website-angular/tsconfig.json index df9889e83..a5485a907 100644 --- a/admin/website-angular/tsconfig.json +++ b/admin/website-angular/tsconfig.json @@ -7,6 +7,7 @@ "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, + "importHelpers": true, "noImplicitAny": false, "preserveConstEnums": true, "allowSyntheticDefaultImports": true, diff --git a/carrier/mobile-ionic/config.xml b/carrier/mobile-ionic/config.xml index 09ff4fe32..b905294f7 100644 --- a/carrier/mobile-ionic/config.xml +++ b/carrier/mobile-ionic/config.xml @@ -82,8 +82,6 @@ - - @@ -100,4 +98,6 @@ + + diff --git a/carrier/mobile-ionic/ionic.config.json b/carrier/mobile-ionic/ionic.config.json index e25bfa24a..13663cd18 100644 --- a/carrier/mobile-ionic/ionic.config.json +++ b/carrier/mobile-ionic/ionic.config.json @@ -3,7 +3,6 @@ "integrations": { "cordova": {} }, - "type": "ionic-angular", - "pro_id": "16ee2ab7", + "type": "angular", "id": "16ee2ab7" } diff --git a/carrier/mobile-ionic/ionic.project b/carrier/mobile-ionic/ionic.project index ae2a14447..c16db3f07 100644 --- a/carrier/mobile-ionic/ionic.project +++ b/carrier/mobile-ionic/ionic.project @@ -3,6 +3,6 @@ "integrations": { "cordova": {} }, - "type": "ionic-angular", + "type": "angular", "app_id": "16ee2ab7" } \ No newline at end of file diff --git a/carrier/mobile-ionic/package.json b/carrier/mobile-ionic/package.json index af60cd936..3d778b353 100644 --- a/carrier/mobile-ionic/package.json +++ b/carrier/mobile-ionic/package.json @@ -97,37 +97,36 @@ "apollo-link-ws": "^1.0.17", "call-number": "~1.0.1", "connect": "^3.6.6", - "cordova-android": "^7.1.4", + "cordova-android": "7.1.4", "cordova-android-support-gradle-release": "^2.0.1", "cordova-browser": "^6.0.0", + "cordova-open-native-settings": "^1.5.2", "cordova-plugin-appavailability": "^0.4.2", - "cordova-plugin-device": "2.0.2", + "cordova-plugin-badge": "^0.8.8", + "cordova-plugin-camera": "^4.0.3", + "cordova-plugin-device": "^2.0.2", "cordova-plugin-dialogs": "^2.0.1", - "cordova-plugin-geolocation": "4.0.1", - "cordova-plugin-globalization": "1.11.0", - "cordova-plugin-google-analytics": "1.8.6", + "cordova-plugin-email-composer": "^0.9.2", + "cordova-plugin-geolocation": "^4.0.1", + "cordova-plugin-globalization": "^1.11.0", + "cordova-plugin-google-analytics": "^1.8.6", "cordova-plugin-inappbrowser": "^3.0.0", "cordova-plugin-intercom": "^6.2.0", "cordova-plugin-ionic-keyboard": "^2.1.3", - "cordova-plugin-ionic-webview": "^4.0.0", - "cordova-plugin-mixpanel": "4.5.2", - "cordova-plugin-splashscreen": "5.0.2", - "cordova-plugin-statusbar": "2.4.2", + "cordova-plugin-ionic-webview": "^4.0.1", + "cordova-plugin-local-notification": "^0.9.0-beta.2", + "cordova-plugin-mixpanel": "^4.5.2", + "cordova-plugin-network-information": "^2.0.1", + "cordova-plugin-screen-orientation": "^3.0.1", + "cordova-plugin-splashscreen": "^5.0.2", + "cordova-plugin-statusbar": "^2.4.2", "cordova-plugin-uniquedeviceid": "^1.3.2", - "cordova-plugin-vibration": "3.1.0", + "cordova-plugin-vibration": "^3.1.0", "cordova-plugin-whitelist": "^1.3.3", - "cordova-open-native-settings": "^1.5.2", - "cordova-plugin-badge": "^0.8.8", - "cordova-plugin-camera": "4.0.3", - "cordova-plugin-email-composer": "^0.9.2", - "cordova-plugin-local-notification": "0.9.0-beta.2", - "cordova-plugin-network-information": "2.0.1", - "cordova-plugin-screen-orientation": "^3.0.1", - "phonegap-plugin-barcodescanner": "^8.0.1", "core-js": "^3.0.0", "cryptiles": "^4.1.3", - "font-awesome": "^4.7.0", "es6-promise-plugin": "^4.2.2", + "font-awesome": "^4.7.0", "graphql": "^14.1.1", "graphql-tag": "^2.10.1", "hooks-fixed": "^2.0.2", @@ -137,8 +136,9 @@ "mongoose": "^5.4.19", "mpath": "^0.5.1", "mquery": "^3.2.0", - "mx.ferreyra.callnumber": "^0.0.2", + "mx.ferreyra.callnumber": "0.0.2", "node-sass": "^4.11.0", + "phonegap-plugin-barcodescanner": "^8.0.1", "qrcode": "^1.3.3", "reflect-metadata": "^0.1.13", "rxjs": "^6.4.0", @@ -147,12 +147,11 @@ "save": "^2.3.3", "socket.io-client": "^2.2.0", "stripe": "^6.28.0", - "swiper": "^4.5.0", "sw-toolbox": "^3.6.0", + "swiper": "^4.5.0", "tslib": "^1.9.3", "uuid": "^3.3.2", "waves": "^0.1.1", - "webpack-merge": "^4.2.1", "zone.js": "^0.9.0" }, "devDependencies": { @@ -209,7 +208,8 @@ "tslint": "^5.14.0", "yargs": "^13.2.2", "typescript": "~3.2.4", - "webpack-bundle-analyzer": "^3.1.0" + "webpack-bundle-analyzer": "^3.1.0", + "webpack-merge": "^4.2.1" }, "config": { "ionic_webpack": "./config/webpack.config.js" @@ -227,7 +227,9 @@ "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+" }, "cordova-plugin-ionic-keyboard": {}, - "cordova-plugin-google-analytics": {}, + "cordova-plugin-google-analytics": { + "GMS_VERSION": "11.0.1" + }, "cordova-plugin-network-information": {}, "cordova-plugin-mixpanel": { "PLAY_SERVICES_VERSION": "+" @@ -246,7 +248,8 @@ "ANDROID_SUPPORT_V4_VERSION": "27.+" }, "cordova-plugin-vibration": {}, - "cordova-plugin-local-notification": {} + "cordova-plugin-local-notification": {}, + "call-number": {} } }, "engines": { diff --git a/carrier/mobile-ionic/scripts/configure.ts b/carrier/mobile-ionic/scripts/configure.ts index 249b8ef44..9b17ea4c9 100644 --- a/carrier/mobile-ionic/scripts/configure.ts +++ b/carrier/mobile-ionic/scripts/configure.ts @@ -69,6 +69,9 @@ export const environment: Environment = { `; const envFileDest: string = isProd ? 'environment.prod.ts' : 'environment.ts'; +const envFileDestOther: string = !isProd + ? 'environment.prod.ts' + : 'environment.ts'; // we always want first to remove old generated files (one of them is not needed for current build) try { @@ -85,3 +88,13 @@ writeFile(`./src/environments/${envFileDest}`, envFileContent, function(err) { console.log(`Generated Angular environment file: ${envFileDest}`); } }); + +writeFile(`./src/environments/${envFileDestOther}`, '', function(err) { + if (err) { + console.log(err); + } else { + console.log( + `Generated Second Empty Angular environment file: ${envFileDestOther}` + ); + } +}); diff --git a/carrier/mobile-ionic/src/pages/information/about/about.ts b/carrier/mobile-ionic/src/pages/information/about/about.ts index 268980f4d..96c042e58 100644 --- a/carrier/mobile-ionic/src/pages/information/about/about.ts +++ b/carrier/mobile-ionic/src/pages/information/about/about.ts @@ -10,7 +10,7 @@ import { environment } from 'environment'; styleUrls: ['about.scss'] }) export class AboutPage { - protected aboutHtml: string; + aboutHtml: string; protected appVersion: string; diff --git a/carrier/mobile-ionic/src/pages/language/language.ts b/carrier/mobile-ionic/src/pages/language/language.ts index c4fc5566f..c6f2d9195 100644 --- a/carrier/mobile-ionic/src/pages/language/language.ts +++ b/carrier/mobile-ionic/src/pages/language/language.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core'; - import { TranslateService } from '@ngx-translate/core'; import { DeviceRouter } from '@modules/client.common.angular2/routers/device-router.service'; @@ -22,11 +21,12 @@ export class LanguagePage { return localStorage.getItem('_deviceId'); } - languageChange(val) { + languageChange() { localStorage.setItem('_language', this.language); // Example: "en-US".substr(0, 2) = "en" const langAbbreviation = this.language.substr(0, 2); + this._langTranslator.use(langAbbreviation); if (this.deviceId) { diff --git a/carrier/mobile-ionic/src/pages/main/delivery/delivery.ts b/carrier/mobile-ionic/src/pages/main/delivery/delivery.ts index c5c7b5550..53c08a8d1 100644 --- a/carrier/mobile-ionic/src/pages/main/delivery/delivery.ts +++ b/carrier/mobile-ionic/src/pages/main/delivery/delivery.ts @@ -27,6 +27,10 @@ export class DeliveryPage implements AfterViewInit { carrierUserDistance: string; disabledButtons: boolean = true; + get fullAddress() { + return this.selectedOrder.user.fullAddress; + } + constructor( private orderRouter: OrderRouter, private mixpanel: Mixpanel, diff --git a/carrier/mobile-ionic/tsconfig.json b/carrier/mobile-ionic/tsconfig.json index b40f2ae87..498cfd056 100644 --- a/carrier/mobile-ionic/tsconfig.json +++ b/carrier/mobile-ionic/tsconfig.json @@ -6,6 +6,7 @@ "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, + "importHelpers": true, "noImplicitAny": false, "preserveConstEnums": true, "allowSyntheticDefaultImports": true, diff --git a/carrier/mobile-ionic/yarn.lock b/carrier/mobile-ionic/yarn.lock index d9b1c1f07..f6366e309 100644 --- a/carrier/mobile-ionic/yarn.lock +++ b/carrier/mobile-ionic/yarn.lock @@ -1226,7 +1226,7 @@ JSONStream@^1.3.4: jsonparse "^1.2.0" through ">=2.2.7 <3" -abbrev@1: +abbrev@*, abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -1444,7 +1444,7 @@ ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" -ansi@^0.3.1: +ansi@*, ansi@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/ansi/-/ansi-0.3.1.tgz#0c42d4fb17160d5a9af1e484bace1c66922c1b21" @@ -1913,7 +1913,7 @@ backo2@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" -balanced-match@^1.0.0: +balanced-match@*, balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -2121,13 +2121,13 @@ boxen@^1.2.1: term-size "^1.2.0" widest-line "^2.0.0" -bplist-parser@^0.1.0: +bplist-parser@*, bplist-parser@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.1.1.tgz#d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6" dependencies: big-integer "^1.6.7" -brace-expansion@^1.1.7: +brace-expansion@*, brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" dependencies: @@ -2864,7 +2864,7 @@ compression@^1.5.2, compression@^1.6.0: safe-buffer "5.1.2" vary "~1.1.2" -concat-map@0.0.1: +concat-map@*, concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -2994,7 +2994,7 @@ cordova-android-support-gradle-release@^2.0.1: semver "5.1.0" xml2js "~0.4.19" -cordova-android@^7.1.4: +cordova-android@7.1.4: version "7.1.4" resolved "https://registry.yarnpkg.com/cordova-android/-/cordova-android-7.1.4.tgz#25261ad66cc64f42a30b70be005901fa30e2430e" integrity sha512-Rtvu002I83uzfVyCsE6p2krFKVHt9TSAqZUATes+zH+o9cdxYGrLHY+PKCQo4SLCdSMdrkIHCDnQPTYTp/d7+g== @@ -3075,12 +3075,12 @@ cordova-plugin-badge@^0.8.8: resolved "https://registry.yarnpkg.com/cordova-plugin-badge/-/cordova-plugin-badge-0.8.8.tgz#0924018699b48f92dd3b33615452737582144c96" integrity sha512-RhIBtd5xhD/iLnxjt35jvOae28oNW/wtMZBOmQR3Rf0y4wirvA1bpAZEhBoFqL+rZGhsd6ddOdQXdex1T0DRyQ== -cordova-plugin-camera@4.0.3: +cordova-plugin-camera@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/cordova-plugin-camera/-/cordova-plugin-camera-4.0.3.tgz#7373a5938318c86ccfd84e3713e2382d10fe076b" integrity sha1-c3Olk4MYyGzP2E43E+I4LRD+B2s= -cordova-plugin-device@2.0.2: +cordova-plugin-device@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/cordova-plugin-device/-/cordova-plugin-device-2.0.2.tgz#fc08f3722e67eef7b6c67bfc99a83df6add0baba" integrity sha1-/Ajzci5n7ve2xnv8mag99q3Quro= @@ -3095,17 +3095,17 @@ cordova-plugin-email-composer@^0.9.2: resolved "https://registry.yarnpkg.com/cordova-plugin-email-composer/-/cordova-plugin-email-composer-0.9.2.tgz#264c66d45679acf2781c2cec54e32b2c1facfdb8" integrity sha512-w8eQZ6lbYWut13o/Cprixmacfyq5hds7DAjuTL34eQhyWWd/DA/o6ziiyY3So2ZOozeQ4DxQpyPN4BiqUKcyew== -cordova-plugin-geolocation@4.0.1: +cordova-plugin-geolocation@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/cordova-plugin-geolocation/-/cordova-plugin-geolocation-4.0.1.tgz#4703fa649d2405d25a9a732c99ebf868754a2c04" integrity sha1-RwP6ZJ0kBdJamnMsmev4aHVKLAQ= -cordova-plugin-globalization@1.11.0: +cordova-plugin-globalization@^1.11.0: version "1.11.0" resolved "https://registry.yarnpkg.com/cordova-plugin-globalization/-/cordova-plugin-globalization-1.11.0.tgz#eac3158100298493afa30be8940e698f61efbcfe" integrity sha1-6sMVgQAphJOvowvolA5pj2HvvP4= -cordova-plugin-google-analytics@1.8.6: +cordova-plugin-google-analytics@^1.8.6: version "1.8.6" resolved "https://registry.yarnpkg.com/cordova-plugin-google-analytics/-/cordova-plugin-google-analytics-1.8.6.tgz#7886bd7ac9264e4dec7355ebed64d939b274731a" integrity sha512-shg8e3ris1MzmhC8roraScc2GEcfe7sVlbKkvrO3wZUAlYr31sf+4wxZr/VQB6tEcPsmTAkoNjGr1zMwoYjMeg== @@ -3125,22 +3125,22 @@ cordova-plugin-ionic-keyboard@^2.1.3: resolved "https://registry.yarnpkg.com/cordova-plugin-ionic-keyboard/-/cordova-plugin-ionic-keyboard-2.1.3.tgz#6b050d5b7cb4393d5758b55f45a46372f25178fe" integrity sha512-6ucQ6FdlLdBm8kJfFnzozmBTjru/0xekHP/dAhjoCZggkGRlgs8TsUJFkxa/bV+qi7Dlo50JjmpE4UMWAO+aOQ== -cordova-plugin-ionic-webview@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-4.0.0.tgz#d00f36761309d31ade55e9740731ffca141f4e54" - integrity sha512-4CNDDXS9PZ+j38ZpzFqC6Ua5GySr/McXTPnWdRfhFSbuFCL6B/xhIHUVoeoj48wo6Sh+gDURvbaH9uu1Z53TJA== +cordova-plugin-ionic-webview@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-4.0.1.tgz#2ff5e73998d87316d3ab8dbe4b6ccf768ab7f637" + integrity sha512-rJf7jFQNw7l0U4Y7P6DjxwmO/qQgS7xqiTgwDbNFS4z4+FZ3EZyupll7/cFEDnxGRNMgWsMKDhIABUo5mIDaUQ== -cordova-plugin-local-notification@0.9.0-beta.2: +cordova-plugin-local-notification@^0.9.0-beta.2: version "0.9.0-beta.2" resolved "https://registry.yarnpkg.com/cordova-plugin-local-notification/-/cordova-plugin-local-notification-0.9.0-beta.2.tgz#e3a0b4a35d11f95bb4f1e367d9baee9909cca695" integrity sha512-63n77K1pt8dnbWnNR8QWETi9Glezi1bvNHvHWmGNIOv0xCb0phZnm+Ku49BQ+omwe8Z5voMvrA4I03SYPpv38w== -cordova-plugin-mixpanel@4.5.2: +cordova-plugin-mixpanel@^4.5.2: version "4.5.2" resolved "https://registry.yarnpkg.com/cordova-plugin-mixpanel/-/cordova-plugin-mixpanel-4.5.2.tgz#76a78090c6333715618901e53e2782da9d3ac06c" integrity sha512-+mlT7fw4ug+wU5/KlR5TX8lZQbyF7jsk/Ol8PNcizfxI7xU6URA5Y/qhTNzOZGjf4Iga6XhJx/VPz9fEzep1iA== -cordova-plugin-network-information@2.0.1: +cordova-plugin-network-information@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/cordova-plugin-network-information/-/cordova-plugin-network-information-2.0.1.tgz#e90421f430c6ab76d409223f25fcefbbbce17690" integrity sha1-6QQh9DDGq3bUCSI/Jfzvu7zhdpA= @@ -3150,12 +3150,12 @@ cordova-plugin-screen-orientation@^3.0.1: resolved "https://registry.yarnpkg.com/cordova-plugin-screen-orientation/-/cordova-plugin-screen-orientation-3.0.1.tgz#75a357ce2938081e8f61d4605394b6d77463c1f8" integrity sha1-daNXzik4CB6PYdRgU5S213Rjwfg= -cordova-plugin-splashscreen@5.0.2: +cordova-plugin-splashscreen@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz#747e74f56e201cd585bc62d14bca19f6867ff1ed" integrity sha1-dH509W4gHNWFvGLRS8oZ9oZ/8e0= -cordova-plugin-statusbar@2.4.2: +cordova-plugin-statusbar@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/cordova-plugin-statusbar/-/cordova-plugin-statusbar-2.4.2.tgz#fc1fbdc0d8d7033a7e8e1f1f7ff167ac9bd4faf6" integrity sha1-/B+9wNjXAzp+jh8ff/FnrJvU+vY= @@ -3165,7 +3165,7 @@ cordova-plugin-uniquedeviceid@^1.3.2: resolved "https://registry.yarnpkg.com/cordova-plugin-uniquedeviceid/-/cordova-plugin-uniquedeviceid-1.3.2.tgz#be05947af2fd1815cb8e3407d72df68c8522fa96" integrity sha1-vgWUevL9GBXLjjQH1y32jIUi+pY= -cordova-plugin-vibration@3.1.0: +cordova-plugin-vibration@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cordova-plugin-vibration/-/cordova-plugin-vibration-3.1.0.tgz#63e57a1de72e318b0944ef727d7c4eff13ca2c93" integrity sha1-Y+V6HecuMYsJRO9yfXxO/xPKLJM= @@ -3175,7 +3175,7 @@ cordova-plugin-whitelist@^1.3.3: resolved "https://registry.yarnpkg.com/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz#b5e85ecdbbfe5aeded40a1bf4ee2372e67d96fb4" integrity sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q= -cordova-registry-mapper@^1.1.8: +cordova-registry-mapper@*, cordova-registry-mapper@^1.1.8: version "1.1.15" resolved "https://registry.yarnpkg.com/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz#e244b9185b8175473bff6079324905115f83dc7c" @@ -5762,14 +5762,14 @@ indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" -inflight@^1.0.4: +inflight@*, inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" dependencies: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: +inherits@*, inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -7301,7 +7301,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: +minimatch@*, "minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -7514,7 +7514,7 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= -mx.ferreyra.callnumber@^0.0.2: +mx.ferreyra.callnumber@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/mx.ferreyra.callnumber/-/mx.ferreyra.callnumber-0.0.2.tgz#dda64ced1d5a19e801d5c64f17f02bcd0599cb63" integrity sha512-J9FJiMrfWG9Q8AQEz/cgYLcXTTD/Z5+vfq29hn8K7yVWjxkSzr7zFi7Dpn8wcv2iKHBHDJY+U0z8yoAzDugXMw== @@ -7906,7 +7906,7 @@ on-headers@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@*, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -10945,7 +10945,7 @@ unc-path-regex@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" -underscore@^1.8.3: +underscore@*, underscore@^1.8.3: version "1.9.1" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" @@ -11008,6 +11008,11 @@ unix-crypt-td-js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz#1c0824150481bc7a01d49e98f1ec668d82412f3b" +unorm@*: + version "1.5.0" + resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.5.0.tgz#01fa9b76f1c60f7916834605c032aa8962c3f00a" + integrity sha512-sMfSWoiRaXXeDZSXC+YRZ23H4xchQpwxjpw1tmfR+kgbBCaOgln4NI0LXejJIhnBuKINrB3WRn+ZI8IWssirVw== + unorm@^1.3.3: version "1.4.1" resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.4.1.tgz#364200d5f13646ca8bcd44490271335614792300" @@ -11510,7 +11515,7 @@ wrap-ansi@^4.0.0: string-width "^2.1.1" strip-ansi "^4.0.0" -wrappy@1: +wrappy@*, wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -11589,7 +11594,7 @@ xmlbuilder@^9.0.7, xmlbuilder@~9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" -xmldom@0.1.x: +xmldom@*, xmldom@0.1.x: version "0.1.27" resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9" diff --git a/ever.code-workspace b/ever.code-workspace index 9228242e4..2eefb2752 100644 --- a/ever.code-workspace +++ b/ever.code-workspace @@ -20,7 +20,7 @@ } ], "settings": { - "typescript.tsdk": "node_modules/typescript/lib", + "typescript.tsdk": "./node_modules/typescript/lib", "debug.node.autoAttach": "on", "search.usePCRE2": true, "git.ignoreLimitWarning": true diff --git a/merchant/tablet-ionic/ionic.config.json b/merchant/tablet-ionic/ionic.config.json index 77e760472..1558cc608 100644 --- a/merchant/tablet-ionic/ionic.config.json +++ b/merchant/tablet-ionic/ionic.config.json @@ -3,7 +3,6 @@ "integrations": { "cordova": {} }, - "type": "ionic-angular", - "pro_id": "4e9f4799", + "type": "angular", "id": "4e9f4799" } diff --git a/merchant/tablet-ionic/ionic.project b/merchant/tablet-ionic/ionic.project index 21de1f922..274537d40 100644 --- a/merchant/tablet-ionic/ionic.project +++ b/merchant/tablet-ionic/ionic.project @@ -3,6 +3,6 @@ "integrations": { "cordova": {} }, - "type": "ionic-angular", + "type": "angular", "app_id": "4e9f4799" } \ No newline at end of file diff --git a/merchant/tablet-ionic/ngsw-config.json b/merchant/tablet-ionic/ngsw-config.json new file mode 100644 index 000000000..0cb79dabc --- /dev/null +++ b/merchant/tablet-ionic/ngsw-config.json @@ -0,0 +1,20 @@ +{ + "index": "/index.html", + "assetGroups": [ + { + "name": "app", + "installMode": "prefetch", + "resources": { + "files": ["/favicon.ico", "/index.html", "/*.css", "/*.js"] + } + }, + { + "name": "assets", + "installMode": "lazy", + "updateMode": "prefetch", + "resources": { + "files": ["/assets/**"] + } + } + ] +} diff --git a/merchant/tablet-ionic/package.json b/merchant/tablet-ionic/package.json index af9218286..3c8c2f2a1 100644 --- a/merchant/tablet-ionic/package.json +++ b/merchant/tablet-ionic/package.json @@ -139,7 +139,6 @@ "graphql": "^14.1.1", "graphql-tag": "^2.10.1", "imagesloaded": "^4.1.4", - "ionic-angular": "^3.9.4", "ionic-selectable": "4.4.0", "ionicons": "^4.5.5", "jsbarcode": "^3.11.0", diff --git a/merchant/tablet-ionic/scripts/configure.ts b/merchant/tablet-ionic/scripts/configure.ts index c6bbf79a1..d7ce0014c 100644 --- a/merchant/tablet-ionic/scripts/configure.ts +++ b/merchant/tablet-ionic/scripts/configure.ts @@ -73,6 +73,9 @@ export const environment: Environment = { `; const envFileDest: string = isProd ? 'environment.prod.ts' : 'environment.ts'; +const envFileDestOther: string = !isProd + ? 'environment.prod.ts' + : 'environment.ts'; // we always want first to remove old generated files (one of them is not needed for current build) try { @@ -89,3 +92,13 @@ writeFile(`./src/environments/${envFileDest}`, envFileContent, function(err) { console.log(`Generated Angular environment file: ${envFileDest}`); } }); + +writeFile(`./src/environments/${envFileDestOther}`, '', function(err) { + if (err) { + console.log(err); + } else { + console.log( + `Generated Second Empty Angular environment file: ${envFileDestOther}` + ); + } +}); diff --git a/merchant/tablet-ionic/src/@shared/user/mutation/user-mutation.component.ts b/merchant/tablet-ionic/src/@shared/user/mutation/user-mutation.component.ts index caaee3818..b79ce3226 100644 --- a/merchant/tablet-ionic/src/@shared/user/mutation/user-mutation.component.ts +++ b/merchant/tablet-ionic/src/@shared/user/mutation/user-mutation.component.ts @@ -18,7 +18,7 @@ import { getDummyImage } from '@modules/server.common/utils'; @Component({ selector: 'user-mutation', templateUrl: './user-mutation.component.html', - styleUrls: ['/user-mutation.component.scss'] + styleUrls: ['./user-mutation.component.scss'] }) export class UserMutationComponent { readonly form: FormGroup = this._formBuilder.group({ diff --git a/merchant/tablet-ionic/src/components/carrier-deliveries-table/warehouse.ts b/merchant/tablet-ionic/src/components/carrier-deliveries-table/warehouse.ts index 2ede4ff3c..0b5342caa 100644 --- a/merchant/tablet-ionic/src/components/carrier-deliveries-table/warehouse.ts +++ b/merchant/tablet-ionic/src/components/carrier-deliveries-table/warehouse.ts @@ -6,8 +6,8 @@ import Warehouse from '@modules/server.common/entities/Warehouse'; @Component({ template: ` - {{ - order.warehouse.name + {{ + getStoreName(order) }}
{{ getStoreFullAddress(order) }}
@@ -24,6 +24,14 @@ export class WarehouseComponent implements ViewCell, OnInit { this.order = this.rowData.order; } + getStoreName(order: Order) { + const store: Warehouse = order.warehouse as Warehouse; + + if (store) return store.name; + + return null; + } + getStoreFullAddress(order: Order) { const store: Warehouse = order.warehouse as Warehouse; diff --git a/merchant/tablet-ionic/src/components/confirm-delete-popup/confirm-delete-popup.ts b/merchant/tablet-ionic/src/components/confirm-delete-popup/confirm-delete-popup.ts index fb9c93e4c..b3b370e7e 100644 --- a/merchant/tablet-ionic/src/components/confirm-delete-popup/confirm-delete-popup.ts +++ b/merchant/tablet-ionic/src/components/confirm-delete-popup/confirm-delete-popup.ts @@ -4,7 +4,7 @@ import { ModalController } from '@ionic/angular'; export interface IConfirmDeleteData { image: string; name: string; - statis?: string; + status?: string; phone?: string; addresses: string; } diff --git a/merchant/tablet-ionic/src/components/order-canceled/order-canceled.ts b/merchant/tablet-ionic/src/components/order-canceled/order-canceled.ts index 8c7e4e318..2cc922939 100644 --- a/merchant/tablet-ionic/src/components/order-canceled/order-canceled.ts +++ b/merchant/tablet-ionic/src/components/order-canceled/order-canceled.ts @@ -12,7 +12,7 @@ export class OrderCanceledComponent { getWarehouseStatus: Function; @Input() - protected order: Order; + order: Order; constructor(private _translateProductLocales: ProductLocalesService) {} diff --git a/merchant/tablet-ionic/src/components/order-delivered/order-delivered.ts b/merchant/tablet-ionic/src/components/order-delivered/order-delivered.ts index a8f0d2919..a6ef4ae9c 100644 --- a/merchant/tablet-ionic/src/components/order-delivered/order-delivered.ts +++ b/merchant/tablet-ionic/src/components/order-delivered/order-delivered.ts @@ -12,7 +12,7 @@ export class OrderDeliveredComponent { getWarehouseStatus: () => void; @Input() - protected order: Order; + order: Order; constructor(private _translateProductLocales: ProductLocalesService) {} diff --git a/merchant/tablet-ionic/src/components/order-delivery-problem/order-delivery-problem.ts b/merchant/tablet-ionic/src/components/order-delivery-problem/order-delivery-problem.ts index 0a7ec162a..dc3e370a3 100644 --- a/merchant/tablet-ionic/src/components/order-delivery-problem/order-delivery-problem.ts +++ b/merchant/tablet-ionic/src/components/order-delivery-problem/order-delivery-problem.ts @@ -10,8 +10,9 @@ import { ILocaleMember } from '@modules/server.common/interfaces/ILocale'; export class OrderDeliveryProblemComponent { @Input() getWarehouseStatus: () => void; + @Input() - protected order: Order; + order: Order; constructor(private _translateProductLocales: ProductLocalesService) {} diff --git a/merchant/tablet-ionic/src/components/order-warehouse-preparation-problem/order-warehouse-preparation-problem.ts b/merchant/tablet-ionic/src/components/order-warehouse-preparation-problem/order-warehouse-preparation-problem.ts index 966a8485d..986c38fdc 100644 --- a/merchant/tablet-ionic/src/components/order-warehouse-preparation-problem/order-warehouse-preparation-problem.ts +++ b/merchant/tablet-ionic/src/components/order-warehouse-preparation-problem/order-warehouse-preparation-problem.ts @@ -12,7 +12,7 @@ export class OrderWarehousePreparationProblemComponent { getWarehouseStatus: () => void; @Input() - protected order: Order; + order: Order; constructor(private _translateProductLocales: ProductLocalesService) {} diff --git a/merchant/tablet-ionic/src/components/order-with-carrier/order-with-carrier.ts b/merchant/tablet-ionic/src/components/order-with-carrier/order-with-carrier.ts index 1405e6e1a..af47b1cfe 100644 --- a/merchant/tablet-ionic/src/components/order-with-carrier/order-with-carrier.ts +++ b/merchant/tablet-ionic/src/components/order-with-carrier/order-with-carrier.ts @@ -14,10 +14,10 @@ export class OrderWithCarrierComponent { getWarehouseStatus: () => void; @Input() - protected order: Order; + order: Order; @Input() - protected onUpdateWarehouseStatus: any; + onUpdateWarehouseStatus: any; constructor(private _translateProductLocales: ProductLocalesService) {} diff --git a/merchant/tablet-ionic/src/components/order-without-carrier/order-without-carrier.ts b/merchant/tablet-ionic/src/components/order-without-carrier/order-without-carrier.ts index 249666452..34bc8e369 100644 --- a/merchant/tablet-ionic/src/components/order-without-carrier/order-without-carrier.ts +++ b/merchant/tablet-ionic/src/components/order-without-carrier/order-without-carrier.ts @@ -13,10 +13,10 @@ export class OrderWithoutCarrierComponent { getWarehouseStatus: () => void; @Input() - protected order: Order; + order: Order; @Input() - protected onUpdateWarehouseStatus: any; + onUpdateWarehouseStatus: any; constructor(private _translateProductLocales: ProductLocalesService) {} diff --git a/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.html b/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.html index e069ddc44..66adb1fbb 100644 --- a/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.html +++ b/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.html @@ -1,26 +1,31 @@ - +
+
+
+ {{ TRANSLATE_PREFIXES.MAKE_ORDER | translate }} +
- -
- {{ TRANSLATE_PREFIXES.MAKE_ORDER | translate }} -
+
+ +
+
-
- -
- +
+ +
- - - - - - - - - \ No newline at end of file + +
diff --git a/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.scss b/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.scss index 4c08963a1..3e7190a19 100644 --- a/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.scss +++ b/merchant/tablet-ionic/src/components/order/make-order/+warehouse-order-modal/warehouse-order-modal.component.scss @@ -1,7 +1,7 @@ -nb-card { +.nb-card { margin: 0; - nb-card-header { + .nb-card-header { border: none; div.checkbox label { cursor: pointer; @@ -17,7 +17,7 @@ nb-card { } } - nb-card-body { + .nb-card-body { padding: 0; ng2-smart-table { @@ -25,7 +25,7 @@ nb-card { } } - nb-card-footer { + .nb-card-footer { button { float: right; margin-right: 2%; diff --git a/merchant/tablet-ionic/src/pages/+carriers/add-carriers-popup/add-new-carrier/add-new-carrier.ts b/merchant/tablet-ionic/src/pages/+carriers/add-carriers-popup/add-new-carrier/add-new-carrier.ts index 3f3d41287..61d611ab6 100644 --- a/merchant/tablet-ionic/src/pages/+carriers/add-carriers-popup/add-new-carrier/add-new-carrier.ts +++ b/merchant/tablet-ionic/src/pages/+carriers/add-carriers-popup/add-new-carrier/add-new-carrier.ts @@ -9,7 +9,6 @@ import { OnChanges } from '@angular/core'; import { ICarrierCreateObject } from '@modules/server.common/interfaces/ICarrier'; - import { getDummyImage } from '@modules/server.common/utils'; import { FileUploader } from 'ng2-file-upload'; import { BasicInfoFormComponent } from './basic-info/basic-info-form.component'; @@ -19,8 +18,8 @@ import { LocationFormComponent } from './location/location-form.component'; @Component({ selector: 'add-new-carrier', - templateUrl: 'add-new-carrier.html', - styleUrls: ['/add-new-carrier.scss'] + templateUrl: './add-new-carrier.html', + styleUrls: ['./add-new-carrier.scss'] }) export class AddNewCarrierComponent implements OnInit, OnDestroy, OnChanges { uploader: FileUploader; @@ -108,7 +107,7 @@ export class AddNewCarrierComponent implements OnInit, OnDestroy, OnChanges { this.isNextStepThreeAvailable = false; } - toStep2event(data) { + toStep2event($event) { this.isNextStepOneAvailable = false; this.isNextStepTwoAvailable = true; this.isNextStepThreeAvailable = false; diff --git a/merchant/tablet-ionic/src/pages/+carriers/carrier-addr-popup/carrier-addr-popup.ts b/merchant/tablet-ionic/src/pages/+carriers/carrier-addr-popup/carrier-addr-popup.ts index b978a501c..8f5264a5c 100644 --- a/merchant/tablet-ionic/src/pages/+carriers/carrier-addr-popup/carrier-addr-popup.ts +++ b/merchant/tablet-ionic/src/pages/+carriers/carrier-addr-popup/carrier-addr-popup.ts @@ -18,12 +18,12 @@ export class CarrierAddrPopupPage implements OnInit { @Input() geoLocation: GeoLocation; - private city: any; - private country: any; - private street: any; - private house: any; - private apartment: any; - private coordinates: any; + city: any; + country: any; + street: any; + house: any; + apartment: any; + coordinates: any; constructor(public modalCtrl: ModalController) {} diff --git a/merchant/tablet-ionic/src/pages/+carriers/carrier-edit-popup/carrier-edit-popup.ts b/merchant/tablet-ionic/src/pages/+carriers/carrier-edit-popup/carrier-edit-popup.ts index 17577e18d..66c36c08c 100644 --- a/merchant/tablet-ionic/src/pages/+carriers/carrier-edit-popup/carrier-edit-popup.ts +++ b/merchant/tablet-ionic/src/pages/+carriers/carrier-edit-popup/carrier-edit-popup.ts @@ -127,6 +127,7 @@ export class CarrierEditPopupPage implements OnInit, OnDestroy, OnChanges { this.cancelModal(); } + get password() { return this.accountForm.password.value; } @@ -137,8 +138,7 @@ export class CarrierEditPopupPage implements OnInit, OnDestroy, OnChanges { this.isNextStepThreeAvailable = false; } - toStep2event() { - // This is event emitter, not a function + toStep2event($event) { this.isNextStepOneAvailable = false; this.isNextStepTwoAvailable = true; this.isNextStepThreeAvailable = false; @@ -155,6 +155,7 @@ export class CarrierEditPopupPage implements OnInit, OnDestroy, OnChanges { this.isNextStepTwoAvailable = false; this.isNextStepThreeAvailable = true; } + cancelModal() { this.modalCtrl.dismiss(); } @@ -163,6 +164,7 @@ export class CarrierEditPopupPage implements OnInit, OnDestroy, OnChanges { const prevOrComplete = data; this.buttonClickEvent.emit(prevOrComplete); } + onClickComplete(data) { this._updateCarrier(); } diff --git a/merchant/tablet-ionic/src/pages/+customers/customer-email-popup/customer-email-popup.ts b/merchant/tablet-ionic/src/pages/+customers/customer-email-popup/customer-email-popup.ts index 94c2b2ef6..15bc7196e 100644 --- a/merchant/tablet-ionic/src/pages/+customers/customer-email-popup/customer-email-popup.ts +++ b/merchant/tablet-ionic/src/pages/+customers/customer-email-popup/customer-email-popup.ts @@ -11,7 +11,7 @@ export class CustomerEmailPopupPage implements OnInit { @Input() user: any; - private email: any; + email: any; constructor( public loadingCtrl: LoadingController, diff --git a/merchant/tablet-ionic/src/pages/+language/language.ts b/merchant/tablet-ionic/src/pages/+language/language.ts index 5857cf3d3..502b3c896 100644 --- a/merchant/tablet-ionic/src/pages/+language/language.ts +++ b/merchant/tablet-ionic/src/pages/+language/language.ts @@ -18,8 +18,8 @@ export class LanguagePage implements OnInit { selected: string; constructor( + public translate: TranslateService, private _deviceRouter: DeviceRouter, - private translate: TranslateService, private store: Store ) {} diff --git a/merchant/tablet-ionic/src/pages/+track/track.ts b/merchant/tablet-ionic/src/pages/+track/track.ts index 6994bfedd..2559c55c1 100644 --- a/merchant/tablet-ionic/src/pages/+track/track.ts +++ b/merchant/tablet-ionic/src/pages/+track/track.ts @@ -29,7 +29,7 @@ export class TrackPage implements OnInit, OnDestroy { map: google.maps.Map; selectedCarrier: Carrier; - private carriers: Carrier[]; + carriers: Carrier[]; private carriers$: Subscription; private warehouse$: Subscription; private params$: Subscription; diff --git a/merchant/tablet-ionic/src/pages/+warehouse/product-pictures-popup/product-images-popup.component.html b/merchant/tablet-ionic/src/pages/+warehouse/product-pictures-popup/product-images-popup.component.html index 07eb81a29..f8cc40820 100644 --- a/merchant/tablet-ionic/src/pages/+warehouse/product-pictures-popup/product-images-popup.component.html +++ b/merchant/tablet-ionic/src/pages/+warehouse/product-pictures-popup/product-images-popup.component.html @@ -12,7 +12,7 @@

- + diff --git a/shop/mobile-ionic/ionic.config.json b/shop/mobile-ionic/ionic.config.json index 8a08bb922..01f239c02 100644 --- a/shop/mobile-ionic/ionic.config.json +++ b/shop/mobile-ionic/ionic.config.json @@ -3,7 +3,6 @@ "integrations": { "cordova": {} }, - "type": "ionic-angular", - "pro_id": "897e13e3", + "type": "angular", "id": "897e13e3" } diff --git a/shop/mobile-ionic/ionic.project b/shop/mobile-ionic/ionic.project index bb7cd9169..698ebb51f 100644 --- a/shop/mobile-ionic/ionic.project +++ b/shop/mobile-ionic/ionic.project @@ -3,6 +3,6 @@ "integrations": { "cordova": {} }, - "type": "ionic-angular", + "type": "angular", "app_id": "897e13e3" } \ No newline at end of file diff --git a/shop/mobile-ionic/package.json b/shop/mobile-ionic/package.json index a95483276..7dd9334e2 100644 --- a/shop/mobile-ionic/package.json +++ b/shop/mobile-ionic/package.json @@ -196,7 +196,8 @@ "tslint": "^5.14.0", "yargs": "^13.2.2", "typescript": "~3.2.4", - "webpack-bundle-analyzer": "^3.1.0" + "webpack-bundle-analyzer": "^3.1.0", + "webpack-merge": "^4.2.1" }, "cordova": { "platforms": [ diff --git a/shop/mobile-ionic/scripts/configure.ts b/shop/mobile-ionic/scripts/configure.ts index d34e8ba09..9aee96d24 100644 --- a/shop/mobile-ionic/scripts/configure.ts +++ b/shop/mobile-ionic/scripts/configure.ts @@ -118,6 +118,9 @@ export const environment: Environment = { `; const envFileDest: string = isProd ? 'environment.prod.ts' : 'environment.ts'; +const envFileDestOther: string = !isProd + ? 'environment.prod.ts' + : 'environment.ts'; // we always want first to remove old generated files (one of them is not needed for current build) try { @@ -134,3 +137,13 @@ writeFile(`./src/environments/${envFileDest}`, envFileContent, function(err) { console.log(`Generated Angular environment file: ${envFileDest}`); } }); + +writeFile(`./src/environments/${envFileDestOther}`, '', function(err) { + if (err) { + console.log(err); + } else { + console.log( + `Generated Second Empty Angular environment file: ${envFileDestOther}` + ); + } +}); diff --git a/shop/mobile-ionic/tsconfig.json b/shop/mobile-ionic/tsconfig.json index b40f2ae87..498cfd056 100644 --- a/shop/mobile-ionic/tsconfig.json +++ b/shop/mobile-ionic/tsconfig.json @@ -6,6 +6,7 @@ "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, + "importHelpers": true, "noImplicitAny": false, "preserveConstEnums": true, "allowSyntheticDefaultImports": true, diff --git a/shop/website-angular/scripts/configure.ts b/shop/website-angular/scripts/configure.ts index ed0611857..3ae148b0b 100644 --- a/shop/website-angular/scripts/configure.ts +++ b/shop/website-angular/scripts/configure.ts @@ -132,6 +132,9 @@ try { } catch {} const envFileDest: string = isProd ? 'environment.prod.ts' : 'environment.ts'; +const envFileDestOther: string = !isProd + ? 'environment.prod.ts' + : 'environment.ts'; writeFile( `./src/environments/${envFileDest}`, @@ -144,3 +147,13 @@ writeFile( } } ); + +writeFile(`./src/environments/${envFileDestOther}`, '', function(err) { + if (err) { + console.log(err); + } else { + console.log( + `Generated Second Empty Angular environment file: ${envFileDest}` + ); + } +});