Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update yaml-script name #100

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Production Server
name: Deploy to cyb.no

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(main)/volunteering/membership/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function MembershipPage() {
data: {
name: newMemberName,
email: "",
comments: newMemberComment,
comment: newMemberComment,
seller_id: session.data.user.id,
semester_id: session.data.semester.id,
},
Expand Down
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;
8 changes: 1 addition & 7 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,13 @@ model UserMembership {
user_id String? @db.VarChar(50)
uio_username String? @db.VarChar(15)
date_lifetime DateTime? @db.DateTime(0)
comments String? @db.Text
comment String? @db.Text
last_edited_by_id Int?
Semester Semester @relation(fields: [semester_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "UserMembership_semester")

@@index([semester_id], map: "UserMembership_semester_idx")
}

model memberLog {
id String @id
name String? @db.VarChar(45)
year Int?
}

model Semester {
id Int @id
semester String? @db.VarChar(45)
Expand Down