Skip to content

Commit 3070563

Browse files
committed
removed status fields, fixed redirects and added text to create workflow to the config
1 parent 0a41f32 commit 3070563

File tree

13 files changed

+24
-77
lines changed

13 files changed

+24
-77
lines changed

client/src/App.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function App() {
3232

3333
const { data: userInfo } = await api.acg.callbackExecute(code);
3434
dispatch(authorizeUser(LoginStatus.ACG, userInfo.name, userInfo.email));
35-
navigate(ROUTE.HOME);
35+
navigate(ROUTE.TRIGGER);
3636
dispatch(closePopupWindow());
3737
dispatch(closeLoadingCircleInPopup());
3838
};
@@ -43,9 +43,7 @@ function App() {
4343
return (
4444
<Routes>
4545
<Route path={ROUTE.ROOT} element={<Hero />} />
46-
<Route path={ROUTE.HOME} element={<HomeAuthenticated />} />
4746
<Route path={ROUTE.TRIGGER} element={<TriggerWorkflowAuthenticated />} />
48-
<Route path={ROUTE.MANAGE} element={<ManageWorkflowAuthenticated />} />
4947
<Route path={`${ROUTE.TRIGGERFORM}/:workflowId`} element={<TriggerWorkflowFormAuthenticated />} />
5048
</Routes>
5149
);

client/src/assets/text.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"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.",
7777
"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.",
7878
"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.",
79-
"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."
79+
"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."
8080
},
8181
"manageWorkflow": {
8282
"mainDescription": "This scenario displays a list of workflow instances, the status of those instances, and the option to cancel them.",
@@ -87,6 +87,7 @@
8787
},
8888
"workflowList": {
8989
"doNotHaveWorkflow": "You do not have any workflows in your account",
90+
"pleaseCreateWorkflow": "Please <a href=''>manually create a workflow</a> in your account before using the sample app.",
9091
"columns": {
9192
"lastRunStatus": "Status of last run",
9293
"workflowName": "Workflow name",
@@ -137,4 +138,4 @@
137138
"createsandbox": "https://go.docusign.com/o/sandbox/",
138139
"learnmore": "https://developers.docusign.com/docs/maestro-api/"
139140
}
140-
}
141+
}

