- Sprint Padawan
+ Pollo
diff --git a/app/routes/api.room.create.tsx b/app/routes/api.room.create.tsx
index 05426e8..c609e6d 100644
--- a/app/routes/api.room.create.tsx
+++ b/app/routes/api.room.create.tsx
@@ -25,7 +25,7 @@ export async function action({ request, params, context }: ActionFunctionArgs) {
created_at: Date.now().toString(),
userId: userId || "",
roomName: data.name,
- storyName: "First Story!",
+ topicName: "First Topic!",
scale: "0.5,1,2,3,5,8",
visible: false,
})
diff --git a/app/routes/api.room.set.$roomId.tsx b/app/routes/api.room.set.$roomId.tsx
index 594e2b6..06f131a 100644
--- a/app/routes/api.room.set.$roomId.tsx
+++ b/app/routes/api.room.set.$roomId.tsx
@@ -44,7 +44,7 @@ export async function action({ request, params, context }: ActionFunctionArgs) {
})
),
roomName: oldRoom.roomName,
- storyName: oldRoom.storyName,
+ topicName: oldRoom.topicName,
}));
}
@@ -54,23 +54,23 @@ export async function action({ request, params, context }: ActionFunctionArgs) {
const newRoom = data.reset
? await db
- .update(rooms)
- .set({
- storyName: data.name,
- visible: data.visible,
- scale: [...new Set(data.scale.split(","))]
- .filter((item) => item !== "")
- .toString(),
- })
- .where(eq(rooms.id, params.roomId || ""))
- .returning()
+ .update(rooms)
+ .set({
+ topicName: data.name,
+ visible: data.visible,
+ scale: [...new Set(data.scale.split(","))]
+ .filter((item) => item !== "")
+ .toString(),
+ })
+ .where(eq(rooms.id, params.roomId || ""))
+ .returning()
: await db
- .update(rooms)
- .set({
- visible: data.visible,
- })
- .where(eq(rooms.id, params.roomId || ""))
- .returning();
+ .update(rooms)
+ .set({
+ visible: data.visible,
+ })
+ .where(eq(rooms.id, params.roomId || ""))
+ .returning();
const success = newRoom.length > 0;
diff --git a/app/routes/dashboard.tsx b/app/routes/dashboard.tsx
index 354b187..98e1476 100644
--- a/app/routes/dashboard.tsx
+++ b/app/routes/dashboard.tsx
@@ -20,19 +20,19 @@ export const loader: LoaderFunction = async (args) => {
type RoomsResponse =
| {
- id: string;
- createdAt: Date;
- roomName: string;
- }[]
+ id: string;
+ createdAt: Date;
+ roomName: string;
+ }[]
| {
- roomName: string | null;
- id: string;
- created_at: Date | null;
- userId: string;
- storyName: string | null;
- visible: boolean;
- scale: string;
- }[]
+ roomName: string | null;
+ id: string;
+ created_at: Date | null;
+ userId: string;
+ topicName: string | null;
+ visible: boolean;
+ scale: string;
+ }[]
| null
| undefined;
diff --git a/app/routes/room.$roomId.tsx b/app/routes/room.$roomId.tsx
index 65ace8a..0deab29 100644
--- a/app/routes/room.$roomId.tsx
+++ b/app/routes/room.$roomId.tsx
@@ -113,7 +113,7 @@ function RoomContent() {
| PresenceItem[]
| undefined;
- const [storyNameText, setStoryNameText] = useState
("");
+ const [topicNameText, setTopicNameText] = useState("");
const [roomScale, setRoomScale] = useState("");
const [copied, setCopied] = useState(false);
@@ -142,7 +142,7 @@ function RoomContent() {
cache: "no-cache",
method: "PUT",
body: JSON.stringify({
- name: storyNameText,
+ name: topicNameText,
visible: data.visible,
scale: roomScale,
reset: data.reset ? data.reset : false,
@@ -175,7 +175,7 @@ function RoomContent() {
userId: item.userId,
roomId: item.roomId,
roomName: item.roomName,
- storyName: item.storyName,
+ topicName: item.topicName,
scale: item.scale,
votes: item.votes,
};
@@ -186,7 +186,7 @@ function RoomContent() {
userId: roomFromDbParsed.userId,
roomId: roomFromDbParsed.id,
roomName: roomFromDbParsed.roomName,
- storyName: storyNameText,
+ topicName: topicNameText,
scale: roomScale,
votes: votesFromDbParsed?.map((vote) => {
return {
@@ -240,7 +240,7 @@ function RoomContent() {
// =================================
useEffect(() => {
if (roomFromDb) {
- setStoryNameText(roomFromDbParsed?.storyName || "");
+ setTopicNameText(roomFromDbParsed?.topicName || "");
setRoomScale(roomFromDbParsed?.scale || "ERROR");
}
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -276,7 +276,7 @@ function RoomContent() {
- Story: {roomFromDbParsed?.storyName}
+ Topic: {roomFromDbParsed?.topicName}
@@ -324,13 +324,13 @@ function RoomContent() {
)}{" "}
{presenceItem.userId ===
roomFromDbParsed?.userId && (
-
-
-
- )}
+
+
+
+ )}
{" : "}
@@ -351,11 +351,10 @@ function RoomContent() {
return (
void setVoteHandler(scaleItem)}
>
{scaleItem}
@@ -389,15 +388,15 @@ function RoomContent() {
}}
/>
- {"Story Name:"}
+ {"Topic Name:"}
{
- setStoryNameText(event.target.value);
+ setTopicNameText(event.target.value);
}}
/>
@@ -434,8 +433,8 @@ function RoomContent() {
visible: false,
reset: true,
log:
- roomFromDbParsed?.storyName === storyNameText ||
- votesFromDb?.length === 0
+ roomFromDbParsed?.topicName === topicNameText ||
+ votesFromDb?.length === 0
? false
: true,
})
@@ -447,8 +446,8 @@ function RoomContent() {
).length <= 1
}
>
- {roomFromDbParsed?.storyName === storyNameText ||
- votesFromDb?.length === 0 ? (
+ {roomFromDbParsed?.topicName === topicNameText ||
+ votesFromDb?.length === 0 ? (
<>
Reset
>
diff --git a/app/services/schema.server.ts b/app/services/schema.server.ts
index ada0d40..a12cd27 100644
--- a/app/services/schema.server.ts
+++ b/app/services/schema.server.ts
@@ -12,7 +12,7 @@ export const rooms = pgTable("Room", {
created_at: text("created_at"),
userId: text("userId").notNull(),
roomName: text("roomName"),
- storyName: text("storyName"),
+ topicName: text("topicName"),
visible: boolean("visible").default(false).notNull(),
scale: text("scale").default("0.5,1,2,3,5").notNull(),
});
@@ -58,7 +58,7 @@ export const logs = pgTable(
scale: text("scale"),
votes: text("votes"),
roomName: text("roomName"),
- storyName: text("storyName"),
+ topicName: text("topicName"),
},
(table) => {
return {
diff --git a/app/services/types.client.ts b/app/services/types.client.ts
index 28ed460..333fdf1 100644
--- a/app/services/types.client.ts
+++ b/app/services/types.client.ts
@@ -13,52 +13,52 @@ export interface PresenceItem {
export type RoomsResponse =
| {
- id: string;
- createdAt: Date;
- roomName: string;
- }[]
+ id: string;
+ createdAt: Date;
+ roomName: string;
+ }[]
| {
- roomName: string | null;
- id: string;
- created_at: Date | null;
- userId: string;
- storyName: string | null;
- visible: boolean;
- scale: string;
- }[]
+ roomName: string | null;
+ id: string;
+ created_at: Date | null;
+ userId: string;
+ topicName: string | null;
+ visible: boolean;
+ scale: string;
+ }[]
| null
| undefined;
export type RoomResponse =
| {
+ id: string;
+ created_at: Date | null;
+ userId: string;
+ roomName: string | null;
+ topicName: string | null;
+ visible: boolean;
+ scale: string | null;
+ logs: {
id: string;
created_at: Date | null;
userId: string;
+ roomId: string;
roomName: string | null;
- storyName: string | null;
- visible: boolean;
+ topicName: string | null;
scale: string | null;
- logs: {
- id: string;
- created_at: Date | null;
- userId: string;
- roomId: string;
- roomName: string | null;
- storyName: string | null;
- scale: string | null;
- votes: unknown;
- }[];
- }
+ votes: unknown;
+ }[];
+ }
| undefined
| null;
export type VoteResponse =
| {
- id: string;
- value: string;
- created_at: Date | null;
- userId: string;
- roomId: string;
- }[]
+ id: string;
+ value: string;
+ created_at: Date | null;
+ userId: string;
+ roomId: string;
+ }[]
| null
| undefined;
diff --git a/bun.lockb b/bun.lockb
index b4c8497..49b445e 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 1094373..ac63a99 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
- "name": "sprintpadawan",
- "version": "4.3.2",
+ "name": "pollo",
+ "version": "5.0.0",
"private": true,
"sideEffects": false,
"type": "module",