Skip to content

Commit

Permalink
jakes log table edits fall24
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Mains committed Dec 13, 2024
1 parent 9984999 commit 4f0878b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function App(props) {
return forward(operation);
}).concat(
new HttpLink({
uri: 'http://149.165.168.236:8080/v1/graphql',
uri: 'http://localhost:8080/v1/graphql',
//uri: process.env.REACT_APP_HASURA_CLIENT
})
),
Expand All @@ -113,7 +113,7 @@ function App(props) {
return forward(operation);
}).concat(
new HttpLink({
uri: 'http://149.165.168.236:4000/api',
uri: 'http://localhost:4000/api',
//uri: process.env.REACT_APP_AUTH_CLIENT
})
),
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/LogSubTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ function LogSubTable({ originalRow }) {
id: "user",
accessor: (row) => row.audit_user[0]?.first ?? "N/A",
},
...Object.keys(originalRow.original.row_data).map((key) => ({
...Object.keys(originalRow.original.row_data).filter((key) =>
!["id", "password", "username", "email", "actor"].includes(key)).map((key) => ({
Header: key,
key: key,
id: "rd_" + key,
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/pages/LogTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,29 @@ function Table({
]);

React.useEffect(() => {
setExpandAllChecked(true);
toggleAllRowsExpanded(true);
setHiddenColumns(
columns.filter((column) => column.hide).map((column) => column.id)
);
}, [columns, setHiddenColumns]);

// Render the UI for your table
// Originally an "Expand All" button, changed to "Collapse All"
return (
<>
<div className="allExpandToggle">
<div className="allExpandToggle" >
<label>
<input
type="checkbox"
onChange={(e) => {
setExpandAllChecked(e.target.checked);
toggleAllRowsExpanded(e.target.checked);
setExpandAllChecked(!e.target.checked);
toggleAllRowsExpanded(!e.target.checked);
}}
/>
{" Expand All"}
{" Collapse All"}
</label>
</div>

<div className="columnToggle">
{allColumns.map((column) =>
column.label !== undefined ? (
Expand Down

0 comments on commit 4f0878b

Please sign in to comment.