diff --git a/hrm-form-definitions/form-definitions/nz/v1/LayoutDefinitions.json b/hrm-form-definitions/form-definitions/nz/v1/LayoutDefinitions.json index 3e75192247..f26945fb78 100644 --- a/hrm-form-definitions/form-definitions/nz/v1/LayoutDefinitions.json +++ b/hrm-form-definitions/form-definitions/nz/v1/LayoutDefinitions.json @@ -8,7 +8,7 @@ }, "case": { "households": { - "splitFormAt": 11 + "splitFormAt": 13 }, "perpetrators": { "splitFormAt": 9 diff --git a/hrm-form-definitions/form-definitions/nz/v1/tabbedForms/CaseInformationTab.json b/hrm-form-definitions/form-definitions/nz/v1/tabbedForms/CaseInformationTab.json index 5c3629f215..755de61667 100644 --- a/hrm-form-definitions/form-definitions/nz/v1/tabbedForms/CaseInformationTab.json +++ b/hrm-form-definitions/form-definitions/nz/v1/tabbedForms/CaseInformationTab.json @@ -10,7 +10,7 @@ }, { "name": "repeatCaller", - "label": "Repeat Caller?", + "label": "Suspected Repeat Client", "type": "checkbox" }, { @@ -19,16 +19,16 @@ "type": "listbox-multiselect", "options": [ { - "value": "Direct interventions by the child helpline", - "label": "Direct interventions by the child helpline" + "value": "Support provided by Youthline", + "label": "Support provided by Youthline" }, { "value": "Recommendations of resources", "label": "Recommendations of resources" }, { - "value": "Referrals to child protection agencies", - "label": "Referrals to child protection agencies" + "value": "Referrals to Oranga Tamariki", + "label": "Referrals to Oranga Tamariki" }, { "value": "Referrals to general healthcare services", @@ -64,10 +64,10 @@ "name": "howDidYouKnowAboutOurLine", "label": "How did you know about our line/number?", "type": "select", - "unknownOption": "", + "unknownOption": "Unknown", "options": [ { - "value": "", + "value": "Unknown", "label": "" }, { @@ -99,7 +99,7 @@ }, { "name": "didYouDiscussRightsWithTheChild", - "label": "Did you discuss privacy rights and consent with the young person?", + "label": "Did you discuss privacy rights and consent with the client?", "type": "mixed-checkbox" } -] \ No newline at end of file +] diff --git a/plugin-hrm-form/src/___tests__/utils/setUpActions.test.ts b/plugin-hrm-form/src/___tests__/utils/setUpActions.test.ts index e7958c9ad7..634351c14c 100644 --- a/plugin-hrm-form/src/___tests__/utils/setUpActions.test.ts +++ b/plugin-hrm-form/src/___tests__/utils/setUpActions.test.ts @@ -57,7 +57,10 @@ describe('afterCompleteTask', () => { describe('excludeDeactivateConversationOrchestration', () => { test('backend_handled_chat_janitor === false and enable_post_survey === false should not change ChatOrchestrator', async () => { const setOrchestrationsSpy = jest.spyOn(ChatOrchestrator, 'setOrchestrations'); - excludeDeactivateConversationOrchestration({ enable_post_survey: false, backend_handled_chat_janitor: false }); + excludeDeactivateConversationOrchestration({ + enable_post_survey: false, + backend_handled_chat_janitor: false, + }); expect(setOrchestrationsSpy).not.toHaveBeenCalled(); }); diff --git a/plugin-hrm-form/src/components/contact/MediaSection/RecordingSection.tsx b/plugin-hrm-form/src/components/contact/MediaSection/RecordingSection.tsx index 3a676607a7..9160a66fb8 100644 --- a/plugin-hrm-form/src/components/contact/MediaSection/RecordingSection.tsx +++ b/plugin-hrm-form/src/components/contact/MediaSection/RecordingSection.tsx @@ -19,7 +19,8 @@ import CircularProgress from '@material-ui/core/CircularProgress'; import { ErrorFont, LoadMediaButton, LoadMediaButtonText } from './styles'; import { S3StoredRecording } from '../../../types/types'; -import { getFileDownloadUrl } from '../../../services/ServerlessService'; +import { generateExternalMediaPath } from '../../../services/ContactService'; +import fetchHrmApi from '../../../services/fetchHrmApi'; type OwnProps = { contactId: string; externalStoredRecording: S3StoredRecording }; @@ -34,11 +35,16 @@ const RecordingSection: React.FC = ({ contactId, externalStoredRecordi setLoading(true); setShowButton(false); - const recordingPreSignedUrl = await getFileDownloadUrl(externalStoredRecording.location.key); - const recordingResponse = await fetch(recordingPreSignedUrl.downloadUrl); - const recordingBlob = await recordingResponse.blob(); - const voiceRecording = new Audio(URL.createObjectURL(recordingBlob)); - setVoiceRecording(voiceRecording.src); + // TODO: this won't currently work for local dev env + const { media_url: recordingPreSignedUrl } = await fetchHrmApi( + generateExternalMediaPath( + contactId, + externalStoredRecording.location.bucket, + externalStoredRecording.location.key, + ), + ); + + setVoiceRecording(recordingPreSignedUrl); setLoading(false); } catch (error) { @@ -86,7 +92,7 @@ const RecordingSection: React.FC = ({ contactId, externalStoredRecordi return (
{voiceRecording ? ( -