Skip to content

Commit 577e65b

Browse files
committed
Merge branch 'main' into fix-edit-prof
2 parents deb54bb + 5cd9499 commit 577e65b

File tree

26 files changed

+691
-637
lines changed

26 files changed

+691
-637
lines changed

bun.lockb

-73.3 KB
Binary file not shown.

common/consts.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,20 @@ export const DAY_TO_JAPANESE_MAP = new Map<Day, string>([
1010
["sun", "日"],
1111
]);
1212

13-
export const ACTIVE_DAYS = ["mon", "tue", "wed", "thu", "fri", "sat"] as const;
13+
export const ACTIVE_DAYS = ["mon", "tue", "wed", "thu", "fri"] as const;
14+
15+
export const sortSlots = (
16+
slots: {
17+
day: "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun" | "other";
18+
period: number;
19+
}[],
20+
) => {
21+
const order = ["mon", "tue", "wed", "thu", "fri", "sat", "sun", "other"];
22+
return slots.sort((a, b) => {
23+
const dayComparison = order.indexOf(a.day) - order.indexOf(b.day);
24+
if (dayComparison !== 0) {
25+
return dayComparison;
26+
}
27+
return a.period - b.period;
28+
});
29+
};

flake.lock

Lines changed: 11 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,54 @@
11
{
22
description = "CourseMate";
33
inputs = {
4-
nixpkgs.url = "github:NixOS/nixpkgs/master";
4+
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
5+
# prisma v6 is only out on unstable uncomment this on updating prisma to v6. can be removed when 25.05 channel is released
6+
# unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
7+
58
flake-utils.url = "github:numtide/flake-utils";
6-
prisma-utils.url = "github:VanCoding/nix-prisma-utils";
79
fenix = {
810
url = "github:nix-community/fenix/monthly";
911
inputs.nixpkgs.follows = "nixpkgs";
1012
};
1113
};
1214

13-
outputs = { nixpkgs, flake-utils, prisma-utils, fenix, ... }:
15+
outputs = { nixpkgs, flake-utils, fenix, /* unstable, */ ... }:
1416
flake-utils.lib.eachDefaultSystem (system:
1517
let
16-
pkgs = import nixpkgs { inherit system; };
17-
prisma = import ./nix/prisma.nix { inherit prisma-utils pkgs; };
18-
rust-pkgs = import ./nix/rust-toolchain.nix { inherit fenix system; };
19-
in
20-
{
21-
devShell = pkgs.mkShell {
22-
src = ./.;
23-
nativeBuildInputs = with pkgs; [ bashInteractive ];
18+
pkgs = nixpkgs.legacyPackages.${system};
19+
# unstable-pkgs = unstable.legacyPackages.${system};
20+
rust-toolchain = import ./nix/rust-toolchain.nix { inherit fenix system; };
21+
22+
common = {
2423
buildInputs = with pkgs; [
2524
gnumake
2625
bun
2726
biome
28-
pkg-config
29-
openssl
3027
lefthook
31-
pkgs.prisma
3228
dotenv-cli
33-
] ++ [
34-
rust-pkgs
29+
prisma
30+
prisma-engines
31+
];
32+
33+
shellHook = with pkgs; ''
34+
# requird by prisma
35+
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine";
36+
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node";
37+
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine";
38+
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt";
39+
'';
40+
};
41+
in
42+
{
43+
devShells.default = pkgs.mkShell common;
44+
devShells.scraper = pkgs.mkShell {
45+
buildInputs = common.buildInputs ++ [
46+
pkgs.pkg-config
47+
pkgs.openssl
48+
rust-toolchain
3549
];
36-
shellHook = ''
37-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.stdenv.cc.cc.lib}/lib
38-
'' + prisma.shellHook;
50+
shellHook = common.shellHook;
3951
};
4052
});
4153
}
54+

nix/prisma.nix

Lines changed: 0 additions & 12 deletions
This file was deleted.

server/src/seeds/test-data/data.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,27 @@ export const courses = [
7373
{
7474
id: "10001",
7575
name: "国語八列",
76-
teacher: "足助太郎",
76+
teacher: "八十島漕郎",
7777
},
7878
{
7979
id: "10002",
8080
name: "数学八列",
81-
teacher: "足助太郎",
81+
teacher: "八十島漕郎",
8282
},
8383
{
8484
id: "10003",
8585
name: "英語八列",
86-
teacher: "足助太郎",
86+
teacher: "八十島漕郎",
8787
},
8888
{
8989
id: "10004",
9090
name: "理科八列",
91-
teacher: "足助太郎",
91+
teacher: "八十島漕郎",
9292
},
9393
{
9494
id: "10005",
9595
name: "社会八列",
96-
teacher: "足助太郎",
96+
teacher: "八十島漕郎",
9797
},
9898
];
9999

web/app/edit/courses/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ export default function EditCourses() {
1212
const error = state.current === "error" ? state.error : null;
1313

1414
return (
15-
<div className="mx-auto my-0 flex h-full max-w-[350] flex-col p-5 text-center">
15+
<div className="mx-auto my-0 flex h-full max-w-[350] flex-col p-2 text-center">
1616
<h1 className="mb-2 text-xl">授業編集</h1>
1717
{loading ? (
1818
<FullScreenCircularProgress />
1919
) : error ? (
2020
<p>Error: {error.message}</p>
2121
) : data ? (
22-
<>
22+
<div className="flex-1 p-2">
2323
<EditableCoursesTable userId={data.id} />
24-
</>
24+
</div>
2525
) : (
2626
<p>データがありません。</p>
2727
)}

web/app/edit/layout.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ export default function EditPageLayout({
88
}) {
99
return (
1010
<NavigateByAuthState type="toLoginForUnauthenticated">
11-
<Header title="編集/Edit" />
12-
<div className="flex h-screen flex-col">{children}</div>
11+
<div className="flex h-screen flex-col">
12+
<Header title="編集/Edit" />
13+
<div className="mt-14 flex-1 sm:mt-16">{children}</div>
14+
</div>
1315
</NavigateByAuthState>
1416
);
1517
}

0 commit comments

Comments
 (0)