2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00

Hide "Expiry Date" column if feature not enabled (#8172)

This commit is contained in:
Oliver 2024-09-26 11:03:37 +10:00 committed by GitHub
parent 752b33177b
commit 1522d1e615
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,6 +25,7 @@ import { notYetImplemented } from '../../functions/notifications';
import { useCreateApiFormModal } from '../../hooks/UseForm'; import { useCreateApiFormModal } from '../../hooks/UseForm';
import { useTable } from '../../hooks/UseTable'; import { useTable } from '../../hooks/UseTable';
import { apiUrl } from '../../states/ApiState'; import { apiUrl } from '../../states/ApiState';
import { useGlobalSettingsState } from '../../states/SettingsState';
import { useUserState } from '../../states/UserState'; import { useUserState } from '../../states/UserState';
import { TableColumn } from '../Column'; import { TableColumn } from '../Column';
import { import {
@ -234,7 +235,8 @@ function stockItemTableColumns(): TableColumn[] {
}), }),
DateColumn({ DateColumn({
title: t`Expiry Date`, title: t`Expiry Date`,
accessor: 'expiry_date' accessor: 'expiry_date',
hidden: !useGlobalSettingsState.getState().isSet('STOCK_ENABLE_EXPIRY')
}), }),
DateColumn({ DateColumn({
title: t`Last Updated`, title: t`Last Updated`,