Skip to content

Commit 05d3ac0

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/lodash-4.17.23
Signed-off-by: Raileen Del Rosario <43893067+raileendr@users.noreply.github.com>
2 parents e67f9bf + 929bc2d commit 05d3ac0

23 files changed

Lines changed: 2817 additions & 902 deletions

File tree

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/package-lock.json

Lines changed: 1749 additions & 327 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"name": "clientapp-temp",
33
"version": "0.1.0",
44
"private": true,
5+
"proxy": "http://localhost:5000",
56
"dependencies": {
67
"@testing-library/dom": "^10.4.1",
78
"@testing-library/jest-dom": "^6.9.1",
89
"@testing-library/react": "^16.3.0",
910
"@testing-library/user-event": "^13.5.0",
10-
"ajv": "^8.17.1",
11-
"axios": "^1.13.2",
11+
"ajv": "^8.18.0",
12+
"axios": "^1.13.5",
1213
"bootstrap": "^5.3.3",
1314
"html-react-parser": "^5.2.10",
1415
"i18next": "^25.6.3",
@@ -18,7 +19,7 @@
1819
"react-dom": "^19.2.0",
1920
"react-hot-toast": "^2.6.0",
2021
"react-i18next": "^16.3.5",
21-
"react-router-dom": "^7.9.6",
22+
"react-router-dom": "^7.12.0",
2223
"react-scripts": "^5.0.1",
2324
"sass": "^1.94.2",
2425
"web-vitals": "^2.1.4"
91.4 KB
Loading

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/public/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
<meta name="theme-color" content="#000000" />
88
<meta name="description" content="Web site created using create-react-app" />
99
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
10+
<meta property="og:title" content="Workspaces Sample App" />
11+
<meta property="og:description" content="Explore how organizations use Workspaces to manage, share, and approve critical documents across teams and clients, secured with Authorization Code Grant authentication." />
12+
<meta property="og:image" content="%PUBLIC_URL%/Workspaces-Sample-App-OG.jpg" />
13+
14+
<!-- Google Tag Manager -->
15+
<script>
16+
(function(w,d,s,l,i){
17+
w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
18+
var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
19+
j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
20+
})(window,document,'script','dataLayer','GTM-WPK6FN5');
21+
</script>
22+
<!-- End Google Tag Manager -->
23+
1024
<!--
1125
manifest.json provides metadata used when your web app is installed on a
1226
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/src/components/AgreementRow.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useTranslation } from 'react-i18next';
22

