From aebf5c39870a5e5a66d345bdc5d9c87d8d8e82ee Mon Sep 17 00:00:00 2001 From: Samil Abud Date: Mon, 27 May 2024 20:35:34 -0400 Subject: [PATCH 001/143] Fixed Desktop - Task - Error occurs when update long content for task description for second time --- src/libs/actions/Task.ts | 2 +- src/pages/tasks/TaskDescriptionPage.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index 1d4415f72f4b..41dab874b495 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -435,7 +435,7 @@ function reopenTask(taskReport: OnyxEntry) { function editTask(report: OnyxTypes.Report, {title, description}: OnyxTypes.Task) { // Create the EditedReportAction on the task const editTaskReportAction = ReportUtils.buildOptimisticEditedTaskFieldReportAction({title, description}); - + console.log({editTaskReportAction, len: description?.length}); // Sometimes title or description is undefined, so we need to check for that, and we provide it to multiple functions const reportName = (title ?? report?.reportName)?.trim(); diff --git a/src/pages/tasks/TaskDescriptionPage.tsx b/src/pages/tasks/TaskDescriptionPage.tsx index c48746c81239..7abfaee4d2dd 100644 --- a/src/pages/tasks/TaskDescriptionPage.tsx +++ b/src/pages/tasks/TaskDescriptionPage.tsx @@ -37,9 +37,10 @@ function TaskDescriptionPage({report, currentUserPersonalDetails}: TaskDescripti const validate = useCallback((values: FormOnyxValues): FormInputErrors => { const errors = {}; + const parsedDescription = ReportUtils.getParsedComment(values?.description); - if (values?.description && values.description?.length > CONST.DESCRIPTION_LIMIT) { - ErrorUtils.addErrorMessage(errors, 'description', ['common.error.characterLimitExceedCounter', {length: values.description.length, limit: CONST.DESCRIPTION_LIMIT}]); + if (parsedDescription && parsedDescription?.length > CONST.DESCRIPTION_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'description', ['common.error.characterLimitExceedCounter', {length: parsedDescription.length, limit: CONST.DESCRIPTION_LIMIT}]); } return errors; From c68d70742cfabb299c0233a9bbdea3e4b87a45cf Mon Sep 17 00:00:00 2001 From: Samil Abud Date: Tue, 4 Jun 2024 21:09:07 -0400 Subject: [PATCH 002/143] Fixed eslint issue --- src/libs/actions/Task.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index 063ec053838d..a774a4052980 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -434,7 +434,6 @@ function reopenTask(taskReport: OnyxEntry) { function editTask(report: OnyxTypes.Report, {title, description}: OnyxTypes.Task) { // Create the EditedReportAction on the task const editTaskReportAction = ReportUtils.buildOptimisticEditedTaskFieldReportAction({title, description}); - console.log({editTaskReportAction, len: description?.length}); // Sometimes title or description is undefined, so we need to check for that, and we provide it to multiple functions const reportName = (title ?? report?.reportName)?.trim(); From cc4beab386a8bbbbaafc34fcbc9c613fe9df8f04 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 17 Jun 2024 01:50:20 +0530 Subject: [PATCH 003/143] add missing face emojis from Emoji Version 14.0. Signed-off-by: Krishna Gupta --- assets/emojis/common.ts | 28 ++++++++++++++++++++++++++++ assets/emojis/en.ts | 21 +++++++++++++++++++++ assets/emojis/es.ts | 28 ++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/assets/emojis/common.ts b/assets/emojis/common.ts index c19d958812d1..71acb355b039 100644 --- a/assets/emojis/common.ts +++ b/assets/emojis/common.ts @@ -162,10 +162,26 @@ const emojis: PickerEmojis = [ name: 'hand_over_mouth', code: '🤭', }, + { + name: 'face_with_open_eyes_and_hand_over_mouth', + code: '🫢', + }, + { + name: 'saluting_face', + code: '🫡', + }, { name: 'shushing_face', code: '🤫', }, + { + name: 'face_with_peeking_eye', + code: '🫣', + }, + { + name: 'melting_face', + code: '🫠', + }, { name: 'thinking', code: '🤔', @@ -174,6 +190,10 @@ const emojis: PickerEmojis = [ name: 'zipper_mouth_face', code: '🤐', }, + { + name: 'dotted_line_face', + code: '🫥', + }, { name: 'raised_eyebrow', code: '🤨', @@ -182,6 +202,10 @@ const emojis: PickerEmojis = [ name: 'neutral_face', code: '😐', }, + { + name: 'face_with_diagonal_mouth', + code: '🫤', + }, { name: 'expressionless', code: '😑', @@ -362,6 +386,10 @@ const emojis: PickerEmojis = [ name: 'cold_sweat', code: '😰', }, + { + name: 'face_holding_back_tears', + code: '🥹', + }, { name: 'disappointed_relieved', code: '😥', diff --git a/assets/emojis/en.ts b/assets/emojis/en.ts index 28051e5ecd99..55d3691204d4 100644 --- a/assets/emojis/en.ts +++ b/assets/emojis/en.ts @@ -92,9 +92,21 @@ const enEmojis: EmojisList = { '🤭': { keywords: ['quiet', 'whoops'], }, + '🫡': { + keywords: ['face', 'salute', 'respect', 'military', 'honor'], + }, + '🫣': { + keywords: ['face', 'peek', 'eye', 'curious', 'shy'], + }, + '🫢': { + keywords: ['face', 'open eyes', 'hand over mouth', 'surprised', 'shock'], + }, '🤫': { keywords: ['silence', 'quiet'], }, + '🫠': { + keywords: ['face', 'disappear', 'dissolve', 'liquid', 'melt', 'melting face'], + }, '🤔': { keywords: ['face'], }, @@ -104,9 +116,15 @@ const enEmojis: EmojisList = { '🤨': { keywords: ['suspicious'], }, + '🫥': { + keywords: ['face', 'invisible', 'hidden', 'dotted line', 'disappear'], + }, '😐': { keywords: ['meh', 'deadpan', 'face', 'neutral'], }, + '🫤': { + keywords: ['face', 'diagonal mouth', 'meh', 'neutral', 'uncertain'], + }, '😑': { keywords: ['face', 'inexpressive', 'unexpressive'], }, @@ -242,6 +260,9 @@ const enEmojis: EmojisList = { '😰': { keywords: ['nervous', 'blue', 'cold', 'face', 'mouth', 'open', 'rushed', 'sweat'], }, + '🥹': { + keywords: ['face', 'tears', 'emotional', 'holding back', 'crying'], + }, '😥': { keywords: ['phew', 'sweat', 'nervous', 'disappointed', 'face', 'relieved', 'whew'], }, diff --git a/assets/emojis/es.ts b/assets/emojis/es.ts index 0d23f887f556..63184574e4ee 100644 --- a/assets/emojis/es.ts +++ b/assets/emojis/es.ts @@ -122,10 +122,26 @@ const esEmojis: EmojisList = { name: 'cara_con_mano_sobre_boca', keywords: ['ostras', 'uy', 'vaya', 'cara con mano sobre la boca'], }, + '🫣': { + name: 'cara_espiando', + keywords: ['cara', 'espiar', 'ojo', 'curioso', 'tímido'], + }, + '🫢': { + name: 'cara_con_ojos_abiertos_y_mano_sobre_boca', + keywords: ['cara', 'ojos abiertos', 'mano sobre boca', 'sorprendido', 'choque'], + }, + '🫡': { + name: 'cara_saludando', + keywords: ['cara', 'saludo', 'respeto', 'militar', 'honor'], + }, '🤫': { name: 'calla', keywords: ['callado', 'silencio', 'cara pidiendo silencio'], }, + '🫠': { + name: 'cara_derritiéndose', + keywords: ['calor', 'cara', 'derritiéndose', 'derretido', 'derretirse', 'desaparecer', 'fundirse', 'líquido'], + }, '🤔': { name: 'cara_pensativa', keywords: ['cara', 'duda', 'pensando', 'cara pensativa'], @@ -138,10 +154,18 @@ const esEmojis: EmojisList = { name: 'cara_con_ceja_levantada', keywords: ['desconfiado', 'escéptico', 'cara con ceja alzada'], }, + '🫥': { + name: 'cara_invisible', + keywords: ['cara', 'invisible', 'oculto', 'línea discontinua', 'desaparecer'], + }, '😐': { name: 'cara_neutra', keywords: ['cara', 'inexpresivo', 'neutral'], }, + '🫤': { + name: 'cara_con_boca_diagonal', + keywords: ['cara', 'boca diagonal', 'meh', 'neutral', 'incierto'], + }, '😑': { name: 'inexpresivo', keywords: ['cara', 'inexpresión', 'inexpresiva', 'inexpresivo', 'cara sin expresión'], @@ -322,6 +346,10 @@ const esEmojis: EmojisList = { name: 'sudor_frío', keywords: ['ansiedad', 'cara', 'frío', 'sudor', 'cara con ansiedad y sudor'], }, + '🥹': { + name: 'cara_con_lágrimas', + keywords: ['cara', 'lágrimas', 'emocional', 'contener', 'llorando'], + }, '😥': { name: 'decepcionado_aliviado', keywords: ['aliviado', 'cara', 'decepcionado', 'menos mal', 'cara triste pero aliviada'], From a5fc8013f9394e6e06efa24099411fdf6c78194c Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Wed, 19 Jun 2024 16:26:55 +0530 Subject: [PATCH 004/143] add more missing emojis. Signed-off-by: Krishna Gupta --- assets/emojis/common.ts | 25 +++++++++++++++++++++++++ assets/emojis/en.ts | 15 +++++++++++++++ assets/emojis/es.ts | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/assets/emojis/common.ts b/assets/emojis/common.ts index 71acb355b039..ccfdb779124b 100644 --- a/assets/emojis/common.ts +++ b/assets/emojis/common.ts @@ -734,6 +734,16 @@ const emojis: PickerEmojis = [ code: '🤏', types: ['🤏🏿', '🤏🏾', '🤏🏽', '🤏🏼', '🤏🏻'], }, + { + name: 'palm_down_hand', + code: '🫳', + types: ['🫳🏿', '🫳🏾', '🫳🏽', '🫳🏼', '🫳🏻'], + }, + { + name: 'palm_up_hand', + code: '🫴', + types: ['🫴🏿', '🫴🏾', '🫴🏽', '🫴🏼', '🫴🏻'], + }, { name: 'v', code: '✌️', @@ -744,6 +754,11 @@ const emojis: PickerEmojis = [ code: '🤞', types: ['🤞🏿', '🤞🏾', '🤞🏽', '🤞🏼', '🤞🏻'], }, + { + name: 'hand_with_index_finger_and_thumb_crossed', + code: '🫰', + types: ['🫰🏿', '🫰🏾', '🫰🏽', '🫰🏼', '🫰🏻'], + }, { name: 'love_you_gesture', code: '🤟', @@ -759,6 +774,16 @@ const emojis: PickerEmojis = [ code: '🤙', types: ['🤙🏿', '🤙🏾', '🤙🏽', '🤙🏼', '🤙🏻'], }, + { + name: 'rightwards_hand', + code: '🫱', + types: ['🫱🏿', '🫱🏾', '🫱🏽', '🫱🏼', '🫱🏻'], + }, + { + name: 'leftwards_hand', + code: '🫲', + types: ['🫲🏿', '🫲🏾', '🫲🏽', '🫲🏼', '🫲🏻'], + }, { name: 'point_left', code: '👈', diff --git a/assets/emojis/en.ts b/assets/emojis/en.ts index 55d3691204d4..140f60d690d1 100644 --- a/assets/emojis/en.ts +++ b/assets/emojis/en.ts @@ -515,12 +515,21 @@ const enEmojis: EmojisList = { '🤏': { keywords: [], }, + '🫳': { + keywords: ['hand', 'palm down', 'gesture'], + }, + '🫴': { + keywords: ['hand', 'palm up', 'gesture'], + }, '✌️': { keywords: ['victory', 'peace'], }, '🤞': { keywords: ['luck', 'hopeful', 'cross', 'finger', 'hand'], }, + '🫰': { + keywords: ['hand', 'finger', 'thumb', 'crossed', 'gesture'], + }, '🤟': { keywords: [], }, @@ -530,6 +539,12 @@ const enEmojis: EmojisList = { '🤙': { keywords: ['call', 'hand', 'shaka'], }, + '🫱': { + keywords: ['hand', 'right', 'pointing', 'gesture'], + }, + '🫲': { + keywords: ['hand', 'left', 'pointing', 'gesture'], + }, '👈': { keywords: ['backhand', 'body', 'finger', 'hand', 'index', 'point'], }, diff --git a/assets/emojis/es.ts b/assets/emojis/es.ts index 63184574e4ee..b278cb45405c 100644 --- a/assets/emojis/es.ts +++ b/assets/emojis/es.ts @@ -686,6 +686,14 @@ const esEmojis: EmojisList = { name: 'mano_pellizcando', keywords: ['pellizco', 'poco', 'poquito', 'mano pellizcando'], }, + '🫳': { + name: 'mano_con_palma_hacia_abajo', + keywords: ['mano', 'palma abajo', 'gesto'], + }, + '🫴': { + name: 'mano_con_palma_hacia_arriba', + keywords: ['mano', 'palma arriba', 'gesto'], + }, '✌️': { name: 'v', keywords: ['mano', 'señal de victoria', 'victoria', 'mano con señal de victoria'], @@ -694,6 +702,10 @@ const esEmojis: EmojisList = { name: 'dedos_cruzados', keywords: ['cruzar', 'dedos', 'mano', 'suerte', 'dedos cruzados'], }, + '🫰': { + name: 'mano_con_dedos_cruzados', + keywords: ['mano', 'dedo', 'pulgar', 'cruzado', 'gesto'], + }, '🤟': { name: 'te_amo_en_lenguaje_de_señas', keywords: ['mano', 'quiero', 'gesto de te quiero'], @@ -706,6 +718,14 @@ const esEmojis: EmojisList = { name: 'mano_llámame', keywords: ['llamar', 'mano', 'meñique', 'pulgar', 'mano haciendo el gesto de llamar'], }, + '🫱': { + name: 'mano_derecha', + keywords: ['mano', 'derecha', 'apuntar', 'gesto'], + }, + '🫲': { + name: 'mano_izquierda', + keywords: ['mano', 'izquierda', 'apuntar', 'gesto'], + }, '👈': { name: 'apuntando_hacia_la_izquierda', keywords: ['dedo', 'índice', 'izquierda', 'mano', 'dorso de mano con índice a la izquierda'], From acefc03818729dfb03ef4238bf5a22b3f3771be7 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 24 Jun 2024 02:26:31 +0530 Subject: [PATCH 005/143] add missing emojis from version 14.0. Signed-off-by: Krishna Gupta --- assets/emojis/common.ts | 57 +++++++++++++++++++++++++++++++++++++++++ assets/emojis/en.ts | 39 ++++++++++++++++++++++++++++ assets/emojis/es.ts | 53 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) diff --git a/assets/emojis/common.ts b/assets/emojis/common.ts index ccfdb779124b..01aa80396555 100644 --- a/assets/emojis/common.ts +++ b/assets/emojis/common.ts @@ -854,6 +854,11 @@ const emojis: PickerEmojis = [ code: '🙌', types: ['🙌🏿', '🙌🏾', '🙌🏽', '🙌🏼', '🙌🏻'], }, + { + name: 'heart_hands', + code: '🫶', + types: ['🫶🏿', '🫶🏾', '🫶🏽', '🫶🏼', '🫶🏻'], + }, { name: 'open_hands', code: '👐', @@ -874,6 +879,11 @@ const emojis: PickerEmojis = [ code: '🙏', types: ['🙏🏿', '🙏🏾', '🙏🏽', '🙏🏼', '🙏🏻'], }, + { + name: 'index_pointing_at_the_viewer', + code: '🫵', + types: ['🫵🏿', '🫵🏾', '🫵🏽', '🫵🏼', '🫵🏻'], + }, { name: 'writing_hand', code: '✍️', @@ -963,6 +973,10 @@ const emojis: PickerEmojis = [ name: 'lips', code: '👄', }, + { + name: 'biting_lip', + code: '🫦', + }, { name: 'baby', code: '👶', @@ -1563,6 +1577,11 @@ const emojis: PickerEmojis = [ code: '🤴', types: ['🤴🏿', '🤴🏾', '🤴🏽', '🤴🏼', '🤴🏻'], }, + { + name: 'person_with_crown', + code: '🫅', + types: ['🫅🏿', '🫅🏾', '🫅🏽', '🫅🏼', '🫅🏻'], + }, { name: 'princess', code: '👸', @@ -1628,6 +1647,16 @@ const emojis: PickerEmojis = [ code: '🤰', types: ['🤰🏿', '🤰🏾', '🤰🏽', '🤰🏼', '🤰🏻'], }, + { + name: 'pregnant_person', + code: '🫄', + types: ['🫄🏿', '🫄🏾', '🫄🏽', '🫄🏼', '🫄🏻'], + }, + { + name: 'pregnant_man', + code: '🫃', + types: ['🫃🏿', '🫃🏾', '🫃🏽', '🫃🏼', '🫃🏻'], + }, { name: 'breast_feeding', code: '🤱', @@ -1773,6 +1802,10 @@ const emojis: PickerEmojis = [ code: '🧝‍♀️', types: ['🧝🏿‍♀️', '🧝🏾‍♀️', '🧝🏽‍♀️', '🧝🏼‍♀️', '🧝🏻‍♀️'], }, + { + name: 'troll', + code: '🧌', + }, { name: 'genie', code: '🧞', @@ -2817,6 +2850,10 @@ const emojis: PickerEmojis = [ name: 'shell', code: '🐚', }, + { + name: 'coral', + code: '🪸', + }, { name: 'snail', code: '🐌', @@ -2905,6 +2942,10 @@ const emojis: PickerEmojis = [ name: 'wilted_flower', code: '🥀', }, + { + name: 'lotus', + code: '🪷', + }, { name: 'hibiscus', code: '🌺', @@ -2973,6 +3014,14 @@ const emojis: PickerEmojis = [ name: 'leaves', code: '🍃', }, + { + name: 'nest_with_eggs', + code: '🪺', + }, + { + name: 'empty_nest', + code: '🪹', + }, { header: true, icon: FoodAndDrink, @@ -3110,6 +3159,10 @@ const emojis: PickerEmojis = [ name: 'peanuts', code: '🥜', }, + { + name: 'beans', + code: '🫘', + }, { name: 'chestnut', code: '🌰', @@ -3402,6 +3455,10 @@ const emojis: PickerEmojis = [ name: 'milk_glass', code: '🥛', }, + { + name: 'pouring_liquid', + code: '🫗', + }, { name: 'coffee', code: '☕', diff --git a/assets/emojis/en.ts b/assets/emojis/en.ts index 140f60d690d1..2899780a744b 100644 --- a/assets/emojis/en.ts +++ b/assets/emojis/en.ts @@ -587,6 +587,9 @@ const enEmojis: EmojisList = { '🙌': { keywords: ['hooray', 'body', 'celebration', 'gesture', 'hand', 'raised'], }, + '🫶': { + keywords: ['hand', 'heart', 'gesture', 'love'], + }, '👐': { keywords: ['body', 'hand', 'open'], }, @@ -599,6 +602,9 @@ const enEmojis: EmojisList = { '🙏': { keywords: ['please', 'hope', 'wish', 'ask', 'body', 'bow', 'folded', 'gesture', 'hand', 'thanks'], }, + '🫵': { + keywords: ['hand', 'pointing', 'viewer', 'gesture'], + }, '✍️': { keywords: [], }, @@ -659,6 +665,9 @@ const enEmojis: EmojisList = { '👄': { keywords: ['kiss', 'body', 'mouth'], }, + '🫦': { + keywords: ['biting', 'lip', 'nervous', 'flirt'], + }, '👶': { keywords: ['child', 'newborn'], }, @@ -1019,6 +1028,9 @@ const enEmojis: EmojisList = { '🤴': { keywords: ['crown', 'royal'], }, + '🫅': { + keywords: ['person', 'crown', 'royalty', 'king', 'queen'], + }, '👸': { keywords: ['crown', 'royal', 'fairy tale', 'fantasy'], }, @@ -1058,6 +1070,12 @@ const enEmojis: EmojisList = { '🤰': { keywords: ['pregnant', 'woman'], }, + '🫄': { + keywords: ['pregnant', 'person', 'expecting', 'parent'], + }, + '🫃': { + keywords: ['pregnant', 'man', 'expecting', 'parent'], + }, '🤱': { keywords: ['nursing'], }, @@ -1145,6 +1163,9 @@ const enEmojis: EmojisList = { '🧝‍♀️': { keywords: [], }, + '🧌': { + keywords: ['troll', 'mythical', 'creature', 'fantasy'], + }, '🧞': { keywords: [], }, @@ -1856,6 +1877,9 @@ const enEmojis: EmojisList = { '🐚': { keywords: ['sea', 'beach', 'spiral'], }, + '🪸': { + keywords: ['coral', 'reef', 'sea', 'ocean', 'marine'], + }, '🐌': { keywords: ['slow'], }, @@ -1922,6 +1946,9 @@ const enEmojis: EmojisList = { '🥀': { keywords: ['flower', 'wilted'], }, + '🪷': { + keywords: ['lotus', 'flower', 'bloom', 'plant'], + }, '🌺': { keywords: ['flower', 'plant'], }, @@ -1973,6 +2000,12 @@ const enEmojis: EmojisList = { '🍃': { keywords: ['leaf', 'blow', 'flutter', 'plant', 'wind'], }, + '🪺': { + keywords: ['nest', 'eggs', 'bird', 'home'], + }, + '🪹': { + keywords: ['nest', 'empty', 'bird', 'home'], + }, '🍇': { keywords: ['fruit', 'grape', 'plant'], }, @@ -2072,6 +2105,9 @@ const enEmojis: EmojisList = { '🥜': { keywords: ['nut', 'peanut', 'vegetable'], }, + '🫘': { + keywords: ['beans', 'food', 'legume'], + }, '🌰': { keywords: ['plant'], }, @@ -2291,6 +2327,9 @@ const enEmojis: EmojisList = { '🥛': { keywords: ['drink', 'glass', 'milk'], }, + '🫗': { + keywords: ['pouring', 'liquid', 'drink', 'water'], + }, '☕': { keywords: ['cafe', 'espresso', 'beverage', 'drink', 'hot', 'steaming', 'tea'], }, diff --git a/assets/emojis/es.ts b/assets/emojis/es.ts index b278cb45405c..b8adf182826d 100644 --- a/assets/emojis/es.ts +++ b/assets/emojis/es.ts @@ -782,6 +782,10 @@ const esEmojis: EmojisList = { name: 'manos_levantadas', keywords: ['celebración', 'gesto', 'hurra', 'mano', 'manos levantadas celebrando'], }, + '🫶': { + name: 'manos_haciendo_corazón', + keywords: ['mano', 'corazón', 'gesto', 'amor'], + }, '👐': { name: 'manos_abiertas', keywords: ['abiertas', 'manos'], @@ -798,6 +802,10 @@ const esEmojis: EmojisList = { name: 'rezo', keywords: ['gracias', 'mano', 'oración', 'orar', 'por favor', 'rezar', 'manos en oración'], }, + '🫵': { + name: 'mano_apuntando', + keywords: ['mano', 'apuntar', 'espectador', 'gesto'], + }, '✍️': { name: 'mano_escribiendo', keywords: ['escribir', 'lápiz', 'mano', 'mano escribiendo'], @@ -878,6 +886,10 @@ const esEmojis: EmojisList = { name: 'labios', keywords: ['labios', 'boca'], }, + '🫦': { + name: 'labios_mordiendo', + keywords: ['mordiendo', 'labio', 'nervioso', 'coqueteo'], + }, '👶': { name: 'bebé', keywords: ['joven', 'niño', 'bebé'], @@ -1338,6 +1350,7 @@ const esEmojis: EmojisList = { name: 'guardia_mujer', keywords: ['guardia', 'mujer', 'vigilante'], }, + '🥷': { name: 'ninja', keywords: ['furtivo', 'guerrero', 'luchador', 'oculto', 'sigilo', 'ninja'], @@ -1358,6 +1371,10 @@ const esEmojis: EmojisList = { name: 'príncipe', keywords: ['corona', 'príncipe'], }, + '🫅': { + name: 'persona_con_corona', + keywords: ['persona', 'corona', 'realeza', 'rey', 'reina'], + }, '👸': { name: 'princesa', keywords: ['cuento', 'fantasía', 'hadas', 'princesa'], @@ -1410,6 +1427,14 @@ const esEmojis: EmojisList = { name: 'embarazada', keywords: ['embarazada', 'mujer'], }, + '🫄': { + name: 'persona_embarazada', + keywords: ['embarazado', 'persona', 'esperando', 'padre'], + }, + '🫃': { + name: 'hombre_embarazado', + keywords: ['embarazado', 'hombre', 'esperando', 'padre'], + }, '🤱': { name: 'amamantar', keywords: ['amamantar', 'bebé', 'dar pecho', 'pecho', 'lactancia materna'], @@ -1526,6 +1551,10 @@ const esEmojis: EmojisList = { name: 'elfa', keywords: ['mágico', 'mujer', 'elfa'], }, + '🧌': { + name: 'trol', + keywords: ['trol', 'mítico', 'criatura', 'fantasía'], + }, '🧞': { name: 'genio', keywords: ['lámpara', 'genio'], @@ -2474,6 +2503,10 @@ const esEmojis: EmojisList = { name: 'caracola', keywords: ['concha', 'mar', 'concha de mar'], }, + '🪸': { + name: 'coral', + keywords: ['coral', 'arrecife', 'mar', 'océano', 'marino'], + }, '🐌': { name: 'caracol', keywords: ['caracola', 'molusco', 'caracol'], @@ -2562,6 +2595,10 @@ const esEmojis: EmojisList = { name: 'flor_marchita', keywords: ['flor', 'marchita', 'marchitada', 'marchitarse'], }, + '🪷': { + name: 'flor_de_loto', + keywords: ['loto', 'flor', 'florecer', 'planta'], + }, '🌺': { name: 'hibisco', keywords: ['flor', 'hibisco', 'flor de hibisco'], @@ -2630,6 +2667,14 @@ const esEmojis: EmojisList = { name: 'hojas', keywords: ['hoja', 'revolotear', 'soplar', 'viento', 'hojas revoloteando al viento'], }, + '🪺': { + name: 'nido_con_huevos', + keywords: ['nido', 'huevos', 'pájaro', 'hogar'], + }, + '🪹': { + name: 'nido_vacío', + keywords: ['nido', 'vacío', 'pájaro', 'hogar'], + }, '🍇': { name: 'uvas', keywords: ['agracejo', 'fruta', 'racimo', 'uva', 'uvas'], @@ -2762,6 +2807,10 @@ const esEmojis: EmojisList = { name: 'cacahuetes', keywords: ['cacahuete', 'comida', 'fruto seco', 'verdura', 'cacahuetes'], }, + '🫘': { + name: 'frijoles', + keywords: ['frijoles', 'comida', 'legumbre'], + }, '🌰': { name: 'castaña', keywords: ['castaño', 'fruto seco', 'castaña'], @@ -3054,6 +3103,10 @@ const esEmojis: EmojisList = { name: 'vaso_de_leche', keywords: ['bebida', 'leche', 'vaso', 'vaso de leche'], }, + '🫗': { + name: 'vertiendo_líquido', + keywords: ['vertiendo', 'líquido', 'bebida', 'agua'], + }, '☕': { name: 'café', keywords: ['bebida', 'café', 'caliente', 'té'], From dd5269048d4b89517b443a720dda6df207ca8fc3 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 24 Jun 2024 02:43:27 +0530 Subject: [PATCH 006/143] add missing emojis from version 14.0. Signed-off-by: Krishna Gupta --- assets/emojis/common.ts | 48 +++++++++++++++++++++++++++++++++++++++++ assets/emojis/en.ts | 36 +++++++++++++++++++++++++++++++ assets/emojis/es.ts | 48 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+) diff --git a/assets/emojis/common.ts b/assets/emojis/common.ts index 01aa80396555..386f11060fc6 100644 --- a/assets/emojis/common.ts +++ b/assets/emojis/common.ts @@ -658,6 +658,10 @@ const emojis: PickerEmojis = [ name: 'sweat_drops', code: '💦', }, + { + name: 'bubbles', + code: '🫧', + }, { name: 'dash', code: '💨', @@ -3303,6 +3307,10 @@ const emojis: PickerEmojis = [ name: 'canned_food', code: '🥫', }, + { + name: 'jar', + code: '🫙', + }, { name: 'bento', code: '🍱', @@ -3952,6 +3960,10 @@ const emojis: PickerEmojis = [ name: 'motorized_wheelchair', code: '🦼', }, + { + name: 'crutch', + code: '🩼', + }, { name: 'auto_rickshaw', code: '🛺', @@ -3972,6 +3984,10 @@ const emojis: PickerEmojis = [ name: 'roller_skate', code: '🛼', }, + { + name: 'wheel', + code: '🛞', + }, { name: 'busstop', code: '🚏', @@ -4044,6 +4060,10 @@ const emojis: PickerEmojis = [ name: 'ship', code: '🚢', }, + { + name: 'ring_buoy', + code: '🛟', + }, { name: 'airplane', code: '✈️', @@ -4477,6 +4497,10 @@ const emojis: PickerEmojis = [ name: 'wind_chime', code: '🎐', }, + { + name: 'mirror_ball', + code: '🪩', + }, { name: 'rice_scene', code: '🎑', @@ -4649,6 +4673,10 @@ const emojis: PickerEmojis = [ name: 'kite', code: '🪁', }, + { + name: 'playground_slide', + code: '🛝', + }, { name: '8ball', code: '🎱', @@ -4665,6 +4693,10 @@ const emojis: PickerEmojis = [ name: 'nazar_amulet', code: '🧿', }, + { + name: 'hamsa', + code: '🪬', + }, { name: 'video_game', code: '🎮', @@ -5078,6 +5110,10 @@ const emojis: PickerEmojis = [ name: 'battery', code: '🔋', }, + { + name: 'low_battery', + code: '🪫', + }, { name: 'electric_plug', code: '🔌', @@ -5290,6 +5326,10 @@ const emojis: PickerEmojis = [ name: 'credit_card', code: '💳', }, + { + name: 'identification_card', + code: '🪪', + }, { name: 'receipt', code: '🧾', @@ -5618,6 +5658,10 @@ const emojis: PickerEmojis = [ name: 'telescope', code: '🔭', }, + { + name: 'x_ray', + code: '🩻', + }, { name: 'satellite', code: '📡', @@ -6179,6 +6223,10 @@ const emojis: PickerEmojis = [ name: 'heavy_division_sign', code: '➗', }, + { + name: 'heavy_equals_sign', + code: '🟰', + }, { name: 'infinity', code: '♾️', diff --git a/assets/emojis/en.ts b/assets/emojis/en.ts index 2899780a744b..312e9e3fb64a 100644 --- a/assets/emojis/en.ts +++ b/assets/emojis/en.ts @@ -464,6 +464,9 @@ const enEmojis: EmojisList = { '💦': { keywords: ['water', 'workout', 'comic', 'splashing', 'sweat'], }, + '🫧': { + keywords: ['bubbles', 'soap', 'water', 'float'], + }, '💨': { keywords: ['wind', 'blow', 'fast', 'comic', 'running'], }, @@ -2213,6 +2216,9 @@ const enEmojis: EmojisList = { '🥫': { keywords: [], }, + '🫙': { + keywords: ['jar', 'container', 'storage'], + }, '🍱': { keywords: ['box'], }, @@ -2696,6 +2702,9 @@ const enEmojis: EmojisList = { '🦼': { keywords: [], }, + '🩼': { + keywords: ['crutch', 'support', 'injury', 'aid'], + }, '🛺': { keywords: [], }, @@ -2711,6 +2720,9 @@ const enEmojis: EmojisList = { '🛼': { keywords: [], }, + '🛞': { + keywords: ['wheel', 'vehicle', 'transportation'], + }, '🚏': { keywords: ['bus', 'stop'], }, @@ -2765,6 +2777,9 @@ const enEmojis: EmojisList = { '🚢': { keywords: ['vehicle'], }, + '🛟': { + keywords: ['ring', 'buoy', 'lifesaver', 'safety'], + }, '✈️': { keywords: ['flight', 'vehicle'], }, @@ -3086,6 +3101,9 @@ const enEmojis: EmojisList = { '🎐': { keywords: ['activity', 'bell', 'celebration', 'chime', 'entertainment', 'wind'], }, + '🪩': { + keywords: ['mirror', 'ball', 'disco', 'party'], + }, '🎑': { keywords: ['activity', 'celebration', 'ceremony', 'entertainment', 'moon'], }, @@ -3215,6 +3233,9 @@ const enEmojis: EmojisList = { '🪁': { keywords: [], }, + '🛝': { + keywords: ['playground', 'slide', 'play', 'park'], + }, '🎱': { keywords: ['pool', 'billiards', '8', '8 ball', 'ball', 'billiard', 'eight', 'game'], }, @@ -3227,6 +3248,9 @@ const enEmojis: EmojisList = { '🧿': { keywords: [], }, + '🪬': { + keywords: ['hamsa', 'hand', 'protection', 'luck'], + }, '🎮': { keywords: ['play', 'controller', 'console', 'entertainment', 'game', 'video game'], }, @@ -3533,6 +3557,9 @@ const enEmojis: EmojisList = { '🔋': { keywords: ['power'], }, + '🪫': { + keywords: ['low', 'battery', 'power', 'charge'], + }, '🔌': { keywords: ['electric', 'electricity', 'plug'], }, @@ -3692,6 +3719,9 @@ const enEmojis: EmojisList = { '💳': { keywords: ['subscription', 'bank', 'card', 'credit', 'money'], }, + '🪪': { + keywords: ['identification', 'card', 'ID', 'document'], + }, '🧾': { keywords: [], }, @@ -3938,6 +3968,9 @@ const enEmojis: EmojisList = { '🔭': { keywords: ['tool'], }, + '🩻': { + keywords: ['x-ray', 'medical', 'scan', 'radiology'], + }, '📡': { keywords: ['signal', 'antenna', 'communication', 'dish'], }, @@ -4355,6 +4388,9 @@ const enEmojis: EmojisList = { '➗': { keywords: ['division', 'math'], }, + '🟰': { + keywords: ['equals', 'sign', 'math', 'symbol'], + }, '♾️': { keywords: [], }, diff --git a/assets/emojis/es.ts b/assets/emojis/es.ts index b8adf182826d..783f838110eb 100644 --- a/assets/emojis/es.ts +++ b/assets/emojis/es.ts @@ -618,6 +618,10 @@ const esEmojis: EmojisList = { name: 'gotas_de_sudor', keywords: ['cómic', 'emoción', 'sudor', 'gotas de sudor'], }, + '🫧': { + name: 'burbujas', + keywords: ['burbujas', 'jabón', 'agua', 'flotar'], + }, '💨': { name: 'guión', keywords: ['carrera', 'cómic', 'correr', 'humo', 'salir corriendo'], @@ -2951,6 +2955,10 @@ const esEmojis: EmojisList = { name: 'comida_enlatada', keywords: ['conserva', 'lata', 'comida enlatada'], }, + '🫙': { + name: 'jarra', + keywords: ['jarra', 'contenedor', 'almacenamiento'], + }, '🍱': { name: 'bento', keywords: ['bento', 'caja', 'comida', 'restaurante', 'caja de bento'], @@ -3595,6 +3603,10 @@ const esEmojis: EmojisList = { name: 'silla_de_ruedas_eléctrica', keywords: ['accesibilidad', 'silla de ruedas eléctrica'], }, + '🩼': { + name: 'muleta', + keywords: ['muleta', 'soporte', 'lesión', 'ayuda'], + }, '🛺': { name: 'mototaxi', keywords: ['rickshaw', 'tuk tuk', 'mototaxi'], @@ -3615,6 +3627,10 @@ const esEmojis: EmojisList = { name: 'patines', keywords: ['patín', 'patín de 4 ruedas', 'patín de cuatro ruedas', 'patines'], }, + '🛞': { + name: 'rueda', + keywords: ['rueda', 'vehículo', 'transporte'], + }, '🚏': { name: 'parada_de_autobús', keywords: ['autobús', 'parada', 'parada de autobús'], @@ -3687,6 +3703,10 @@ const esEmojis: EmojisList = { name: 'barco', keywords: ['vehículo', 'barco'], }, + '🛟': { + name: 'aro_salvavidas', + keywords: ['aro', 'salvavidas', 'seguridad'], + }, '✈️': { name: 'avión', keywords: ['aeroplano', 'avión'], @@ -4115,6 +4135,10 @@ const esEmojis: EmojisList = { name: 'campanilla_de_viento', keywords: ['campanilla', 'furin', 'viento', 'campanilla de viento'], }, + '🪩': { + name: 'bola_de_disco', + keywords: ['bola', 'espejo', 'disco', 'fiesta'], + }, '🎑': { name: 'espiga_de_arroz', keywords: ['celebración', 'contemplación', 'luna', 'tsukimi', 'ceremonia de contemplación de la luna'], @@ -4287,6 +4311,10 @@ const esEmojis: EmojisList = { name: 'cometa', keywords: ['juguete', 'planear', 'viento', 'volar', 'cometa'], }, + '🛝': { + name: 'resbaladilla', + keywords: ['parque', 'resbaladilla', 'jugar', 'parque'], + }, '🎱': { name: 'bola_ocho', keywords: ['8', 'billar', 'bola ocho', 'juego', 'bola negra de billar'], @@ -4303,6 +4331,10 @@ const esEmojis: EmojisList = { name: 'ojo_turco', keywords: ['amuleto', 'mal de ojo', 'nazar', 'talismán', 'ojo turco'], }, + '🪬': { + name: 'hamsa', + keywords: ['hamsa', 'mano', 'protección', 'suerte'], + }, '🎮': { name: 'videojuego', keywords: ['juego', 'mando', 'videojuego', 'mando de videoconsola'], @@ -4711,6 +4743,10 @@ const esEmojis: EmojisList = { name: 'batería', keywords: ['batería', 'pila'], }, + '🪫': { + name: 'batería_baja', + keywords: ['bajo', 'batería', 'poder', 'carga'], + }, '🔌': { name: 'enchufe_eléctrico', keywords: ['corriente', 'electricidad', 'eléctrico', 'enchufe'], @@ -4923,6 +4959,10 @@ const esEmojis: EmojisList = { name: 'tarjeta_de_crédito', keywords: ['crédito', 'tarjeta', 'tarjeta de crédito'], }, + '🪪': { + name: 'tarjeta_de_identificación', + keywords: ['identificación', 'tarjeta', 'ID', 'documento'], + }, '🧾': { name: 'recibo', keywords: ['contabilidad', 'prueba', 'teneduría de libros', 'testimonio', 'recibo'], @@ -5251,6 +5291,10 @@ const esEmojis: EmojisList = { name: 'telescopio', keywords: ['astronomía', 'instrumento', 'telescopio'], }, + '🩻': { + name: 'rayos_x', + keywords: ['rayos x', 'médico', 'escáner', 'radiología'], + }, '📡': { name: 'antena_de_satélite', keywords: ['antena', 'comunicación', 'satélite', 'antena de satélite'], @@ -5807,6 +5851,10 @@ const esEmojis: EmojisList = { name: 'signo_de_división_grueso', keywords: ['÷', 'signo', 'signo de división', 'división'], }, + '🟰': { + name: 'signo_igual', + keywords: ['igual', 'signo', 'matemáticas', 'símbolo'], + }, '♾️': { name: 'infinito', keywords: ['ilimitado', 'siempre', 'universal', 'infinito'], From 464d3a6bd44fbc396b82dc293c81e46051ad1081 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Fri, 28 Jun 2024 17:45:25 +0530 Subject: [PATCH 007/143] add missing emojis from version 15.0 & 15.1. Signed-off-by: Krishna Gupta --- assets/emojis/common.ts | 217 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) diff --git a/assets/emojis/common.ts b/assets/emojis/common.ts index 386f11060fc6..f4bac5544c5f 100644 --- a/assets/emojis/common.ts +++ b/assets/emojis/common.ts @@ -210,6 +210,10 @@ const emojis: PickerEmojis = [ name: 'expressionless', code: '😑', }, + { + name: 'shaking_face', + code: '🫨', + }, { name: 'no_mouth', code: '😶', @@ -226,6 +230,10 @@ const emojis: PickerEmojis = [ name: 'unamused', code: '😒', }, + { + name: 'head_shaking_horizontally', + code: '🙂‍↔️', + }, { name: 'roll_eyes', code: '🙄', @@ -318,6 +326,10 @@ const emojis: PickerEmojis = [ name: 'partying_face', code: '🥳', }, + { + name: 'head_shaking_vertically', + code: '🙂‍↕️', + }, { name: 'disguised_face', code: '🥸', @@ -606,6 +618,18 @@ const emojis: PickerEmojis = [ name: 'heart', code: '❤️', }, + { + name: 'pink_heart', + code: '🩷', + }, + { + name: 'light_blue_heart', + code: '🩵', + }, + { + name: 'grey_heart', + code: '🩶', + }, { name: 'orange_heart', code: '🧡', @@ -848,6 +872,16 @@ const emojis: PickerEmojis = [ code: '🤜', types: ['🤜🏿', '🤜🏾', '🤜🏽', '🤜🏼', '🤜🏻'], }, + { + name: 'leftwards_pushing_hand', + code: '🫷', + types: ['🫷🏿', '🫷🏾', '🫷🏽', '🫷🏼', '🫷🏻'], + }, + { + name: 'rightwards_pushing_hand', + code: '🫸', + types: ['🫸🏿', '🫸🏾', '🫸🏽', '🫸🏼', '🫸🏻'], + }, { name: 'clap', code: '👏', @@ -1996,6 +2030,96 @@ const emojis: PickerEmojis = [ name: 'dancing_women', code: '👯‍♀️', }, + { + name: 'person_walking_facing_right', + code: '🚶‍➡️', + types: ['🚶🏿‍➡️', '🚶🏾‍➡️', '🚶🏽‍➡️', '🚶🏼‍➡️', '🚶🏻‍➡️'], + }, + { + name: 'woman_walking_facing_right', + code: '🚶‍♀️‍➡️', + types: ['🚶🏿‍♀️‍➡️', '🚶🏾‍♀️‍➡️', '🚶🏽‍♀️‍➡️', '🚶🏼‍♀️‍➡️', '🚶🏻‍♀️‍➡️'], + }, + { + name: 'man_walking_facing_right', + code: '🚶‍♂️‍➡️', + types: ['🚶🏿‍♂️‍➡️', '🚶🏾‍♂️‍➡️', '🚶🏽‍♂️‍➡️', '🚶🏼‍♂️‍➡️', '🚶🏻‍♂️‍➡️'], + }, + { + name: 'person_kneeling_facing_right', + code: '🧎‍➡️', + types: ['🧎🏿‍➡️', '🧎🏾‍➡️', '🧎🏽‍➡️', '🧎🏼‍➡️', '🧎🏻‍➡️'], + }, + { + name: 'woman_kneeling_facing_right', + code: '🧎‍♀️‍➡️', + types: ['🧎🏿‍♀️‍➡️', '🧎🏾‍♀️‍➡️', '🧎🏽‍♀️‍➡️', '🧎🏼‍♀️‍➡️', '🧎🏻‍♀️‍➡️'], + }, + { + name: 'man_kneeling_facing_right', + code: '🧎‍♂️‍➡️', + types: ['🧎🏿‍♂️‍➡️', '🧎🏾‍♂️‍➡️', '🧎🏽‍♂️‍➡️', '🧎🏼‍♂️‍➡️', '🧎🏻‍♂️‍➡️'], + }, + { + name: 'person_with_white_cane_facing_right', + code: '🧑‍🦯‍➡️', + types: ['🧑🏿‍🦯‍➡️', '🧑🏾‍🦯‍➡️', '🧑🏽‍🦯‍➡️', '🧑🏼‍🦯‍➡️', '🧑🏻‍🦯‍➡️'], + }, + { + name: 'man_with_white_cane_facing_right', + code: '👨‍🦯‍➡️', + types: ['👨🏿‍🦯‍➡️', '👨🏾‍🦯‍➡️', '👨🏽‍🦯‍➡️', '👨🏼‍🦯‍➡️', '👨🏻‍🦯‍➡️'], + }, + { + name: 'woman_with_white_cane_facing_right', + code: '👩‍🦯‍➡️', + types: ['👩🏿‍🦯‍➡️', '👩🏾‍🦯‍➡️', '👩🏽‍🦯‍➡️', '👩🏼‍🦯‍➡️', '👩🏻‍🦯‍➡️'], + }, + { + name: 'person_in_motorized_wheelchair_facing_right', + code: '🧑‍🦼‍➡️', + types: ['🧑🏿‍🦼‍➡️', '🧑🏾‍🦼‍➡️', '🧑🏽‍🦼‍➡️', '🧑🏼‍🦼‍➡️', '🧑🏻‍🦼‍➡️'], + }, + { + name: 'man_in_motorized_wheelchair_facing_right', + code: '👨‍🦼‍➡️', + types: ['👨🏿‍🦼‍➡️', '👨🏾‍🦼‍➡️', '👨🏽‍🦼‍➡️', '👨🏼‍🦼‍➡️', '👨🏻‍🦼‍➡️'], + }, + { + name: 'woman_in_motorized_wheelchair_facing_right', + code: '👩‍🦼‍➡️', + types: ['👩🏿‍🦼‍➡️', '👩🏾‍🦼‍➡️', '👩🏽‍🦼‍➡️', '👩🏼‍🦼‍➡️', '👩🏻‍🦼‍➡️'], + }, + { + name: 'person_in_manual_wheelchair_facing_right', + code: '🧑‍🦽‍➡️', + types: ['🧑🏿‍🦽‍➡️', '🧑🏾‍🦽‍➡️', '🧑🏽‍🦽‍➡️', '🧑🏼‍🦽‍➡️', '🧑🏻‍🦽‍➡️'], + }, + { + name: 'man_in_manual_wheelchair_facing_right', + code: '👨‍🦽‍➡️', + types: ['👨🏿‍🦽‍➡️', '👨🏾‍🦽‍➡️', '👨🏽‍🦽‍➡️', '👨🏼‍🦽‍➡️', '👨🏻‍🦽‍➡️'], + }, + { + name: 'woman_in_manual_wheelchair_facing_right', + code: '👩‍🦽‍➡️', + types: ['👩🏿‍🦽‍➡️', '👩🏾‍🦽‍➡️', '👩🏽‍🦽‍➡️', '👩🏼‍🦽‍➡️', '👩🏻‍🦽‍➡️'], + }, + { + name: 'person_running_facing_right', + code: '🏃‍➡️', + types: ['🏃🏿‍➡️', '🏃🏾‍➡️', '🏃🏽‍➡️', '🏃🏼‍➡️', '🏃🏻‍➡️'], + }, + { + name: 'woman_running_facing_right', + code: '🏃‍♀️‍➡️', + types: ['🏃🏿‍♀️‍➡️', '🏃🏾‍♀️‍➡️', '🏃🏽‍♀️‍➡️', '🏃🏼‍♀️‍➡️', '🏃🏻‍♀️‍➡️'], + }, + { + name: 'man_running_facing_right', + code: '🏃‍♂️‍➡️', + types: ['🏃🏿‍♂️‍➡️', '🏃🏾‍♂️‍➡️', '🏃🏽‍♂️‍➡️', '🏃🏼‍♂️‍➡️', '🏃🏻‍♂️‍➡️'], + }, { name: 'sauna_person', code: '🧖', @@ -2538,6 +2662,34 @@ const emojis: PickerEmojis = [ name: 'unicorn', code: '🦄', }, + { + name: 'moose', + code: '🫎', + }, + { + name: 'donkey', + code: '🫏', + }, + { + name: 'wing', + code: '🪽', + }, + { + name: 'black_bird', + code: '🐦‍⬛', + }, + { + name: 'goose', + code: '🪿', + }, + { + name: 'jellyfish', + code: '🪼', + }, + { + name: 'hyacinth', + code: '🪻', + }, { name: 'zebra', code: '🦓', @@ -2806,6 +2958,10 @@ const emojis: PickerEmojis = [ name: 'dragon', code: '🐉', }, + { + name: 'phoenix', + code: '🐦‍🔥', + }, { name: 'sauropod', code: '🦕', @@ -3051,6 +3207,10 @@ const emojis: PickerEmojis = [ name: 'lemon', code: '🍋', }, + { + name: 'lime', + code: '🍋‍🟩', + }, { name: 'banana', code: '🍌', @@ -3159,6 +3319,10 @@ const emojis: PickerEmojis = [ name: 'mushroom', code: '🍄', }, + { + name: 'brown_mushroom', + code: '🍄‍🟫', + }, { name: 'peanuts', code: '🥜', @@ -3343,6 +3507,14 @@ const emojis: PickerEmojis = [ name: 'sweet_potato', code: '🍠', }, + { + name: 'ginger', + code: '🫚', + }, + { + name: 'pea_pod', + code: '🫛', + }, { name: 'oden', code: '🍢', @@ -4489,6 +4661,10 @@ const emojis: PickerEmojis = [ name: 'dolls', code: '🎎', }, + { + name: 'folding_hand_fan', + code: '🪭', + }, { name: 'flags', code: '🎏', @@ -5062,6 +5238,10 @@ const emojis: PickerEmojis = [ name: 'musical_keyboard', code: '🎹', }, + { + name: 'maracas', + code: '🪇', + }, { name: 'trumpet', code: '🎺', @@ -5070,6 +5250,10 @@ const emojis: PickerEmojis = [ name: 'violin', code: '🎻', }, + { + name: 'flute', + code: '🪈', + }, { name: 'banjo', code: '🪕', @@ -5618,6 +5802,10 @@ const emojis: PickerEmojis = [ name: 'chains', code: '⛓️', }, + { + name: 'broken_chain', + code: '⛓️‍💥', + }, { name: 'hook', code: '🪝', @@ -5738,6 +5926,10 @@ const emojis: PickerEmojis = [ name: 'razor', code: '🪒', }, + { + name: 'hair_pick', + code: '🪮', + }, { name: 'lotion_bottle', code: '🧴', @@ -5843,6 +6035,22 @@ const emojis: PickerEmojis = [ name: 'baby_symbol', code: '🚼', }, + { + name: 'family_adult_adult_child', + code: '🧑‍🧑‍🧒', + }, + { + name: 'family_adult_adult_child_child', + code: '🧑‍🧑‍🧒‍🧒', + }, + { + name: 'family_adult_child', + code: '🧑‍🧒', + }, + { + name: 'family_adult_child_child', + code: '🧑‍🧒‍🧒', + }, { name: 'wc', code: '🚾', @@ -5863,6 +6071,10 @@ const emojis: PickerEmojis = [ name: 'left_luggage', code: '🛅', }, + { + name: 'wireless', + code: '🛜', + }, { name: 'warning', code: '⚠️', @@ -6019,6 +6231,11 @@ const emojis: PickerEmojis = [ name: 'wheel_of_dharma', code: '☸️', }, + { + name: 'khanda', + code: '🪯', + }, + { name: 'yin_yang', code: '☯️', From a62428dfdac3088fcc0adf62780c5a18c338ddd0 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Fri, 28 Jun 2024 18:03:09 +0530 Subject: [PATCH 008/143] fix EmojiTest.ts. Signed-off-by: Krishna Gupta --- tests/unit/EmojiTest.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/EmojiTest.ts b/tests/unit/EmojiTest.ts index 968e543363f2..471dd181a24e 100644 --- a/tests/unit/EmojiTest.ts +++ b/tests/unit/EmojiTest.ts @@ -162,6 +162,11 @@ describe('EmojiTest', () => { it('correct suggests emojis accounting for keywords', () => { const thumbEmojis: Emoji[] = [ + { + name: 'hand_with_index_finger_and_thumb_crossed', + code: '🫰', + types: ['🫰🏿', '🫰🏾', '🫰🏽', '🫰🏼', '🫰🏻'], + }, { code: '👍', name: '+1', From 50cfa4c1fef58f6fda2a656701331a53ecfd9ac9 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Fri, 28 Jun 2024 18:06:53 +0530 Subject: [PATCH 009/143] fix EmojiTest.ts. Signed-off-by: Krishna Gupta --- tests/unit/EmojiTest.ts | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/unit/EmojiTest.ts b/tests/unit/EmojiTest.ts index 471dd181a24e..664f6c97afe4 100644 --- a/tests/unit/EmojiTest.ts +++ b/tests/unit/EmojiTest.ts @@ -161,7 +161,7 @@ describe('EmojiTest', () => { }); it('correct suggests emojis accounting for keywords', () => { - const thumbEmojis: Emoji[] = [ + const thumbEmojisEn: Emoji[] = [ { name: 'hand_with_index_finger_and_thumb_crossed', code: '🫰', @@ -179,9 +179,27 @@ describe('EmojiTest', () => { }, ]; - expect(EmojiUtils.suggestEmojis(':thumb', 'en')).toEqual(thumbEmojis); + const thumbEmojisEs: Emoji[] = [ + { + name: 'mano_con_dedos_cruzados', + code: '🫰', + types: ['🫰🏿', '🫰🏾', '🫰🏽', '🫰🏼', '🫰🏻'], + }, + { + code: '👍', + name: '+1', + types: ['👍🏿', '👍🏾', '👍🏽', '👍🏼', '👍🏻'], + }, + { + code: '👎', + name: '-1', + types: ['👎🏿', '👎🏾', '👎🏽', '👎🏼', '👎🏻'], + }, + ]; + + expect(EmojiUtils.suggestEmojis(':thumb', 'en')).toEqual(thumbEmojisEn); - expect(EmojiUtils.suggestEmojis(':thumb', 'es')).toEqual(thumbEmojis); + expect(EmojiUtils.suggestEmojis(':thumb', 'es')).toEqual(thumbEmojisEs); expect(EmojiUtils.suggestEmojis(':pulgar', 'es')).toEqual([ { From cb75c287712dec6ee12f906e2d0a229a01b189f9 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Fri, 28 Jun 2024 18:31:12 +0530 Subject: [PATCH 010/143] fix EmojiTest.ts. Signed-off-by: Krishna Gupta --- tests/unit/EmojiTest.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/EmojiTest.ts b/tests/unit/EmojiTest.ts index 664f6c97afe4..fbc75f9ae24f 100644 --- a/tests/unit/EmojiTest.ts +++ b/tests/unit/EmojiTest.ts @@ -202,6 +202,11 @@ describe('EmojiTest', () => { expect(EmojiUtils.suggestEmojis(':thumb', 'es')).toEqual(thumbEmojisEs); expect(EmojiUtils.suggestEmojis(':pulgar', 'es')).toEqual([ + { + name: 'hand_with_index_finger_and_thumb_crossed', + code: '🫰', + types: ['🫰🏿', '🫰🏾', '🫰🏽', '🫰🏼', '🫰🏻'], + }, { code: '🤙', name: 'mano_llámame', From e1edff0292f592fbb6de921befb06da66fdfd0e1 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Fri, 28 Jun 2024 18:37:20 +0530 Subject: [PATCH 011/143] fix EmojiTest.ts. Signed-off-by: Krishna Gupta --- tests/unit/EmojiTest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/EmojiTest.ts b/tests/unit/EmojiTest.ts index fbc75f9ae24f..ef4a590c061f 100644 --- a/tests/unit/EmojiTest.ts +++ b/tests/unit/EmojiTest.ts @@ -203,7 +203,7 @@ describe('EmojiTest', () => { expect(EmojiUtils.suggestEmojis(':pulgar', 'es')).toEqual([ { - name: 'hand_with_index_finger_and_thumb_crossed', + name: 'mano_con_dedos_cruzados', code: '🫰', types: ['🫰🏿', '🫰🏾', '🫰🏽', '🫰🏼', '🫰🏻'], }, From 7ad0af4ac8f76c4770fcd4b55af352e97fcff892 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:27:00 +0200 Subject: [PATCH 012/143] feat: add offline pattern B for manual report exports --- src/languages/en.ts | 8 +- src/languages/types.ts | 2 +- .../API/parameters/MarkAsExportedParams.ts | 1 + src/libs/API/parameters/ReportExportParams.ts | 1 + src/libs/ReportActionsUtils.ts | 2 +- src/libs/ReportUtils.ts | 72 ++++++++++++++++ src/libs/actions/Report.ts | 83 ++++++++++++++++++- 7 files changed, 162 insertions(+), 7 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index aef5372f76b1..053956043215 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3059,7 +3059,13 @@ export default { changeType: ({oldType, newType}: ChangeTypeParams) => `changed type from ${oldType} to ${newType}`, delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `sent this report to ${delegateUser} since ${originalManager} is on vacation`, exportedToCSV: `exported this report to CSV`, - exportedToIntegration: ({label}: ExportedToIntegrationParams) => `exported this report to ${label}`, + exportedToIntegration: ({label, markedManually}: ExportedToIntegrationParams) => { + if (markedManually) { + // TODO: Verify translation - it was taken from the backend response, and it is needed here for the optimistic response + return `You marked this report as manually exported to`; + } + return `exported this report to ${label}`; + }, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, integrationsMessage: ({errorMessage, label}: IntegrationsMessageParams) => `failed to export this report to ${label}. ${errorMessage}`, managerAttachReceipt: `added a receipt`, diff --git a/src/languages/types.ts b/src/languages/types.ts index eb90f2d9e0b2..f6ff01894368 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -306,7 +306,7 @@ type ChangeTypeParams = {oldType: string; newType: string}; type DelegateSubmitParams = {delegateUser: string; originalManager: string}; -type ExportedToIntegrationParams = {label: string}; +type ExportedToIntegrationParams = {label: string; markedManually: boolean}; type ForwardedParams = {amount: string; currency: string}; diff --git a/src/libs/API/parameters/MarkAsExportedParams.ts b/src/libs/API/parameters/MarkAsExportedParams.ts index 03348e856b15..09f5c4cf2e61 100644 --- a/src/libs/API/parameters/MarkAsExportedParams.ts +++ b/src/libs/API/parameters/MarkAsExportedParams.ts @@ -1,6 +1,7 @@ type MarkAsExportedParams = { reportIDList: string; markedManually: true; + optimisticReportActionID: string; }; export default MarkAsExportedParams; diff --git a/src/libs/API/parameters/ReportExportParams.ts b/src/libs/API/parameters/ReportExportParams.ts index dc87ce2170c4..ff626059a036 100644 --- a/src/libs/API/parameters/ReportExportParams.ts +++ b/src/libs/API/parameters/ReportExportParams.ts @@ -5,6 +5,7 @@ type ReportExportParams = { reportIDList: string; connectionName: ValueOf; type: 'MANUAL'; + optimisticReportActionID: string; }; export default ReportExportParams; diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 63a56633edc6..a1dbb446ecd9 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1258,7 +1258,7 @@ function getMessageOfOldDotReportAction(oldDotAction: PartialReportAction | OldD case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_CSV: return Localize.translateLocal('report.actions.type.exportedToCSV'); case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION: - return Localize.translateLocal('report.actions.type.exportedToIntegration', {label: originalMessage.label}); + return Localize.translateLocal('report.actions.type.exportedToIntegration', {label: originalMessage.label, markedManually: originalMessage.markedManually}); case CONST.REPORT.ACTIONS.TYPE.INTEGRATIONS_MESSAGE: { const {errorMessage, label} = originalMessage; return Localize.translateLocal('report.actions.type.integrationsMessage', {errorMessage, label}); diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 3fd4749bbd88..69fb101a841e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -276,6 +276,23 @@ type OptimisticChatReport = Pick< isOptimisticReport: true; }; +type OptimisticExportAction = Pick< + ReportAction, + | 'reportActionID' + | 'actionName' + | 'actorAccountID' + | 'avatar' + | 'created' + | 'lastModified' + | 'message' + | 'originalMessage' + | 'person' + | 'shouldShow' + | 'pendingAction' + | 'errors' + | 'automatic' +>; + type OptimisticTaskReportAction = Pick< ReportAction, | 'reportActionID' @@ -5109,6 +5126,60 @@ function buildOptimisticTaskReport( }; } +// function buildOptimisticCreatedReportAction(emailCreatingAction: string, created = DateUtils.getDBTime()): OptimisticCreatedReportAction { +// return { +// reportActionID: NumberUtils.rand64(), +// actionName: CONST.REPORT.ACTIONS.TYPE.CREATED, +// pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, +// actorAccountID: currentUserAccountID, +// message: [ +// { +// type: CONST.REPORT.MESSAGE.TYPE.TEXT, +// style: 'strong', +// text: emailCreatingAction, +// }, +// { +// type: CONST.REPORT.MESSAGE.TYPE.TEXT, +// style: 'normal', +// text: ' created this report', +// }, +// ], +// person: [ +// { +// type: CONST.REPORT.MESSAGE.TYPE.TEXT, +// style: 'strong', +// text: getCurrentUserDisplayNameOrEmail(), +// }, +// ], +// automatic: false, +// avatar: getCurrentUserAvatar(), +// created, +// shouldShow: true, +// }; +// } + +// Manual export +function buildOptimisticExportIntegrationAction(label = '', markedManually = false): OptimisticExportAction { + return { + reportActionID: NumberUtils.rand64(), + actionName: CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION, + pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, + actorAccountID: currentUserAccountID, + message: [], + person: [], + automatic: false, + avatar: getCurrentUserAvatar(), + created: DateUtils.getDBTime(), + shouldShow: true, + originalMessage: { + automaticAction: false, + label, + lastModified: DateUtils.getDBTime(), + markedManually, + }, + }; +} + /** * A helper method to create transaction thread * @@ -7341,6 +7412,7 @@ export { changeMoneyRequestHoldStatus, createDraftWorkspaceAndNavigateToConfirmationScreen, isChatUsedForOnboarding, + buildOptimisticExportIntegrationAction, getChatUsedForOnboarding, findPolicyExpenseChatByPolicyID, getIntegrationIcon, diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index f63639673083..f318bd2c1dce 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3735,22 +3735,97 @@ function setGroupDraft(newGroupDraft: Partial) { } function exportToIntegration(reportID: string, connectionName: ConnectionName) { - API.write(WRITE_COMMANDS.REPORT_EXPORT, { + const action = ReportUtils.buildOptimisticExportIntegrationAction(connectionName); + const optimisticReportActionID = action.reportActionID; + + const optimisticData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + [optimisticReportActionID]: action, + }, + }, + ]; + + const successData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + [optimisticReportActionID]: null, + }, + }, + ]; + const failureData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + [optimisticReportActionID]: { + errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'), + }, + }, + }, + ]; + + const params = { // TODO: Update it when backend is ready // eslint-disable-next-line @typescript-eslint/naming-convention 'reportIDList[]': reportID, connectionName, type: 'MANUAL', - }); + optimisticReportActionID, + }; + + API.write(WRITE_COMMANDS.REPORT_EXPORT, params, {optimisticData, successData, failureData}); } function markAsManuallyExported(reportID: string) { - API.write(WRITE_COMMANDS.MARK_AS_EXPORTED, { + const action = ReportUtils.buildOptimisticExportIntegrationAction(undefined, true); + const optimisticReportActionID = action.reportActionID; + + const optimisticData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + [optimisticReportActionID]: action, + }, + }, + ]; + + const successData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + [optimisticReportActionID]: null, + }, + }, + ]; + + const failureData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + [optimisticReportActionID]: { + errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'), + }, + }, + }, + ]; + + const params = { // TODO: Update it when backend is ready // eslint-disable-next-line @typescript-eslint/naming-convention 'reportIDList[]': reportID, markedManually: true, - }); + optimisticReportActionID, + }; + + API.write(WRITE_COMMANDS.MARK_AS_EXPORTED, params, {optimisticData, successData, failureData}); } /** Save the preferred export method for a policy */ From 533097ae4c5123725a3f156388850d14a5b02198 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:26:25 +0200 Subject: [PATCH 013/143] cleanup --- src/libs/ReportUtils.ts | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index a792c485f46f..71056ebf1bd4 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5152,38 +5152,6 @@ function buildOptimisticTaskReport( }; } -// function buildOptimisticCreatedReportAction(emailCreatingAction: string, created = DateUtils.getDBTime()): OptimisticCreatedReportAction { -// return { -// reportActionID: NumberUtils.rand64(), -// actionName: CONST.REPORT.ACTIONS.TYPE.CREATED, -// pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, -// actorAccountID: currentUserAccountID, -// message: [ -// { -// type: CONST.REPORT.MESSAGE.TYPE.TEXT, -// style: 'strong', -// text: emailCreatingAction, -// }, -// { -// type: CONST.REPORT.MESSAGE.TYPE.TEXT, -// style: 'normal', -// text: ' created this report', -// }, -// ], -// person: [ -// { -// type: CONST.REPORT.MESSAGE.TYPE.TEXT, -// style: 'strong', -// text: getCurrentUserDisplayNameOrEmail(), -// }, -// ], -// automatic: false, -// avatar: getCurrentUserAvatar(), -// created, -// shouldShow: true, -// }; -// } - // Manual export function buildOptimisticExportIntegrationAction(label = '', markedManually = false): OptimisticExportAction { return { From 0c88e4b0e420facfd42fb414d5a4547c96fd1dcd Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 4 Jul 2024 23:06:43 +0800 Subject: [PATCH 014/143] fix onModalHide isn't called --- src/components/EmojiPicker/EmojiPicker.tsx | 7 ++----- src/libs/actions/EmojiPickerAction.ts | 2 +- .../report/ReportActionCompose/ReportActionCompose.tsx | 7 ++++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/EmojiPicker/EmojiPicker.tsx b/src/components/EmojiPicker/EmojiPicker.tsx index 2be8ea4aea7a..86207361bb0f 100644 --- a/src/components/EmojiPicker/EmojiPicker.tsx +++ b/src/components/EmojiPicker/EmojiPicker.tsx @@ -40,7 +40,7 @@ function EmojiPicker({viewportOffsetTop}: EmojiPickerProps, ref: ForwardedRef {}); + const onModalHide = useRef(() => {}); const onEmojiSelected = useRef(() => {}); const activeEmoji = useRef(); const emojiSearchInput = useRef(); @@ -107,13 +107,10 @@ function EmojiPicker({viewportOffsetTop}: EmojiPickerProps, ref: ForwardedRef { - if (isNavigating) { - onModalHide.current = () => {}; - } const currOnModalHide = onModalHide.current; onModalHide.current = () => { if (currOnModalHide) { - currOnModalHide(); + currOnModalHide(!!isNavigating); } emojiPopoverAnchorRef.current = null; }; diff --git a/src/libs/actions/EmojiPickerAction.ts b/src/libs/actions/EmojiPickerAction.ts index 787f105e4939..e6123733b0e8 100644 --- a/src/libs/actions/EmojiPickerAction.ts +++ b/src/libs/actions/EmojiPickerAction.ts @@ -16,7 +16,7 @@ type EmojiPopoverAnchor = MutableRefObject void; -type OnModalHideValue = () => void; +type OnModalHideValue = (isNavigating?: boolean) => void; type EmojiPickerRef = { showEmojiPicker: ( diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx index 8dcb5e199ba1..c4e4bdd6951e 100644 --- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx +++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx @@ -480,7 +480,12 @@ function ReportActionCompose({ {DeviceCapabilities.canUseTouchScreen() && isMediumScreenWidth ? null : ( { + if (isNavigating) { + return; + } + focus(); + }} onEmojiSelected={(...args) => composerRef.current?.replaceSelectionWithText(...args)} emojiPickerID={report?.reportID} shiftVertical={emojiShiftVertical} From bb1eb9f4215f230aa9207d540956aa58ad20edc8 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 4 Jul 2024 23:06:52 +0800 Subject: [PATCH 015/143] remove freeze capture --- src/pages/home/report/ReportActionItem.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 2264feddd679..d740a2a04ddc 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -876,7 +876,6 @@ function ReportActionItem({ accessible > From 1425235363fbdbf93bdd21e9760b076ac0b25a4e Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Thu, 4 Jul 2024 15:02:05 +0200 Subject: [PATCH 016/143] fix: rbr --- src/components/ReportActionItem/ReportPreview.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 53b8ecd9a47e..2161067e06c3 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -154,7 +154,7 @@ function ReportPreview({ const hasReceipts = transactionsWithReceipts.length > 0; const isScanning = hasReceipts && areAllRequestsBeingSmartScanned; const hasErrors = - hasMissingSmartscanFields || + (hasMissingSmartscanFields && !iouSettled) || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing (canUseViolations && (ReportUtils.hasViolations(iouReportID, transactionViolations) || ReportUtils.hasWarningTypeViolations(iouReportID, transactionViolations))) || ReportUtils.hasActionsWithErrors(iouReportID); @@ -283,7 +283,7 @@ function ReportPreview({ const shouldShowSettlementButton = (shouldShowPayButton || shouldShowApproveButton) && !showRTERViolationMessage; const shouldPromptUserToAddBankAccount = ReportUtils.hasMissingPaymentMethod(userWallet, iouReportID); - const shouldShowRBR = !iouSettled && hasErrors; + const shouldShowRBR = hasErrors; /* Show subtitle if at least one of the expenses is not being smart scanned, and either: From 652ce3684fbabac2b99dce791c5a37763a471403 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:49:59 +0200 Subject: [PATCH 017/143] feat: add in progress status --- src/languages/en.ts | 1 + src/languages/types.ts | 2 +- src/libs/ReportActionsUtils.ts | 6 +++++- src/libs/ReportUtils.ts | 24 +++++++----------------- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 85bcae07530c..966a25a9623c 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3235,6 +3235,7 @@ export default { } return `exported this report to ${label}`; }, + exportInProgress: ({label}: ExportedToIntegrationParams) => `started exporting this report to ${label}...`, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, integrationsMessage: (errorMessage: string, label: string) => `failed to export this report to ${label} ("${errorMessage}").`, managerAttachReceipt: `added a receipt`, diff --git a/src/languages/types.ts b/src/languages/types.ts index caf44a73bd3b..397c35651e82 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -308,7 +308,7 @@ type ChangeTypeParams = {oldType: string; newType: string}; type DelegateSubmitParams = {delegateUser: string; originalManager: string}; -type ExportedToIntegrationParams = {label: string; markedManually: boolean}; +type ExportedToIntegrationParams = {label: string; markedManually?: boolean; inProgress?: boolean; lastModified?: string}; type ForwardedParams = {amount: string; currency: string}; diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index b7e13c929056..bac669f63ec9 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1257,8 +1257,12 @@ function getMessageOfOldDotReportAction(oldDotAction: PartialReportAction | OldD } case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_CSV: return Localize.translateLocal('report.actions.type.exportedToCSV'); - case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION: + case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION: { + if (originalMessage.inProgress) { + return Localize.translateLocal('report.actions.type.exportInProgress', {label: originalMessage.label}); + } return Localize.translateLocal('report.actions.type.exportedToIntegration', {label: originalMessage.label, markedManually: originalMessage.markedManually}); + } case CONST.REPORT.ACTIONS.TYPE.INTEGRATIONS_MESSAGE: { const {result, label} = originalMessage; const errorMessage = result?.messages?.join(', ') ?? ''; diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 11ca6edf239e..a9d583a9b6cd 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -39,6 +39,7 @@ import type { UserWallet, } from '@src/types/onyx'; import type {Participant} from '@src/types/onyx/IOU'; +import {OriginalMessageExportedToIntegration} from '@src/types/onyx/OldDotAction'; import type {Errors, Icon, PendingAction} from '@src/types/onyx/OnyxCommon'; import type {OriginalMessageChangeLog, PaymentMethodType} from '@src/types/onyx/OriginalMessage'; import type {Status} from '@src/types/onyx/PersonalDetails'; @@ -276,22 +277,11 @@ type OptimisticChatReport = Pick< isOptimisticReport: true; }; -type OptimisticExportAction = Pick< - ReportAction, - | 'reportActionID' - | 'actionName' - | 'actorAccountID' - | 'avatar' - | 'created' - | 'lastModified' - | 'message' - | 'originalMessage' - | 'person' - | 'shouldShow' - | 'pendingAction' - | 'errors' - | 'automatic' ->; +type OptimisticExportAction = OriginalMessageExportedToIntegration & + Pick< + ReportAction, + 'reportActionID' | 'actorAccountID' | 'avatar' | 'created' | 'lastModified' | 'message' | 'person' | 'shouldShow' | 'pendingAction' | 'errors' | 'automatic' + >; type OptimisticTaskReportAction = Pick< ReportAction, @@ -5196,10 +5186,10 @@ function buildOptimisticExportIntegrationAction(label = '', markedManually = fal created: DateUtils.getDBTime(), shouldShow: true, originalMessage: { - automaticAction: false, label, lastModified: DateUtils.getDBTime(), markedManually, + inProgress: true, }, }; } From 42b923c67c185e427c4fb21bcc687820dc335fbf Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:35:24 +0200 Subject: [PATCH 018/143] fix lang --- src/languages/en.ts | 2 +- src/libs/ReportUtils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index b63b093ead9d..846a9af5b734 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3351,7 +3351,7 @@ export default { } return `exported this report to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}`; }, - exportInProgress: ({label}: ExportedToIntegrationParams) => `started exporting this report to ${label}...`, + exportInProgress: ({label}: ExportedToIntegrationParams) => `started exporting this report to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}...`, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, integrationsMessage: (errorMessage: string, label: string) => `failed to export this report to ${label} ("${errorMessage}").`, managerAttachReceipt: `added a receipt`, diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index e050799e0c0f..e15d3abfbb0d 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5126,7 +5126,7 @@ function buildOptimisticTaskReport( } // Manual export -function buildOptimisticExportIntegrationAction(label = '', markedManually = false): OptimisticExportAction { +function buildOptimisticExportIntegrationAction(label: ConnectionName, markedManually = false): OptimisticExportAction { return { reportActionID: NumberUtils.rand64(), actionName: CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION, From 98c74431ddad2176730073c8a047f7b1f12d651f Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:19:01 +0200 Subject: [PATCH 019/143] fixes --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index fb7fda9db7f1..1069cba9b73a 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5123,7 +5123,7 @@ function buildOptimisticTaskReport( } // Manual export -function buildOptimisticExportIntegrationAction(label: ConnectionName, markedManually = false): OptimisticExportAction { +function buildOptimisticExportIntegrationAction(label?: ConnectionName, markedManually = false): OptimisticExportAction { return { reportActionID: NumberUtils.rand64(), actionName: CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION, From e24a9176a0ecf7007c99d595106a6f17e8fd7fea Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 11 Jul 2024 14:29:38 +0500 Subject: [PATCH 020/143] fix: archived reports are unable to mark as read --- src/pages/home/report/ReportActionsList.tsx | 32 ++++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 1ea58028c69f..5e06659e1d62 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -171,7 +171,8 @@ function ReportActionsList({ const userActiveSince = useRef(null); const lastMessageTime = useRef(null); - const [isVisible, setIsVisible] = useState(false); + const [isVisible, setIsVisible] = useState(Visibility.isVisible()); + const hasCalledReadNewestAction = useRef(false); const isFocused = useIsFocused(); useEffect(() => { @@ -261,6 +262,9 @@ function ReportActionsList({ if (!userActiveSince.current || report.reportID !== prevReportID) { return; } + if (hasCalledReadNewestAction.current) { + return; + } if (ReportUtils.isUnread(report)) { // On desktop, when the notification center is displayed, Visibility.isVisible() will return false. // Currently, there's no programmatic way to dismiss the notification center panel. @@ -269,6 +273,7 @@ function ReportActionsList({ if ((Visibility.isVisible() || isFromNotification) && scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD) { Report.readNewestAction(report.reportID); Navigation.setParams({referrer: undefined}); + hasCalledReadNewestAction.current = true; } else { readActionSkipped.current = true; } @@ -516,6 +521,10 @@ function ReportActionsList({ return; } + if (hasCalledReadNewestAction.current) { + return; + } + if (!isVisible || !isFocused) { if (!lastMessageTime.current) { lastMessageTime.current = sortedVisibleReportActions[0]?.created ?? ''; @@ -527,24 +536,25 @@ function ReportActionsList({ // show marker based on report.lastReadTime const newMessageTimeReference = lastMessageTime.current && report.lastReadTime && lastMessageTime.current > report.lastReadTime ? userActiveSince.current : report.lastReadTime; lastMessageTime.current = null; - if ( - scrollingVerticalOffset.current >= MSG_VISIBLE_THRESHOLD || - !sortedVisibleReportActions.some( - (reportAction) => - newMessageTimeReference && - newMessageTimeReference < reportAction.created && - (ReportActionsUtils.isReportPreviewAction(reportAction) ? reportAction.childLastActorAccountID : reportAction.actorAccountID) !== Report.getCurrentUserAccountID(), - ) - ) { + const isSome = sortedVisibleReportActions.some((reportAction) => { + const isTimeLesserOrEqual = ReportUtils.isArchivedRoom(report) + ? newMessageTimeReference && newMessageTimeReference <= reportAction.created + : newMessageTimeReference && newMessageTimeReference < reportAction.created; + return ( + isTimeLesserOrEqual && + (ReportActionsUtils.isReportPreviewAction(reportAction) ? reportAction.childLastActorAccountID : reportAction.actorAccountID) !== Report.getCurrentUserAccountID() + ); + }); + if (scrollingVerticalOffset.current >= MSG_VISIBLE_THRESHOLD || !isSome) { return; } - Report.readNewestAction(report.reportID); userActiveSince.current = DateUtils.getDBTime(); lastReadTimeRef.current = newMessageTimeReference; setCurrentUnreadMarker(null); cacheUnreadMarkers.delete(report.reportID); calculateUnreadMarker(); + hasCalledReadNewestAction.current = true; // This effect logic to `mark as read` will only run when the report focused has new messages and the App visibility // is changed to visible(meaning user switched to app/web, while user was previously using different tab or application). From 29665f7c6784379e7b41b658ed480ae872bff048 Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 11 Jul 2024 14:41:59 +0500 Subject: [PATCH 021/143] refactor: renamve variable and add comments --- src/pages/home/report/ReportActionsList.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 5e06659e1d62..5ae633a00b4c 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -536,7 +536,12 @@ function ReportActionsList({ // show marker based on report.lastReadTime const newMessageTimeReference = lastMessageTime.current && report.lastReadTime && lastMessageTime.current > report.lastReadTime ? userActiveSince.current : report.lastReadTime; lastMessageTime.current = null; - const isSome = sortedVisibleReportActions.some((reportAction) => { + const areSomeReportActionsUnread = sortedVisibleReportActions.some((reportAction) => { + /** + * In case of archived reports, we have `newMessageTimeReference` equal to `reportAction.created`. + * So the condition should be `<=` to mark the report as read. We will only use this condition when + * the report is archived to not introduce any regression for other reports. + */ const isTimeLesserOrEqual = ReportUtils.isArchivedRoom(report) ? newMessageTimeReference && newMessageTimeReference <= reportAction.created : newMessageTimeReference && newMessageTimeReference < reportAction.created; @@ -545,7 +550,7 @@ function ReportActionsList({ (ReportActionsUtils.isReportPreviewAction(reportAction) ? reportAction.childLastActorAccountID : reportAction.actorAccountID) !== Report.getCurrentUserAccountID() ); }); - if (scrollingVerticalOffset.current >= MSG_VISIBLE_THRESHOLD || !isSome) { + if (scrollingVerticalOffset.current >= MSG_VISIBLE_THRESHOLD || !areSomeReportActionsUnread) { return; } Report.readNewestAction(report.reportID); From 94cea2e1fe1508f5718e4fe2a2e8c31b43686743 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Fri, 12 Jul 2024 15:38:52 +0800 Subject: [PATCH 022/143] keep action highlighted when payment method popover is visible --- src/components/ButtonWithDropdownMenu/index.tsx | 8 +++++++- src/components/PopoverMenu.tsx | 2 ++ src/components/ReportActionItem/ReportPreview.tsx | 4 ++++ src/components/SettlementButton.tsx | 4 ++++ src/pages/home/report/ReportActionItem.tsx | 5 ++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index 094c26a2b387..94ffdf7de188 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -31,6 +31,8 @@ function ButtonWithDropdownMenu({ onPress, options, onOptionSelected, + onOptionsMenuShow, + onOptionsMenuHide, enterKeyEventListenerPriority = 0, wrapperStyle, }: ButtonWithDropdownMenuProps) { @@ -136,7 +138,11 @@ function ButtonWithDropdownMenu({ {(shouldAlwaysShowDropdownMenu || options.length > 1) && popoverAnchorPosition && ( setIsMenuVisible(false)} + onClose={() => { + setIsMenuVisible(false) + onOptionsMenuHide(); + }} + onModalShow={onOptionsMenuShow} onItemSelected={() => setIsMenuVisible(false)} anchorPosition={popoverAnchorPosition} anchorRef={caretButton} diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 0f97a3c4414f..0efc54889a3f 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -89,6 +89,7 @@ function PopoverMenu({ anchorPosition, anchorRef, onClose, + onModalShow, headerText, fromSidebarMediumScreen, anchorAlignment = { @@ -204,6 +205,7 @@ function PopoverMenu({ }} isVisible={isVisible} onModalHide={onModalHide} + onModalShow={onModalShow} animationIn={animationIn} animationOut={animationOut} animationInTiming={animationInTiming} diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 4a145d4e79e9..c93016b87af7 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -105,6 +105,8 @@ function ReportPreview({ isHovered = false, isWhisper = false, checkIfContextMenuActive = () => {}, + onPaymentOptionsShow = () => {}, + onPaymentOptionsHide = () => {}, userWallet, }: ReportPreviewProps) { const theme = useTheme(); @@ -411,6 +413,8 @@ function ReportPreview({ chatReportID={chatReportID} iouReport={iouReport} onPress={confirmPayment} + onPaymentOptionsShow={onPaymentOptionsShow} + onPaymentOptionsHide={onPaymentOptionsHide} confirmApproval={confirmApproval} enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS} addBankAccountRoute={bankAccountRoute} diff --git a/src/components/SettlementButton.tsx b/src/components/SettlementButton.tsx index 7c3c021a08eb..036a8cfe061f 100644 --- a/src/components/SettlementButton.tsx +++ b/src/components/SettlementButton.tsx @@ -140,6 +140,8 @@ function SettlementButton({ enterKeyEventListenerPriority = 0, confirmApproval, policy, + onPaymentOptionsShow, + onPaymentOptionsHide, }: SettlementButtonProps) { const {translate} = useLocalize(); const {isOffline} = useNetwork(); @@ -273,6 +275,8 @@ function SettlementButton({ {(triggerKYCFlow, buttonRef) => ( success + onOptionsMenuShow={onPaymentOptionsShow} + onOptionsMenuHide={onPaymentOptionsHide} buttonRef={buttonRef} shouldAlwaysShowDropdownMenu={isInvoiceReport} customText={isInvoiceReport ? translate('iou.settlePayment', {formattedAmount}) : undefined} diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 3df1511dc8ce..f1cfd4a1d59c 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -193,6 +193,7 @@ function ReportActionItem({ const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; const [isContextMenuActive, setIsContextMenuActive] = useState(() => ReportActionContextMenu.isActiveReportAction(action.reportActionID)); const [isEmojiPickerActive, setIsEmojiPickerActive] = useState(); + const [isPaymentMethodPopoverActive, setIsPaymentMethodPopoverActive] = useState(); const [isHidden, setIsHidden] = useState(false); const [moderationDecision, setModerationDecision] = useState(CONST.MODERATION.MODERATOR_DECISION_APPROVED); @@ -563,6 +564,8 @@ function ReportActionItem({ isHovered={hovered} contextMenuAnchor={popoverAnchorRef.current} checkIfContextMenuActive={toggleContextMenuFromActiveReportAction} + onPaymentOptionsShow={() => setIsPaymentMethodPopoverActive(true)} + onPaymentOptionsHide={() => setIsPaymentMethodPopoverActive(false)} isWhisper={isWhisper} /> ); @@ -922,7 +925,7 @@ function ReportActionItem({ )} From 8df8c62c36e057aad516d31f471d5b688ffbe1a7 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Fri, 12 Jul 2024 18:29:05 +0800 Subject: [PATCH 023/143] fix typing --- src/components/ButtonWithDropdownMenu/index.tsx | 2 +- src/components/ButtonWithDropdownMenu/types.ts | 6 ++++++ src/components/PopoverMenu.tsx | 3 +++ src/components/ReportActionItem/ReportPreview.tsx | 10 ++++++++-- src/components/SettlementButton.tsx | 6 ++++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index 94ffdf7de188..2f662045097e 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -140,7 +140,7 @@ function ButtonWithDropdownMenu({ isVisible={isMenuVisible} onClose={() => { setIsMenuVisible(false) - onOptionsMenuHide(); + onOptionsMenuHide?.(); }} onModalShow={onOptionsMenuShow} onItemSelected={() => setIsMenuVisible(false)} diff --git a/src/components/ButtonWithDropdownMenu/types.ts b/src/components/ButtonWithDropdownMenu/types.ts index d1eedd560694..5d7e0a80b364 100644 --- a/src/components/ButtonWithDropdownMenu/types.ts +++ b/src/components/ButtonWithDropdownMenu/types.ts @@ -42,6 +42,12 @@ type ButtonWithDropdownMenuProps = { /** Callback to execute when a dropdown option is selected */ onOptionSelected?: (option: DropdownOption) => void; + /** Callback when the options popover is shown */ + onOptionsMenuShow?: () => void; + + /** Callback when the options popover is shown */ + onOptionsMenuHide?: () => void; + /** Call the onPress function on main button when Enter key is pressed */ pressOnEnter?: boolean; diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 0efc54889a3f..653571e642ab 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -42,6 +42,9 @@ type PopoverMenuProps = Partial & { /** Callback method fired when the user requests to close the modal */ onClose: () => void; + /** Callback method fired when the modal is shown */ + onModalShow?: () => void; + /** State that determines whether to display the modal or not */ isVisible: boolean; diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index c93016b87af7..7c8f52d2d523 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -83,6 +83,12 @@ type ReportPreviewProps = ReportPreviewOnyxProps & { /** Callback for updating context menu active state, used for showing context menu */ checkIfContextMenuActive?: () => void; + /** Callback when the payment options popover is shown */ + onPaymentOptionsShow?: () => void; + + /** Callback when the payment options popover is closed */ + onPaymentOptionsHide?: () => void; + /** Whether a message is a whisper */ isWhisper?: boolean; @@ -105,8 +111,8 @@ function ReportPreview({ isHovered = false, isWhisper = false, checkIfContextMenuActive = () => {}, - onPaymentOptionsShow = () => {}, - onPaymentOptionsHide = () => {}, + onPaymentOptionsShow, + onPaymentOptionsHide, userWallet, }: ReportPreviewProps) { const theme = useTheme(); diff --git a/src/components/SettlementButton.tsx b/src/components/SettlementButton.tsx index 036a8cfe061f..d1803f403469 100644 --- a/src/components/SettlementButton.tsx +++ b/src/components/SettlementButton.tsx @@ -43,6 +43,12 @@ type SettlementButtonProps = SettlementButtonOnyxProps & { /** Callback to execute when this button is pressed. Receives a single payment type argument. */ onPress: (paymentType?: PaymentMethodType) => void; + /** Callback when the payment options popover is shown */ + onPaymentOptionsShow?: () => void; + + /** Callback when the payment options popover is closed */ + onPaymentOptionsHide?: () => void; + /** The route to redirect if user does not have a payment method setup */ enablePaymentsRoute: EnablePaymentsRoute; From a1a6dd741c8ed382e15b7461916f3224a67491d9 Mon Sep 17 00:00:00 2001 From: Samil Abud Date: Fri, 12 Jul 2024 13:53:03 -0400 Subject: [PATCH 024/143] Restoring new line erased (nit) --- src/libs/actions/Task.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index 1162d364f059..964f5be0129b 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -494,6 +494,7 @@ function reopenTask(taskReport: OnyxEntry) { function editTask(report: OnyxTypes.Report, {title, description}: OnyxTypes.Task) { // Create the EditedReportAction on the task const editTaskReportAction = ReportUtils.buildOptimisticEditedTaskFieldReportAction({title, description}); + // Sometimes title or description is undefined, so we need to check for that, and we provide it to multiple functions const reportName = (title ?? report?.reportName)?.trim(); From 972f91075f0d02e43097f8b070e0e6439ca9df6e Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:39:21 +0200 Subject: [PATCH 025/143] cleanup --- .../ExportWithDropdownMenu.tsx | 4 ++-- src/languages/en.ts | 6 +++--- src/libs/ReportActionsUtils.ts | 2 +- src/libs/ReportUtils.ts | 9 +++++++-- src/libs/actions/Report.ts | 18 ++++++++---------- .../home/report/ReportDetailsExportPage.tsx | 2 +- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/components/ReportActionItem/ExportWithDropdownMenu.tsx b/src/components/ReportActionItem/ExportWithDropdownMenu.tsx index a13c0a266689..87ddb3b42bf0 100644 --- a/src/components/ReportActionItem/ExportWithDropdownMenu.tsx +++ b/src/components/ReportActionItem/ExportWithDropdownMenu.tsx @@ -74,7 +74,7 @@ function ExportWithDropdownMenu({policy, report, connectionName}: ExportWithDrop if (modalStatus === CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION) { ReportActions.exportToIntegration(reportID, connectionName); } else if (modalStatus === CONST.REPORT.EXPORT_OPTIONS.MARK_AS_EXPORTED) { - ReportActions.markAsManuallyExported(reportID); + ReportActions.markAsManuallyExported(reportID, connectionName); } }, [connectionName, modalStatus, reportID]); @@ -106,7 +106,7 @@ function ExportWithDropdownMenu({policy, report, connectionName}: ExportWithDrop if (value === CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION) { ReportActions.exportToIntegration(reportID, connectionName); } else if (value === CONST.REPORT.EXPORT_OPTIONS.MARK_AS_EXPORTED) { - ReportActions.markAsManuallyExported(reportID); + ReportActions.markAsManuallyExported(reportID, connectionName); } }} onOptionSelected={({value}) => savePreferredExportMethod(value)} diff --git a/src/languages/en.ts b/src/languages/en.ts index d8cb0862485b..77d9c1a13b92 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3608,11 +3608,11 @@ export default { delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `sent this report to ${delegateUser} since ${originalManager} is on vacation`, exportedToCSV: `exported this report to CSV`, exportedToIntegration: ({label, markedManually}: ExportedToIntegrationParams) => { + const friendlyLabel = CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label; if (markedManually) { - // TODO: Verify translation - it was taken from the backend response, and it is needed here for the optimistic response - return `You marked this report as manually exported to`; + return `You marked this report as manually exported to ${friendlyLabel}`; } - return `exported this report to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}`; + return `exported this report to ${friendlyLabel}`; }, exportInProgress: ({label}: ExportedToIntegrationParams) => `started exporting this report to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}...`, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 1c2ef82154b6..00ed22886700 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1221,7 +1221,7 @@ function getMessageOfOldDotReportAction(oldDotAction: PartialReportAction | OldD case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_CSV: return Localize.translateLocal('report.actions.type.exportedToCSV'); case CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION: { - if (originalMessage.inProgress) { + if (originalMessage.inProgress && !originalMessage.markedManually) { return Localize.translateLocal('report.actions.type.exportInProgress', {label: originalMessage.label}); } return Localize.translateLocal('report.actions.type.exportedToIntegration', {label: originalMessage.label, markedManually: originalMessage.markedManually}); diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index aaf81bd97e06..a26d440f14d9 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -40,7 +40,7 @@ import type { UserWallet, } from '@src/types/onyx'; import type {Participant} from '@src/types/onyx/IOU'; -import {OriginalMessageExportedToIntegration} from '@src/types/onyx/OldDotAction'; +import type {OriginalMessageExportedToIntegration} from '@src/types/onyx/OldDotAction'; import type Onboarding from '@src/types/onyx/Onboarding'; import type {Errors, Icon, PendingAction} from '@src/types/onyx/OnyxCommon'; import type {OriginalMessageChangeLog, PaymentMethodType} from '@src/types/onyx/OriginalMessage'; @@ -5138,7 +5138,12 @@ function buildOptimisticTaskReport( }; } -// Manual export +/** + * Builds an optimistic EXPORTED_TO_INTEGRATION report action + * + * @param label - The connectionName of the integration + * @param markedManually - Whether the integration was marked as manually exported + */ function buildOptimisticExportIntegrationAction(label: ConnectionName, markedManually = false): OptimisticExportAction { return { reportActionID: NumberUtils.rand64(), diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 29b5866ff5ba..56d982694614 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -24,6 +24,7 @@ import type { InviteToGroupChatParams, InviteToRoomParams, LeaveRoomParams, + MarkAsExportedParams, MarkAsUnreadParams, OpenReportParams, OpenRoomMembersPageParams, @@ -31,6 +32,7 @@ import type { RemoveEmojiReactionParams, RemoveFromGroupChatParams, RemoveFromRoomParams, + ReportExportParams, ResolveActionableMentionWhisperParams, ResolveActionableReportMentionWhisperParams, SearchForReportsParams, @@ -3814,19 +3816,17 @@ function exportToIntegration(reportID: string, connectionName: ConnectionName) { ]; const params = { - // TODO: Update it when backend is ready - // eslint-disable-next-line @typescript-eslint/naming-convention - 'reportIDList[]': reportID, + reportIDList: reportID, connectionName, type: 'MANUAL', optimisticReportActionID, - }; + } satisfies ReportExportParams; API.write(WRITE_COMMANDS.REPORT_EXPORT, params, {optimisticData, successData, failureData}); } -function markAsManuallyExported(reportID: string) { - const action = ReportUtils.buildOptimisticExportIntegrationAction(undefined, true); +function markAsManuallyExported(reportID: string, connectionName: ConnectionName) { + const action = ReportUtils.buildOptimisticExportIntegrationAction(connectionName, true); const optimisticReportActionID = action.reportActionID; const optimisticData: OnyxUpdate[] = [ @@ -3862,12 +3862,10 @@ function markAsManuallyExported(reportID: string) { ]; const params = { - // TODO: Update it when backend is ready - // eslint-disable-next-line @typescript-eslint/naming-convention - 'reportIDList[]': reportID, + reportIDList: reportID, markedManually: true, optimisticReportActionID, - }; + } satisfies MarkAsExportedParams; API.write(WRITE_COMMANDS.MARK_AS_EXPORTED, params, {optimisticData, successData, failureData}); } diff --git a/src/pages/home/report/ReportDetailsExportPage.tsx b/src/pages/home/report/ReportDetailsExportPage.tsx index 99b7305cc7a9..6f16786682af 100644 --- a/src/pages/home/report/ReportDetailsExportPage.tsx +++ b/src/pages/home/report/ReportDetailsExportPage.tsx @@ -45,7 +45,7 @@ function ReportDetailsExportPage({route}: ReportDetailsExportPageProps) { if (type === CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION) { ReportActions.exportToIntegration(reportID, connectionName); } else if (type === CONST.REPORT.EXPORT_OPTIONS.MARK_AS_EXPORTED) { - ReportActions.markAsManuallyExported(reportID); + ReportActions.markAsManuallyExported(reportID, connectionName); } setModalStatus(null); Navigation.dismissModal(); From 37a7735259a2e3bbe3e434585bab41f123b64467 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:04:49 +0200 Subject: [PATCH 026/143] add DeepL translations --- src/languages/en.ts | 5 ++--- src/languages/es.ts | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 77d9c1a13b92..84440f748cd3 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3608,11 +3608,10 @@ export default { delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `sent this report to ${delegateUser} since ${originalManager} is on vacation`, exportedToCSV: `exported this report to CSV`, exportedToIntegration: ({label, markedManually}: ExportedToIntegrationParams) => { - const friendlyLabel = CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label; if (markedManually) { - return `You marked this report as manually exported to ${friendlyLabel}`; + return `You marked this report as manually exported to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}`; } - return `exported this report to ${friendlyLabel}`; + return `exported this report to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}`; }, exportInProgress: ({label}: ExportedToIntegrationParams) => `started exporting this report to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}...`, forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`, diff --git a/src/languages/es.ts b/src/languages/es.ts index 055dcf043ef4..9dd1832592d5 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3662,7 +3662,13 @@ export default { changeType: ({oldType, newType}: ChangeTypeParams) => `cambió type de ${oldType} a ${newType}`, delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `envié este informe a ${delegateUser} ya que ${originalManager} está de vacaciones`, exportedToCSV: `exportó este informe a CSV`, - exportedToIntegration: ({label}: ExportedToIntegrationParams) => `exportó este informe a ${label}`, + exportedToIntegration: ({label, markedManually}: ExportedToIntegrationParams) => { + if (markedManually) { + return `Ha marcado este informe como exportado manualmente a ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}`; + } + return `exportó este informe a ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}`; + }, + exportInProgress: ({label}: ExportedToIntegrationParams) => `comenzado a exportar este informe a ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[label] ?? label}...`, forwarded: ({amount, currency}: ForwardedParams) => `aprobado ${currency}${amount}`, integrationsMessage: (errorMessage: string, label: string) => `no se pudo exportar este informe a ${label} ("${errorMessage}").`, managerAttachReceipt: `agregó un recibo`, From fdcd82718f81c1c2e495c462d4671a389ca617f0 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Wed, 17 Jul 2024 08:38:36 +0200 Subject: [PATCH 027/143] fix: displaying friendly name --- src/libs/ReportUtils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 289a772d13e5..9c2f8bb9795d 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5146,10 +5146,11 @@ function buildOptimisticTaskReport( /** * Builds an optimistic EXPORTED_TO_INTEGRATION report action * - * @param label - The connectionName of the integration + * @param integration - The connectionName of the integration * @param markedManually - Whether the integration was marked as manually exported */ -function buildOptimisticExportIntegrationAction(label: ConnectionName, markedManually = false): OptimisticExportAction { +function buildOptimisticExportIntegrationAction(integration: ConnectionName, markedManually = false): OptimisticExportAction { + const label = CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[integration]; return { reportActionID: NumberUtils.rand64(), actionName: CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION, From 07e6c61610d47328b0209f9dd4136c56528b0d8f Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Wed, 17 Jul 2024 20:43:26 +0800 Subject: [PATCH 028/143] track-expense and submit-expense deep links --- .well-known/apple-app-site-association | 8 +++ android/app/src/main/AndroidManifest.xml | 4 ++ src/ROUTES.ts | 2 + src/SCREENS.ts | 2 + .../Navigation/AppNavigator/AuthScreens.tsx | 12 ++++ src/libs/Navigation/linkingConfig/config.ts | 2 + src/libs/Navigation/types.ts | 2 + src/pages/SubmitExpensePage.tsx | 56 +++++++++++++++ src/pages/TrackExpensePage.tsx | 71 +++++++++++++++++++ 9 files changed, 159 insertions(+) create mode 100644 src/pages/SubmitExpensePage.tsx create mode 100644 src/pages/TrackExpensePage.tsx diff --git a/.well-known/apple-app-site-association b/.well-known/apple-app-site-association index 394e45f8d9ae..dce724440adf 100644 --- a/.well-known/apple-app-site-association +++ b/.well-known/apple-app-site-association @@ -91,6 +91,14 @@ { "/": "/money2020/*", "comment": "Money 2020" + }, + { + "/": "/track-expense/*", + "comment": "Track Expense" + }, + { + "/": "/submit-expense/*", + "comment": "Submit Expense" } ] } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 520602a28a02..142d919a7a18 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -73,6 +73,8 @@ + + @@ -94,6 +96,8 @@ + + diff --git a/src/ROUTES.ts b/src/ROUTES.ts index f13724bf4322..b29e4d27dcb3 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -61,6 +61,8 @@ const ROUTES = { // This is a utility route used to go to the user's concierge chat, or the sign-in page if the user's not authenticated CONCIERGE: 'concierge', + TRACK_EXPENSE: 'track-expense', + SUBMIT_EXPENSE: 'submit-expense', FLAG_COMMENT: { route: 'flag/:reportID/:reportActionID', getRoute: (reportID: string, reportActionID: string) => `flag/${reportID}/${reportActionID}` as const, diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 3a0bb2248303..0b6e3e4c9c4f 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -8,6 +8,8 @@ const PROTECTED_SCREENS = { HOME: 'Home', CONCIERGE: 'Concierge', ATTACHMENTS: 'Attachments', + TRACK_EXPENSE: 'TrackExpense', + SUBMIT_EXPENSE: 'SubmitExpense', } as const; const SCREENS = { diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 0e40fa4d4037..dfc47d9bb342 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -71,6 +71,8 @@ const loadReportAttachments = () => require('../../../page const loadValidateLoginPage = () => require('../../../pages/ValidateLoginPage').default; const loadLogOutPreviousUserPage = () => require('../../../pages/LogOutPreviousUserPage').default; const loadConciergePage = () => require('../../../pages/ConciergePage').default; +const loadTrackExpensePage = () => require('../../../pages/TrackExpensePage').default; +const loadSubmitExpensePage = () => require('../../../pages/SubmitExpensePage').default; const loadProfileAvatar = () => require('../../../pages/settings/Profile/ProfileAvatar').default; const loadWorkspaceAvatar = () => require('../../../pages/workspace/WorkspaceAvatar').default; const loadReportAvatar = () => require('../../../pages/ReportAvatar').default; @@ -358,6 +360,16 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie options={defaultScreenOptions} getComponent={loadConciergePage} /> + + ['config'] = { [SCREENS.TRANSITION_BETWEEN_APPS]: ROUTES.TRANSITION_BETWEEN_APPS, [SCREENS.CONNECTION_COMPLETE]: ROUTES.CONNECTION_COMPLETE, [SCREENS.CONCIERGE]: ROUTES.CONCIERGE, + [SCREENS.TRACK_EXPENSE]: ROUTES.TRACK_EXPENSE, + [SCREENS.SUBMIT_EXPENSE]: ROUTES.SUBMIT_EXPENSE, [SCREENS.SIGN_IN_WITH_APPLE_DESKTOP]: ROUTES.APPLE_SIGN_IN, [SCREENS.SIGN_IN_WITH_GOOGLE_DESKTOP]: ROUTES.GOOGLE_SIGN_IN, [SCREENS.SAML_SIGN_IN]: ROUTES.SAML_SIGN_IN, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index c273b2db6a10..a628e4a4d1bf 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -1208,6 +1208,8 @@ type PublicScreensParamList = SharedScreensParamList & { type AuthScreensParamList = CentralPaneScreensParamList & SharedScreensParamList & { [SCREENS.CONCIERGE]: undefined; + [SCREENS.TRACK_EXPENSE]: undefined; + [SCREENS.SUBMIT_EXPENSE]: undefined; [SCREENS.ATTACHMENTS]: { reportID: string; source: string; diff --git a/src/pages/SubmitExpensePage.tsx b/src/pages/SubmitExpensePage.tsx new file mode 100644 index 000000000000..7eb1fda045ad --- /dev/null +++ b/src/pages/SubmitExpensePage.tsx @@ -0,0 +1,56 @@ +import {useFocusEffect} from '@react-navigation/native'; +import React, {useEffect, useRef} from 'react'; +import {View} from 'react-native'; +import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView'; +import ReportHeaderSkeletonView from '@components/ReportHeaderSkeletonView'; +import ScreenWrapper from '@components/ScreenWrapper'; +import useThemeStyles from '@hooks/useThemeStyles'; +import Navigation from '@libs/Navigation/Navigation'; +import * as App from '@userActions/App'; +import * as IOU from '@userActions/IOU'; +import CONST from '@src/CONST'; +import * as ReportUtils from '@libs/ReportUtils'; +import interceptAnonymousUser from '@libs/interceptAnonymousUser'; + +/* + * This is a "utility page", that does this: + * - If the user is authenticated, start Submit Expense + * - Else re-route to the login page + */ +function SubmitExpensePage() { + const styles = useThemeStyles(); + const isUnmounted = useRef(false); + + useFocusEffect(() => { + interceptAnonymousUser(() => { + App.confirmReadyToOpenApp(); + Navigation.isNavigationReady().then(() => { + if (isUnmounted.current) { + return; + } + Navigation.goBack(); + IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, ReportUtils.generateReportID(),); + }); + }); + }); + + useEffect( + () => () => { + isUnmounted.current = true; + }, + [], + ); + + return ( + + + + + + + ); +} + +SubmitExpensePage.displayName = 'SubmitExpensePage'; + +export default SubmitExpensePage; \ No newline at end of file diff --git a/src/pages/TrackExpensePage.tsx b/src/pages/TrackExpensePage.tsx new file mode 100644 index 000000000000..854444de275c --- /dev/null +++ b/src/pages/TrackExpensePage.tsx @@ -0,0 +1,71 @@ +import {useFocusEffect} from '@react-navigation/native'; +import React, {useEffect, useRef} from 'react'; +import {View} from 'react-native'; +import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView'; +import ReportHeaderSkeletonView from '@components/ReportHeaderSkeletonView'; +import ScreenWrapper from '@components/ScreenWrapper'; +import useThemeStyles from '@hooks/useThemeStyles'; +import Navigation from '@libs/Navigation/Navigation'; +import * as App from '@userActions/App'; +import ONYXKEYS from '@src/ONYXKEYS'; +import * as IOU from '@userActions/IOU'; +import CONST from '@src/CONST'; +import * as ReportUtils from '@libs/ReportUtils'; +import interceptAnonymousUser from '@libs/interceptAnonymousUser'; +import ROUTES from '@src/ROUTES'; +import useNetwork from '@hooks/useNetwork'; +import { useOnyx } from "react-native-onyx"; + +/* + * This is a "utility page", that does this: + * - If the user is authenticated, find their self DM and and start a Track Expense + * - Else re-route to the login page + */ +function TrackExpensePage() { + const styles = useThemeStyles(); + const isUnmounted = useRef(false); + const {isOffline} = useNetwork(); + const [hasSeenTrackTraining] = useOnyx(ONYXKEYS.NVP_HAS_SEEN_TRACK_TRAINING); + + useFocusEffect(() => { + interceptAnonymousUser(() => { + App.confirmReadyToOpenApp(); + Navigation.isNavigationReady().then(() => { + if (isUnmounted.current) { + return; + } + Navigation.goBack(); + IOU.startMoneyRequest( + CONST.IOU.TYPE.TRACK, + ReportUtils.findSelfDMReportID() || ReportUtils.generateReportID(), + ) + + if (!hasSeenTrackTraining && !isOffline) { + setTimeout(() => { + Navigation.navigate(ROUTES.TRACK_TRAINING_MODAL); + }, CONST.ANIMATED_TRANSITION); + } + }); + }); + }); + + useEffect( + () => () => { + isUnmounted.current = true; + }, + [], + ); + + return ( + + + + + + + ); +} + +TrackExpensePage.displayName = 'TrackExpensePage'; + +export default TrackExpensePage; \ No newline at end of file From 2b8d4ba0000c62ca21661d8fcf67c63373c523f3 Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Thu, 18 Jul 2024 19:54:54 +0800 Subject: [PATCH 029/143] lint --- src/pages/SubmitExpensePage.tsx | 8 ++++---- src/pages/TrackExpensePage.tsx | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/pages/SubmitExpensePage.tsx b/src/pages/SubmitExpensePage.tsx index 7eb1fda045ad..f4f6ea623c34 100644 --- a/src/pages/SubmitExpensePage.tsx +++ b/src/pages/SubmitExpensePage.tsx @@ -5,12 +5,12 @@ import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView'; import ReportHeaderSkeletonView from '@components/ReportHeaderSkeletonView'; import ScreenWrapper from '@components/ScreenWrapper'; import useThemeStyles from '@hooks/useThemeStyles'; +import interceptAnonymousUser from '@libs/interceptAnonymousUser'; import Navigation from '@libs/Navigation/Navigation'; +import * as ReportUtils from '@libs/ReportUtils'; import * as App from '@userActions/App'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; -import * as ReportUtils from '@libs/ReportUtils'; -import interceptAnonymousUser from '@libs/interceptAnonymousUser'; /* * This is a "utility page", that does this: @@ -29,7 +29,7 @@ function SubmitExpensePage() { return; } Navigation.goBack(); - IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, ReportUtils.generateReportID(),); + IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, ReportUtils.generateReportID()); }); }); }); @@ -53,4 +53,4 @@ function SubmitExpensePage() { SubmitExpensePage.displayName = 'SubmitExpensePage'; -export default SubmitExpensePage; \ No newline at end of file +export default SubmitExpensePage; diff --git a/src/pages/TrackExpensePage.tsx b/src/pages/TrackExpensePage.tsx index 854444de275c..71f2bf6c5d77 100644 --- a/src/pages/TrackExpensePage.tsx +++ b/src/pages/TrackExpensePage.tsx @@ -1,20 +1,20 @@ import {useFocusEffect} from '@react-navigation/native'; import React, {useEffect, useRef} from 'react'; import {View} from 'react-native'; +import {useOnyx} from 'react-native-onyx'; import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView'; import ReportHeaderSkeletonView from '@components/ReportHeaderSkeletonView'; import ScreenWrapper from '@components/ScreenWrapper'; +import useNetwork from '@hooks/useNetwork'; import useThemeStyles from '@hooks/useThemeStyles'; +import interceptAnonymousUser from '@libs/interceptAnonymousUser'; import Navigation from '@libs/Navigation/Navigation'; +import * as ReportUtils from '@libs/ReportUtils'; import * as App from '@userActions/App'; -import ONYXKEYS from '@src/ONYXKEYS'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; -import * as ReportUtils from '@libs/ReportUtils'; -import interceptAnonymousUser from '@libs/interceptAnonymousUser'; +import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import useNetwork from '@hooks/useNetwork'; -import { useOnyx } from "react-native-onyx"; /* * This is a "utility page", that does this: @@ -37,8 +37,9 @@ function TrackExpensePage() { Navigation.goBack(); IOU.startMoneyRequest( CONST.IOU.TYPE.TRACK, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing ReportUtils.findSelfDMReportID() || ReportUtils.generateReportID(), - ) + ); if (!hasSeenTrackTraining && !isOffline) { setTimeout(() => { @@ -68,4 +69,4 @@ function TrackExpensePage() { TrackExpensePage.displayName = 'TrackExpensePage'; -export default TrackExpensePage; \ No newline at end of file +export default TrackExpensePage; From b396f145370d3cbb182b75a34e20e6bb1d635953 Mon Sep 17 00:00:00 2001 From: hurali97 Date: Fri, 19 Jul 2024 12:55:17 +0500 Subject: [PATCH 030/143] fix: update condition to mark archived chats as read --- src/pages/home/report/ReportActionsList.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index ba867c6feb17..47f6a918ae1f 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -541,16 +541,13 @@ function ReportActionsList({ lastMessageTime.current = null; const areSomeReportActionsUnread = sortedVisibleReportActions.some((reportAction) => { /** - * In case of archived reports, we have `newMessageTimeReference` equal to `reportAction.created`. - * So the condition should be `<=` to mark the report as read. We will only use this condition when - * the report is archived to not introduce any regression for other reports. + * The archived reports should not be marked as unread. So we are checking if the report is archived or not. + * If the report is archived and unread, we will mark the report as read. */ - const isTimeLesserOrEqual = ReportUtils.isArchivedRoom(report) - ? newMessageTimeReference && newMessageTimeReference <= reportAction.created - : newMessageTimeReference && newMessageTimeReference < reportAction.created; + const isUnreadArchivedReport = ReportUtils.isArchivedRoom(report) && ReportUtils.isUnread(report); + const isUnread = isUnreadArchivedReport || (newMessageTimeReference && newMessageTimeReference < reportAction.created); return ( - isTimeLesserOrEqual && - (ReportActionsUtils.isReportPreviewAction(reportAction) ? reportAction.childLastActorAccountID : reportAction.actorAccountID) !== Report.getCurrentUserAccountID() + isUnread && (ReportActionsUtils.isReportPreviewAction(reportAction) ? reportAction.childLastActorAccountID : reportAction.actorAccountID) !== Report.getCurrentUserAccountID() ); }); if (scrollingVerticalOffset.current >= MSG_VISIBLE_THRESHOLD || !areSomeReportActionsUnread) { From 407d9528dbe1e1068aac237c98f5ae050b3c2d24 Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Fri, 19 Jul 2024 11:20:10 +0200 Subject: [PATCH 031/143] fix: move to expensifyCard folder --- src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx | 2 +- .../workspace/{card => expensifyCard}/issueNew/AssigneeStep.tsx | 0 .../workspace/{card => expensifyCard}/issueNew/CardNameStep.tsx | 0 .../workspace/{card => expensifyCard}/issueNew/CardTypeStep.tsx | 0 .../{card => expensifyCard}/issueNew/ConfirmationStep.tsx | 0 .../{card => expensifyCard}/issueNew/IssueNewCardPage.tsx | 0 .../workspace/{card => expensifyCard}/issueNew/LimitStep.tsx | 0 .../{card => expensifyCard}/issueNew/LimitTypeStep.tsx | 0 8 files changed, 1 insertion(+), 1 deletion(-) rename src/pages/workspace/{card => expensifyCard}/issueNew/AssigneeStep.tsx (100%) rename src/pages/workspace/{card => expensifyCard}/issueNew/CardNameStep.tsx (100%) rename src/pages/workspace/{card => expensifyCard}/issueNew/CardTypeStep.tsx (100%) rename src/pages/workspace/{card => expensifyCard}/issueNew/ConfirmationStep.tsx (100%) rename src/pages/workspace/{card => expensifyCard}/issueNew/IssueNewCardPage.tsx (100%) rename src/pages/workspace/{card => expensifyCard}/issueNew/LimitStep.tsx (100%) rename src/pages/workspace/{card => expensifyCard}/issueNew/LimitTypeStep.tsx (100%) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index 6a89d4bb0851..e0301a5f4128 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -413,7 +413,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../../pages/workspace/taxes/ValuePage').default, [SCREENS.WORKSPACE.TAX_CREATE]: () => require('../../../../pages/workspace/taxes/WorkspaceCreateTaxPage').default, [SCREENS.WORKSPACE.TAX_CODE]: () => require('../../../../pages/workspace/taxes/WorkspaceTaxCodePage').default, - [SCREENS.WORKSPACE.EXPENSIFY_CARD_ISSUE_NEW]: () => require('../../../../pages/workspace/card/issueNew/IssueNewCardPage').default, + [SCREENS.WORKSPACE.EXPENSIFY_CARD_ISSUE_NEW]: () => require('../../../../pages/workspace/expensifyCard/issueNew/IssueNewCardPage').default, [SCREENS.WORKSPACE.EXPENSIFY_CARD_BANK_ACCOUNT]: () => require('../../../../pages/workspace/expensifyCard/WorkspaceExpensifyCardBankAccounts').default, [SCREENS.WORKSPACE.EXPENSIFY_CARD_DETAILS]: () => require('../../../../pages/workspace/expensifyCard/WorkspaceExpensifyCardDetailsPage').default, [SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../../pages/TeachersUnite/SaveTheWorldPage').default, diff --git a/src/pages/workspace/card/issueNew/AssigneeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx similarity index 100% rename from src/pages/workspace/card/issueNew/AssigneeStep.tsx rename to src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx diff --git a/src/pages/workspace/card/issueNew/CardNameStep.tsx b/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx similarity index 100% rename from src/pages/workspace/card/issueNew/CardNameStep.tsx rename to src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx diff --git a/src/pages/workspace/card/issueNew/CardTypeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx similarity index 100% rename from src/pages/workspace/card/issueNew/CardTypeStep.tsx rename to src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx diff --git a/src/pages/workspace/card/issueNew/ConfirmationStep.tsx b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx similarity index 100% rename from src/pages/workspace/card/issueNew/ConfirmationStep.tsx rename to src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx diff --git a/src/pages/workspace/card/issueNew/IssueNewCardPage.tsx b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx similarity index 100% rename from src/pages/workspace/card/issueNew/IssueNewCardPage.tsx rename to src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx diff --git a/src/pages/workspace/card/issueNew/LimitStep.tsx b/src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx similarity index 100% rename from src/pages/workspace/card/issueNew/LimitStep.tsx rename to src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx diff --git a/src/pages/workspace/card/issueNew/LimitTypeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx similarity index 100% rename from src/pages/workspace/card/issueNew/LimitTypeStep.tsx rename to src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx From e969c68ce85e140c8b176c440705ec4b124be74d Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Fri, 19 Jul 2024 11:28:14 +0200 Subject: [PATCH 032/143] fix: style fixes --- src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx | 2 +- src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx index 787e564676f4..c063f4246a56 100644 --- a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx @@ -67,7 +67,7 @@ function ConfirmationStep() { contentContainerStyle={styles.flexGrow1} > {translate('workspace.card.issueNewCard.letsDoubleCheck')} - {translate('workspace.card.issueNewCard.willBeReady')} + {translate('workspace.card.issueNewCard.willBeReady')} setTypeSelected(value)} sections={[{data}]} shouldDebounceRowSelect + initiallyFocusedOptionKey={typeSelected} />