IO-1998 Filter schedule by event type.
This commit is contained in:
@@ -5,8 +5,18 @@ import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { QUERY_AUDIT_TRAIL } from "../../graphql/audit_trail.queries";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobAuditTrail);
|
||||
|
||||
export default function JobAuditTrail({ jobId }) {
|
||||
export function JobAuditTrail({ currentUser, jobId }) {
|
||||
const { t } = useTranslation();
|
||||
const { loading, data, refetch } = useQuery(QUERY_AUDIT_TRAIL, {
|
||||
variables: { jobid: jobId },
|
||||
@@ -75,26 +85,28 @@ export default function JobAuditTrail({ jobId }) {
|
||||
dataIndex: "subject",
|
||||
key: "subject",
|
||||
},
|
||||
// {
|
||||
// title: t("audit.fields.contents"),
|
||||
// dataIndex: "contents",
|
||||
// key: "contents",
|
||||
// width: "10%",
|
||||
// render: (text, record) => (
|
||||
// <Button
|
||||
// onClick={() => {
|
||||
// var win = window.open(
|
||||
// "",
|
||||
// "Title",
|
||||
// "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=400,"
|
||||
// );
|
||||
// win.document.body.innerHTML = record.contents;
|
||||
// }}
|
||||
// >
|
||||
// Preview
|
||||
// </Button>
|
||||
// ),
|
||||
// },
|
||||
...(currentUser?.email.includes("@imex.") && [
|
||||
{
|
||||
title: t("audit.fields.contents"),
|
||||
dataIndex: "contents",
|
||||
key: "contents",
|
||||
width: "10%",
|
||||
render: (text, record) => (
|
||||
<Button
|
||||
onClick={() => {
|
||||
var win = window.open(
|
||||
"",
|
||||
"Title",
|
||||
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=400,"
|
||||
);
|
||||
win.document.body.innerHTML = record.contents;
|
||||
}}
|
||||
>
|
||||
Preview
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
]),
|
||||
];
|
||||
return (
|
||||
<Row gutter={[16, 16]}>
|
||||
|
||||
Reference in New Issue
Block a user