From 5ee40ee2e3156127cbe9778de2938c06c5b30b65 Mon Sep 17 00:00:00 2001 From: prakashdurlabhji Date: Tue, 15 Oct 2019 21:29:23 +0530 Subject: [PATCH 1/8] f2f join-dec-btn --- emails/src/partials/project-team.html | 58 ++++++++++++++++++++------- emails/src/styles/main.css | 9 +++++ emails/src/styles/modules/_color.scss | 1 + emails/src/styles/partials/_base.scss | 16 ++++++++ 4 files changed, 69 insertions(+), 15 deletions(-) diff --git a/emails/src/partials/project-team.html b/emails/src/partials/project-team.html index f5dbb21..f292f69 100644 --- a/emails/src/partials/project-team.html +++ b/emails/src/partials/project-team.html @@ -105,23 +105,51 @@ - + + {{else}} - {{#if notifications.[0].[isSSO]}} - - SSO Login - - {{else}} - - View project on Connect - - {{/if}} + + + {{/if}} - + {{else}} + + {{/if}}
- {{#if notifications.[0].[connect.notification.project.member.invite.requested]}} - - Manage project team - + {{#if notifications.[0].[connect.notification.project.member.invite.created]}} + {{#if notifications.[0].[isSSO]}} + + + Join Project + + + + Decline + + + + Join Project + + + + Decline + + + {{#if notifications.[0].[connect.notification.project.member.invite.requested]}} + + Manage project team + + {{else}} + {{#if notifications.[0].[isSSO]}} + + SSO Login + + {{else}} + + View project on Connect + + {{/if}} + {{/if}} +
diff --git a/emails/src/styles/main.css b/emails/src/styles/main.css index a73295c..0a8dc9c 100644 --- a/emails/src/styles/main.css +++ b/emails/src/styles/main.css @@ -148,6 +148,9 @@ table.container, table.footer-container { height: 15px; background-color: #FFFFFF; } +.empty-child-10 { + width: 10px; } + .post-details .main-child { background-color: #FFFFFF; } .post-details .main-child .empty-child-one { @@ -220,6 +223,12 @@ table.container, table.footer-container { text-align: center; color: #FFFFFF; font-size: 13px; } + .button-row .main-child .second-child.project-team.decline-sec { + background-color: #FFFFFF; } + .button-row .main-child .second-child.project-team a.decline-btn { + color: #555555; + border: 1px solid #808080; + background-color: #FFFFFF; } .button-one .main-child .empty-child-one, .button-three .main-child .empty-child-one { width: 216px; } diff --git a/emails/src/styles/modules/_color.scss b/emails/src/styles/modules/_color.scss index 96cbe42..f1fdc36 100644 --- a/emails/src/styles/modules/_color.scss +++ b/emails/src/styles/modules/_color.scss @@ -8,3 +8,4 @@ $grey-color: #888894; $blue-color: #006DEA; $grey-hyperlink: #808080; $button-color: #0681FF; +$tc-gray-70: #555555; diff --git a/emails/src/styles/partials/_base.scss b/emails/src/styles/partials/_base.scss index a3f28e6..d1d1d1a 100644 --- a/emails/src/styles/partials/_base.scss +++ b/emails/src/styles/partials/_base.scss @@ -206,6 +206,10 @@ table.container, table.footer-container { } } +.empty-child-10 { + width: 10px; +} + // emptys end // post details @@ -321,6 +325,18 @@ table.container, table.footer-container { color: $white-background; font-size: 13px; } + &.project-team { + &.decline-sec { + background-color: $white-background; + } + a { + &.decline-btn { + color: $tc-gray-70; + border: 1px solid $grey-hyperlink; + background-color: $white-background; + } + } + } } } } From 605500a83a16d3b80fd97909e8b03667cb739147 Mon Sep 17 00:00:00 2001 From: Maksym Mykhailenko Date: Wed, 16 Oct 2019 11:46:24 +0800 Subject: [PATCH 2/8] fix: improved "Join Project" and "Decline" link styles in emails - make the second button height and width more accurately match the primary button size - rename some classes to have more clear names --- emails/src/partials/project-team.html | 24 ++++++++++++---------- emails/src/styles/main.css | 18 +++++++++-------- emails/src/styles/partials/_base.scss | 29 +++++++++++++++------------ 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/emails/src/partials/project-team.html b/emails/src/partials/project-team.html index f292f69..5c3671d 100644 --- a/emails/src/partials/project-team.html +++ b/emails/src/partials/project-team.html @@ -104,35 +104,37 @@ - {{#if notifications.[0].[connect.notification.project.member.invite.created]}} + {{#if notifications.[0].[isSSO]}} - - - + {{else}} - - - + {{/if}} + {{else}} - + + {{/if}} -
+ Join Project - + + Decline + Join Project - + + Decline + {{#if notifications.[0].[connect.notification.project.member.invite.requested]}} Manage project team @@ -149,8 +151,8 @@ {{/if}} {{/if}}
diff --git a/emails/src/styles/main.css b/emails/src/styles/main.css index 0a8dc9c..621406a 100644 --- a/emails/src/styles/main.css +++ b/emails/src/styles/main.css @@ -148,7 +148,7 @@ table.container, table.footer-container { height: 15px; background-color: #FFFFFF; } -.empty-child-10 { +.empty-width-10 { width: 10px; } .post-details .main-child { @@ -210,7 +210,6 @@ table.container, table.footer-container { .button-row .main-child .second-child { border-radius: 4px; vertical-align: middle; - background-color: #0681FF; height: 30px; } .button-row .main-child .second-child a { border-radius: 4px; @@ -218,20 +217,23 @@ table.container, table.footer-container { text-decoration: none; display: block; background-color: #0681FF; - padding-top: 6px; - padding-bottom: 5px; + padding-top: 8px; + padding-bottom: 7px; text-align: center; color: #FFFFFF; font-size: 13px; } - .button-row .main-child .second-child.project-team.decline-sec { - background-color: #FFFFFF; } - .button-row .main-child .second-child.project-team a.decline-btn { + .button-row .main-child .second-child a.second-btn { color: #555555; border: 1px solid #808080; - background-color: #FFFFFF; } + background-color: #FFFFFF; + padding-top: 7px; + padding-bottom: 6px; + width: 165px; } .button-one .main-child .empty-child-one, .button-three .main-child .empty-child-one { width: 216px; } + .button-one .main-child .empty-child-one.for-two-buttons, .button-three .main-child .empty-child-one.for-two-buttons { + width: 128px; } .button-one .main-child .second-child, .button-three .main-child .second-child { width: 167px; } diff --git a/emails/src/styles/partials/_base.scss b/emails/src/styles/partials/_base.scss index d1d1d1a..77cd54e 100644 --- a/emails/src/styles/partials/_base.scss +++ b/emails/src/styles/partials/_base.scss @@ -206,7 +206,7 @@ table.container, table.footer-container { } } -.empty-child-10 { +.empty-width-10 { width: 10px; } @@ -310,7 +310,6 @@ table.container, table.footer-container { // width: 167px; border-radius: 4px; vertical-align: middle; - background-color: $button-color; height: 30px; a { // width: 167px; @@ -319,22 +318,20 @@ table.container, table.footer-container { text-decoration: none; display: block; background-color: $button-color; - padding-top: 6px; - padding-bottom: 5px; + padding-top: 8px; + padding-bottom: 7px; text-align: center; color: $white-background; font-size: 13px; } - &.project-team { - &.decline-sec { + a { + &.second-btn { + color: $tc-gray-70; + border: 1px solid $grey-hyperlink; background-color: $white-background; - } - a { - &.decline-btn { - color: $tc-gray-70; - border: 1px solid $grey-hyperlink; - background-color: $white-background; - } + padding-top: 7px; // minus 1px border-top + padding-bottom: 6px; // minus 1px border-bottom + width: 165px; // minus 2px borders } } } @@ -348,6 +345,12 @@ table.container, table.footer-container { .main-child { .empty-child-one { width: 216px; + + // if we have two buttons in one row with 10px spacing between: + // space=128px + button=167px + space=10px + button=167px + space=128px + &.for-two-buttons { + width: 128px; + } } .second-child { width: 167px; From 126e30d3dc450f44b2947372ab3883f7476fc45e Mon Sep 17 00:00:00 2001 From: vikasrohit Date: Mon, 16 Dec 2019 10:59:55 +0530 Subject: [PATCH 3/8] Skip filtering bot notifications Passing through the Bot topic for receiving notifications. https://github.com/appirio-tech/connect-app/issues/3405 --- connect/connectNotificationServer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index 34674e3..7ddab15 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -411,8 +411,9 @@ const handler = (topic, message, logger, callback) => { // because they create too much clutter and duplicate info const botIds = [config.TCWEBSERVICE_ID, config.CODERBOT_USER_ID]; if (topic === BUS_API_EVENT.CONNECT.TOPIC.CREATED && botIds.indexOf(message.userId.toString()) !== -1) { - logger.info(`Ignoring, to avoid noise, Bot topic ${topic}`); - return callback(null, []); + // logger.info(`Ignoring, to avoid noise, Bot topic ${topic}`); + // return callback(null, []); + logger.info(`Passing through the Bot topic ${topic} for receiving notifications`); } // get project details From 5afe050dfaac59282c4cba03580950827aec5656 Mon Sep 17 00:00:00 2001 From: vikasrohit Date: Mon, 16 Dec 2019 11:59:36 +0530 Subject: [PATCH 4/8] Fixing issue with coder bot user details call if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce, for fetching more details about the user --- connect/connectNotificationServer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index 7ddab15..72c659a 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -455,7 +455,12 @@ const handler = (topic, message, logger, callback) => { const ids = []; logger.debug(message.initiatorUserId, 'message.initiatorUserId'); if (message.initiatorUserId) { - ids.push(message.initiatorUserId); + // if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce + if (botIds.indexOf(message.userId.toString()) !== -1) { + ids.push(config.TCWEBSERVICE_ID); + } else { + ids.push(message.initiatorUserId); + } } // if message has userId such messages will likely need userHandle and user full name // so let's get it From cf95611e1e0975209335db748bcb7170dc899290 Mon Sep 17 00:00:00 2001 From: vikasrohit Date: Mon, 16 Dec 2019 12:17:05 +0530 Subject: [PATCH 5/8] fix: part two of fixing the coderbot notifications Applied the logic with both initiatorUserId and userId --- connect/connectNotificationServer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index 72c659a..b80880d 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -456,7 +456,7 @@ const handler = (topic, message, logger, callback) => { logger.debug(message.initiatorUserId, 'message.initiatorUserId'); if (message.initiatorUserId) { // if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce - if (botIds.indexOf(message.userId.toString()) !== -1) { + if (botIds.indexOf(message.initiatorUserId.toString()) !== -1) { ids.push(config.TCWEBSERVICE_ID); } else { ids.push(message.initiatorUserId); @@ -466,7 +466,12 @@ const handler = (topic, message, logger, callback) => { // so let's get it logger.debug(message.userId, 'message.userId'); if (message.userId) { - ids.push(message.userId); + // if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce + if (botIds.indexOf(message.userId.toString()) !== -1) { + ids.push(config.TCWEBSERVICE_ID); + } else { + ids.push(message.userId); + } } return service.getUsersById(ids); // return []; From 306036e4e21118ecf90fcf7edd6dc99b3eb9bdf2 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 17 Dec 2019 10:34:40 +0530 Subject: [PATCH 6/8] Revert "fix: part two of fixing the coderbot notifications" This reverts commit cf95611e1e0975209335db748bcb7170dc899290. --- connect/connectNotificationServer.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index b80880d..72c659a 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -456,7 +456,7 @@ const handler = (topic, message, logger, callback) => { logger.debug(message.initiatorUserId, 'message.initiatorUserId'); if (message.initiatorUserId) { // if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce - if (botIds.indexOf(message.initiatorUserId.toString()) !== -1) { + if (botIds.indexOf(message.userId.toString()) !== -1) { ids.push(config.TCWEBSERVICE_ID); } else { ids.push(message.initiatorUserId); @@ -466,12 +466,7 @@ const handler = (topic, message, logger, callback) => { // so let's get it logger.debug(message.userId, 'message.userId'); if (message.userId) { - // if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce - if (botIds.indexOf(message.userId.toString()) !== -1) { - ids.push(config.TCWEBSERVICE_ID); - } else { - ids.push(message.userId); - } + ids.push(message.userId); } return service.getUsersById(ids); // return []; From ed655da4d2b6f756329a22f6af4dcdef46ce11c9 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 17 Dec 2019 10:34:50 +0530 Subject: [PATCH 7/8] Revert "Fixing issue with coder bot user details call" This reverts commit 5afe050dfaac59282c4cba03580950827aec5656. --- connect/connectNotificationServer.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index 72c659a..7ddab15 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -455,12 +455,7 @@ const handler = (topic, message, logger, callback) => { const ids = []; logger.debug(message.initiatorUserId, 'message.initiatorUserId'); if (message.initiatorUserId) { - // if message is posted by the coder bot, use useId of the predefined system user i.e. tcwebserivce - if (botIds.indexOf(message.userId.toString()) !== -1) { - ids.push(config.TCWEBSERVICE_ID); - } else { - ids.push(message.initiatorUserId); - } + ids.push(message.initiatorUserId); } // if message has userId such messages will likely need userHandle and user full name // so let's get it From 9fcd0afe3164665aa10db613fdc3d45c6aa5f1c7 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Tue, 17 Dec 2019 10:34:55 +0530 Subject: [PATCH 8/8] Revert "Skip filtering bot notifications" This reverts commit 126e30d3dc450f44b2947372ab3883f7476fc45e. --- connect/connectNotificationServer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index 7ddab15..34674e3 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -411,9 +411,8 @@ const handler = (topic, message, logger, callback) => { // because they create too much clutter and duplicate info const botIds = [config.TCWEBSERVICE_ID, config.CODERBOT_USER_ID]; if (topic === BUS_API_EVENT.CONNECT.TOPIC.CREATED && botIds.indexOf(message.userId.toString()) !== -1) { - // logger.info(`Ignoring, to avoid noise, Bot topic ${topic}`); - // return callback(null, []); - logger.info(`Passing through the Bot topic ${topic} for receiving notifications`); + logger.info(`Ignoring, to avoid noise, Bot topic ${topic}`); + return callback(null, []); } // get project details