From 410cf405ca06b0cb8190ad9510f525e12955ac7c Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Mon, 23 May 2022 15:39:55 -0700 Subject: [PATCH 1/9] opacity parameter --- src/styles/StyleUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index 4da69f75d42..f8978832432 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -389,7 +389,7 @@ function getLoginPagePromoStyle() { * @param {Boolean} [isHovered] * @returns {Object} */ -function getReportActionItemStyle(isHovered = false) { +function getReportActionItemStyle(isHovered = false, isPending = false) { return { display: 'flex', justifyContent: 'space-between', From e5ee291d160cbb8b09004d2a6b9f49df4975e485 Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Mon, 23 May 2022 15:40:07 -0700 Subject: [PATCH 2/9] set opacity value --- src/styles/StyleUtils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index f8978832432..8cb3c419416 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -398,6 +398,9 @@ function getReportActionItemStyle(isHovered = false, isPending = false) { // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android : colors.transparent, + opacity: isPending + ? 0.5 + : 1, cursor: 'default', }; } From 4d8e49ab531756bc48e80a4b6ea4e64a4c74b702 Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Mon, 23 May 2022 15:42:32 -0700 Subject: [PATCH 3/9] pass pending argument --- src/pages/home/report/ReportActionItem.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index ca4baf30465..32f9563e7ad 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -173,6 +173,7 @@ class ReportActionItem extends Component { hovered || this.state.isContextMenuActive || this.props.draftMessage, + this.props.action.isPending, )} > {!this.props.displayAsGroup From c04f6edee8abae26bac58cec3013575cd1487cc7 Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Mon, 23 May 2022 15:44:07 -0700 Subject: [PATCH 4/9] use second param for error as well --- src/pages/home/report/ReportActionItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 32f9563e7ad..ac04ba8a5e5 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -173,7 +173,7 @@ class ReportActionItem extends Component { hovered || this.state.isContextMenuActive || this.props.draftMessage, - this.props.action.isPending, + this.props.action.isPending || this.props.action.error, )} > {!this.props.displayAsGroup From 3cdbd70f0c4ae631ad92e9a7e06aca09aa23ea60 Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Tue, 24 May 2022 11:23:55 -0700 Subject: [PATCH 5/9] Added proptypes --- src/pages/home/report/reportActionPropTypes.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pages/home/report/reportActionPropTypes.js b/src/pages/home/report/reportActionPropTypes.js index 54df5df5239..30abe19e1a4 100644 --- a/src/pages/home/report/reportActionPropTypes.js +++ b/src/pages/home/report/reportActionPropTypes.js @@ -23,4 +23,11 @@ export default { // The ID of the iou transaction IOUTransactionID: PropTypes.string, }), + + // Used to indicate the pending state. + // Pending means the addComment request is waiting to be sent to the server. + isPending: PropTypes.bool, + + // Error message that's come back from the server. + error: PropTypes.string, }; From 04653ae01ce6a7cbe9044d1f2f2c8b25148b6c7e Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Tue, 24 May 2022 12:37:58 -0700 Subject: [PATCH 6/9] props for styleUtils --- src/styles/StyleUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index 8cb3c419416..c51cd54b52d 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -387,6 +387,7 @@ function getLoginPagePromoStyle() { * Generate the styles for the ReportActionItem wrapper view. * * @param {Boolean} [isHovered] + * @param {Boolean} [isPending] * @returns {Object} */ function getReportActionItemStyle(isHovered = false, isPending = false) { From 5083e8f10e25f1dc563dfe02fff047561b073564 Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Tue, 24 May 2022 16:48:48 -0700 Subject: [PATCH 7/9] cleared up the comment --- src/pages/home/report/reportActionPropTypes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/reportActionPropTypes.js b/src/pages/home/report/reportActionPropTypes.js index 30abe19e1a4..8e90b425612 100644 --- a/src/pages/home/report/reportActionPropTypes.js +++ b/src/pages/home/report/reportActionPropTypes.js @@ -24,8 +24,8 @@ export default { IOUTransactionID: PropTypes.string, }), - // Used to indicate the pending state. - // Pending means the addComment request is waiting to be sent to the server. + // If the reportAction is pending, that means we have not yet sent the Report_AddComment command to the server. + // This should most often occur when the client is offline. isPending: PropTypes.bool, // Error message that's come back from the server. From 0e9192dfa9decdceeb6600d851d6deccf867ce42 Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Thu, 26 May 2022 13:44:24 -0700 Subject: [PATCH 8/9] jsdoc style --- src/pages/home/report/reportActionPropTypes.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/home/report/reportActionPropTypes.js b/src/pages/home/report/reportActionPropTypes.js index 8e90b425612..c4400d36c3a 100644 --- a/src/pages/home/report/reportActionPropTypes.js +++ b/src/pages/home/report/reportActionPropTypes.js @@ -3,31 +3,31 @@ import PropTypes from 'prop-types'; import reportActionFragmentPropTypes from './reportActionFragmentPropTypes'; export default { - // Name of the action e.g. ADDCOMMENT + /** Name of the action e.g. ADDCOMMENT */ actionName: PropTypes.string, - // Person who created the action + /** Person who created the action */ person: PropTypes.arrayOf(reportActionFragmentPropTypes), - // ID of the report action + /** ID of the report action */ sequenceNumber: PropTypes.number, - // Unix timestamp + /** Unix timestamp */ timestamp: PropTypes.number, - // report action message + /** report action message */ message: PropTypes.arrayOf(reportActionFragmentPropTypes), - // Original message associated with this action + /** Original message associated with this action */ originalMessage: PropTypes.shape({ // The ID of the iou transaction IOUTransactionID: PropTypes.string, }), - // If the reportAction is pending, that means we have not yet sent the Report_AddComment command to the server. - // This should most often occur when the client is offline. + /** If the reportAction is pending, that means we have not yet sent the Report_AddComment command to the server. + This should most often occur when the client is offline. */ isPending: PropTypes.bool, - // Error message that's come back from the server. + /** Error message that's come back from the server. */ error: PropTypes.string, }; From 8ebac288e44dcab51be71c068b16edcec687949b Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Thu, 26 May 2022 13:44:54 -0700 Subject: [PATCH 9/9] clean up style utilis --- src/styles/StyleUtils.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index c51cd54b52d..ab37cbe68b7 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -399,9 +399,7 @@ function getReportActionItemStyle(isHovered = false, isPending = false) { // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android : colors.transparent, - opacity: isPending - ? 0.5 - : 1, + opacity: isPending ? 0.5 : 1, cursor: 'default', }; }