Skip to content

Commit

Permalink
Merge branch 'sinekhaya/sg/workflow-update' of https://github.com/tec…
Browse files Browse the repository at this point in the history
…hmatters/flex-plugins into sinekhaya/sg/workflow-update
  • Loading branch information
sinehome committed Sep 17, 2024
2 parents 31c991c + 8e6299b commit 5b95615
Show file tree
Hide file tree
Showing 16 changed files with 668 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,5 @@
"rows": 20,
"width": 500,
"placeholder": "Enter a summary of the client"
},
{
"name": "recommendedApproach",
"label": "Recommended Approach",
"editLabel": "Edit Recommended Approach",
"type": "textarea",
"rows": 20,
"width": 500,
"placeholder": "Enter recommended approach"
},
{
"name": "details",
"label": "Details",
"editLabel": "Edit Details",
"type": "textarea",
"rows": 20,
"width": 500,
"placeholder": "Enter Details"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@
"label": "Vulnerable Groups",
"type": "listbox-multiselect",
"options": [
{
"value": "Asylum seeker",
"label": "Asylum seeker"
},
{
"value": "HIV Positive?",
"label": "HIV Positive?"
Expand Down Expand Up @@ -400,6 +404,10 @@
"value": "Out-of-school child",
"label": "Out-of-school child"
},
{
"value": "Refugees",
"label": "Refugees"
},
{
"value": "Other",
"label": "Other"
Expand Down
7 changes: 4 additions & 3 deletions plugin-hrm-form/src/components/contact/ContactDetailsHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,15 @@ const ContactDetailsHome: React.FC<Props> = function ({
);

const addedToCaseBanner = () => <ContactAddedToCaseBanner taskId={task.taskSid} contactId={savedContact.id} />;
const showAddcaseButton = !isDraft && !showRemovedFromCaseBanner;

const renderCaseButton = () => {
const renderCaseBanners = () => {
if (featureFlags.enable_case_merging) {
return (
<>
{caseId
? addedToCaseBanner()
: !showRemovedFromCaseBanner && (
: showAddcaseButton && (
<Box display="flex" justifyContent="flex-end" marginBottom="4px">
<AddCaseButton
position="top"
Expand Down Expand Up @@ -340,7 +341,7 @@ const ContactDetailsHome: React.FC<Props> = function ({
</BannerContainer>
)}

{renderCaseButton()}
{renderCaseBanners()}

<ContactDetailsSection
sectionTitle={<Template code="ContactDetails-GeneralDetails" />}
Expand Down
2 changes: 1 addition & 1 deletion plugin-hrm-form/src/permissions/sg.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"unflagProfile": [["isSupervisor"]],
"createProfileSection": [["everyone"]],
"viewProfileSection": [["everyone"]],
"editProfileSection": [["everyone"]],
"editProfileSection": [["isSupervisor"]],

"viewPostSurvey": [["isSupervisor"]],

Expand Down
2 changes: 1 addition & 1 deletion plugin-hrm-form/src/translations/en-NZ/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"WelcomeMsg": "Kia ora, you're now talking with a Youthline counsellor. How can we support you?",
"GoodbyeMsg": "We've closed this conversation on our side - you're welcome to reach out to us again the next time you need support. As a reminder, if you're feeling unsafe at any time you can get urgent support by calling 111, or the number for your area at www.health.govt.nz/cateams",
"GoodbyeMsg": "We've closed this conversation on our side - you're welcome to reach out to us again the next time you need support. As a reminder, if you're feeling unsafe at any time you can get urgent support by calling 111, or the number for your area at info.health.nz/crisis-assessment-teams",
"EndChatMsg": "The client has clicked 'End Chat'. Thank you for reaching out. Please contact us again if you need more help.",
"ClosedOutOfShift": "You've reached the Helpline outside our webchat hours. If you'd like to talk to us now, please txt us for free on 234 or call us for free on 0800376633",
"ClosedHolidays": "The helpline is closed due to a holiday."
Expand Down
14 changes: 9 additions & 5 deletions plugin-hrm-form/src/utils/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ const getContactValueFromWebchat = task => {
return preEngagementData.contactIdentifier;
};

/**
* IMPORTANT: keep up to date with serverless/functions/getProfileFlagsForIdentifier
*/
const trimSpaces = (s: string) => s.replaceAll(' ', '');

const trimHyphens = (s: string) => s.replaceAll('-', '');
const phoneNumberStandardization = (s: string) => [trimSpaces, trimHyphens].reduce((accum, f) => f(accum), s);
type TransformIdentifierFunction = (c: string) => string;
const channelTransformations: { [k in ChannelTypes]: TransformIdentifierFunction[] } = {
voice: [trimSpaces],
sms: [trimSpaces],
whatsapp: [s => s.replace('whatsapp:', ''), trimSpaces],
modica: [s => s.replace('modica:', ''), trimSpaces],
voice: [phoneNumberStandardization],
sms: [phoneNumberStandardization],
whatsapp: [s => s.replace('whatsapp:', ''), phoneNumberStandardization],
modica: [s => s.replace('modica:', ''), phoneNumberStandardization],
facebook: [s => s.replace('messenger:', '')],
instagram: [],
line: [],
Expand Down
14 changes: 9 additions & 5 deletions twilio-iac/helplines/as/production.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,50 @@ locals {
flow_vars = {
capture_channel_with_bot_function_sid = "ZHd9eb5ce1b230abe29d9eafccc88b16d3"
chatbot_callback_cleanup_function_sid = "ZH757387715913592aa1938b284411f18b"
send_message_janitor_function_sid = "ZHdfbbef84918d1e31fab54ab0cab8d0f7"
bot_language = "en-US"
widget_from = "Aselo"
chat_blocked_message = "Sorry, you're not able to contact SafeSpot from this device or account"
error_message = "There has been an error with your message, please try writing us again."
}

channels = {
webchat : {
channel_type = "web"
contact_identity = ""
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
facebook : {
messaging_mode = "conversations"
channel_type = "facebook"
contact_identity = "messenger:105642325869250"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
whatsapp : {
messaging_mode = "conversations"
channel_type = "whatsapp"
contact_identity = "whatsapp:+15079441697"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
instagram : {
messaging_mode = "conversations"
channel_type = "custom"
contact_identity = "instagram"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-custom-channel-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
line : {
messaging_mode = "conversations"
channel_type = "custom"
contact_identity = "line"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-custom-channel-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
Expand Down
16 changes: 10 additions & 6 deletions twilio-iac/helplines/as/staging.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,59 @@ locals {
flow_vars = {
capture_channel_with_bot_function_sid = "ZH979fc67a70a4a9572552c81a0d5d41d7"
chatbot_callback_cleanup_function_sid = "ZH31416a207f81bf504a1391ed7649400e"
send_message_janitor_function_sid = "ZH91e33557d45b6dd60100876452e2428b"
bot_language = "en-US"
widget_from = "Aselo"
chat_blocked_message = "Sorry, you're not able to contact Aselo from this device or account"
error_message = "There has been an error with your message, please try writing us again."

}

channels = {
webchat : {
channel_type = "web"
contact_identity = ""
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
facebook : {
messaging_mode = "conversations"
channel_type = "messenger"
contact_identity = "messenger:131329426738030"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
whatsapp : {
messaging_mode = "conversations"
channel_type = "whatsapp"
contact_identity = "whatsapp:+12055189944"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
line : {
messaging_mode = "conversations"
channel_type = "custom"
contact_identity = "line"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-custom-channel-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
telegram : {
messaging_mode = "conversations"
channel_type = "custom"
contact_identity = "telegram"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-custom-channel-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
instagram : {
messaging_mode = "conversations"
channel_type = "custom"
contact_identity = "instagram"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-lex-v3.tftpl"
templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-custom-channel-lex-v3-blocking.tftpl"
channel_flow_vars = {}
chatbot_unique_names = []
},
Expand Down
Loading

0 comments on commit 5b95615

Please sign in to comment.