{
+ this.setState(prevState => {
+ let newFilters =
+ typeof updaterOrValue === "function"
+ ? updaterOrValue(prevState.columnFilters)
+ : updaterOrValue;
+ return {columnFilters: newFilters};
+ });
+ }}
+ enableRowSelection={true}
+ rowSelection={this.state.rowSelection}
+ onRowSelectionChange={updater => {
+ this.setState(prevState => ({
+ rowSelection:
+ typeof updater === "function" ? updater(prevState.rowSelection) : updater,
+ }));
+ }}
+ getRowId={row => row._id}
/>
);
} else {
@@ -797,10 +883,6 @@ class RawCriteriaTable extends React.Component {
}
}
-const GradersTable = withSelection(RawGradersTable);
-const GroupsTable = withSelection(RawGroupsTable);
-const CriteriaTable = withSelection(RawCriteriaTable);
-
class GradersActionBox extends React.Component {
render = () => {
let showHiddenGraderTooltip = "";
diff --git a/app/javascript/Components/table/case_sensitive_search_filter.jsx b/app/javascript/Components/table/case_sensitive_search_filter.jsx
new file mode 100644
index 0000000000..8de2b9ff53
--- /dev/null
+++ b/app/javascript/Components/table/case_sensitive_search_filter.jsx
@@ -0,0 +1,44 @@
+import React from "react";
+
+export const defaultSearchPlaceholderText = () => I18n.t("table.search");
+
+export default function CaseSensitiveSearchFilter({column, filterValue}) {
+ let caseSensitive;
+ return (
+
+ {
+ column.setFilterValue({
+ value: event.target.value,
+ caseSensitive: filterValue?.caseSensitive ?? false,
+ });
+ }}
+ />
+
+
+ );
+}
diff --git a/app/javascript/Components/table/filter.jsx b/app/javascript/Components/table/filter.jsx
index 7957cc775a..1db6c34113 100644
--- a/app/javascript/Components/table/filter.jsx
+++ b/app/javascript/Components/table/filter.jsx
@@ -1,19 +1,23 @@
import React from "react";
import SearchFilter from "./search_filter";
import SelectFilter from "./select_filter";
+import CaseSensitiveSearchFilter from "./case_sensitive_search_filter";
function Filter({column, filterValue, facetedUniqueValues}) {
const {filterVariant} = column.columnDef.meta ?? {};
-
- return filterVariant === "select" ? (
-
- ) : (
-
- );
+ if (filterVariant === "select") {
+ return (
+
+ );
+ } else if (filterVariant === "case-sensitive-text") {
+ return ;
+ } else {
+ return ;
+ }
}
function FilterCell({size, column, filterValue, facetedUniqueValues}) {
diff --git a/app/javascript/Components/table/search_filter.jsx b/app/javascript/Components/table/search_filter.jsx
index 1827f8fc39..489b1a34d3 100644
--- a/app/javascript/Components/table/search_filter.jsx
+++ b/app/javascript/Components/table/search_filter.jsx
@@ -1,6 +1,9 @@
import React from "react";
-export const defaultSearchPlaceholderText = () => I18n.t("table.search");
+export const defaultSearchPlaceholderText = (header = "") => {
+ const base = I18n.t("table.search");
+ return header ? `${base} ${header}` : base;
+};
export default function SearchFilter({column, filterValue}) {
return (
@@ -10,7 +13,7 @@ export default function SearchFilter({column, filterValue}) {
onChange={e => column.setFilterValue(e.target.value)}
value={filterValue?.toString() || ""}
style={{width: "100%"}}
- aria-label={defaultSearchPlaceholderText()}
+ aria-label={defaultSearchPlaceholderText(column.columnDef.header)}
/>
);
}
diff --git a/app/javascript/Components/table/table.jsx b/app/javascript/Components/table/table.jsx
index 406e223957..33c96380de 100644
--- a/app/javascript/Components/table/table.jsx
+++ b/app/javascript/Components/table/table.jsx
@@ -224,6 +224,7 @@ export default function Table({
// columnSizing is not used directly in TableRow, but is passed to trigger
// re-render when column sizes change
columnSizing={columnSizing}
+ columns={finalColumns}
/>
))}
{loading && table.getRowModel().rows.length > 0 && (
diff --git a/app/javascript/Components/table/table_row.jsx b/app/javascript/Components/table/table_row.jsx
index 9e336d79f1..6bb1cae9e4 100644
--- a/app/javascript/Components/table/table_row.jsx
+++ b/app/javascript/Components/table/table_row.jsx
@@ -32,5 +32,6 @@ export default React.memo(
prev.row.original === next.row.original &&
prev.isSelected === next.isSelected &&
prev.isExpanded === next.isExpanded &&
- prev.columnSizing === next.columnSizing
+ prev.columnSizing === next.columnSizing &&
+ prev.columns === next.columns
);