Skip to content

Commit

Permalink
Squashed commit adding pr/81
Browse files Browse the repository at this point in the history
commit 1b1e2db
Merge: cbe876a 6beb84d
Author: Eric Svebakk <47322476+EricSvebakk@users.noreply.github.com>
Date:   Tue Oct 29 18:26:04 2024 +0100

    Merge pull request #81 from Sebbben/betterUsabilityForCustomTableComponent

    Better usability for custom table component

commit 6beb84d
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Fri Oct 25 10:40:23 2024 +0200

    Implementet default filter parameters for customtable component

commit cbe876a
Merge: 8b529ef ac17a6e
Author: Eric Svebakk <47322476+EricSvebakk@users.noreply.github.com>
Date:   Mon Oct 28 16:24:24 2024 +0100

    Merge pull request #82 from Sebbben/moveBoardPage

    Move board page

commit ac17a6e
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Fri Oct 25 10:54:13 2024 +0200

    moved pages/main/board/* to (pages)/(main)/board

commit 8b529ef
Author: Tepohe <ericatsvebakk@gmail.com>
Date:   Thu Oct 17 16:20:05 2024 +0200

    Updated incorrect url-path

commit 73999a8
Merge: f0bacbb 1861431
Author: Eric Svebakk <ericatsvebakk@gmail.com>
Date:   Thu Oct 17 16:11:36 2024 +0200

    git push origin developmentMerge branch 'Sebbben-featureBetterRegisterFeedback' into development
    Handled merge-conflict for pr/64

commit 1861431
Merge: f0bacbb cd922ac
Author: Tepohe <ericatsvebakk@gmail.com>
Date:   Thu Oct 17 16:08:02 2024 +0200

    Handled merge-conflict

commit f0bacbb
Merge: d26bd3f d198b94
Author: Eric Svebakk <47322476+EricSvebakk@users.noreply.github.com>
Date:   Thu Oct 17 15:46:05 2024 +0200

    Merge pull request #75 from Borgarsy/feature-halloween-theme

    Temporary Halloween theme

commit cd922ac
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Fri Oct 11 10:20:45 2024 +0200

    made it so that pressing enter on signin and register page submits the forms

commit 56dc570
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Fri Oct 11 10:16:44 2024 +0200

    removed duplicate login button on successfull registration

commit d26bd3f
Merge: 0f096c0 c019c46
Author: Eric Svebakk <47322476+EricSvebakk@users.noreply.github.com>
Date:   Thu Oct 10 16:54:40 2024 +0200

    Merge pull request #67 from Sebbben/fixNoResultMembershipSearch

    Fix no result membership search

commit c019c46
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Sat Oct 5 16:20:01 2024 +0200

    Made tables turn to first page when the table content changes with a search

commit 0f096c0
Merge: a1ce2ec 4dfd6f8
Author: Tepohe <ericatsvebakk@gmail.com>
Date:   Thu Oct 10 14:42:19 2024 +0200

    Merge branch 'main' into development

commit d198b94
Author: Borgar <borgarsy@uio.no>
Date:   Tue Oct 8 15:01:29 2024 +0200

    adds halloween theme.

commit a1ce2ec
Merge: 4f7d813 f06a472
Author: Tepohe <ericatsvebakk@gmail.com>
Date:   Tue Oct 8 13:53:44 2024 +0200

    Merge branch 'pr/53' into development

commit f06a472
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Mon Oct 7 16:47:03 2024 +0200

    Fixed wrong path for nav bar home from pointing to /home to pointing to /

commit a715fac
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Tue Oct 1 17:24:53 2024 +0200

    added snackbar to singin page

commit 6322071
Merge: 131cc76 ea38e61
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Tue Oct 1 17:08:07 2024 +0200

    Merged features from featureBetterRegisterFeedback into changes made by pvk05's fixRegisterUserResponse

commit 131cc76
Merge: 221a968 eb8b2f2
Author: Philip Knudsen <113419351+pvk05@users.noreply.github.com>
Date:   Tue Oct 1 16:32:52 2024 +0200

    Merge branch 'cybernetisk:main' into fixRegisterUserResponse

commit 221a968
Author: pvk05 <philip.v.knudsen@gmail.com>
Date:   Sat Sep 28 00:57:24 2024 +0200

    moved register response to a snackbar for better visual feedback

commit ea38e61
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Fri Sep 27 23:41:22 2024 +0200

    added loading indicator to singin page as well

commit 8a3d2de
Author: pvk05 <philip.v.knudsen@gmail.com>
Date:   Fri Sep 27 23:14:48 2024 +0200

    checks if email includes "@" before registering user

commit 3f547cf
Author: pvk05 <philip.v.knudsen@gmail.com>
Date:   Fri Sep 27 22:44:11 2024 +0200

    fixed response from sendMail function to send correct feedback when failing

commit 0b33808
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Thu Sep 26 17:07:50 2024 +0200

    visual queue when registering user

commit 0d154f5
Author: Sebbben <sebastian.jossang@gmail.com>
Date:   Thu Sep 26 14:40:51 2024 +0200

    Renamed some directories to take advantage of nexts routing for more usable url paths

Co-Authored-By: Sebbben <42118203+Sebbben@users.noreply.github.com>
  • Loading branch information
EricSvebakk and Sebbben committed Oct 29, 2024
1 parent 184fe7d commit 005b413
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions app/components/CustomTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ const booleanFilterOptions = [
{ id: "false", name: "False" },
]

function CustomTable({ headers, data, defaultFilterBy }) {
function CustomTable({ headers, data, defaultFilterBy=null }) {
let header = null;
if (defaultFilterBy) {
header = headers.filter(h => h.id == defaultFilterBy)[0];
}
const [sortBy, setSortBy] = useState(() => headers[0]?.sortBy || null);
const [sortDirection, setSortDirection] = useState("DESC");
const [rowsPerPage, setRowsPerPage] = useState(10);
Expand All @@ -66,11 +70,15 @@ function CustomTable({ headers, data, defaultFilterBy }) {
const [searchString, setSearchString] = useState("");
const [selectedDateTime, setSelectedDateTime] = useState(new Date());

const [availableFilterOptions, setAvailableFilterOptions] = useState([]);
const [selectedFilterOption, setSelectedFilterOption] = useState(null);
const [selectedSearchColumn, setSelectedSearchColumn] = useState(null);
const [availableFilterOptions, setAvailableFilterOptions] = useState(
header.type === "string" || header.type === "boolean" ? filterTableOptions.filter((e) => e.id === "contains") : filterTableOptions.filter((e) => e.id !== "contains")
);
const [selectedFilterOption, setSelectedFilterOption] = useState(availableFilterOptions[0]);
const [selectedSearchColumn, setSelectedSearchColumn] = useState(header);
const [selectedBooleanOption, setSelectedBooleanOption] = useState(null);



const sortedData = useMemo(() => {
return [...data].sort((a, b) => sortTableRows(a, b, sortBy, sortDirection));
}, [data, sortBy, sortDirection]);
Expand Down Expand Up @@ -160,7 +168,7 @@ function CustomTable({ headers, data, defaultFilterBy }) {
setAvailableFilterOptions(filterTableOptions.filter((e) => e.id !== "contains"));
}

setSelectedFilterOption(null);
setSelectedFilterOption(availableFilterOptions.length > 0 ? availableFilterOptions[0] : null);
setSelectedBooleanOption(null);
setSearchString("");

Expand Down Expand Up @@ -394,7 +402,7 @@ CustomTable.propTypes = {
})
).isRequired,
data: PropTypes.array.isRequired,
sortBy: PropTypes.string
sortBy: PropTypes.string,
};

export default CustomTable;

0 comments on commit 005b413

Please sign in to comment.