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

Updating chatrooms description #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions api/Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.1.2"
ruby "3.2.2"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.3", ">= 7.0.3.1"
Expand Down Expand Up @@ -52,4 +52,3 @@ group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end

8 changes: 7 additions & 1 deletion api/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ GEM
nio4r (2.5.9)
nokogiri (1.15.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.3-x64-mingw-ucrt)
racc (~> 1.4)
puma (5.6.6)
nio4r (~> 2.0)
racc (1.7.1)
Expand Down Expand Up @@ -185,17 +187,21 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.6.3-arm64-darwin)
sqlite3 (1.6.3-x64-mingw-ucrt)
thor (1.2.2)
timeout (0.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2023.3)
tzinfo (>= 1.0.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.8)

PLATFORMS
arm64-darwin-21
x64-mingw-ucrt

DEPENDENCIES
bootsnap
Expand All @@ -213,7 +219,7 @@ DEPENDENCIES
tzinfo-data

RUBY VERSION
ruby 3.1.2p20
ruby 3.2.2p53

BUNDLED WITH
2.4.12
14 changes: 13 additions & 1 deletion console/src/modules/chatroom/ChatroomListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
import { KeyboardArrowDown, KeyboardArrowUp, Edit, Save, Cancel } from "@mui/icons-material";
import {
Box,
Card,
Expand All @@ -7,6 +7,7 @@ import {
IconButton,
Typography,
styled,
Input,
} from "@mui/material";
import { useState } from "react";

Expand All @@ -28,9 +29,20 @@ export const ChatroomListItem: React.FC<ChatroomListItemProps> = ({
chatroom,
}) => {
const [showDetails, setShowDetails] = useState(false);
const [isEditing, setIsEditing] = useState(false);
const [editedDescription, setEditedDescription] = useState(chatroom.description);

const natureCodeName = chatroom.natureCode?.name ?? "Uncategorized";

const handleEditClick = () => {
setIsEditing(true);
};

const handleCancelClick = () => {
setIsEditing(false);
setEditedDescription(chatroom.description);
};

return (
<ChatroomCard variant="outlined">
<Box
Expand Down