Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Jira
runs-on: ubuntu-latest
steps:
- uses: openstax/jira-linked-action@v0.1.14
- uses: openstax/jira-linked-action@v0.1.15
with:
jira_site: openstax
jira_project: DISCO
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"styled-components": "*"
},
"devDependencies": {
"npm-run-all": "^4.1.5",
"@ladle/react": "^2.1.2",
"@openstax/ts-utils": "^1.27.6",
"@playwright/test": "^1.25.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^28.1.4",
"@types/node": "^18.7.5",
Expand All @@ -59,6 +59,7 @@
"jest-environment-node": "^29.6.2",
"microbundle": "^0.15.1",
"node-fetch": "<3.0.0",
"npm-run-all": "^4.1.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^16.8.0",
Expand Down
30 changes: 0 additions & 30 deletions src/components/HelpMenu.spec.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createGlobalStyle } from 'styled-components';
import { BodyPortalSlotsContext } from './BodyPortalSlotsContext';
import { HelpMenu, HelpMenuItem } from './HelpMenu';
import { NavBar } from './NavBar';
import { BodyPortalSlotsContext } from '../BodyPortalSlotsContext';
import { HelpMenu, HelpMenuItem } from '.';
import { NavBar } from '../NavBar';

const BodyPortalGlobalStyle = createGlobalStyle`
[data-portal-slot="nav"] {
Expand All @@ -11,12 +11,18 @@ const BodyPortalGlobalStyle = createGlobalStyle`
}
`;

const contactParams = [
{ key: 'userId', value: 'test' },
{ key: 'userFirstName', value: 'test' },
{ key: 'organizationName', value: 'org' },
];

export const Default = () => {
return (
<BodyPortalSlotsContext.Provider value={['nav', 'root']}>
<BodyPortalGlobalStyle />
<NavBar logo>
<HelpMenu contactFormParams={[{key: 'userId', value: 'test'}]}>
<HelpMenu contactFormParams={contactParams}>
<HelpMenuItem onAction={() => window.alert('Ran HelpMenu callback function')}>
Test Callback
</HelpMenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`HelpMenu matches snapshot 1`] = `
<body>
<nav
aria-hidden="true"
class="sc-jqUVSM cCVOTe"
data-portal-slot="nav"
>
Expand Down Expand Up @@ -50,10 +51,14 @@ exports[`HelpMenu matches snapshot 1`] = `
/>
</svg>
<button
aria-expanded="false"
aria-controls="react-aria-2"
aria-expanded="true"
aria-haspopup="true"
aria-label="Help menu"
class="sc-bczRLJ dKgZvy sc-eCYdqJ henMfs"
data-focus-visible="true"
data-focused="true"
data-pressed="true"
data-rac=""
data-react-aria-pressable="true"
id="react-aria-1"
Expand All @@ -67,8 +72,113 @@ exports[`HelpMenu matches snapshot 1`] = `
</div>
</nav>
<main
aria-hidden="true"
id="root"
/>
<div />
<div
aria-hidden="true"
/>
<script
aria-hidden="true"
src="https://openstax.my.site.com/ESWWebMessagingDeployme1716235390398/assets/js/bootstrap.min.js"
/>
<span
aria-hidden="true"
data-focus-scope-start="true"
hidden=""
/>
<div
aria-hidden="true"
data-testid="underlay"
style="position: fixed; inset: 0;"
/>
<div
style="display: contents;"
>
<div
aria-labelledby="react-aria-1"
class="sc-hKMtZM gqPqDX"
data-placement="bottom"
data-rac=""
data-trigger="MenuTrigger"
dir="ltr"
role="dialog"
style="position: absolute; z-index: 100000; max-height: -24px; left: 12px; top: 8px;"
tabindex="-1"
>
<div
style="border: 0px; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap;"
>
<button
aria-label="Dismiss"
id="react-aria-4"
style="width: 1px; height: 1px;"
tabindex="-1"
/>
</div>
<template
data-react-aria-hidden="true"
/>
<span
data-focus-scope-start="true"
hidden=""
/>
<div
aria-labelledby="react-aria-1"
class="react-aria-Menu"
data-collection="react-aria-5"
data-rac=""
id="react-aria-2"
role="menu"
tabindex="-1"
>
<div
class="sc-gsnTZi sc-jSMfEi bPmhIj"
data-collection="react-aria-5"
data-focus-visible="true"
data-focused="true"
data-key="react-aria-1"
data-rac=""
data-react-aria-pressable="true"
id="react-aria-10"
role="menuitem"
tabindex="0"
>
Report an issue
</div>
<div
class="sc-gsnTZi sc-jSMfEi bPmhIj"
data-collection="react-aria-5"
data-key="react-aria-2"
data-rac=""
data-react-aria-pressable="true"
id="react-aria-14"
role="menuitem"
tabindex="-1"
>
Test Callback
</div>
</div>
<span
data-focus-scope-end="true"
hidden=""
/>
<div
style="border: 0px; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap;"
>
<button
aria-label="Dismiss"
id="react-aria-6"
style="width: 1px; height: 1px;"
tabindex="-1"
/>
</div>
</div>
</div>
<span
aria-hidden="true"
data-focus-scope-end="true"
hidden=""
/>
</body>
`;
22 changes: 22 additions & 0 deletions src/components/HelpMenu/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const orgId = '00DU0000000Kwch';
export const app = 'Web_Messaging_Deployment';
export const deployment = 'ESWWebMessagingDeployme1716235390398';
export const deploymentURL = `https://openstax.my.site.com/${deployment}`;
export const scrt2URL = 'https://openstax.my.salesforce-scrt.com';
export const scriptUrl = `${deploymentURL}/assets/js/bootstrap.min.js`;
export const businessHoursURL =
`${scrt2URL}/embeddedservice/v1/businesshours?orgId=${orgId}&esConfigName=${app}`;
export const chatEmbedDefaults = {
orgId,
app,
deploymentURL,
scrt2URL,
scriptUrl,
businessHoursURL,
} as const;

export const embeddedChatEvents = {
READY: 'onEmbeddedMessagingReady',
BUSINESS_HOURS_STARTED: 'onEmbeddedMessagingBusinessHoursStarted',
BUSINESS_HOURS_ENDED: 'onEmbeddedMessagingBusinessHoursEnded',
} as const;
Loading
Loading