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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CardHeader from '@elementor/ui/CardHeader';
import Table from '@elementor/ui/Table';
import TableBody from '@elementor/ui/TableBody';
import TableCell from '@elementor/ui/TableCell';
import TableFooter from '@elementor/ui/TableFooter';
import TableHead from '@elementor/ui/TableHead';
import TablePagination from '@elementor/ui/TablePagination';
import TableRow from '@elementor/ui/TableRow';
Expand Down Expand Up @@ -98,20 +99,22 @@ export const UsageTable = () => {
</TableRow>
))}
</TableBody>
{tablePageData.length > 1 && (
<TableFooter>
<TableRow>
<TablePagination
disabled={!stats.elements.length}
count={stats.elements.length}
onPageChange={(event, page) => setCurrentPage(page)}
page={currentPage}
rowsPerPage={TABLE_PER_PAGE}
rowsPerPageOptions={[]}
sx={{ borderBottom: 'none' }}
/>
</TableRow>
</TableFooter>
)}
</Table>
{tablePageData.length > 1 && (
<Box display="flex" justifyContent="end">
<TablePagination
disabled={!stats.elements.length}
count={stats.elements.length}
onPageChange={(event, page) => setCurrentPage(page)}
page={currentPage}
rowsPerPage={TABLE_PER_PAGE}
rowsPerPageOptions={[]}
sx={{ borderBottom: 'none' }}
/>
</Box>
)}
{stats.elements.length === 0 && <NoData />}
</StyledCardContent>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,17 @@ const ProItemInfotip = ({
}}
onOpen={handleOnOpenEvent}
>
{showIcon && (
<StyledChip
color="promotion"
variant="standard"
icon={<ProCrownIcon />}
size="small"
/>
)}
{children}
<>
{showIcon && (
<StyledChip
color="promotion"
variant="standard"
icon={<ProCrownIcon />}
size="small"
/>
)}
{children}
</>
</Infotip>
);
};
Expand Down
6 changes: 3 additions & 3 deletions modules/settings/assets/js/components/help-menu/popup-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { mixpanelEvents, mixpanelService } from '@ea11y-apps/global/services';
import { __ } from '@wordpress/i18n';
import { openLink } from '../../utils';

