Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Pham-dev/hls-emr-flex-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ssepactwilio committed Jun 10, 2022
2 parents b89851e + f06795b commit 361b0c7
Show file tree
Hide file tree
Showing 21 changed files with 156 additions and 87,493 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,6 @@ build/
.vscode

# plugin-backend
.twiliodeployinfo
.twiliodeployinfo

package-lock.json
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ ARG TWILIO_AUTH_TOKEN=token
ARG REACT_APP_TELEHEALTH_URL=telehealthUrl
ARG REACT_APP_NGROK_URL=url

# Update React Version to 16.13.1. By default this plugin is not compatible with the default version (16.5.2)
RUN curl -X POST 'https://flex-api.twilio.com/v1/Configuration' \
-u ${TWILIO_ACCOUNT_SID}:${TWILIO_AUTH_TOKEN} \
-H 'Content-Type: application/json' \
-d "{\"account_sid\":\"${TWILIO_ACCOUNT_SID}\",\"ui_dependencies\":{\"react\":\"~16.13.1\",\"react-dom\":\"~16.13.1\"}}"

# Download serverless and flex plugin CLIs
RUN twilio plugins:install @twilio-labs/plugin-serverless
RUN twilio plugins:install @twilio-labs/plugin-flex
Expand All @@ -30,6 +24,9 @@ COPY . /hls-deploy
WORKDIR /hls-deploy/plugin-backend
RUN npm install
RUN echo "REACT_APP_NGROK_URL=${REACT_APP_NGROK_URL}" > .env
RUN echo "gfAccountKey=6735d87e-1cd1-4b7b-ab00-719ff6f05507" >> .env
RUN echo "gfAccountSecret=1Eu7MkApmwjvKdSERDLJpnLCVb8BMgaMOaaY1krcH30=" >> .env
RUN echo "gfApiUrl=https://api.geofluent.com/Translation/v3/" >> .env
RUN echo "REACT_APP_BACKEND_URL=$(eval twilio serverless:deploy --override-existing-project --runtime node14 -o=json | grep -o '"domain": "[^"]*' | grep -o '[^"]*$')" >> .env
RUN cp .env /hls-deploy
WORKDIR /hls-deploy
Expand Down
2 changes: 1 addition & 1 deletion installer/functions/task-router/deploy-task-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const handler: ServerlessFunctionSignature = async function(
}
const adminWorker = workers[0];
const w = await giveAllSkillsToWorker(client, workspaceSid, adminWorker.sid, adminWorker.attributes);
console.log("Admin Worker given 'Education' and 'Scheduling' skills. Admin's new attributes: ", w.attributes);
console.log("Admin Worker given 'Education', 'language*es-xl', and 'Scheduling' skills. Admin's new attributes: ", w.attributes);

response.setBody({Message: 'HLS Flex Plugin Account Setup completed'});
response.setStatusCode(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const SCHEDULERS = "Schedulers";
export const EDUCATORS = "Educators";
export const SCHEDULING = "Scheduling";
export const EDUCATION = "Education";
export const SPANISH = "language*es-xl";
export const ASSIGN_TO_ANYONE = "Assign to Anyone";
export const INTAKE_BY_SCHEDULERS = "Intake by Schedulers";
export const TRANSFER_TO_NURSE_EDUCATOR = "Transfer to Nurse Educator";
Expand Down Expand Up @@ -141,7 +142,7 @@ export function getAllWorkers(client: TwilioClient, workspaceSid: string): Promi
export function giveAllSkillsToWorker(client: TwilioClient, workspaceSid: string, workerSid: string, attributes: string): Promise<WorkerInstance> {
const jsonAttributes = JSON.parse(attributes);
jsonAttributes.routing = {
skills: [SCHEDULING, EDUCATION],
skills: [SCHEDULING, EDUCATION, SPANISH],
levels: {},
}
const worker = client.taskrouter.workspaces(workspaceSid)
Expand Down
Loading

0 comments on commit 361b0c7

Please sign in to comment.