Преглед изворни кода

Update Equipment Page

master
B.E.N.S.O.N пре 3 недеља
родитељ
комит
1dd0586776
3 измењених фајлова са 1 додато и 9 уклоњено
  1. +0
    -1
      src/components/EquipmentSearch/EquipmentSearchLoading.tsx
  2. +1
    -7
      src/components/EquipmentSearch/EquipmentSearchResults.tsx
  3. +0
    -1
      src/components/EquipmentTypeSearch/EquipmentTypeSearchLoading.tsx

+ 0
- 1
src/components/EquipmentSearch/EquipmentSearchLoading.tsx Прегледај датотеку

@@ -6,7 +6,6 @@ import Skeleton from "@mui/material/Skeleton";
import Stack from "@mui/material/Stack"; import Stack from "@mui/material/Stack";
import React from "react"; import React from "react";


// Can make this nicer
export const EquipmentTypeSearchLoading: React.FC = () => { export const EquipmentTypeSearchLoading: React.FC = () => {
return ( return (
<> <>


+ 1
- 7
src/components/EquipmentSearch/EquipmentSearchResults.tsx Прегледај датотеку

@@ -139,7 +139,6 @@ function isCheckboxColumn<T extends ResultWithId>(
return column.type === "checkbox"; return column.type === "checkbox";
} }


// Icon Component Functions
function convertObjectKeysToLowercase<T extends object>( function convertObjectKeysToLowercase<T extends object>(
obj: T, obj: T,
): object | undefined { ): object | undefined {
@@ -207,7 +206,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
const [page, setPage] = React.useState(0); const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10); const [rowsPerPage, setRowsPerPage] = React.useState(10);
/// this
const handleChangePage: TablePaginationProps["onPageChange"] = ( const handleChangePage: TablePaginationProps["onPageChange"] = (
_event, _event,
newPage, newPage,
@@ -238,7 +236,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
} }
}; };


// checkbox
const currItems = useMemo(() => { const currItems = useMemo(() => {
return items.length > 10 ? items return items.length > 10 ? items
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
@@ -254,7 +251,6 @@ function EquipmentSearchResults<T extends ResultWithId>({


const handleRowClick = useCallback( const handleRowClick = useCallback(
(event: MouseEvent<unknown>, item: T, columns: Column<T>[]) => { (event: MouseEvent<unknown>, item: T, columns: Column<T>[]) => {
// check is disabled or not
let disabled = false; let disabled = false;
columns.forEach((col) => { columns.forEach((col) => {
if (isCheckboxColumn(col) && col.disabled) { if (isCheckboxColumn(col) && col.disabled) {
@@ -269,7 +265,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
return; return;
} }


// set id
const id = item.id; const id = item.id;
if (setCheckboxIds) { if (setCheckboxIds) {
const selectedIndex = checkboxIds.indexOf(id); const selectedIndex = checkboxIds.indexOf(id);
@@ -335,7 +330,7 @@ function EquipmentSearchResults<T extends ResultWithId>({
column.renderHeader() column.renderHeader()
) : ( ) : (
column.label.split('\n').map((line, index) => ( column.label.split('\n').map((line, index) => (
<div key={index}>{line}</div> // Render each line in a div
<div key={index}>{line}</div>
)) ))
)} )}
</TableCell> </TableCell>
@@ -442,7 +437,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
return noWrapper ? table : <Paper sx={{ overflow: "hidden" }}>{table}</Paper>; return noWrapper ? table : <Paper sx={{ overflow: "hidden" }}>{table}</Paper>;
} }


// Table cells
interface TableCellsProps<T extends ResultWithId> { interface TableCellsProps<T extends ResultWithId> {
column: Column<T>; column: Column<T>;
columnName: keyof T; columnName: keyof T;


+ 0
- 1
src/components/EquipmentTypeSearch/EquipmentTypeSearchLoading.tsx Прегледај датотеку

@@ -4,7 +4,6 @@ import Skeleton from "@mui/material/Skeleton";
import Stack from "@mui/material/Stack"; import Stack from "@mui/material/Stack";
import React from "react"; import React from "react";


// Can make this nicer
export const EquipmentTypeSearchLoading: React.FC = () => { export const EquipmentTypeSearchLoading: React.FC = () => {
return ( return (
<> <>


Loading…
Откажи
Сачувај