export const HelpPopupMenu = (menuProps) => {
export const HelpPopupMenu = ({ closeAction, ...menuProps }) => {
const { setIsGetStartedModalOpen } = useSettings();

const handleGetStartedClick = () => {
Expand All @@ -18,8 +18,8 @@ export const HelpPopupMenu = (menuProps) => {
});
setIsGetStartedModalOpen(true);

if (menuProps.closeAction) {
menuProps.closeAction();
if (closeAction) {
closeAction();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const HtmlToTypography = ({ htmlString, replacements }) => {
};

// Function to transform HTML elements into Typography components
const transform = (node) => {
const transform = (node, index) => {
if (node.type === 'tag') {
const tagName = node.name; // Extract the HTML tag name

Expand All @@ -46,13 +46,15 @@ const HtmlToTypography = ({ htmlString, replacements }) => {
if (supportedTags.includes(tagName)) {
return (
<Typography
key={index}
variant={tagName === 'p' ? 'body2' : 'subtitle2'}
component={tagName}
marginBottom={1}
sx={node.attribs.class ? { textAlign: 'center' } : {}} //for correct render on preview
sx={node.attribs?.class ? { textAlign: 'center' } : {}} //for correct render on preview
color={tagName === 'p' ? 'text.secondary' : 'text.primary'}
>
{node.children && node.children.map((child) => transform(child))}
{node.children &&
node.children.map((child, i) => transform(child, i))}
</Typography>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import API from '../../api/index';
import { truncateEmail } from '../../helpers/popup-menu';
import { openLink } from '../../utils';

export const PopupMenu = (menuProps) => {
export const PopupMenu = ({ closeAction, showUpgradeButton, ...menuProps }) => {
const { save } = useStorage();
const { error } = useToastNotification();
const { planData } = useSettings();
Expand Down Expand Up @@ -117,7 +117,7 @@ export const PopupMenu = (menuProps) => {
<QuotaBar type="scanner" quotaData={planData?.scannedPages} />
<QuotaBar type="ai" quotaData={planData?.aiCredits} />

{!menuProps.showUpgradeButton && (
{!showUpgradeButton && (
<Button
variant="outlined"
startIcon={isFree ? <CrownIcon /> : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const verticalOptions = [
{ value: 'bottom', label: __('Lower', 'pojo-accessibility') },
];

const StyledContainer = styled(Box)`
const StyledContainer = styled(Box, {
shouldForwardProp: (prop) => prop !== 'isError',
})`
display: flex;
gap: ${({ theme }) => theme.spacing(1)};
margin-top: ${({ theme }) => theme.spacing(2)};
Expand Down
4 changes: 2 additions & 2 deletions modules/settings/assets/js/layouts/statement-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const StatementLink = () => {
<Box
display="flex"
flexDirection="row"
fullWidth
width="100%"
alignItems="center"
>
<PageSelect />
Expand Down Expand Up @@ -194,11 +194,11 @@ const StatementLink = () => {
color="info"
size="small"
sx={{ marginLeft: 3 }}
checked={!!accessibilityStatementData?.hideLink}
/>
}
sx={{ marginBottom: 3, alignSelf: 'start', ml: 0 }}
onChange={onHideLink}
checked={accessibilityStatementData?.hideLink}
/>
</FormControl>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const AccessibilityAssistantResultsPagination = () => {
onPageChange={onPageChange}
rowsPerPage={rowsPerPage}
onRowsPerPageChange={onRowsPerPageChange}
colspan="6"
colSpan={6}
align="right"
/>
);
Expand Down
4 changes: 3 additions & 1 deletion modules/settings/assets/js/pages/assistant/results/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ const StyledSearchButton = styled(Button)`
margin-inline-end: ${({ theme }) => theme.spacing(2)};
`;

const StyledTextField = styled(TextField)`
const StyledTextField = styled(TextField, {
shouldForwardProp: (prop) => prop !== 'expanded',
})`
width: ${({ expanded }) => (expanded ? '250px' : '0')};

opacity: ${({ expanded }) => (expanded ? 1 : 0)};
Expand Down
12 changes: 5 additions & 7 deletions modules/settings/assets/js/pages/assistant/results/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const AccessibilityAssistantResultsTable = ({ scannerResults, loading }) => {
</TableCell>
<TableCell>
<VisuallyHidden>
<Typography as="span">
<Typography component="span">
{__('Actions', 'pojo-accessibility')}
</Typography>
</VisuallyHidden>
Expand All @@ -98,16 +98,14 @@ const AccessibilityAssistantResultsTable = ({ scannerResults, loading }) => {
<TableRow>
<StyledShortCell component="th" scope="row">
<Tooltip arrow title={result.page_title}>
{result.page_title}
<span>{result.page_title}</span>
</Tooltip>
</StyledShortCell>

<StyledLongCell>
<span>
<Tooltip arrow title={result.page_url}>
{result.page_url}
</Tooltip>
</span>
<Tooltip arrow title={result.page_url}>
<span>{result.page_url}</span>
</Tooltip>
</StyledLongCell>

<StyledShortCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ IssueList.propTypes = {
issueByCategory: PropTypes.object.isRequired,
};

const StyledIssueLevel = styled(Box)`
const StyledIssueLevel = styled(Box, {
shouldForwardProp: (prop) => prop !== 'colorIndex',
})`
display: flex;
justify-content: flex-start;
align-items: center;
Expand Down
4 changes: 3 additions & 1 deletion modules/settings/assets/js/pages/assistant/stats/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const StatsPieTooltip = (props) => {

export default StatsPieTooltip;

const StyledStatsPieTooltipTitle = styled(Typography)`
const StyledStatsPieTooltipTitle = styled(Typography, {
shouldForwardProp: (prop) => prop !== 'itemColor',
})`
position: relative;
padding-left: 18px;
&:before {
Expand Down