Skip to content

Commit

Permalink
UI dugnad (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbjoralt authored Nov 13, 2023
1 parent c62b111 commit 82fe117
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 28 deletions.
7 changes: 3 additions & 4 deletions backend/Core/DomainModels/Week.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace Core.DomainModels;

public class Week : IComparable<Week>, IEquatable<Week>

{
public Week(int year, int weekNumber)
{
Expand Down Expand Up @@ -33,7 +32,7 @@ public bool Equals(Week? other)

/// <summary>
/// Returns a string in the format yyyyww where y is year and w is week
/// Example: 202352 or 202401
/// Example: 202352 or 202401
/// </summary>
public override string ToString()
{
Expand All @@ -42,10 +41,10 @@ public override string ToString()

/// <summary>
/// Returns an int in the format yyyyww where y is year and w is week
/// Example: 202352 or 202401
/// Example: 202352 or 202401
/// </summary>
public int ToSortableInt()
{
return (Year * 100) + WeekNumber;
return Year * 100 + WeekNumber;
}
}
8 changes: 4 additions & 4 deletions frontend/mockdata/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
} from "@/types";

const MockWeeklyBookingReadModel: WeeklyBookingReadModel = {
totalBillable: 0,
totalOffered: 0,
totalPlannedAbstences: 0,
totalSellableTime: 0,
totalHolidayHours: 0,
totalOverbooking: 0,
totalPlannedAbstences: 0,
totalSellableTime: 0,
totalBillable: 0,
totalOffered: 0,
totalVacationHours: 0,
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/[organisation]/bemanning/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function Bemanning({
>
<StaffingSidebar />

<div className="main p-6 w-full flex flex-col gap-8">
<div className="main p-4 w-full flex flex-col gap-8">
<h1>Bemanning</h1>
<FilteredConsultantsList />
<InfoPillDescriptions />
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@

h1 {
font-size: 2rem;
font-family: "Recoleta-Regular";
font-family: "Graphik-Regular", sans-serif;
font-weight: normal;
line-height: 2.5rem;
}

h2 {
font-size: 1.625rem;
font-family: "Graphik-Regular";
font-family: "Graphik-Regular", sans-serif;
line-height: 2.5rem;
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ConsultantRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function WeekCell(props: {
} = props;

return (
<td key={bookedHoursPerWeek.weekNumber} className="h-[52px] p-0.5">
<td key={bookedHoursPerWeek.weekNumber} className="h-[52px] px-0.5">
<div
className={`flex flex-col gap-1 p-2 justify-end rounded w-full h-full relative ${
bookedHoursPerWeek.bookingModel.totalOverbooking > 0
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/FilterButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import PrimaryButton from "@/components/PrimaryButton";

export default function FilterButton({
label,
onClick,
Expand All @@ -16,7 +18,11 @@ export default function FilterButton({
<input
id="checkbox"
type="checkbox"
className="appearance-none border flex items-center border-primary_default border-opacity-50 m-[1px] mr-2 h-4 w-4 rounded-sm hover:bg-primary_default hover:bg-opacity-10 hover:border-primary_default checked:bg-primary_default"
className={`appearance-none border flex items-center border-primary_default border-opacity-50 m-[1px] mr-2 h-4 w-4 rounded-sm hover:border-primary_default checked:bg-primary_default ${
checked
? "hover:bg-primary_default hover:brightness-[1.5]"
: "hover:bg-primary_default hover:bg-opacity-10"
}`}
checked={checked}
disabled={!enabled}
readOnly
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/FilteredConsultantsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function FilteredConsultantList() {

return (
<div className="flex flex-col gap-8">
<div className="flex flex-col gap-4">
<div className="flex flex-col gap-6">
<ActiveFilters />
<WeekSelection />
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/NavBar/NavBarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function NavBarDropdown(props: { initials: string }) {

return (
<>
<div className="relative" ref={menuRef}>
<div className="relative p-2" ref={menuRef}>
<button
className={`flex rounded-full border border-white h-9 min-w-[36px] justify-center items-center ${
props.initials.length > 3 && "px-1"
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/components/NavBar/NavBarUserIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export default async function NavBarUserIcon() {
.split(" ")
.map((name) => name.charAt(0).toUpperCase())
.join("")
: "";
: "NN";

if (session) {
return <NavBarDropdown initials={initials} />;
}
return <NavBarDropdown initials={initials} />;
}
4 changes: 2 additions & 2 deletions frontend/src/components/PrimaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export default function PrimaryButton({
}) {
return (
<button
className="interaction-button px-2 py-3 bg-primary_default rounded-lg text-white "
className="interaction-button px-2 py-3 bg-primary_default rounded-lg text-white"
onClick={onClick}
>
{label}
<p className={"hover:brightness-150"}>{label}</p>
</button>
);
}
2 changes: 1 addition & 1 deletion frontend/src/components/SearchBarComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function SearchBarComponent({
searchIsActive ? "border-primary_default" : "border-primary_l1"
} `}
>
<Search className="text-primary_default h-4 w-4" />
<Search className="text-primary_default h-6 w-6" />

<input
placeholder="Søk etter konsulent"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SecondaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function SecondaryButton({
}) {
return (
<button
className="interaction-button py-3 px-2 rounded-lg border border-primary_l1 hover:bg-primary_default hover:border-primary_default hover:bg-opacity-10 text-primary_default"
className="interaction-button p-3 rounded-lg border border-primary_l1 hover:bg-primary_default hover:border-primary_default hover:bg-opacity-10 text-primary_default"
onClick={onClick}
>
{label}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/StaffingSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export default function StaffingSidebar() {
return (
<div className="sidebar z-10">
{!isSidebarHidden ? (
<div className=" bg-primary_l4 h-full flex flex-col gap-6 p-8 w-[300px]">
<div className=" bg-primary_l4 h-full flex flex-col gap-6 p-4 w-[300px]">
<div className="flex flex-row justify-between items-center">
<h3 className="">Filter</h3>
<h1 className="">Filter</h1>
<button
onClick={() => setIsSidebarHidden(true)}
className="rounded p-2 hover:bg-primary_default hover:bg-opacity-20 h-9 w-9"
className="p-2 text-primary_default rounded-lg hover:bg-primary_default hover:bg-opacity-10"
>
<ArrowLeft className="text-primary_default" size="20" />
<ArrowLeft className="text-primary_default" size="24" />
</button>
</div>
<SearchBarComponent />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/WeekSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function WeekSelection() {
} = useSelectedWeek();

return (
<div className="flex flex-row gap-1">
<div className="flex flex-row gap-2">
<DropDown
startingOption={weekSpan ? weekSpan + " uker" : weekSpanOptions[0]}
dropDownOptions={weekSpanOptions}
Expand Down

0 comments on commit 82fe117

Please sign in to comment.