Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1fa80c7
First attempt at adding chat
TylerZeroMaster Sep 18, 2025
98523d8
Move stuff; polish things
TylerZeroMaster Sep 18, 2025
e1ac610
Update tests
TylerZeroMaster Sep 22, 2025
3db9a40
Update Jira action version
TylerZeroMaster Sep 22, 2025
cedefed
Update snapshot
TylerZeroMaster Sep 22, 2025
240b55a
Rework fetching to be more robust; update tests
TylerZeroMaster Sep 24, 2025
2aabb41
Remove some extra stuff
TylerZeroMaster Sep 24, 2025
6642ac5
Add pre-chat fields
TylerZeroMaster Sep 26, 2025
644cd6b
Update snapshot for embed service event listeners
TylerZeroMaster Sep 26, 2025
0369aef
Set hidden pre-caht fields immediately if ready
TylerZeroMaster Sep 26, 2025
8a29f4a
More complete handling of prechat fields
TylerZeroMaster Sep 29, 2025
95d6535
Add 10 second grace period for business hours
TylerZeroMaster Sep 29, 2025
c23b069
Fetch business hours on become visible too
TylerZeroMaster Sep 30, 2025
6b1495a
Make grace period adjustable
TylerZeroMaster Sep 30, 2025
97eda52
Pre-fill school field if possible; minor refactor
TylerZeroMaster Sep 30, 2025
9c9259b
Avoid extra renders
TylerZeroMaster Sep 30, 2025
02c064f
Use external business hours and embed
TylerZeroMaster Oct 6, 2025
242610b
Use less nesting in chat configuration
TylerZeroMaster Oct 7, 2025
1bcb194
Remove unused constants
TylerZeroMaster Oct 7, 2025
726a755
Timezones in tests ...
TylerZeroMaster Oct 7, 2025
34f337f
Merge branch 'main' into CORE-954-window-help-menu
TylerZeroMaster Oct 7, 2025
fe10827
Cleanup some lingering comments
TylerZeroMaster Oct 8, 2025
313211b
Type - strict comparison
TylerZeroMaster Oct 9, 2025
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
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.

27 changes: 0 additions & 27 deletions src/components/HelpMenu.stories.tsx

This file was deleted.

46 changes: 46 additions & 0 deletions src/components/HelpMenu/HelpMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { createGlobalStyle } from 'styled-components';
import { BodyPortalSlotsContext } from '../BodyPortalSlotsContext';
import { HelpMenu, HelpMenuItem, HelpMenuProps } from '.';
import { NavBar } from '../NavBar';
import { ChatConfiguration } from './hooks';

const BodyPortalGlobalStyle = createGlobalStyle`
[data-portal-slot="nav"] {
position: fixed;
top: 0;
width: 100%;
}
`;

const happyHoursResponse: ChatConfiguration['businessHours'] = {
businessHoursInfo: {
businessHours: [
{ startTime: Date.now() - 60_000, endTime: Date.now() + 1_440_000 }
]
},
timestamp: Date.now(),
};

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

const chatEmbedPath = 'https://localhost/assignable-chat';
const chatEmbedParams: HelpMenuProps['chatConfig'] = {chatEmbedPath, businessHours: happyHoursResponse};

export const Default = () => {
return (
<BodyPortalSlotsContext.Provider value={['nav', 'root']}>
<BodyPortalGlobalStyle />
<NavBar logo>
<HelpMenu contactFormParams={contactParams} chatConfig={chatEmbedParams}>
<HelpMenuItem onAction={() => window.alert('Ran HelpMenu callback function')}>
Test Callback
</HelpMenuItem>
</HelpMenu>
</NavBar>
</BodyPortalSlotsContext.Provider>
);
};
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,109 @@ exports[`HelpMenu matches snapshot 1`] = `
</div>
</nav>
<main
aria-hidden="true"
id="root"
/>
<div />
<div
aria-hidden="true"
/>
<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>
`;
Loading
Loading