3-
export const AgreementRow = ({ label, checked, onToggle, onPreview }) => {
3+
export const AgreementRow = ({ label, checked, onToggle, onPreview, showPreview = true }) => {
44
const { t } = useTranslation();
55
return (
66
<div className="agreement-row">
@@ -12,10 +12,11 @@ export const AgreementRow = ({ label, checked, onToggle, onPreview }) => {
1212
className="agreement-row__checkbox"
1313
/>
1414
{label}
15-
16-
<button onClick={onPreview} className="agreement-row__preview-btn">
17-
{t('Common.Preview')}
18-
</button>
15+
{showPreview && onPreview && (
16+
<button onClick={onPreview} className="agreement-row__preview-btn">
17+
{t('Common.Preview')}
18+
</button>
19+
)}
1920
</label>
2021
</div>
2122
);

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/src/components/Layout.js

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
22
import { Link, Outlet, useNavigate, useLocation } from 'react-router-dom';
33
import { useTranslation } from 'react-i18next';
44
import LoginModal from '../loginModal/LoginModal';
5+
import { useAcgLogin } from '../hooks/useAcgLogin';
56
import { ReactComponent as ChevronRightIcon } from '../assets/icons/chevron-right.svg';
67
import { ReactComponent as CrossIcon } from '../assets/icons/cross.svg';
78
import { ReactComponent as LogoIcon } from '../assets/icons/logo_40х40.svg';
@@ -27,6 +28,9 @@ export default function Layout() {
2728
{ key: 'demo', label: t('Layout.Demo'), url: 'https://account-d.docusign.com' },
2829
{ key: 'production', label: t('Layout.Production'), url: 'https://account.docusign.com' },
2930
];
31+
32+
const { loginWithAcg } = useAcgLogin(API_BASE, ENVIRONMENTS[0].url);
33+
3034
const [accountStatus, setAccountStatus] = useState(null);
3135
const [isTestAccount, setIsTestAccount] = useState(() =>
3236
typeof JSON.parse(localStorage.getItem('isTestAccount')) === 'boolean'
@@ -86,9 +90,30 @@ export default function Layout() {
8690
useEffect(() => {
8791
const authStep = getCookie('ds_auth_step');
8892
if (authStep === 'acg-consent' && accountStatus?.isConsentGranted) {
89-
setIsLoginOpen(true);
93+
// Complete ACG login directly without opening modal
94+
setIsTestAccount(false);
95+
loginWithAcg(async () => {
96+
await fetchStatus();
97+
clearAuthCookie();
98+
}).catch(err => {
99+
console.error('Failed to complete ACG login after consent:', err);
100+
clearAuthCookie();
101+
});
90102
}
91-
}, [accountStatus]);
103+
}, [accountStatus, loginWithAcg]);
104+
105+
const handleDirectLogin = async () => {
106+
setIsNavOpen(false);
107+
setIsTestAccount(false);
108+
try {
109+
await loginWithAcg(async () => {
110+
await fetchStatus();
111+
clearAuthCookie();
112+
});
113+
} catch (err) {
114+
console.error('Login failed:', err);
115+
}
116+
};
92117

93118
const openLoginModal = () => {
94119
setIsNavOpen(false);
@@ -167,7 +192,7 @@ export default function Layout() {
167192
<button
168193
className="pill pill--light nav__cta"
169194
type="button"
170-
onClick={openLoginModal}
195+
onClick={handleDirectLogin}
171196
>
172197
{t('Login')}
173198
</button>
@@ -178,7 +203,7 @@ export default function Layout() {
178203
</header>
179204

180205
<main className="main-content">
181-
<Outlet context={{ openLoginModal, accountStatus, isTestAccount }} />
206+
<Outlet context={{ openLoginModal, handleDirectLogin, accountStatus, isTestAccount }} />
182207
</main>
183208

184209
<footer className="footer">

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/src/components/RequestFormPhysician.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export const RequestFormPhysician = ({
201201
listPhysician.map((item) => (
202202
<DoctorRow
203203
key={item?.workspaceId}
204-
label={item.name}
204+
label={`Dr. ${item.name}`}
205205
checked={selectedPhysician?.workspaceId === item?.workspaceId}
206206
onToggle={() => toggle(item)}
207207
/>

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/src/components/SelectDocuments.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ReactComponent as ArrowLeftIcon } from '../assets/icons/arrow-left.svg'
77
const listToSign = [
88
{
99
id: 21,
10-
name: 'Engagement Agreement.pdf',
10+
name: 'Engagement Letter.pdf',
1111
path: '/Engagement Agreement placeholder.pdf',
1212
isForSignature: true,
1313
},
@@ -95,6 +95,7 @@ export const SelectDocuments = ({ onAddDocuments, requesting = false, onPrevious
9595
onPreview={() => {
9696
handlePreview(item);
9797
}}
98+
showPreview={false}
9899
/>
99100
))}
100101
</div>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { useTranslation } from 'react-i18next';
2+
import './WorkspaceAccessErrorModal.scss';
3+
4+
function WorkspaceAccessErrorModal({ isOpen, onClose }) {
5+
const { t } = useTranslation();
6+
7+
if (!isOpen) return null;
8+
9+
return (
10+
<div className="workspace-error-modal__backdrop" role="dialog" aria-modal="true">
11+
<div className="workspace-error-modal">
12+
<button
13+
className="workspace-error-modal__close"
14+
type="button"
15+
onClick={onClose}
16+
aria-label={t('Common.Close')}
17+
>
18+
×
19+
</button>
20+
<div className="workspace-error-modal__header">
21+
<h2>{t('WorkspaceAccessError.Title')}</h2>
22+
</div>
23+
<div className="workspace-error-modal__content">
24+
<p className="workspace-error-modal__description">
25+
{t('WorkspaceAccessError.Description')}
26+
</p>
27+
<div className="workspace-error-modal__cta">
28+
<a
29+
href="https://apps-d.docusign.com/workspaces"
30+
target="_blank"
31+
rel="noreferrer"
32+
className="workspace-error-modal__primary-button"
33+
>
34+
{t('WorkspaceAccessError.EnableWorkspaces')}
35+
</a>
36+
</div>
37+
<div className="workspace-error-modal__support">
38+
<p>{t('WorkspaceAccessError.NeedHelp')}</p>
39+
<a
40+
href="https://developers.docusign.com/docs/workspaces-api/"
41+
target="_blank"
42+
rel="noreferrer"
43+
className="workspace-error-modal__link"
44+
>
45+
{t('WorkspaceAccessError.ViewDocumentation')}
46+
</a>
47+
<a
48+
href="https://developers.docusign.com/support/"
49+
target="_blank"
50+
rel="noreferrer"
51+
className="workspace-error-modal__link"
52+
>
53+
{t('WorkspaceAccessError.ContactSupport')}
54+
</a>
55+
</div>
56+
</div>
57+
<div className="workspace-error-modal__actions">
58+
<button className="primary-btn" type="button" onClick={onClose}>
59+
{t('Common.Close')}
60+
</button>
61+
</div>
62+
</div>
63+
</div>
64+
);
65+
}
66+
67+
export default WorkspaceAccessErrorModal;

0 commit comments

Comments
 (0)