From ca70de46ab4fb6608202dbb32eb4f23b6598a0b2 Mon Sep 17 00:00:00 2001 From: saikiran Date: Mon, 24 Aug 2020 20:45:52 +0530 Subject: [PATCH 01/23] fix: removed credentials from rasa containers --- docker-compose.build_from_source.yml | 2 -- docker-compose.ngrok_example.yml | 2 -- docker-compose.test.yml | 2 -- docker-compose.yml | 2 -- 4 files changed, 8 deletions(-) diff --git a/docker-compose.build_from_source.yml b/docker-compose.build_from_source.yml index e23ff6f1..b79a31e9 100644 --- a/docker-compose.build_from_source.yml +++ b/docker-compose.build_from_source.yml @@ -70,8 +70,6 @@ services: - run - --endpoints - config/endpoints.yml - - --credentials - - config/credentials.yml - --debug - --enable-api - --cors diff --git a/docker-compose.ngrok_example.yml b/docker-compose.ngrok_example.yml index 99acad15..38627667 100644 --- a/docker-compose.ngrok_example.yml +++ b/docker-compose.ngrok_example.yml @@ -72,8 +72,6 @@ services: - run - --endpoints - config/endpoints.yml - - --credentials - - config/credentials.yml - --debug - --enable-api - --cors diff --git a/docker-compose.test.yml b/docker-compose.test.yml index f569b507..0aa7a675 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -82,8 +82,6 @@ services: - run - --endpoints - config/endpoints.yml - - --credentials - - config/credentials.yml - --debug - --enable-api - --cors diff --git a/docker-compose.yml b/docker-compose.yml index 8678eb38..c87b379e 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -75,8 +75,6 @@ services: - run - --endpoints - config/endpoints.yml - - --credentials - - config/credentials.yml - --debug - --enable-api - --cors From 4f9b726cdef218e7bdf4045b370a6c2ebe1b8abd Mon Sep 17 00:00:00 2001 From: saikiran Date: Mon, 24 Aug 2020 21:03:17 +0530 Subject: [PATCH 02/23] fix: set password for redis access. --- docker-compose.build_from_source.yml | 2 ++ docker-compose.ngrok_example.yml | 2 ++ docker-compose.test.yml | 2 ++ docker-compose.yml | 2 ++ va_api_gateway/endpoints.py | 3 ++- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docker-compose.build_from_source.yml b/docker-compose.build_from_source.yml index b79a31e9..ef255867 100644 --- a/docker-compose.build_from_source.yml +++ b/docker-compose.build_from_source.yml @@ -10,6 +10,7 @@ services: - THREADS=50 - REDIS_URL=redis - REDIS_PORT=6379 + - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 - RASA_SERVER=http://va_custom_rasa:5005/model @@ -22,6 +23,7 @@ services: redis: image: 'redis:4-alpine' + command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' diff --git a/docker-compose.ngrok_example.yml b/docker-compose.ngrok_example.yml index 38627667..1b8ed8f3 100644 --- a/docker-compose.ngrok_example.yml +++ b/docker-compose.ngrok_example.yml @@ -12,6 +12,7 @@ services: - THREADS=50 - REDIS_URL=redis - REDIS_PORT=6379 + - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 - RASA_SERVER=http://va_custom_rasa:5005/model @@ -24,6 +25,7 @@ services: redis: image: 'redis:4-alpine' + command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 0aa7a675..e17ab44e 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -20,6 +20,7 @@ services: - THREADS=50 - REDIS_URL=redis - REDIS_PORT=6379 + - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 - RASA_SERVER=http://custom_rasa:5005/model @@ -32,6 +33,7 @@ services: redis: image: 'redis:4-alpine' + command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' diff --git a/docker-compose.yml b/docker-compose.yml index c87b379e..775fbc4b 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: - THREADS=50 - REDIS_URL=redis - REDIS_PORT=6379 + - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 - RASA_SERVER=http://va_custom_rasa:5005/model @@ -23,6 +24,7 @@ services: redis: image: 'redis:4-alpine' + command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' diff --git a/va_api_gateway/endpoints.py b/va_api_gateway/endpoints.py index 5916404d..967831df 100644 --- a/va_api_gateway/endpoints.py +++ b/va_api_gateway/endpoints.py @@ -52,7 +52,8 @@ try: r = redis.Redis(host=os.environ['REDIS_URL'], port=os.environ['REDIS_PORT'], - charset="utf-8", decode_responses=True) + charset="utf-8", decode_responses=True, + password=os.environ['REDIS_PASS']) logger.info("Trying to connect to Redis Docker container ") except KeyError: logger.debug("Local run connecting to Redis ") From bd7cc4c3c1631dc9b56641bef254bc3570b9a731 Mon Sep 17 00:00:00 2001 From: saikiran Date: Mon, 24 Aug 2020 21:08:27 +0530 Subject: [PATCH 03/23] fix: updated redis image to latest tag --- docker-compose.build_from_source.yml | 2 +- docker-compose.ngrok_example.yml | 2 +- docker-compose.test.yml | 2 +- docker-compose.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.build_from_source.yml b/docker-compose.build_from_source.yml index ef255867..318ef735 100644 --- a/docker-compose.build_from_source.yml +++ b/docker-compose.build_from_source.yml @@ -22,7 +22,7 @@ services: - redis redis: - image: 'redis:4-alpine' + image: redis:latest command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' diff --git a/docker-compose.ngrok_example.yml b/docker-compose.ngrok_example.yml index 1b8ed8f3..f26c6bdb 100644 --- a/docker-compose.ngrok_example.yml +++ b/docker-compose.ngrok_example.yml @@ -24,7 +24,7 @@ services: - redis redis: - image: 'redis:4-alpine' + image: redis:latest command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' diff --git a/docker-compose.test.yml b/docker-compose.test.yml index e17ab44e..e22dc67e 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -32,7 +32,7 @@ services: - redis redis: - image: 'redis:4-alpine' + image: redis:latest command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' diff --git a/docker-compose.yml b/docker-compose.yml index 775fbc4b..c8190a77 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: - redis redis: - image: 'redis:4-alpine' + image: redis:latest command: redis-server --requirepass Y7T6r5re3t8j9yr ports: - '6379:6379' From 0b1a0418c56c5cfe34948958cc63be4170a5ddd9 Mon Sep 17 00:00:00 2001 From: saikiran Date: Mon, 24 Aug 2020 21:45:37 +0530 Subject: [PATCH 04/23] fix: setting password for mongodb connection --- docker-compose.build_from_source.yml | 6 ++++-- docker-compose.ngrok_example.yml | 6 ++++-- docker-compose.test.yml | 6 ++++-- docker-compose.yml | 6 ++++-- va_api_gateway/models.py | 5 ++++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/docker-compose.build_from_source.yml b/docker-compose.build_from_source.yml index 318ef735..f84a736c 100644 --- a/docker-compose.build_from_source.yml +++ b/docker-compose.build_from_source.yml @@ -13,6 +13,8 @@ services: - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 + - MONGODB_USERNAME=eva + - MONGODB_PASS=evapass - RASA_SERVER=http://va_custom_rasa:5005/model ports: - "3000:3000" @@ -41,8 +43,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGODB_USER="eva" - - MONGODB_PASS="evapass" + - MONGO_INITDB_ROOT_USERNAME="eva" + - MONGO_INITDB_ROOT_PASSWORD="evapass" volumes: - mongodb:/data/db ports: diff --git a/docker-compose.ngrok_example.yml b/docker-compose.ngrok_example.yml index f26c6bdb..85ba8cf3 100644 --- a/docker-compose.ngrok_example.yml +++ b/docker-compose.ngrok_example.yml @@ -15,6 +15,8 @@ services: - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 + - MONGODB_USERNAME=eva + - MONGODB_PASS=evapass - RASA_SERVER=http://va_custom_rasa:5005/model ports: - "3000:3000" @@ -43,8 +45,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGODB_USER="eva" - - MONGODB_PASS="evapass" + - MONGO_INITDB_ROOT_USERNAME="eva" + - MONGO_INITDB_ROOT_PASSWORD="evapass" volumes: - mongodb:/data/db ports: diff --git a/docker-compose.test.yml b/docker-compose.test.yml index e22dc67e..c67bccb3 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -23,6 +23,8 @@ services: - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 + - MONGODB_USERNAME=eva + - MONGODB_PASS=evapass - RASA_SERVER=http://custom_rasa:5005/model ports: - "3000:3000" @@ -51,8 +53,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGODB_USER="eva" - - MONGODB_PASS="evapass" + - MONGO_INITDB_ROOT_USERNAME="eva" + - MONGO_INITDB_ROOT_PASSWORD="evapass" volumes: - mongodb:/data/db ports: diff --git a/docker-compose.yml b/docker-compose.yml index c8190a77..ddbc3f04 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,8 @@ services: - REDIS_PASS=Y7T6r5re3t8j9yr - MONGODB_HOST=mongodb - MONGODB_PORT=27017 + - MONGODB_USERNAME=eva + - MONGODB_PASS=evapass - RASA_SERVER=http://va_custom_rasa:5005/model ports: - "3000:3000" @@ -43,8 +45,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGODB_USER="eva" - - MONGODB_PASS="evapass" + - MONGO_INITDB_ROOT_USERNAME="eva" + - MONGO_INITDB_ROOT_PASSWORD="evapass" volumes: - mongodb:/data/db ports: diff --git a/va_api_gateway/models.py b/va_api_gateway/models.py index fbdb642a..05985631 100644 --- a/va_api_gateway/models.py +++ b/va_api_gateway/models.py @@ -12,7 +12,10 @@ try: - client = MongoClient(os.environ['MONGODB_HOST'], int(os.environ['MONGODB_PORT'])) + client = MongoClient(os.environ['MONGODB_HOST'], + int(os.environ['MONGODB_PORT']), + username=os.environ['MONGODB_USERNAME'], + password=os.environ['MONGODB_PASS']) except KeyError: client = MongoClient('localhost', 27017) From 77ed5ae16fa7fc0245989eacfd34e3937c6a4315 Mon Sep 17 00:00:00 2001 From: saikiran Date: Tue, 25 Aug 2020 15:56:04 +0530 Subject: [PATCH 05/23] fix: correction Mongodb Connection string --- docker-compose.build_from_source.yml | 4 ++-- docker-compose.ngrok_example.yml | 4 ++-- va_api_gateway/models.py | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docker-compose.build_from_source.yml b/docker-compose.build_from_source.yml index f84a736c..f4a09800 100644 --- a/docker-compose.build_from_source.yml +++ b/docker-compose.build_from_source.yml @@ -43,8 +43,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGO_INITDB_ROOT_USERNAME="eva" - - MONGO_INITDB_ROOT_PASSWORD="evapass" + - MONGO_INITDB_ROOT_USERNAME=eva + - MONGO_INITDB_ROOT_PASSWORD=evapass volumes: - mongodb:/data/db ports: diff --git a/docker-compose.ngrok_example.yml b/docker-compose.ngrok_example.yml index 85ba8cf3..9939454e 100644 --- a/docker-compose.ngrok_example.yml +++ b/docker-compose.ngrok_example.yml @@ -45,8 +45,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGO_INITDB_ROOT_USERNAME="eva" - - MONGO_INITDB_ROOT_PASSWORD="evapass" + - MONGO_INITDB_ROOT_USERNAME=eva + - MONGO_INITDB_ROOT_PASSWORD=evapass volumes: - mongodb:/data/db ports: diff --git a/va_api_gateway/models.py b/va_api_gateway/models.py index 05985631..f4d3c35a 100644 --- a/va_api_gateway/models.py +++ b/va_api_gateway/models.py @@ -12,10 +12,8 @@ try: - client = MongoClient(os.environ['MONGODB_HOST'], - int(os.environ['MONGODB_PORT']), - username=os.environ['MONGODB_USERNAME'], - password=os.environ['MONGODB_PASS']) + client = MongoClient('mongodb://' + os.environ['MONGODB_USERNAME'] + ':' + os.environ['MONGODB_PASS'] + '@' + + str(os.environ['MONGODB_HOST'])) except KeyError: client = MongoClient('localhost', 27017) From d4323383784e3bff19354bec7728ff4b6b729c39 Mon Sep 17 00:00:00 2001 From: saikiran Date: Tue, 25 Aug 2020 15:57:12 +0530 Subject: [PATCH 06/23] fix: correction Mongodb Connection string --- docker-compose.test.yml | 4 ++-- docker-compose.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index c67bccb3..bec71ea3 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -53,8 +53,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGO_INITDB_ROOT_USERNAME="eva" - - MONGO_INITDB_ROOT_PASSWORD="evapass" + - MONGO_INITDB_ROOT_USERNAME=eva + - MONGO_INITDB_ROOT_PASSWORD=evapass volumes: - mongodb:/data/db ports: diff --git a/docker-compose.yml b/docker-compose.yml index ddbc3f04..fb2ec9af 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,8 +45,8 @@ services: environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null - - MONGO_INITDB_ROOT_USERNAME="eva" - - MONGO_INITDB_ROOT_PASSWORD="evapass" + - MONGO_INITDB_ROOT_USERNAME=eva + - MONGO_INITDB_ROOT_PASSWORD=evapass volumes: - mongodb:/data/db ports: From d300fde7d329facdc16502399b4db027828d3ce8 Mon Sep 17 00:00:00 2001 From: saikiran Date: Tue, 25 Aug 2020 16:01:58 +0530 Subject: [PATCH 07/23] fix: correction Mongodb Connection string --- rasa_custom/endpoints.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rasa_custom/endpoints.yml b/rasa_custom/endpoints.yml index 07a97e2c..3b90ec0c 100644 --- a/rasa_custom/endpoints.yml +++ b/rasa_custom/endpoints.yml @@ -4,5 +4,7 @@ tracker_store: store_type: mongod url: mongodb://mongodb:27017 db: eva_platform + username: eva + password: evapass auth_source: admin collection: conversations From 5b1caa8966ddffa19cb633c18210df1d8c84d40c Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Tue, 25 Aug 2020 18:17:35 +0530 Subject: [PATCH 08/23] Fixed Dependabot Alerts & Updated RELEASE.md file --- RELEASE.md | 2 ++ ui-trainer/package-lock.json | 6 +++--- ui-trainer/package.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index d02865be..0ad84950 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -36,6 +36,8 @@ Bug fixes * [214](https://github.com/navigateconsulting/eva/pull/214) Spinner was continously spinning in loop even after the training had completed and getting the completed status in the front end. * [215](https://github.com/navigateconsulting/eva/pull/215) npm dependancy in package.json file upgraded from 6.13.4 to 6.14.6 * [216](https://github.com/navigateconsulting/eva/pull/216) loadash dependancy in package.json file upgraded from 4.17.15 to 4.17.19 +* [220](https://github.com/navigateconsulting/eva/pull/220) elliptic dependancy in package-lock.json upgraded from 6.5.2 to 6.5.3. +* [222](https://github.com/navigateconsulting/eva/pull/222) Sorted Conversations in descending order with respect to timestamp of comversation date and added Full Date on the right side panel in try now page # Release 2.0.3 diff --git a/ui-trainer/package-lock.json b/ui-trainer/package-lock.json index bd20e4b1..bc869f86 100644 --- a/ui-trainer/package-lock.json +++ b/ui-trainer/package-lock.json @@ -3266,9 +3266,9 @@ "dev": true }, "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "dev": true, "requires": { "bn.js": "^4.4.0", diff --git a/ui-trainer/package.json b/ui-trainer/package.json index b531a3d3..d63fa125 100644 --- a/ui-trainer/package.json +++ b/ui-trainer/package.json @@ -60,7 +60,7 @@ "minimist": ">=0.2.1", "node-sass": "^4.12.0", "protractor": "~5.4.0", - "serialize-javascript": ">=2.1.1", + "serialize-javascript": ">=3.1.0", "ts-node": "~7.0.0", "tslint": "~5.11.0", "typescript": "~3.1.6" From 3c6c457980af43e7cff5b60d4cdea5c361e88acd Mon Sep 17 00:00:00 2001 From: saikiran Date: Tue, 25 Aug 2020 19:48:27 +0530 Subject: [PATCH 09/23] fix: pagination for conversations --- va_api_gateway/app.py | 2 +- va_api_gateway/endpoints.py | 27 +++++++++++++++++---------- va_api_gateway/models.py | 5 +++-- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/va_api_gateway/app.py b/va_api_gateway/app.py index f81616db..c1c22789 100644 --- a/va_api_gateway/app.py +++ b/va_api_gateway/app.py @@ -32,7 +32,7 @@ api.add_resource(Projects, '/projects', endpoint='projects') api.add_resource(CopyProject, '/copy_project', endpoint='copy_project') api.add_resource(Domains, '/domains/', endpoint="domains") -api.add_resource(AllConversations, '/all_conversations', endpoint='all_conversations') +api.add_resource(AllConversations, '/all_conversations//', endpoint='all_conversations') api.add_resource(Conversations, '/conversation/', endpoint='conversation') api.add_resource(RefreshDb, '/refresh_db', endpoint='refresh_db') diff --git a/va_api_gateway/endpoints.py b/va_api_gateway/endpoints.py index 967831df..71a81768 100644 --- a/va_api_gateway/endpoints.py +++ b/va_api_gateway/endpoints.py @@ -596,20 +596,27 @@ def delete(self, project_id): # noinspection PyMethodMayBeStatic class AllConversations(Resource): - def get(self): + def get(self, page_number, page_size): - # check if result can be served from cache - if r.exists("conversations"): - return json.loads(r.get("conversations")) + logging.debug('getting Data from DB') - else: - # Get results and update the cache with new values - logging.debug('getting Data from DB') + result = ConversationsModel.get_all_conversations(page_number, page_size) + r.set("conversations", json.dumps(result), ex=GLOBAL_EXPIRY) - result = ConversationsModel.get_all_conversations() - r.set("conversations", json.dumps(result), ex=GLOBAL_EXPIRY) + return result - return result + # # check if result can be served from cache + # if r.exists("conversations"): + # return json.loads(r.get("conversations")) + # + # else: + # # Get results and update the cache with new values + # logging.debug('getting Data from DB') + # + # result = ConversationsModel.get_all_conversations() + # r.set("conversations", json.dumps(result), ex=GLOBAL_EXPIRY) + # + # return result # noinspection PyMethodMayBeStatic diff --git a/va_api_gateway/models.py b/va_api_gateway/models.py index f4d3c35a..ae2c4906 100644 --- a/va_api_gateway/models.py +++ b/va_api_gateway/models.py @@ -872,8 +872,9 @@ class ConversationsModel: def __init__(self): pass - def get_all_conversations(self): - cursor = db.conversations.find() + def get_all_conversations(self, page_num, page_size): + skips = int(page_size) * (int(page_num) - 1) + cursor = db.conversations.find().sort('latest_event_time', -1).skip(skips).limit(int(page_size)) return json.loads(dumps(list(cursor))) def get_conversations(self, sender_id): From 05ec9c96e05487dcfda016b2d8fb5c42b0208d16 Mon Sep 17 00:00:00 2001 From: Sai Kiran Date: Wed, 26 Aug 2020 10:05:07 +0530 Subject: [PATCH 10/23] Update RELEASE.md --- RELEASE.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 0ad84950..edd87356 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -35,8 +35,10 @@ Bug fixes * [213](https://github.com/navigateconsulting/eva/pull/213) Updated documentation * [214](https://github.com/navigateconsulting/eva/pull/214) Spinner was continously spinning in loop even after the training had completed and getting the completed status in the front end. * [215](https://github.com/navigateconsulting/eva/pull/215) npm dependancy in package.json file upgraded from 6.13.4 to 6.14.6 -* [216](https://github.com/navigateconsulting/eva/pull/216) loadash dependancy in package.json file upgraded from 4.17.15 to 4.17.19 +* [216](https://github.com/navigateconsulting/eva/pull/216) and [217](https://github.com/navigateconsulting/eva/pull/217) loadash dependancy in package.json file upgraded from 4.17.15 to 4.17.19 +* [218](https://github.com/navigateconsulting/eva/pull/218) and [219](https://github.com/navigateconsulting/eva/pull/219) changes in populating default actions for projects * [220](https://github.com/navigateconsulting/eva/pull/220) elliptic dependancy in package-lock.json upgraded from 6.5.2 to 6.5.3. +* [221](https://github.com/navigateconsulting/eva/pull/221) removed Credentials yml file from rasa container, presence of this caused rasa to assume channels are used. * [222](https://github.com/navigateconsulting/eva/pull/222) Sorted Conversations in descending order with respect to timestamp of comversation date and added Full Date on the right side panel in try now page # Release 2.0.3 @@ -51,4 +53,4 @@ Bug fixes * [207](https://github.com/navigateconsulting/eva/pull/207) changes to UI * [210](https://github.com/navigateconsulting/eva/pull/210) Spinner issue on Manage Project Page has now been resolved, earlier there was a delay in showing the spinner. Conversations Chat was not displaying the slot values earlier, now the issue is fixed. -* [211](https://github.com/navigateconsulting/eva/pull/211) Displaying Conversations In Descending Order so that the latest conversation would be displayed first in the list. \ No newline at end of file +* [211](https://github.com/navigateconsulting/eva/pull/211) Displaying Conversations In Descending Order so that the latest conversation would be displayed first in the list. From ec648f17974d7d2e740b85f9ada96bc20e0998d6 Mon Sep 17 00:00:00 2001 From: saikiran Date: Wed, 26 Aug 2020 10:34:07 +0530 Subject: [PATCH 11/23] chore: rasa version upgrade to 1.10.11 --- Readme.md | 2 +- rasa_custom/Dockerfile | 2 +- trainer_worker/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index bb6a3978..0485158f 100755 --- a/Readme.md +++ b/Readme.md @@ -31,7 +31,7 @@ A snippet of how this application works ! We used below projects as chat bot framework. -* [Rasa Open Source](https://github.com/RasaHQ/rasa) Version 1.10.3 +* [Rasa Open Source](https://github.com/RasaHQ/rasa) Version 1.10.11 The Application stack is built with Python as backend and Angular as front end. diff --git a/rasa_custom/Dockerfile b/rasa_custom/Dockerfile index 478a14b3..37b753bf 100644 --- a/rasa_custom/Dockerfile +++ b/rasa_custom/Dockerfile @@ -1,5 +1,5 @@ # Extend the official Rasa SDK image -FROM rasa/rasa:1.10.3-full +FROM rasa/rasa:1.10.11-full # Use subdirectory as working directory #WORKDIR /app/config diff --git a/trainer_worker/requirements.txt b/trainer_worker/requirements.txt index b268cfdd..c1266a2d 100644 --- a/trainer_worker/requirements.txt +++ b/trainer_worker/requirements.txt @@ -1,2 +1,2 @@ celery[redis] -rasa[convert]==1.10.3 \ No newline at end of file +rasa[convert]==1.10.11 \ No newline at end of file From 6be84c8b47ecbb1fd401ce2b86c9988c19a2c3ee Mon Sep 17 00:00:00 2001 From: saikiran Date: Wed, 26 Aug 2020 15:51:12 +0530 Subject: [PATCH 12/23] fix: trainer worker setting redis pass --- docker-compose.build_from_source.yml | 2 ++ docker-compose.ngrok_example.yml | 2 ++ docker-compose.test.yml | 2 ++ docker-compose.yml | 2 ++ trainer_worker/tasks.py | 4 +++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docker-compose.build_from_source.yml b/docker-compose.build_from_source.yml index f4a09800..4ac1f81c 100644 --- a/docker-compose.build_from_source.yml +++ b/docker-compose.build_from_source.yml @@ -31,6 +31,8 @@ services: va_trainer_worker: build: './trainer_worker' + environment: + - REDIS_PASS=Y7T6r5re3t8j9yr volumes: - rasa_projects:/rasa_projects depends_on: diff --git a/docker-compose.ngrok_example.yml b/docker-compose.ngrok_example.yml index 9939454e..e8660089 100644 --- a/docker-compose.ngrok_example.yml +++ b/docker-compose.ngrok_example.yml @@ -35,6 +35,8 @@ services: build: './trainer_worker' volumes: - rasa_projects:/rasa_projects + environment: + - REDIS_PASS=Y7T6r5re3t8j9yr depends_on: - redis - va_api_gateway diff --git a/docker-compose.test.yml b/docker-compose.test.yml index bec71ea3..01592100 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -41,6 +41,8 @@ services: trainer_worker: build: './trainer_worker' + environment: + - REDIS_PASS=Y7T6r5re3t8j9yr volumes: - rasa_projects:/rasa_projects depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index fb2ec9af..26be934f 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,8 @@ services: va_trainer_worker: #image: docker.pkg.github.com/navigateconsulting/virtual-assistant/trainer_worker:latest image: navigateconsulting/va_trainer_worker + environment: + - REDIS_PASS=Y7T6r5re3t8j9yr volumes: - rasa_projects:/rasa_projects depends_on: diff --git a/trainer_worker/tasks.py b/trainer_worker/tasks.py index 213a0318..7107a51c 100644 --- a/trainer_worker/tasks.py +++ b/trainer_worker/tasks.py @@ -5,7 +5,9 @@ logger = get_task_logger(__name__) -app = Celery('tasks', broker='redis://redis:6379/0', backend='redis://redis:6379/0') +redis_url = 'redis://:' + os.environ['REDIS_PASS'] + '@redis:6379/0' + +app = Celery('tasks', broker=redis_url, backend=redis_url) @app.task() From 53d2f6414ab2b953268e20c476d9d431c7d4ee1d Mon Sep 17 00:00:00 2001 From: saikiran Date: Fri, 28 Aug 2020 20:29:36 +0530 Subject: [PATCH 13/23] fix: trainer worker setting redis pass, fix for celery broker connection --- va_api_gateway/endpoints.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/va_api_gateway/endpoints.py b/va_api_gateway/endpoints.py index 71a81768..f48ae67d 100644 --- a/va_api_gateway/endpoints.py +++ b/va_api_gateway/endpoints.py @@ -61,8 +61,9 @@ # Connect to celery task Queue +redis_url = 'redis://:' + os.environ['REDIS_PASS'] + '@redis:6379/0' -trainer_app = Celery('simple_worker', broker='redis://redis:6379/0', backend='redis://redis:6379/0') +trainer_app = Celery('simple_worker', broker=redis_url, backend=redis_url) # noinspection PyMethodMayBeStatic @@ -676,10 +677,11 @@ def get(self, project_id): ProjectsModel.set_project_mode(mode="Training", project_id=project_id) result = Export.call_main(project_id) - logger.debug(result) + logger.debug("Project Export Completed Result - " + str(result)) # Start Training for the model + logger.debug("Starting model training task") task_obj = trainer_app.send_task('tasks.train_model', kwargs={'project_id': project_id}) logger.debug("Task ID "+str(task_obj.id)) From 8cb447863e8b64d731d88fd5e61a334ed44718fa Mon Sep 17 00:00:00 2001 From: saikiran Date: Fri, 28 Aug 2020 20:36:08 +0530 Subject: [PATCH 14/23] fix: after refresh , the project details cache was not getting refreshed --- va_api_gateway/endpoints.py | 1 + 1 file changed, 1 insertion(+) diff --git a/va_api_gateway/endpoints.py b/va_api_gateway/endpoints.py index f48ae67d..6fc57724 100644 --- a/va_api_gateway/endpoints.py +++ b/va_api_gateway/endpoints.py @@ -633,6 +633,7 @@ class RefreshDb(Resource): def get(self): result = RefreshDbModel.refresh_db() + r.delete("all_projects") return result From c25f64fcef9f42234bea66eefe2ec2439bc3db05 Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 12:59:52 +0530 Subject: [PATCH 15/23] Added Conversation Page Index & Size For Optimized GET Conversations List --- .../src/app/common/services/apis.service.ts | 8 ++++---- .../conversations/conversations.component.ts | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ui-trainer/src/app/common/services/apis.service.ts b/ui-trainer/src/app/common/services/apis.service.ts index b392c79f..dd168425 100644 --- a/ui-trainer/src/app/common/services/apis.service.ts +++ b/ui-trainer/src/app/common/services/apis.service.ts @@ -113,13 +113,13 @@ export class ApiService { private conversationsCache$: Observable; private reloadConversations$ = new Subject(); - requestConversations(): Observable { + requestConversations(pageIndex: number, pageSize: number): Observable { if (!this.conversationsCache$) { // Set up timer that ticks every X milliseconds const timer$ = timer(0, REFRESH_INTERVAL); // For each tick make an http request to fetch new data this.conversationsCache$ = timer$.pipe( - switchMap(_ => this.requestGetConversations()), + switchMap(_ => this.requestGetConversations(pageIndex, pageSize)), takeUntil(this.reloadConversations$), shareReplay(CACHE_SIZE) ); @@ -127,8 +127,8 @@ export class ApiService { return this.conversationsCache$; } - requestGetConversations() { - return this.http.get(this.apiURL + '/all_conversations', this.httpOptions) + requestGetConversations(pageIndex: number, pageSize: number) { + return this.http.get(this.apiURL + '/all_conversations/' + pageIndex + '/' + pageSize, this.httpOptions) .pipe( retry(1), catchError(this.handleError) diff --git a/ui-trainer/src/app/conversations/conversations.component.ts b/ui-trainer/src/app/conversations/conversations.component.ts index e91c4517..a165e82b 100644 --- a/ui-trainer/src/app/conversations/conversations.component.ts +++ b/ui-trainer/src/app/conversations/conversations.component.ts @@ -28,15 +28,23 @@ export class ConversationsComponent implements OnInit, OnDestroy { @ViewChild(MatPaginator) paginator: MatPaginator; ngOnInit() { + sessionStorage.setItem('currentPage', 'conversations'); this.conversations_json = new Array(); this.conversations_json_backup = new Array(); + this.getConvoPaginationData(); this.getConversations(); - this.paginator.pageIndex = +localStorage.getItem('conversations_pageIndex'); - this.paginator.pageSize = +localStorage.getItem('conversations_pageSize'); } - + getConvoPaginationData() { + if (+localStorage.getItem('conversations_pageIndex') !== 0 && +localStorage.getItem('conversations_pageSize') !== 0) { + this.paginator.pageIndex = +localStorage.getItem('conversations_pageIndex'); + this.paginator.pageSize = +localStorage.getItem('conversations_pageSize'); + } else { + localStorage.setItem('conversations_pageIndex', '1'); + localStorage.setItem('conversations_pageSize', '10'); + } + } getConversations() { - this.apiService.requestConversations().subscribe(conversations => { + this.apiService.requestConversations(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')).subscribe(conversations => { if (conversations) { this.conversations_json = conversations.sort(function (a, b) { var x = a['latest_event_time']; var y = b['latest_event_time']; @@ -72,6 +80,7 @@ export class ConversationsComponent implements OnInit, OnDestroy { getConversationsPaginatorData(event: any) { localStorage.setItem('conversations_pageIndex', event.pageIndex); localStorage.setItem('conversations_pageSize', event.pageSize); + this.getConversations(); } openConversationChat(conversation_id: string) { @@ -85,6 +94,7 @@ export class ConversationsComponent implements OnInit, OnDestroy { } ngOnDestroy(): void { + sessionStorage.removeItem('currentPage'); this.apiService.forceConversationsCacheReload(); } From c4b44b89db77189b3083176b9a47cbe972670dfb Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 13:00:25 +0530 Subject: [PATCH 16/23] Changes In Routes (Separate for each component) --- ui-trainer/src/app/app-routing.module.ts | 1 - ui-trainer/src/app/app.component.ts | 10 +++++++++- .../src/app/applications/applications.component.scss | 2 +- .../src/app/applications/applications.component.ts | 9 +++++++++ ui-trainer/src/app/deploy/deploy.component.ts | 2 ++ ui-trainer/src/app/home/home.component.html | 2 +- ui-trainer/src/app/home/home.component.ts | 10 +++++++++- .../src/app/manage-actions/manage-actions.component.ts | 2 ++ .../src/app/manage-trainer/manage-trainer.component.ts | 5 +++++ 9 files changed, 38 insertions(+), 5 deletions(-) diff --git a/ui-trainer/src/app/app-routing.module.ts b/ui-trainer/src/app/app-routing.module.ts index da795514..97d4f6c1 100755 --- a/ui-trainer/src/app/app-routing.module.ts +++ b/ui-trainer/src/app/app-routing.module.ts @@ -12,7 +12,6 @@ import { ApplicationsComponent } from '../app/applications/applications.componen import { AuthGuard } from './auth.guard'; const routes: Routes = [ - // { path: ':atoken', component: AppComponent }, // { path: '', redirectTo: 'home/trainer', pathMatch: 'full' }, { path: 'applications', component: ApplicationsComponent, canActivate: [AuthGuard] }, { path: 'home', component: HomeComponent, canActivate: [AuthGuard], children: [ diff --git a/ui-trainer/src/app/app.component.ts b/ui-trainer/src/app/app.component.ts index b4832ba9..8b914de7 100755 --- a/ui-trainer/src/app/app.component.ts +++ b/ui-trainer/src/app/app.component.ts @@ -4,6 +4,7 @@ import { DomSanitizer } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { AuthService } from './common/services/auth.service'; import { environment } from '../environments/environment'; +import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-root', @@ -17,6 +18,7 @@ export class AppComponent { constructor(private matIconRegistry: MatIconRegistry, private domSanitizer: DomSanitizer, + private route: ActivatedRoute, private router: Router, public authService: AuthService) { this.matIconRegistry.addSvgIcon( 'project', @@ -117,7 +119,13 @@ export class AppComponent { checkTokenValidity() { if (!this.authService.isTokenExpired()) { this.loggedIn = true; - this.router.navigate(['/home/trainer']) + if (localStorage.getItem('jwt_token') === 'no_token' && window.location.href.split('/').pop() !== 'applications' && window.location.href.split('/').pop() !== 'home' && window.location.href.split('/').pop() !== '') { + sessionStorage.setItem('appParamExists', 'Y'); + this.router.navigate(['applications', { app : window.location.href.split('/').pop() }]); + } else { + sessionStorage.setItem('appParamExists', 'N'); + this.router.navigate(['applications']); + } } else { this.callParentApp(); } diff --git a/ui-trainer/src/app/applications/applications.component.scss b/ui-trainer/src/app/applications/applications.component.scss index 8f78dc32..3e12e929 100644 --- a/ui-trainer/src/app/applications/applications.component.scss +++ b/ui-trainer/src/app/applications/applications.component.scss @@ -2,7 +2,7 @@ .main-app-div { box-sizing: border-box; - height: 740px; + height: 100vh; } /* Create two equal columns that floats next to each other */ diff --git a/ui-trainer/src/app/applications/applications.component.ts b/ui-trainer/src/app/applications/applications.component.ts index 7008a553..fb53178c 100644 --- a/ui-trainer/src/app/applications/applications.component.ts +++ b/ui-trainer/src/app/applications/applications.component.ts @@ -3,6 +3,8 @@ import { NotificationsService } from '../common/services/notifications.service'; import { MatDialog } from '@angular/material/dialog'; import { ConfirmRefreshComponent } from '../common/modals/confirm-refresh/confirm-refresh.component'; import { ApiService } from '../common/services/apis.service'; +import { ActivatedRoute } from '@angular/router'; +import { Router } from '@angular/router'; @Component({ selector: 'app-applications', @@ -13,9 +15,16 @@ export class ApplicationsComponent implements OnInit { constructor(public dialog: MatDialog, public apiService: ApiService, + private route: ActivatedRoute, + private router: Router, private notificationsService: NotificationsService) { } ngOnInit() { + if (this.route.snapshot.paramMap.get('app') !== null && this.route.snapshot.paramMap.get('app') !== 'refresh') { + this.router.navigate(['home/' + this.route.snapshot.paramMap.get('app')]); + } else if (this.route.snapshot.paramMap.get('app') === 'refresh') { + this.refreshDB(); + } } refreshDB() { diff --git a/ui-trainer/src/app/deploy/deploy.component.ts b/ui-trainer/src/app/deploy/deploy.component.ts index 5aa9fcc7..26fd54bd 100755 --- a/ui-trainer/src/app/deploy/deploy.component.ts +++ b/ui-trainer/src/app/deploy/deploy.component.ts @@ -32,6 +32,7 @@ export class DeployComponent implements OnInit, OnDestroy { @ViewChild(MatPaginator) paginator: MatPaginator; ngOnInit() { + sessionStorage.setItem('currentPage', 'deploy'); this.getProjectsForDeploy(); this.paginator.pageIndex = +localStorage.getItem('deploy_pageIndex'); this.paginator.pageSize = +localStorage.getItem('deploy_pageSize'); @@ -79,6 +80,7 @@ export class DeployComponent implements OnInit, OnDestroy { } ngOnDestroy(): void { + sessionStorage.removeItem('currentPage'); this.overlayService.spin$.next(false); this.dialog.closeAll(); } diff --git a/ui-trainer/src/app/home/home.component.html b/ui-trainer/src/app/home/home.component.html index df998bb5..07603f9b 100755 --- a/ui-trainer/src/app/home/home.component.html +++ b/ui-trainer/src/app/home/home.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/ui-trainer/src/app/home/home.component.ts b/ui-trainer/src/app/home/home.component.ts index 94f29f81..480b53a1 100755 --- a/ui-trainer/src/app/home/home.component.ts +++ b/ui-trainer/src/app/home/home.component.ts @@ -7,8 +7,16 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { + appParamExists: boolean; + constructor() { } - ngOnInit() {} + ngOnInit() { + if (sessionStorage.getItem('appParamExists') === 'Y') { + this.appParamExists = true; + } else { + this.appParamExists = false; + } + } } diff --git a/ui-trainer/src/app/manage-actions/manage-actions.component.ts b/ui-trainer/src/app/manage-actions/manage-actions.component.ts index f8b0d81a..8ac37b43 100644 --- a/ui-trainer/src/app/manage-actions/manage-actions.component.ts +++ b/ui-trainer/src/app/manage-actions/manage-actions.component.ts @@ -29,6 +29,7 @@ export class ManageActionsComponent implements OnInit, OnDestroy { @ViewChild(MatPaginator) paginator: MatPaginator; ngOnInit() { + sessionStorage.setItem('currentPage', 'actions'); this.actions_json = new Array(); this.getActions(); this.paginator.pageIndex = +localStorage.getItem('actions_pageIndex'); @@ -125,6 +126,7 @@ export class ManageActionsComponent implements OnInit, OnDestroy { } ngOnDestroy(): void { + sessionStorage.removeItem('currentPage'); this.apiService.forceActionsCacheReload('finish'); this.dialog.closeAll(); } diff --git a/ui-trainer/src/app/manage-trainer/manage-trainer.component.ts b/ui-trainer/src/app/manage-trainer/manage-trainer.component.ts index 3fbf880e..698bb372 100755 --- a/ui-trainer/src/app/manage-trainer/manage-trainer.component.ts +++ b/ui-trainer/src/app/manage-trainer/manage-trainer.component.ts @@ -26,6 +26,7 @@ export class ManageTrainerComponent implements OnInit { constructor(private router: Router) { } ngOnInit() { + sessionStorage.setItem('currentPage', 'trainer'); this.breadcrumb_arr = new Array(); this.breadcrumb_arr.push({breadcrumb_name: 'Projects', breadcrumb_stub: {}, breadcrumb_type: 'root'}); this.setComponent = 'manage-projects'; @@ -108,4 +109,8 @@ export class ManageTrainerComponent implements OnInit { } } + ngOnDestroy(): void { + sessionStorage.removeItem('currentPage'); + } + } From e98801eea1f00211a6e4b3bf26872449b052114e Mon Sep 17 00:00:00 2001 From: saikiran Date: Wed, 2 Sep 2020 16:43:04 +0530 Subject: [PATCH 17/23] fix: correction to try now tracker store --- va_api_gateway/database_files/try_now_endpoints.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/va_api_gateway/database_files/try_now_endpoints.yml b/va_api_gateway/database_files/try_now_endpoints.yml index 07a97e2c..3b90ec0c 100644 --- a/va_api_gateway/database_files/try_now_endpoints.yml +++ b/va_api_gateway/database_files/try_now_endpoints.yml @@ -4,5 +4,7 @@ tracker_store: store_type: mongod url: mongodb://mongodb:27017 db: eva_platform + username: eva + password: evapass auth_source: admin collection: conversations From 47a0e656ddc3a54540d6b72fb5abbdba856be488 Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 19:23:33 +0530 Subject: [PATCH 18/23] Changing the font for symmetry with HWF --- ui-trainer/src/index.html | 1 + ui-trainer/src/scss/_variables.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ui-trainer/src/index.html b/ui-trainer/src/index.html index da735106..266a9ac2 100755 --- a/ui-trainer/src/index.html +++ b/ui-trainer/src/index.html @@ -13,6 +13,7 @@ /> + diff --git a/ui-trainer/src/scss/_variables.scss b/ui-trainer/src/scss/_variables.scss index 1f6355b7..d0892955 100755 --- a/ui-trainer/src/scss/_variables.scss +++ b/ui-trainer/src/scss/_variables.scss @@ -1,4 +1,4 @@ -$font-family: 'Open Sans', sans-serif; +$font-family: 'Varela Round', sans-serif; $global_gradient: linear-gradient(to right, #19D2CC, #0968B5); $global_gradient_black: linear-gradient(to right, #878787, #2B2B2B); From 66f5d8ccfea3f58493b12a7bcdaa8da34e1245d6 Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 19:24:41 +0530 Subject: [PATCH 19/23] CSS Tweaks in Conversation Chat Components --- .../src/app/conversation-chat/conversation-chat.component.html | 2 +- .../src/app/conversation-chat/conversation-chat.component.scss | 1 + ui-trainer/src/app/try-now/try-now.component.scss | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ui-trainer/src/app/conversation-chat/conversation-chat.component.html b/ui-trainer/src/app/conversation-chat/conversation-chat.component.html index db0a4c0f..81e9ab40 100644 --- a/ui-trainer/src/app/conversation-chat/conversation-chat.component.html +++ b/ui-trainer/src/app/conversation-chat/conversation-chat.component.html @@ -79,7 +79,7 @@ {{ userBotCardText }} - {{ userBotCardTime | date: "shortTime" }} + {{ userBotCardTime | date: "medium" }} | {{ userBotCardIntent }} | diff --git a/ui-trainer/src/app/conversation-chat/conversation-chat.component.scss b/ui-trainer/src/app/conversation-chat/conversation-chat.component.scss index 74f305cb..14bcb9eb 100644 --- a/ui-trainer/src/app/conversation-chat/conversation-chat.component.scss +++ b/ui-trainer/src/app/conversation-chat/conversation-chat.component.scss @@ -158,6 +158,7 @@ height: 32px; line-height: 1em; border-radius: 50%; + background-color: #19D2CC; } .bot-color { diff --git a/ui-trainer/src/app/try-now/try-now.component.scss b/ui-trainer/src/app/try-now/try-now.component.scss index 2400b0f4..6f4c0e83 100755 --- a/ui-trainer/src/app/try-now/try-now.component.scss +++ b/ui-trainer/src/app/try-now/try-now.component.scss @@ -149,6 +149,7 @@ height: 32px; line-height: 1em; border-radius: 50%; + background-color: #19D2CC; } .bot-color { From ffbca58c2f3bd91760e5e5878f50e793511d0667 Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 19:25:38 +0530 Subject: [PATCH 20/23] Route Tweaks --- ui-trainer/src/app/app.component.ts | 18 +++++++++++------- ui-trainer/src/app/home/home.component.html | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ui-trainer/src/app/app.component.ts b/ui-trainer/src/app/app.component.ts index 8b914de7..285adf61 100755 --- a/ui-trainer/src/app/app.component.ts +++ b/ui-trainer/src/app/app.component.ts @@ -17,9 +17,9 @@ export class AppComponent { loggedIn = false; constructor(private matIconRegistry: MatIconRegistry, - private domSanitizer: DomSanitizer, - private route: ActivatedRoute, - private router: Router, public authService: AuthService) { + private domSanitizer: DomSanitizer, + private route: ActivatedRoute, + private router: Router, public authService: AuthService) { this.matIconRegistry.addSvgIcon( 'project', this.domSanitizer.bypassSecurityTrustResourceUrl('../assets/images/project.svg') @@ -120,8 +120,12 @@ export class AppComponent { if (!this.authService.isTokenExpired()) { this.loggedIn = true; if (localStorage.getItem('jwt_token') === 'no_token' && window.location.href.split('/').pop() !== 'applications' && window.location.href.split('/').pop() !== 'home' && window.location.href.split('/').pop() !== '') { - sessionStorage.setItem('appParamExists', 'Y'); - this.router.navigate(['applications', { app : window.location.href.split('/').pop() }]); + if (window.location.href.split('/').slice(-2)[0] !== 'home' && window.location.href.split('/').slice(-2)[0] !== 'conversations' && window.location.href.split('/').slice(-2)[0] !== 'trainer') { + sessionStorage.setItem('appParamExists', 'Y'); + this.router.navigate(['applications', { app: window.location.href.split('/').pop() }]); + } else { + sessionStorage.setItem('appParamExists', 'N'); + } } else { sessionStorage.setItem('appParamExists', 'N'); this.router.navigate(['applications']); @@ -131,9 +135,9 @@ export class AppComponent { } } - callParentApp () { + callParentApp() { localStorage.clear(); - let url = environment.PARENT_APP_URL; + let url = environment.PARENT_APP_URL; window.open(url, '_self'); } } diff --git a/ui-trainer/src/app/home/home.component.html b/ui-trainer/src/app/home/home.component.html index 07603f9b..fc320b10 100755 --- a/ui-trainer/src/app/home/home.component.html +++ b/ui-trainer/src/app/home/home.component.html @@ -1,4 +1,4 @@ -
+
From 58eac7cf6b0cc4953571d42dee48d696152c19c7 Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 19:26:14 +0530 Subject: [PATCH 21/23] New Font Changes & Tweaks --- .../modals/confirm-refresh/confirm-refresh.component.html | 2 +- ui-trainer/src/app/manage-trainer/manage-trainer.component.scss | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ui-trainer/src/app/common/modals/confirm-refresh/confirm-refresh.component.html b/ui-trainer/src/app/common/modals/confirm-refresh/confirm-refresh.component.html index deca1eef..df000737 100644 --- a/ui-trainer/src/app/common/modals/confirm-refresh/confirm-refresh.component.html +++ b/ui-trainer/src/app/common/modals/confirm-refresh/confirm-refresh.component.html @@ -12,7 +12,7 @@

