-
Notifications
You must be signed in to change notification settings - Fork 2
Kwon ye kyeong #1
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
base: KwonYeKyeong-Dev
Are you sure you want to change the base?
Changes from all commits
9b51ca5
a8e3386
c9fa10b
4668511
3c9bb13
4e58a77
37b07af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
| # dependencies | ||
| **/node_modules | ||
| # testing | ||
| **/coverage | ||
| # production | ||
| **/build | ||
| # misc | ||
| **/.DS_Store | ||
| npm-debug.log* | ||
| **/yarn-debug.log* | ||
| **/yarn-error.log* | ||
| # Created by https://www.toptal.com/developers/gitignore/api/webstorm | ||
| # Edit at https://www.toptal.com/developers/gitignore?templates=webstorm | ||
| ### WebStorm ### | ||
| # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
| # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
| # User-specific stuff | ||
| .idea/**/workspace.xml | ||
| .idea/**/tasks.xml | ||
| .idea/**/usage.statistics.xml | ||
| .idea/**/dictionaries | ||
| .idea/**/shelf | ||
| .idea/**/*.xml | ||
| .idea/**/*.iml | ||
| # Generated files | ||
| .idea/**/contentModel.xml | ||
| # Sensitive or high-churn files | ||
| .idea/**/dataSources/ | ||
| .idea/**/dataSources.ids | ||
| .idea/**/dataSources.local.xml | ||
| .idea/**/sqlDataSources.xml | ||
| .idea/**/dynamic.xml | ||
| .idea/**/uiDesigner.xml | ||
| .idea/**/dbnavigator.xml | ||
| # Sonarlint plugin | ||
| .idea/**/sonarlint/ | ||
| # SonarQube Plugin | ||
| .idea/**/sonarIssues.xml | ||
| # Markdown Navigator plugin | ||
| .idea/**/markdown-navigator.xml | ||
| .idea/**/markdown-navigator-enh.xml | ||
| .idea/**/markdown-navigator/ | ||
| # Cache file creation bug | ||
| # See https://youtrack.jetbrains.com/issue/JBR-2257 | ||
| .idea/$CACHE_FILE$ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ import '../css/Board.css'; | |||||||||||
| import moveTo from "../service/moveTo"; | ||||||||||||
| import {Link} from "react-router-dom"; | ||||||||||||
| import {toName, toToggleName} from '../utility/status'; | ||||||||||||
| import deleteCard from "../service/deleteCard"; | ||||||||||||
|
|
||||||||||||
| function Board() { | ||||||||||||
| const [cards, updateCards] = useState({}); | ||||||||||||
|
|
@@ -25,19 +26,64 @@ function Board() { | |||||||||||
| const changedStatus = toName(result.status); | ||||||||||||
| cards[changedStatus].push(result); | ||||||||||||
|
|
||||||||||||
| // case 1: | ||||||||||||
| // const changedCards = await getCards(); | ||||||||||||
| // updateCards({ | ||||||||||||
| // todo: changedCards.todo, | ||||||||||||
| // done: changedCards.done | ||||||||||||
| // }); | ||||||||||||
|
|
||||||||||||
| // case 2: | ||||||||||||
| cards.todo.sort(function (a, b) { | ||||||||||||
| return a.priority-b.priority; | ||||||||||||
| }); | ||||||||||||
| cards.done.sort(function (a, b) { | ||||||||||||
| return a.priority-b.priority; | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 몇가지 추가로 살펴보면 그래서, |
||||||||||||
| }); | ||||||||||||
|
|
||||||||||||
| updateCards({ | ||||||||||||
| todo: cards.todo, | ||||||||||||
| done: cards.done | ||||||||||||
| }); | ||||||||||||
| } | ||||||||||||
| }; | ||||||||||||
| function remove(id) { | ||||||||||||
| const todo = cards.todo; | ||||||||||||
| const done = cards.done; | ||||||||||||
|
|
||||||||||||
| let index = todo.findIndex((value) => { | ||||||||||||
| return value.id === id; | ||||||||||||
| }); | ||||||||||||
|
Comment on lines
+54
to
+56
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 코드가 65번 라인의 todo-frontend/static/src/page/Board.jsx Lines 65 to 67 in 3c9bb13
function remove(id, status) {
...
const index = cards[originStatus].findIndex((task) => task.id === id);
...
} |
||||||||||||
| if(index!==-1) { | ||||||||||||
| todo.splice(index, 1); | ||||||||||||
| const isSuccesses = deleteCard(id); | ||||||||||||
| if (!isSuccesses) { | ||||||||||||
| alert('NotFound(todo)'); | ||||||||||||
| } | ||||||||||||
|
Comment on lines
+58
to
+62
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 부분도 68~72 라인하고 중복되는 형식인거 같아 todo-frontend/static/src/page/Board.jsx Lines 68 to 72 in 3c9bb13
일반화하기 앞서서, 먼저 중복 코드를 별도의 함수로 분리해보는 것도 좋을거 같아~ |
||||||||||||
| } | ||||||||||||
| else{ | ||||||||||||
| index = done.findIndex((value) => { | ||||||||||||
| return value.id === id; | ||||||||||||
| }); | ||||||||||||
| done.splice(index, 1); | ||||||||||||
| const isSuccesses = deleteCard(id); | ||||||||||||
| if (!isSuccesses) { | ||||||||||||
| alert('NotFound(done)'); | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| updateCards({ | ||||||||||||
| "todo": cards.todo, | ||||||||||||
| "done": cards.done | ||||||||||||
| }); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| return ( | ||||||||||||
| <div className='board'> | ||||||||||||
| <div className='board-list'> | ||||||||||||
| { | ||||||||||||
| Object.entries(cards).map(([subject, tasks]) => { | ||||||||||||
| return <Card key={subject} subject={subject} tasks={tasks} move={move}/>; | ||||||||||||
| return <Card key={subject} subject={subject} tasks={tasks} move={move} remove={remove}/>; | ||||||||||||
| }) | ||||||||||||
| } | ||||||||||||
| </div> | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String 타입으로 변경하지 않아도, '순위' 문자열이 추가되면서 string 타입으로 변경될 거 같아~