Skip to content

Commit

Permalink
Merge pull request #1 from annahileta/remove-old-scenarios
Browse files Browse the repository at this point in the history
Removed old scenarios
  • Loading branch information
annahileta authored Dec 4, 2024
2 parents 0a41f32 + 253d048 commit 3f9a0c6
Show file tree
Hide file tree
Showing 44 changed files with 218 additions and 2,147 deletions.
6 changes: 1 addition & 5 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { useEffect } from 'react';
import { Route, Routes, useLocation, useNavigate } from 'react-router-dom';
import { useDispatch } from 'react-redux';
import Hero from './pages/Hero/Hero.jsx';
import HomeAuthenticated from './pages/Home/Home.jsx';
import ManageWorkflowAuthenticated from './pages/ManageWorkflow/ManageWorkflow.jsx';
import TriggerWorkflowAuthenticated from './pages/TriggerWorkflow/TriggerWorkflow.jsx';
import TriggerWorkflowFormAuthenticated from './pages/TriggerWorkflowForm/TriggerWorkflowForm.jsx';
import { LoginStatus, ROUTE } from './constants.js';
Expand Down Expand Up @@ -32,7 +30,7 @@ function App() {

const { data: userInfo } = await api.acg.callbackExecute(code);
dispatch(authorizeUser(LoginStatus.ACG, userInfo.name, userInfo.email));
navigate(ROUTE.HOME);
navigate(ROUTE.TRIGGER);
dispatch(closePopupWindow());
dispatch(closeLoadingCircleInPopup());
};
Expand All @@ -43,9 +41,7 @@ function App() {
return (
<Routes>
<Route path={ROUTE.ROOT} element={<Hero />} />
<Route path={ROUTE.HOME} element={<HomeAuthenticated />} />
<Route path={ROUTE.TRIGGER} element={<TriggerWorkflowAuthenticated />} />
<Route path={ROUTE.MANAGE} element={<ManageWorkflowAuthenticated />} />
<Route path={`${ROUTE.TRIGGERFORM}/:workflowId`} element={<TriggerWorkflowFormAuthenticated />} />
</Routes>
);
Expand Down
67 changes: 4 additions & 63 deletions client/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,50 +68,6 @@ export const api = Object.freeze({
},
},
workflows: {
createWorkflowDefinition: async templateType => {
try {
const response = await instance.post('/workflows/create', { templateType: templateType });
return response;
} catch (error) {
if (error.response && error.response.status === 400) {
return error.response;
}
throw error;
}
},
cancelWorkflowInstance: async workflow => {
try {
const response = await instance.put(`/workflows/${workflow.id}/instances/${workflow.instanceId}/cancel`);
return response;
} catch (error) {
return error.response;
}
},
publishWorkflow: async workflowId => {
try {
const response = await instance.post('/workflows/publish', { workflowId });

if (response.status === 210) {
try {
window.open(response.data, 'newTab', 'width=600,height=400');
await new Promise(r => setTimeout(r, 3000));

const published = await instance.post('/workflows/publish', { workflowId });
return published;
} catch (error) {
console.log(error);
return error.response;
}
}

return response;
} catch (error) {
if (error.response && error.response.status >= 400) {
return error.response;
}
throw error;
}
},
triggerWorkflow: async (workflowId, templateType, body) => {
try {
const response = await instance.put(`/workflows/${workflowId}/trigger?type=${templateType}`, body);
Expand All @@ -124,27 +80,12 @@ export const api = Object.freeze({
const response = await instance.get(`/workflows/definitions`);
return response;
},
getWorkflowInstance: async workflow => {
const response = await instance.get(`/workflows/${workflow.id}/instances/${workflow.instanceId}`);
return response;
},
getWorkflowInstances: async workflowId => {
const response = await instance.get(`/workflows/${workflowId}/instances`);
return response;
},
downloadWorkflowTemplate: async templateName => {
getWorkflowTriggerRequirements: async workflowId => {
try {
const response = await fetch(`${apiUrl}/workflows/download/${templateName}`);
const blob = await response.blob();
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = templateName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
const response = await instance.get(`/workflows/${workflowId}/requirements`);
return response;
} catch (error) {
console.log(error);
return error.response;
}
},
},
Expand Down
5 changes: 0 additions & 5 deletions client/src/assets/img/workflow-create.svg

This file was deleted.

5 changes: 0 additions & 5 deletions client/src/assets/img/workflow-manage.svg

This file was deleted.

48 changes: 4 additions & 44 deletions client/src/assets/text.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"triggerForm": {
"formTitle": "Fill in details",
"formTitleWithoutInputs": "This workflow does not require additional fields",
"formName": "Participant Information",
"fieldsI9": {
"field1": "Preparer name",
Expand All @@ -39,20 +40,6 @@
"field2": "HR manager email"
}
},
"home": {
"card1": {
"title": "Create a workflow",
"description": "Create a new workflow definition"
},
"card2": {
"title": "Trigger a workflow",
"description": "Get a list of workflow definitions and trigger a workflow instance"
},
"card3": {
"title": "Manage workflows",
"description": "Get the status of existing workflow instances and cancel instances"
}
},
"loader": {
"title": "Waiting for log in"
},
Expand All @@ -67,26 +54,16 @@
"descriptions": {
"codeDescription": "See the source code: "
},
"createWorkflow": {
"mainDescription": "This scenario creates a new workflow definition in the user's account. These workflows depend on eSignature templates that need to exist in the user's account before the workflows can be created. If the necessary templates do not exist in the user's account, the sample app will prompt them to download the relevant template definitions and create them in their account.",
"step1Description": "The WorkflowManagement: createWorkflowDefinition method is used to create a new workflow definition in the user's account. The steps for this workflow are defined in the sample app's source code.",
"step2Description": "After the new workflow definition has been created it needs to be published using the WorkflowManagement: publishOrUnPublishWorkflow method. Once the workflow has been published, new instances of that workflow can be triggered through the Trigger a workflow scenario."
},
"triggerWorkflow": {
"mainDescription": "This scenario gets a list of published workflow definitions, gets the status of the last workflow instance triggered from each workflow definition, and triggers a new workflow instance.",
"step1Description": "Display all of the workflow definitions in the user's account by calling the WorkflowManagment: getWorkflowDefinitions endpoint. Each row on this page represents a workflow definition.",
"step2Description": "After the user chooses a workflow to trigger, the next step is to get the workflow definition by calling the WorkflowMangement: getWorkflowDefinition endpoint. The response for this API call includes a triggerURL property that will be used in the next step.",
"step3Description": "Finally, call the WorkflowTrigger: triggerWorkflow endpoint to trigger the workflow instance. The response of this call includes the workflowInstanceUrl where the workflow participant can complete the workflow steps."
},
"manageWorkflow": {
"mainDescription": "This scenario displays a list of workflow instances, the status of those instances, and the option to cancel them.",
"step1Description": "The WorkflowInstanceManagement: getWorkflowInstances endpoint is called to get a list of the workflow instances that have been triggered by the sample app.",
"step2Description": "To get the status of a given workflow instance, the WorkflowInstanceManagement: getWorkflowInstance method is called.",
"step3Description": "If a user chooses to cancel a workflow instance, the WorkflowInstanceManagement: cancelWorkflowInstance method is called."
"step3Description": "Finally, call the WorkflowTrigger: triggerWorkflow endpoint to trigger the workflow instance. The response of this call includes the workflowInstanceUrl where the workflow participant can complete the workflow steps."
}
},
"workflowList": {
"doNotHaveWorkflow": "You do not have any workflows in your account",
"pleaseCreateWorkflow": "Please <a href=''>manually create a workflow</a> in your account before using the sample app.",
"columns": {
"lastRunStatus": "Status of last run",
"workflowName": "Workflow name",
Expand All @@ -101,20 +78,6 @@
"workflowTriggered": {
"title": "Workflow triggered",
"description": "To complete the workflow steps, select Continue"
},
"workflowDefinitionCreated": {
"publish": {
"description": "To publish the workflow, proceed with the Publish button",
"button": "Publish"
},
"published": {
"title": "Done",
"description": "Workflow successfully published"
},
"error": {
"title": "Workflow creation was unsuccessful",
"button": "Download the template"
}
}
},
"buttons": {
Expand All @@ -123,11 +86,8 @@
"behindTheScenes": "Behind the scenes",
"continue": "Continue",
"cancel": "Cancel",
"createWorkflow": "Create new workflow ->",
"triggerWorkflow": "Trigger workflow",
"triggerNewWorkflow": "Trigger new workflow ->",
"updateWorkflow": "Update workflow status",
"cancelWorkflow": "Cancel workflow",
"getStarted": "Get started",
"moreInfo": "More info",
"backHome": "← Back to home"
Expand All @@ -137,4 +97,4 @@
"createsandbox": "https://go.docusign.com/o/sandbox/",
"learnmore": "https://developers.docusign.com/docs/maestro-api/"
}
}
}
51 changes: 0 additions & 51 deletions client/src/components/Card/Card.jsx

This file was deleted.

74 changes: 0 additions & 74 deletions client/src/components/Card/Card.module.css

This file was deleted.

Loading

0 comments on commit 3f9a0c6

Please sign in to comment.