-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test ai comments #2639
Test ai comments #2639
Conversation
…to feature/send-location
pull_request: | ||
types: | ||
- labeled | ||
permissions: write-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's recommended to secure the permissions
setting. Using write-all
could pose a security risk. Specify more granular permissions based on the exact needs of the GitHub action.
@@ -152,6 +152,9 @@ export const GUPSHUP_QUICK_REPLY = | |||
export const CALL_TO_ACTION = 'CALL_TO_ACTION'; | |||
export const LIST = 'LIST'; | |||
export const QUICK_REPLY = 'QUICK_REPLY'; | |||
export const LOCATION_REQUEST = 'LOCATION_REQUEST_MESSAGE'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New constants have been added here; ensure that these changes are reflected anywhere in the codebase that could utilize these new constants, including tests and any relevant documentation.
@@ -209,10 +212,3 @@ export const yupPasswordValidation = (t: any) => | |||
) | |||
.min(10, t('Password must be at least 10 characters long.')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the constants INTERACTIVE_QUICK_REPLY
and INTERACTIVE_LIST
may impact existing code that depends on them. Ensure to update all references and any possible import conflicts throughout the codebase.
@@ -134,6 +134,8 @@ export const getInteractiveMessageBody = (interactiveJSON: any) => { | |||
default: | |||
break; | |||
} | |||
} else if (interactiveJSON.type === 'location_request_message') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When checking the type of interactiveJSON
for location_request_message
, ensure that it is consistently named and matches the pattern and naming conventions used for other message types, including the JSON structure being parsed elsewhere.
INTERACTIVE_LIST, | ||
INTERACTIVE_QUICK_REPLY, | ||
LIST, | ||
QUICK_REPLY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from INTERACTIVE_LIST
and INTERACTIVE_QUICK_REPLY
to LIST
and QUICK_REPLY
needs to be reflected in the entire codebase. Watch out for any discrepancies that might occur due to this refactor.
@@ -477,7 +507,7 @@ | |||
}, | |||
// checkbox is not needed in media types | |||
{ | |||
skip: type && type.label, | |||
skip: (type && type.label) || isLocationRequestType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding isLocationRequestType
to handle conditionally rendering certain form fields. Ensure that all required form fields relevant to location request templates are rendered and functional.
@@ -602,6 +625,24 @@ | |||
interactiveContent: JSON.stringify(listJSON), | |||
}); | |||
} | |||
|
|||
if (templateType === LOCATION_REQUEST) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementing location request handling here requires thorough validation to ensure that the information is formatted correctly and communicated to the server appropriately.
@@ -631,6 +672,7 @@ | |||
if (translations) { | |||
translationsCopy = JSON.parse(translations); | |||
translationsCopy[language.id] = JSON.parse(payloadData.interactiveContent); | |||
setTranslations(JSON.stringify(translationsCopy)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting translations in state needs a cautious approach. Confirm that translations are being applied correctly, and there are no race conditions or stale state.
@@ -702,7 +744,9 @@ | |||
}, | |||
]; | |||
|
|||
let formFields: any = templateType === LIST ? [...fields] : [...fields, ...attachmentInputs]; | |||
let formFields: any = | |||
templateType === QUICK_REPLY ? [...fields, ...attachmentInputs] : [...fields]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition for rendering formFields
has been modified. Verify that this change doesn't exclude necessary fields for types such as LOCATION_REQUEST
.
LIST: 'List', | ||
}; | ||
|
||
return <p className={styles.TableText}>{typeMappings[text]}</p>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the new mapping for the typeMappings
object is accurately used throughout the UI, and matches the expected values for message types.
@@ -0,0 +1,48 @@ | |||
import { Button } from '@mui/material'; | |||
import LocationIconDark from 'assets/images/icons/Location/Dark.svg?react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid hard coding string 'location' as it might be used at other places as well. It will be easier to manage if you set it as a constant variable.
<ChatMessageType type="TEXT" body={body} isSimulatedMessage={isSimulator} /> | ||
</div> | ||
<Button | ||
variant="text" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if onSendLocationClick
is not null
or undefined
before calling it. This will prevent potential errors in case the function is not provided
font-family: 'Heebo', sans-serif, emoji; | ||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); | ||
clear: both; | ||
max-width: 404px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The max-width
attribute has been declared twice. Consider removing one of them.
font-family: 'Heebo', sans-serif, emoji; | ||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); | ||
clear: both; | ||
max-width: 404px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have defined 'max-width' twice here. Please remove the duplicate.
Summary
Test ai comments