client/src/components/Header/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const Header = () => {
3030
return (
3131
<header className={styles.Header} role="banner">
3232
<nav className={styles.navBar}>
33-
<Link className={styles.logo} to={ROUTE.ROOT}>
33+
<Link className={styles.logo} to={ROUTE.ROOT} onClick={handleLogOut}>
3434
<img src={logo} alt="logo" />
3535
</Link>
3636
<div className={styles.headerEnd}>

client/src/components/LoginForm/LoginForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const LoginForm = ({ togglePopup }) => {
2626
if (authType === LoginStatus.JWT) {
2727
const { data: userInfo } = await api.jwt.login();
2828
dispatch(authorizeUser(authType, userInfo.name, userInfo.email));
29-
navigate(ROUTE.HOME);
29+
navigate(ROUTE.TRIGGER);
3030
dispatch(closePopupWindow());
3131
dispatch(closeLoadingCircleInPopup());
3232
}

client/src/components/Popups/WorkflowTriggerResult/WorkflowTriggerResult.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const WorkflowTriggerResult = ({ workflowInstanceUrl }) => {
1313

1414
const handleFinishTrigger = async () => {
1515
dispatch(closePopupWindow());
16-
navigate(ROUTE.HOME);
16+
navigate(ROUTE.TRIGGER);
1717
};
1818

1919
return (

client/src/components/TriggerForm/TriggerForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const TriggerForm = ({ workflowId, templateType }) => {
5858

5959
const handleCloseTriggerPopup = () => {
6060
dispatch(closePopupWindow());
61-
navigate(ROUTE.HOME);
61+
navigate(ROUTE.TRIGGER);
6262
};
6363

6464
const handleSubmit = async event => {

client/src/components/WorkflowDescription/WorkflowDescription.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ import { Link } from 'react-router-dom';
22
import styles from './WorkflowDescription.module.css';
33
import textContent from '../../assets/text.json';
44

5-
const WorkflowDescription = ({ title, behindTheScenesComponent, backRoute }) => {
5+
const WorkflowDescription = ({ title, behindTheScenesComponent }) => {
66
return (
77
<div className={styles.descriptionContainer}>
8-
<Link to={backRoute}>
9-
<button className={styles.backButton}>{textContent.buttons.backHome}</button>
10-
</Link>
118
<h2>{title}</h2>
129
<div className={`dropdown ${styles.dropDown}`}>
1310
<button

client/src/components/WorkflowList/WorkflowList.jsx

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,8 @@ const WorkflowList = ({ items, interactionType, isLoading }) => {
9191
return (
9292
<div className={`list-group ${styles.listGroup}`}>
9393
<div className={styles.emptyListContainer}>
94-
<h1>{textContent.workflowList.doNotHaveWorkflow}</h1>
95-
<Link to={ROUTE.HOME}>
96-
<button className={styles.defaultButton} type="button">
97-
{interactionType === WorkflowItemsInteractionType.TRIGGER
98-
? textContent.buttons.createWorkflow
99-
: textContent.buttons.triggerNewWorkflow}
100-
</button>
101-
</Link>
94+
<h2>{textContent.workflowList.doNotHaveWorkflow}</h2>
95+
<h4 className={styles.resetStyle} dangerouslySetInnerHTML={{ __html: textContent.workflowList.pleaseCreateWorkflow }}></h4>
10296
</div>
10397
</div>
10498
);
@@ -109,7 +103,6 @@ const WorkflowList = ({ items, interactionType, isLoading }) => {
109103
{interactionType === WorkflowItemsInteractionType.TRIGGER && (
110104
<div className={styles.headerRow}>
111105
<div>
112-
<p>{textContent.workflowList.columns.lastRunStatus}</p>
113106
<p>{textContent.workflowList.columns.workflowName}</p>
114107
</div>
115108
<div className={styles.typeHeader}>
@@ -118,66 +111,20 @@ const WorkflowList = ({ items, interactionType, isLoading }) => {
118111
</div>
119112
)}
120113

121-
{interactionType === WorkflowItemsInteractionType.MANAGE && (
122-
<div className={styles.headerAction}>
123-
<button type="button" onClick={() => navigate(ROUTE.TRIGGER)}>
124-
{textContent.buttons.triggerNewWorkflow}
125-
</button>
126-
</div>
127-
)}
128-
129114
<div className={styles.list} style={items.length >= 2 ? listStyles : {}}>
130115
{items.map((item, idx) => (
131116
<div key={`${item.name}${idx}`} className={`list-group-item list-group-item-action ${styles.listRow}`}>
132117
<div className={styles.cell1}>
133-
{loadingWorkflow.isLoading && loadingWorkflow.id === item.id ? (
134-
<StatusLoader />
135-
) : (
136-
<WorkflowStatusPill status={item.instanceState} />
137-
)}
138118
<h4>{WorkflowItemsInteractionType.TRIGGER ? item.name : item.instanceName}</h4>
139119
</div>
120+
140121
<p>{item.type}</p>
141122

142123
{interactionType === WorkflowItemsInteractionType.TRIGGER && (
143-
<button onClick={() => navigate(`${ROUTE.TRIGGERFORM}/${item.id}?type=${item.type}`)}>
124+
<button className={styles.cell3} onClick={() => navigate(`${ROUTE.TRIGGERFORM}/${item.id}?type=${item.type}`)}>
144125
{textContent.buttons.triggerWorkflow}
145126
</button>
146127
)}
147-
148-
{interactionType === WorkflowItemsInteractionType.MANAGE && (
149-
<div
150-
className="dropdown"
151-
style={{ position: 'relative !important' }}
152-
onFocus={() => handleFocusDropdown(idx)}
153-
onBlur={() => handleBlurDropdown(idx)}
154-
>
155-
<button
156-
className={styles.dropdownButton}
157-
type="button"
158-
id="dropdownMenuButton"
159-
data-toggle="dropdown"
160-
aria-haspopup="true"
161-
aria-expanded="false"
162-
>
163-
<img src={dropdownSvg} alt="More actions" />
164-
</button>
165-
<div
166-
className={`dropdown-menu dropdown-menu-right ${styles.dropdownMenu}`}
167-
style={dropdownOptions.isOpen && dropdownOptions.id === idx ? { display: 'block' } : {}}
168-
>
169-
<a
170-
className={`dropdown-item ${styles.dropdownItem}`}
171-
onClick={() => handleUpdateWorkflowStatus(item)}
172-
>
173-
{textContent.buttons.updateWorkflow}
174-
</a>
175-
<a className={`dropdown-item ${styles.dropdownItem}`} onClick={() => handleCancelWorkflow(item)}>
176-
{textContent.buttons.cancelWorkflow}
177-
</a>
178-
</div>
179-
</div>
180-
)}
181128
</div>
182129
))}
183130
</div>

client/src/components/WorkflowList/WorkflowList.module.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
display: flex;
8989
flex-direction: row;
9090
gap: 16px;
91+
margin-left: 10px;
92+
}
93+
94+
.listRow .cell3 {
95+
margin-right: 10px;
9196
}
9297

9398
.headerRow {
@@ -180,10 +185,12 @@
180185
display: flex;
181186
flex-direction: column;
182187
justify-items: center;
183-
align-items: center;
184188
padding-top: 15rem;
185189
padding-left: 5rem;
186-
width: 80%;
190+
}
191+
192+
.resetStyle {
193+
all: unset;
187194
}
188195

189196
.loaderContainer {

client/src/pages/Hero/Hero.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ const Hero = () => {
2323

2424
if (authType === LoginStatus.ACG) {
2525
const isLoggedIn = await api.acg.loginStatus();
26-
isLoggedIn && navigate(ROUTE.HOME);
26+
isLoggedIn && navigate(ROUTE.TRIGGER);
2727
}
2828
if (authType === LoginStatus.JWT) {
2929
const isLoggedIn = await api.jwt.loginStatus();
30-
isLoggedIn && navigate(ROUTE.HOME);
30+
isLoggedIn && navigate(ROUTE.TRIGGER);
3131
}
3232
};
3333

0 commit comments

Comments
 (0)