Преглед на файлове

Hide create invoice button

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi преди 1 година
родител
ревизия
c510077150
променени са 2 файла, в които са добавени 9 реда и са изтрити 3 реда
  1. +3
    -2
      src/components/InvoiceSearch/CreateInvoiceModal.tsx
  2. +6
    -1
      src/components/InvoiceSearch/InvoiceTable.tsx

+ 3
- 2
src/components/InvoiceSearch/CreateInvoiceModal.tsx Целия файл

@@ -56,8 +56,9 @@ const CreateInvoiceModal: React.FC<Props> = ({isOpen, onClose}) => {
</Typography>
<Box
sx={{
marginInline: -4,
marginBlock: 4,
display: 'flex',
justifyContent: 'center',
marginBlock: 2,
}}
>
<InvoiceTable/>


+ 6
- 1
src/components/InvoiceSearch/InvoiceTable.tsx Целия файл

@@ -21,6 +21,7 @@ import { GridToolbarContainer } from "@mui/x-data-grid";
import { FooterPropsOverrides } from "@mui/x-data-grid";
import { th } from "@faker-js/faker";
import { GridRowIdGetter } from "@mui/x-data-grid";
import { useFormContext } from "react-hook-form";

type InvoiceListError = {
[field in keyof invoiceList]?: string;
@@ -53,6 +54,8 @@ const InvoiceTable: React.FC = () => {
const { t } = useTranslation()
const [rowModesModel, setRowModesModel] = useState<GridRowModesModel>({});
const [selectedRow, setSelectedRow] = useState<invoiceListRow[] | []>([]);
const { getValues, setValue, clearErrors, setError } =
useFormContext<any>();
const apiRef = useGridApiRef();

const validateInvoiceEntry = (
@@ -176,7 +179,8 @@ const InvoiceTable: React.FC = () => {

useEffect(() => {
console.log(selectedRow)
}, [selectedRow]);
setValue("data", selectedRow)
}, [selectedRow, setValue]);


const editCombinedColumns = useMemo<GridColDef[]>(
@@ -245,6 +249,7 @@ const footer = (
border: "1px solid",
borderColor: "warning.main",
},
height: 400, width: '95%'
}}
disableColumnMenu
editMode="row"


Зареждане…
Отказ
Запис