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

Add support for deleting absence entries on table #637

Merged
merged 26 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ce10dfb
Issue #596: First draft of table
KattisLej Sep 5, 2022
dfb939d
Issue #596: Adjustments to the styling of the table
KattisLej Sep 6, 2022
cd8b175
Obtain entry ids of vacation ranges
jonandernovella Sep 6, 2022
cf9335d
Add example for deleting entries
jonandernovella Sep 6, 2022
83cf27a
Improve error handling
jonandernovella Sep 6, 2022
242a314
Issue #596: Connecting the backend with the table
KattisLej Sep 7, 2022
65522dc
WIP: Introducing delete function
KattisLej Sep 7, 2022
b896ed0
Improve entry ids
jonandernovella Sep 7, 2022
09557aa
Clean up entry duplicates
jonandernovella Sep 7, 2022
9cad34d
Move reload var
jonandernovella Sep 7, 2022
3dfbb74
Use more consistent date diff calculation
jonandernovella Sep 8, 2022
fcf143c
Vacation -> Absence refactor
jonandernovella Sep 8, 2022
3d7ad27
Remove vacation planner file
jonandernovella Sep 8, 2022
e51a1ae
Make css linter happy
jonandernovella Sep 8, 2022
ed41a69
Do not visualize table if there are no entries
jonandernovella Sep 8, 2022
01c35b5
Fix non-consecutive dates bug
jonandernovella Sep 8, 2022
ffc66aa
Disable group related data fetching
jonandernovella Sep 8, 2022
0715544
Issue #596: Addressing review issues
KattisLej Sep 12, 2022
9644090
Add better validation
jonandernovella Sep 12, 2022
3aaa31b
Merge branch 'feature/add-vacation-table' of github.com:NBISweden/urd…
jonandernovella Sep 12, 2022
2ba0b82
Issue #596: Addressing more review issues
KattisLej Sep 12, 2022
660b4f5
Remove conflicting condition
jonandernovella Sep 12, 2022
7669d95
Fix extra range bug
jonandernovella Sep 12, 2022
cc30451
Remove log line
jonandernovella Sep 12, 2022
96a6671
Issue #596: Converting function to arrow functions
KattisLej Sep 12, 2022
964cb42
Issue #596: Code fixing
KattisLej Sep 12, 2022
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
6 changes: 3 additions & 3 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
import { Login } from "./pages/Login";
import { Report } from "./pages/Report";
import { Help } from "./pages/Help";
import { VacationPlanner } from "./pages/VacationPlanner";
import { AbsencePlanner } from "./pages/AbsencePlanner";
import { AuthProvider } from "./components/AuthProvider";
import { ProtectedRoute } from "./components/ProtectedRoute";
import { getISOWeek } from "date-fns";
Expand Down Expand Up @@ -50,10 +50,10 @@ export const App = () => {
}
/>
<Route
path="/vacation"
path="/absence"
element={
<ProtectedRoute>
<VacationPlanner />
<AbsencePlanner />
</ProtectedRoute>
}
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/HeaderUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export const HeaderUser = ({ username }: { username: string }) => {
<a className="nav-item" href="/report">
Report time
</a>
<a className="nav-item" href="/vacation">
Vacation
<a className="nav-item" href="/absence">
Absence
</a>
<button type="button" className="nav-item" onClick={logout}>
Log out
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/icons/pencil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/src/icons/trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 56 additions & 3 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -841,19 +841,72 @@ Other button classes are defined further down together with other classes for th
overflow: hidden;
}

.vacation-plan-picker-label {
.absence-plan-picker-label {
margin: 0 0 0.1rem;
}

.vacation-plan-dates-wrapper {
.absence-plan-dates-wrapper {
display: flex;
margin-right: 2rem;
align-items: center;
}

.vacation-plan-container {
.absence-plan-container {
margin: 3rem;
}

.table-wrapper {
padding: 1.5rem 0;
}

table {
border-collapse: collapse;
width: 70%;
}

td {
border: none;
text-align: left;
padding: 8px;
}

th {
border-top: 1px solid hsl(0deg 0% 90%);
text-align: left;
padding: 8px;
background-color: hsl(185deg 92% 20%);
color: white;
}

tr:nth-child(even) {
background-color: hsl(186deg 30% 94%);
}

tr:last-of-type td {
border-bottom: 1px solid hsl(0deg 0% 90%);
}

.image-container {
display: flex;
align-items: center;
justify-content: space-evenly;
}

.pencil-icon {
width: 1.25rem;
}

.trash-icon {
width: 1.25rem;
}
HenrikeW marked this conversation as resolved.
Show resolved Hide resolved
HenrikeW marked this conversation as resolved.
Show resolved Hide resolved

.trash-button {
border: none;
display: flex;
HenrikeW marked this conversation as resolved.
Show resolved Hide resolved
background: none;
cursor: pointer;
}

.apply-dates-button {
height: 3rem;
width: 8rem;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export interface Issue {

export interface TimeEntry {
id: number;
issue_id: number;
activity_id: number;
issue_id?: number;
activity_id?: number;
hours: number;
comments: string;
spent_on: string;
comments?: string;
spent_on?: string;
}

export interface FetchedTimeEntry {
Expand Down
Loading