Skip to content

Commit

Permalink
Version bump for Paragon to 22.6.1, with stricter typing (openedx#1146)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency @openedx/paragon to v22.6.1

* fix: lint errors from stricter types in new paragon version

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
bradenmacdonald and renovate[bot] authored Jul 8, 2024
1 parent 9528bfd commit 8cf26e1
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 16 deletions.
15 changes: 12 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/content-tags-drawer/ContentTagsCollapsible.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const CustomMenu = (props) => {
<div className="d-flex flex-row justify-content-end">
<div className="d-inline">
<Button
tabIndex="0"
tabIndex={0}
ref={selectCancelRef}
variant="tertiary"
className="tags-drawer-cancel-button"
Expand All @@ -83,7 +83,7 @@ const CustomMenu = (props) => {
{ intl.formatMessage(messages.collapsibleCancelStagedTagsButtonText) }
</Button>
<Button
tabIndex="0"
tabIndex={0}
ref={selectAddRef}
variant="tertiary"
className="text-info-500 add-tags-button"
Expand Down Expand Up @@ -139,7 +139,7 @@ const CustomIndicatorsContainer = (props) => {
onClick={handleCommitStagedTags}
onMouseDown={(e) => { e.stopPropagation(); e.preventDefault(); }}
ref={selectInlineAddRef}
tabIndex="0"
tabIndex={0}
onKeyDown={disableActionKeys} // To prevent navigating staged tags when button focused
>
{ intl.formatMessage(messages.collapsibleInlineAddStagedTagsButtonText) }
Expand Down Expand Up @@ -240,7 +240,7 @@ const ContentTagsCollapsible = ({
const selectCancelRef = React.useRef(/** @type {HTMLSelectElement | null} */(null));
const selectAddRef = React.useRef(/** @type {HTMLSelectElement | null} */(null));
const selectInlineAddRef = React.useRef(/** @type {HTMLSelectElement | null} */(null));
const selectInlineEditModeRef = React.useRef(/** @type {HTMLSelectElement | null} */(null));
const selectInlineEditModeRef = React.useRef(/** @type {HTMLButtonElement | null} */(null));
const selectRef = React.useRef(/** @type {HTMLSelectElement | null} */(null));

const [selectMenuIsOpen, setSelectMenuIsOpen] = React.useState(false);
Expand Down Expand Up @@ -393,7 +393,7 @@ const ContentTagsCollapsible = ({
<div className="mb-3" key={taxonomyId}>
<p className="text-gray-500">{intl.formatMessage(messages.collapsibleNoTagsAddedText)}
<Button
tabIndex="0"
tabIndex={0}
size="inline"
ref={selectInlineEditModeRef}
variant="link"
Expand Down
2 changes: 1 addition & 1 deletion src/content-tags-drawer/ContentTagsDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const TaxonomyList = ({ contentId }) => {
values={{
link: (
<Button
tabIndex="0"
tabIndex={0}
size="inline"
variant="link"
className="text-info-500 p-0 enable-taxonomies-button"
Expand Down
2 changes: 1 addition & 1 deletion src/content-tags-drawer/ContentTagsDropDownSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ const ContentTagsDropDownSelector = ({
? (
<div>
<Button
tabIndex="0"
tabIndex={0}
variant="tertiary"
iconBefore={Add}
onClick={loadMoreTags}
Expand Down
2 changes: 1 addition & 1 deletion src/files-and-videos/videos-page/VideoThumbnail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const VideoThumbnail = ({
variant="primary"
size="sm"
onClick={fileInputControl.click}
tabIndex="0"
tabIndex={0}
>
{addThumbnailMessage}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const WhatsInClipboard = ({
/>
<p
/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
tabIndex="0"
tabIndex={0}
role="presentation"
ref={triggerElementRef}
className="whats-in-clipboard-text m-0"
Expand Down
2 changes: 1 addition & 1 deletion src/generic/clipboard/paste-component/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const PasteComponent = ({
const handlePopoverToggle = (isOpen) => togglePopover(isOpen);

const renderPopover = (props) => (
<div role="link" ref={popoverElementRef} tabIndex="0">
<div role="link" ref={popoverElementRef} tabIndex={0}>
<Popover
className="clipboard-popover"
id="popover-positioned"
Expand Down
2 changes: 1 addition & 1 deletion src/search-modal/SearchFilterWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const SearchFilterWidget: React.FC<{
children: React.ReactNode;
}> = ({ appliedFilters, ...props }) => {
const [isOpen, open, close] = useToggle(false);
const [target, setTarget] = React.useState(null);
const [target, setTarget] = React.useState<HTMLButtonElement | null>(null);

return (
<>
Expand Down
4 changes: 2 additions & 2 deletions src/search-modal/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import type { ContentHit } from './data/api';
import Highlight from './Highlight';
import messages from './messages';

const STRUCTURAL_TYPE_ICONS: Record<string, React.ReactElement> = {
const STRUCTURAL_TYPE_ICONS: Record<string, React.ComponentType> = {
vertical: TYPE_ICONS_MAP.vertical,
sequential: Folder,
chapter: Folder,
};

function getItemIcon(blockType: string): React.ReactElement {
function getItemIcon(blockType: string): React.ComponentType {
return STRUCTURAL_TYPE_ICONS[blockType] ?? COMPONENT_TYPE_ICON_MAP[blockType] ?? Article;
}

Expand Down

0 comments on commit 8cf26e1

Please sign in to comment.