Skip to content

Commit

Permalink
Merge pull request #5861 from VivekVinushanth/vv-add-componentIds
Browse files Browse the repository at this point in the history
Add component Ids for audit logs
  • Loading branch information
VivekVinushanth committed Apr 1, 2024
2 parents 8913737 + bd79ef3 commit d2da745
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-bees-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/features": patch
---

add componentId for audit logs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { EmptyPlaceholder,
LinkButton,
Message,
PrimaryButton } from "@wso2is/react-components";
import { getEmptyPlaceholderIllustrations } from "../../../admin-core-v1";
import React, {
MutableRefObject,
ReactElement,
Expand All @@ -32,6 +31,7 @@ import React, {
} from "react";
import { useTranslation } from "react-i18next";
import { Icon, Label } from "semantic-ui-react";
import { getEmptyPlaceholderIllustrations } from "../../../admin-core-v1";
import InfiniteScrollContainer from "../logs/components/infinite-scroll-container";
import TimeRangeSelector from "../logs/components/time-range-selector";
import { LogsConstants } from "../logs/constants";
Expand Down Expand Up @@ -548,3 +548,13 @@ export const AuditLogsPage = (props: AuditPagePropsInterface) : ReactElement =>
</div>
);
};


/**
* Default props for the component.
*/
AuditLogsPage.defaultProps = {
"data-componentid": "audit-logs"
};

export default AuditLogsPage;
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ const InfiniteScrollContainer = (props: InfiniteScrollContainerPropsInterface):
<td className="view-data-button">
<Link
data-testid={ `${ componentId }-${ logObject["id"] }-view-data-button` }
data-componentid={ `${ componentId }-view-data-button` }
underline="hover"
onClick={ () => handleLogDataViewOpen(logObject) }
>
Expand All @@ -261,6 +262,7 @@ const InfiniteScrollContainer = (props: InfiniteScrollContainerPropsInterface):
<td className="download-data-button">
<Link
data-testid={ `${ componentId }-${ logObject["id"] }-download-data-button` }
data-componentid={ `${ componentId }-download-data-button` }
underline="hover"
onClick={ () => exportDataOfLog(logObject) }
>
Expand Down Expand Up @@ -327,7 +329,10 @@ const InfiniteScrollContainer = (props: InfiniteScrollContainerPropsInterface):
);

const LogViewerToolbar: ReactElement = (
<Box className="log-data-viewer-toolbar-container">
<Box
className="log-data-viewer-toolbar-container"
data-componentid={ `${ componentId }-toolbar-container` }
>
<Toolbar variant="dense">
<Box>
<Typography>
Expand All @@ -339,19 +344,22 @@ const InfiniteScrollContainer = (props: InfiniteScrollContainerPropsInterface):
<Box className="actions">
<Button
className="data-viewer-buttons"
data-componentid={ `${ componentId }-log-data-viewer-panel-download-button` }
onClick={ exportCurrentLog }
startIcon={ <DownloadIcon /> }
>
{ t("extensions:develop.monitor.logView.logDataviewer.download") }
</Button>
<Button
data-componentid={ `${ componentId }-log-data-viewer-panel-copy-button` }
className="data-viewer-buttons"
onClick={ copyCurrentLog }
startIcon={ <CopyIcon /> }
>
{ t("extensions:develop.monitor.logView.logDataviewer.copy") }
</Button>
<IconButton
data-componentid={ `${ componentId }-log-data-viewer-panel-close-button` }
size="small"
onClick={ handleLogDataViewClose }
>
Expand Down Expand Up @@ -407,7 +415,10 @@ const InfiniteScrollContainer = (props: InfiniteScrollContainerPropsInterface):
style={ { padding: "0px" } }
>
<div className="log-row">
<Icon name="dropdown" />
<Icon
name="dropdown"
data-componentid={ `${ componentId }-dropdown-button` }
/>
<div className="log-time-container">
{ getDateFromTimestamp(log.recordedAt) }
<span className="log-time">
Expand Down Expand Up @@ -531,4 +542,12 @@ const InfiniteScrollContainer = (props: InfiniteScrollContainerPropsInterface):
);
};

/**
* Default props for the component.
*/
InfiniteScrollContainer.defaultProps = {
"data-componentid": "logs-container"
};


export default InfiniteScrollContainer;

0 comments on commit d2da745

Please sign in to comment.