Are you sure you want to refresh? By hitting the co
-
+
diff --git a/ui-trainer/src/app/manage-trainer/manage-trainer.component.scss b/ui-trainer/src/app/manage-trainer/manage-trainer.component.scss index 6a8940e1..e14a2b22 100755 --- a/ui-trainer/src/app/manage-trainer/manage-trainer.component.scss +++ b/ui-trainer/src/app/manage-trainer/manage-trainer.component.scss @@ -34,7 +34,6 @@ color: $breadcrumb-font-color; font-size: $breadcrumb-font-size; line-height: $breadcrumb-line-height; - font-family: 'Open Sans', sans-serif !important; } .breadcrumb-element { cursor: pointer; From 815068281bdd5e15165c1dd68888e7986b2ba4de Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 19:26:32 +0530 Subject: [PATCH 22/23] Conversation Pagination Changes UI & API --- .../src/app/common/services/apis.service.ts | 7 ++- .../conversations.component.html | 60 +++++++++++++------ .../conversations.component.scss | 11 ++-- .../conversations/conversations.component.ts | 30 +++++++++- 4 files changed, 83 insertions(+), 25 deletions(-) diff --git a/ui-trainer/src/app/common/services/apis.service.ts b/ui-trainer/src/app/common/services/apis.service.ts index dd168425..6a1ff0b3 100644 --- a/ui-trainer/src/app/common/services/apis.service.ts +++ b/ui-trainer/src/app/common/services/apis.service.ts @@ -143,11 +143,16 @@ export class ApiService { ); } - forceConversationsCacheReload() { + forceConversationsCacheReload(type: string) { + if (type === 'reset') { // Calling next will complete the current cache instance this.reloadConversations$.next(); // Setting the cache to null will create a new cache the this.conversationsCache$ = null; + } else if (type === 'finish') { + // Calling next will complete the current cache instance + this.reloadConversations$.next(); + } } // Conversations API End diff --git a/ui-trainer/src/app/conversations/conversations.component.html b/ui-trainer/src/app/conversations/conversations.component.html index 98635c66..b5833f75 100644 --- a/ui-trainer/src/app/conversations/conversations.component.html +++ b/ui-trainer/src/app/conversations/conversations.component.html @@ -2,12 +2,8 @@
- +
@@ -37,27 +33,57 @@ - Conversation Details + Details - - + - + > -->

- +
+
+
+ + Items Per Page + + 10 + 15 + 20 + + +
+ +
+ \ No newline at end of file diff --git a/ui-trainer/src/app/conversations/conversations.component.scss b/ui-trainer/src/app/conversations/conversations.component.scss index 29bc8692..4b4efdcd 100644 --- a/ui-trainer/src/app/conversations/conversations.component.scss +++ b/ui-trainer/src/app/conversations/conversations.component.scss @@ -6,7 +6,7 @@ height: auto; } .conversations-table-container { - height: 80vh; + height: 72vh; padding: 0.5%; overflow-y: auto; } @@ -45,21 +45,24 @@ table { .project-icons { color: #1C90D1; } +.page-item { + cursor: pointer; +} @media screen and (min-width: 1367px) and (max-width: 1620px) { .conversations-table-container { - height: 82vh; + height: 74vh; overflow-y: auto; } } @media screen and (min-width: 1621px) and (max-width: 1729px) { .conversations-table-container { - height: 84vh; + height: 76vh; overflow-y: auto; } } @media screen and (min-width: 1730px) { .conversations-table-container { - height: 86vh; + height: 78vh; overflow-y: auto; } } \ No newline at end of file diff --git a/ui-trainer/src/app/conversations/conversations.component.ts b/ui-trainer/src/app/conversations/conversations.component.ts index a165e82b..1e070fce 100644 --- a/ui-trainer/src/app/conversations/conversations.component.ts +++ b/ui-trainer/src/app/conversations/conversations.component.ts @@ -24,6 +24,8 @@ export class ConversationsComponent implements OnInit, OnDestroy { conversations_json: Array; conversations_json_backup: Array; filterConversationText = ''; + pageIndex = 0 + pageSize = 0; @ViewChild(MatPaginator) paginator: MatPaginator; @@ -36,16 +38,20 @@ export class ConversationsComponent implements OnInit, OnDestroy { } getConvoPaginationData() { if (+localStorage.getItem('conversations_pageIndex') !== 0 && +localStorage.getItem('conversations_pageSize') !== 0) { - this.paginator.pageIndex = +localStorage.getItem('conversations_pageIndex'); - this.paginator.pageSize = +localStorage.getItem('conversations_pageSize'); + this.pageIndex = +localStorage.getItem('conversations_pageIndex'); + this.pageSize = +localStorage.getItem('conversations_pageSize'); } else { + this.pageIndex = 1; + this.pageSize = 10; localStorage.setItem('conversations_pageIndex', '1'); localStorage.setItem('conversations_pageSize', '10'); } } getConversations() { + console.log(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')); this.apiService.requestConversations(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')).subscribe(conversations => { if (conversations) { + console.log(conversations); this.conversations_json = conversations.sort(function (a, b) { var x = a['latest_event_time']; var y = b['latest_event_time']; return ((x > y) ? -1 : ((x < y) ? 1 : 0)); @@ -93,9 +99,27 @@ export class ConversationsComponent implements OnInit, OnDestroy { return new Date(time_stamp * 1000).toLocaleString(); } + updatePageSize(event: any) { + localStorage.setItem('conversations_pageSize', event.value); + this.apiService.forceConversationsCacheReload('reset'); + this.getConversations(); + } + + updatePageIndex(type: string) { + if (type === '+') { + this.pageIndex += 1; + localStorage.setItem('conversations_pageIndex', '' + this.pageIndex); + } else if (type === '-' && this.pageIndex > 1) { + this.pageIndex -= 1; + localStorage.setItem('conversations_pageIndex', '' + this.pageIndex); + } + this.apiService.forceConversationsCacheReload('reset'); + this.getConversations(); + } + ngOnDestroy(): void { sessionStorage.removeItem('currentPage'); - this.apiService.forceConversationsCacheReload(); + this.apiService.forceConversationsCacheReload('finish'); } } From 28bcfcfb92cad8ec70a129c5e1f9ff0464702722 Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 20:52:33 +0530 Subject: [PATCH 23/23] Conversation Chat Entity Addition --- RELEASE.md | 5 +++++ .../conversation-chat.component.html | 16 +++++++++++++++- .../conversation-chat.component.ts | 10 +++++++++- .../app/conversations/conversations.component.ts | 2 -- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index edd87356..186bf6ce 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -29,6 +29,11 @@ Bug fixes ## Major Features and Improvements +* [223](https://github.com/navigateconsulting/eva/pull/223) Added authentication for mongo, and redis containers
+Lazy loading for conversations API and UI
+Changes In Routes (Separate for each component eg: Actions, Conversations, Projects, etc.)
+CSS Tweaks in Conversations Chat Components +Added Entity Display feature respective to the intent selected in the chat ## Bug Fixes and Other Changes diff --git a/ui-trainer/src/app/conversation-chat/conversation-chat.component.html b/ui-trainer/src/app/conversation-chat/conversation-chat.component.html index 81e9ab40..d80d3672 100644 --- a/ui-trainer/src/app/conversation-chat/conversation-chat.component.html +++ b/ui-trainer/src/app/conversation-chat/conversation-chat.component.html @@ -161,7 +161,7 @@
- +
@@ -176,6 +176,20 @@
Key
+ + + + + + + + + + + + + +
KeyValue
{{ entity.entity }}{{ entity.value }}
diff --git a/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts b/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts index 3caed30c..a4dd8214 100644 --- a/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts +++ b/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts @@ -23,9 +23,11 @@ export class ConversationChatComponent implements OnInit { predictions: any; userBotCardType: string; userBotCardText: string; - private userBotCardTime; + userBotCardTime; userBotCardIntent: string; userBotCardConfidence: string; + showAllIntentEntities = true; + showIntentEntitiesData: []; constructor(public sharedDataService: SharedDataService, public _router: Router, @@ -74,6 +76,12 @@ export class ConversationChatComponent implements OnInit { this.userBotCardTime = new Date(Math.floor(this.chats[chat_row_index]['timestamp']) * 1000); this.userBotCardIntent = this.chats[chat_row_index]['parse_data']['intent']['name']; this.userBotCardConfidence = this.chats[chat_row_index]['parse_data']['intent']['confidence']; + if (this.chats[chat_row_index]['parse_data']['entities'].length >= 1) { + this.showIntentEntitiesData = this.chats[chat_row_index]['parse_data']['entities'] + } else { + this.showIntentEntitiesData = []; + } + this.showAllIntentEntities = false; // tslint:disable-next-line: max-line-length this.predictions = { text: this.chats[chat_row_index]['parse_data']['text'], intent_ranking: this.chats[chat_row_index]['parse_data']['intent_ranking'] }; this.showUserBotCardDetails = true; diff --git a/ui-trainer/src/app/conversations/conversations.component.ts b/ui-trainer/src/app/conversations/conversations.component.ts index 1e070fce..c1b389d8 100644 --- a/ui-trainer/src/app/conversations/conversations.component.ts +++ b/ui-trainer/src/app/conversations/conversations.component.ts @@ -48,10 +48,8 @@ export class ConversationsComponent implements OnInit, OnDestroy { } } getConversations() { - console.log(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')); this.apiService.requestConversations(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')).subscribe(conversations => { if (conversations) { - console.log(conversations); this.conversations_json = conversations.sort(function (a, b) { var x = a['latest_event_time']; var y = b['latest_event_time']; return ((x > y) ? -1 : ((x < y) ? 1 : 0));