Skip to content

Commit

Permalink
Remove references to vote (#66)
Browse files Browse the repository at this point in the history
* Update naming of max stars board property for consistency

* Rename variable for consistency

Replaced "votes" with "stars"

* Replace "vote" mode with "active" mode

* Remove references to "voting"
  • Loading branch information
joekrump authored Feb 23, 2021
1 parent 5f3de99 commit 8bbd4c0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A tool for helping run [a retrospective meeting](https://www.softwaretestinghelp
1. Drag and drop cards between columns.
2. **Anonymity**
- Each user has a session but no personal identifying information is required.
- You only see your ⭐️s that you've given to cards while in voting mode.
- You only see your ⭐️s that you've given to cards while in "active" mode.
3. **Review mode**
- See the total number of ⭐️ values given to each card
- Quickly identify the cards with the most ⭐️s using sorting.
Expand Down
8 changes: 4 additions & 4 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ let sessionStore: {
};
} = {};

const MAX_VOTES_USER_VOTE_PER_BOARD = 10;
const BOARD_MAX_STARS_PER_USER = 10;
const NEW_BOARD: Board = {
title: `Retro - ${(new Date()).toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric" })}`,
showResults: false,
starsPerUser: MAX_VOTES_USER_VOTE_PER_BOARD,
maxStarsPerUser: BOARD_MAX_STARS_PER_USER,
cards: {},
timerRemainingMS: 0,
timerDurationMS: 0,
Expand Down Expand Up @@ -115,7 +115,7 @@ function updateRemainingStars(
card.stars[session.id]++;
} else {
console.log("No more stars left");
socket.emit(`board:star-limit-reached:${boardId}`, { maxStars: MAX_VOTES_USER_VOTE_PER_BOARD });
socket.emit(`board:star-limit-reached:${boardId}`, { maxStars: BOARD_MAX_STARS_PER_USER });
}
}

Expand Down Expand Up @@ -214,7 +214,7 @@ io.on("connection", (socket) => {

const newSession = {
id: sessionId,
remainingStars: MAX_VOTES_USER_VOTE_PER_BOARD,
remainingStars: BOARD_MAX_STARS_PER_USER,
};

if(!sessionStore[boardId]) {
Expand Down
2 changes: 1 addition & 1 deletion src/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface Column {
}

export interface Board {
starsPerUser: number;
maxStarsPerUser: number;
title: string;
showResults: boolean;
columns: Column[];
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const App = () => {
sessionId: string,
remainingStars: number,
}) => {
updateMode(board.showResults ? AppMode.review : AppMode.vote);
updateMode(board.showResults ? AppMode.review : AppMode.active);
updateTimer({
remainingMS: board.timerRemainingMS,
status: board.timerStatus,
Expand All @@ -62,7 +62,7 @@ export const App = () => {
updateBoard({
id: boardId,
title: board.title,
starsPerUser: board.starsPerUser,
maxStarsPerUser: board.maxStarsPerUser,
});
updateRemainingStars(remainingStars);
sessionStorage.setItem("retroSessionId", sessionId);
Expand All @@ -78,7 +78,7 @@ export const App = () => {
});

socket.on(`board:show-results:${boardId}`, (data: { showResults: boolean }) => {
updateMode(data.showResults ? AppMode.review : AppMode.vote);
updateMode(data.showResults ? AppMode.review : AppMode.active);
});
socket.on(`board:timer-tick:${boardId}`, ({ remainingMS, status }: { remainingMS: number, status: "running" | "paused" | "stopped" }) => {
updateTimer({
Expand Down Expand Up @@ -120,7 +120,7 @@ export const App = () => {
<Header socket={socket} />
<Board socket={socket} />
<div className={`alert alert-star-limit ${showStarLimitAlert ? "alert--show" : ""}`}>
Your voting limit of {board.starsPerUser} has been reached. Undo previous stars if you want some back.
Your ⭐️ limit of {board.maxStarsPerUser} has been reached. Undo previous stars if you want some back.
</div>
</Suspense>
</AppErrorBoundary>
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const Card = (props: CardProps) => {
}

function isEditable() {
return ownerId === sessionId && mode === AppMode.vote;
return ownerId === sessionId && mode === AppMode.active;
}

function renderUserStars() {
Expand Down Expand Up @@ -248,8 +248,8 @@ export const Card = (props: CardProps) => {
⭐️
</button>
}
{ mode === AppMode.vote ? renderUserStars() : renderResults() }
{ mode === AppMode.vote && userStars > 0 ? renderUndoButton() : null }
{ mode === AppMode.active ? renderUserStars() : renderResults() }
{ mode === AppMode.active && userStars > 0 ? renderUndoButton() : null }
</div>
{ editLink }
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/overmind/state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BoardColumn, Card } from "../../@types";

export enum AppMode {
"vote",
"active",
"review",
};

Expand All @@ -10,7 +10,7 @@ export type State = {
board: {
title: string;
id: string;
starsPerUser: number;
maxStarsPerUser: number;
};
sessionId: string;
columns: BoardColumn[];
Expand All @@ -26,13 +26,13 @@ export type State = {
const initialSessionId = sessionStorage.getItem("retroSessionId") ?? "";

export const state: State = {
mode: AppMode.vote,
mode: AppMode.active,
sessionId: initialSessionId,
remainingStars: 0,
board: {
title: "",
id: "",
starsPerUser: 0,
maxStarsPerUser: 0,
},
timer: {
remainingMS: 0,
Expand Down

0 comments on commit 8bbd4c0

Please sign in to comment.