Skip to content

Commit

Permalink
Merge pull request #982 from DeepBlueCLtd/957_live_items_asset_report…
Browse files Browse the repository at this point in the history
…_fails_with_projekt_filter

live items asset report fails with project filter issue resolved
  • Loading branch information
IanMayo authored Jan 10, 2024
2 parents 47e8c3f + 3083b87 commit 4a079dc
Showing 1 changed file with 48 additions and 36 deletions.
84 changes: 48 additions & 36 deletions src/resources/items/ItemsReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DateTime } from 'luxon'
import { Download } from '@mui/icons-material'
import Printable from '../../components/Printable'
import FlexBox from '../../components/FlexBox'

import { useConfigData } from '../../utils/useConfigData'
type Props = PartialBy<ListProps, 'children'> & {
footer?: React.FunctionComponent
headStyle?: Record<string, any>
Expand Down Expand Up @@ -99,7 +99,7 @@ export default function ItemsReport(
const { footer, children, headStyle = {}, sx = {}, ...rest } = props
return (
<List
resource={constants.R_ITEMS}
resource={constants.R_RICH_ITEMS}
pagination={false}
actions={false}
sx={{ margin: '20px 0' }}
Expand Down Expand Up @@ -134,40 +134,6 @@ export default function ItemsReport(
</List>
)
}

const referenceFields: RefFieldType[] = [
{
name: 'vaultLocation',
resource: constants.R_VAULT_LOCATION,
source: 'name',
label: 'Vault Location'
},
{
name: 'createdBy_eq',
resource: constants.R_USERS,
source: 'name',
label: 'Created By'
},
{
name: 'createdBy',
resource: constants.R_USERS,
source: 'name',
label: 'Created By'
},
{
name: 'protectiveMarking',
resource: constants.R_PROTECTIVE_MARKING,
source: 'name',
label: 'Protective Marking'
},
{
name: 'batch',
resource: constants.R_BATCHES,
source: 'batchNumber',
label: 'Batch'
}
]

const fields: FieldType[] = [
{
name: 'mediaType',
Expand Down Expand Up @@ -206,6 +172,52 @@ export function ItemAssetReport(props: Props): React.ReactElement {
}

const { data } = useGetIdentity()
const configDate = useConfigData()

const referenceFields: RefFieldType[] = [
{
name: 'vaultLocation',
resource: constants.R_VAULT_LOCATION,
source: 'name',
label: 'Vault Location'
},
{
name: 'createdBy_eq',
resource: constants.R_USERS,
source: 'name',
label: 'Created By'
},
{
name: 'createdBy',
resource: constants.R_USERS,
source: 'name',
label: 'Created By'
},
{
name: 'protectiveMarking',
resource: constants.R_PROTECTIVE_MARKING,
source: 'name',
label: 'Protective Marking'
},
{
name: 'batch',
resource: constants.R_BATCHES,
source: 'batchNumber',
label: 'Batch'
},
{
name: 'project',
resource: constants.R_PROJECTS,
source: 'name',
label: configDate?.projectName ?? 'Default Label'
},
{
name: 'platform',
resource: constants.R_PLATFORMS,
source: 'name',
label: 'Platform'
}
]

const handleOpen = (open: boolean) => () => {
setOpen(open)
Expand Down

0 comments on commit 4a079dc

Please sign in to comment.