-
${author}
+
@${author}
${columnTitle}에 ${title}를
${LOG_TYPE[type.toUpperCase()]}하였습니다.
diff --git a/front/src/components/SideContent/SideContent.js b/front/src/components/SideContent/SideContent.js
index e17585358..37f079c21 100644
--- a/front/src/components/SideContent/SideContent.js
+++ b/front/src/components/SideContent/SideContent.js
@@ -1,3 +1,5 @@
+import { getISODateDiff } from "../../common/dateUtils";
+import { pipe } from "../../common/utils";
import peact from "../../core/peact";
import Button from "../../tagComponents/Button";
import Action from "./Action/Action";
@@ -45,10 +47,20 @@ const SideContent = ({ todoLogs, columns }) => {
const menuBtnRef = peact.useRef();
const closeBtnRef = peact.useRef();
- const newTodoLogs = todoLogs.map((todoLog) => {
- const column = columns?.find((col) => col._id === todoLog.columnId);
- return { ...todoLog, columnTitle: column?.title };
- });
+ const insertColumnTitle = (todoLogs) => {
+ return todoLogs.map((todoLog) => {
+ const column = columns?.find((col) => col._id === todoLog.columnId);
+ return { ...todoLog, columnTitle: column?.title };
+ });
+ };
+
+ const sortTodoLogs = (todoLogs) => {
+ return todoLogs.sort((aTodo, bTodo) =>
+ getISODateDiff(bTodo.createdAt, aTodo.createdAt)
+ );
+ };
+
+ const sortedTodoLogs = pipe(insertColumnTitle, sortTodoLogs)(todoLogs);
const toggleElements = [
{ elementRef: actionsRef, className: styles.active },
@@ -66,7 +78,7 @@ const SideContent = ({ todoLogs, columns }) => {
const $actionsWrap = peact.createElement({
tag: "div",
className: styles.actionWrap,
- child: newTodoLogs.map((todoLog) => Action({ todoLog })),
+ child: sortedTodoLogs.map((todoLog) => Action({ todoLog })),
});
const $closeBtn = Button({
From 7125d446177c3739f0f31d60332a09e0475ce048 Mon Sep 17 00:00:00 2001
From: Sangjin Park <58503584+healtheloper@users.noreply.github.com>
Date: Fri, 15 Apr 2022 14:59:05 +0900
Subject: [PATCH 8/8] =?UTF-8?q?[Park]=20visible=20=EC=B2=98=EB=A6=AC=20?=
=?UTF-8?q?=EB=A1=9C=EC=A7=81,=20input=20=EA=B0=92=20=EC=B2=B4=ED=81=AC=20?=
=?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80,=20Webpack=20alias=20?=
=?UTF-8?q?=EC=84=A4=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* refactor: visible 처리 로직, input 값 체크 로직 추가
* env: webpack alias 설정
---
front/.eslintrc.js | 9 +
front/package-lock.json | 172 ++++++++++++++++++
front/package.json | 1 +
front/src/App.js | 19 +-
front/src/components/Content/Card/Card.js | 3 +-
.../Content/CardWritable/CardWritable.js | 18 +-
.../CardWritable/cardWritable.module.css | 4 +
front/src/components/Content/Cards/Cards.js | 17 +-
.../Content/ColumnHeader/ColumnHeader.js | 3 +-
.../src/components/Content/Columns/Columns.js | 15 +-
front/src/components/Content/Content.js | 2 +-
front/src/components/Header/Header.js | 3 +-
front/src/components/Modal/Modal.js | 5 +-
.../components/SideContent/Action/Action.js | 7 +-
.../src/components/SideContent/SideContent.js | 19 +-
front/src/index.js | 3 +-
front/src/tagComponents/Button.js | 4 +-
front/webpack.config.js | 10 +
18 files changed, 264 insertions(+), 50 deletions(-)
diff --git a/front/.eslintrc.js b/front/.eslintrc.js
index 6ecdbcff8..11fca4b8a 100644
--- a/front/.eslintrc.js
+++ b/front/.eslintrc.js
@@ -11,6 +11,15 @@ module.exports = {
"plugin:prettier/recommended",
"plugin:import/recommended",
],
+ settings: {
+ "import/resolver": {
+ webpack: {
+ env: {
+ DEPLOY: true,
+ },
+ },
+ },
+ },
rules: {
"prettier/prettier": [
"error",
diff --git a/front/package-lock.json b/front/package-lock.json
index 0e7ce2b70..b02913781 100644
--- a/front/package-lock.json
+++ b/front/package-lock.json
@@ -25,6 +25,7 @@
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
+ "eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-webpack-plugin": "^3.1.1",
@@ -2320,6 +2321,12 @@
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
+ "node_modules/array-find": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz",
+ "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=",
+ "dev": true
+ },
"node_modules/array-includes": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz",
@@ -3524,6 +3531,82 @@
"ms": "^2.1.1"
}
},
+ "node_modules/eslint-import-resolver-webpack": {
+ "version": "0.13.2",
+ "resolved": "https://registry.npmjs.org/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.13.2.tgz",
+ "integrity": "sha512-XodIPyg1OgE2h5BDErz3WJoK7lawxKTJNhgPNafRST6csC/MZC+L5P6kKqsZGRInpbgc02s/WZMrb4uGJzcuRg==",
+ "dev": true,
+ "dependencies": {
+ "array-find": "^1.0.0",
+ "debug": "^3.2.7",
+ "enhanced-resolve": "^0.9.1",
+ "find-root": "^1.1.0",
+ "has": "^1.0.3",
+ "interpret": "^1.4.0",
+ "is-core-module": "^2.7.0",
+ "is-regex": "^1.1.4",
+ "lodash": "^4.17.21",
+ "resolve": "^1.20.0",
+ "semver": "^5.7.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ },
+ "peerDependencies": {
+ "eslint-plugin-import": ">=1.4.0",
+ "webpack": ">=1.11.0"
+ }
+ },
+ "node_modules/eslint-import-resolver-webpack/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/eslint-import-resolver-webpack/node_modules/enhanced-resolve": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz",
+ "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=",
+ "dev": true,
+ "dependencies": {
+ "graceful-fs": "^4.1.2",
+ "memory-fs": "^0.2.0",
+ "tapable": "^0.1.8"
+ },
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/eslint-import-resolver-webpack/node_modules/interpret": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/eslint-import-resolver-webpack/node_modules/semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/eslint-import-resolver-webpack/node_modules/tapable": {
+ "version": "0.1.10",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz",
+ "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
"node_modules/eslint-module-utils": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz",
@@ -4193,6 +4276,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/find-root": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
+ "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==",
+ "dev": true
+ },
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
@@ -5597,6 +5686,12 @@
"node": ">= 4.0.0"
}
},
+ "node_modules/memory-fs": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz",
+ "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=",
+ "dev": true
+ },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -9942,6 +10037,12 @@
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
+ "array-find": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz",
+ "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=",
+ "dev": true
+ },
"array-includes": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz",
@@ -10922,6 +11023,65 @@
}
}
},
+ "eslint-import-resolver-webpack": {
+ "version": "0.13.2",
+ "resolved": "https://registry.npmjs.org/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.13.2.tgz",
+ "integrity": "sha512-XodIPyg1OgE2h5BDErz3WJoK7lawxKTJNhgPNafRST6csC/MZC+L5P6kKqsZGRInpbgc02s/WZMrb4uGJzcuRg==",
+ "dev": true,
+ "requires": {
+ "array-find": "^1.0.0",
+ "debug": "^3.2.7",
+ "enhanced-resolve": "^0.9.1",
+ "find-root": "^1.1.0",
+ "has": "^1.0.3",
+ "interpret": "^1.4.0",
+ "is-core-module": "^2.7.0",
+ "is-regex": "^1.1.4",
+ "lodash": "^4.17.21",
+ "resolve": "^1.20.0",
+ "semver": "^5.7.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "enhanced-resolve": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz",
+ "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "memory-fs": "^0.2.0",
+ "tapable": "^0.1.8"
+ }
+ },
+ "interpret": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
+ "dev": true
+ },
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ },
+ "tapable": {
+ "version": "0.1.10",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz",
+ "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=",
+ "dev": true
+ }
+ }
+ },
"eslint-module-utils": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz",
@@ -11319,6 +11479,12 @@
}
}
},
+ "find-root": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
+ "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==",
+ "dev": true
+ },
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
@@ -12318,6 +12484,12 @@
"fs-monkey": "1.0.3"
}
},
+ "memory-fs": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz",
+ "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=",
+ "dev": true
+ },
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
diff --git a/front/package.json b/front/package.json
index be1e6d1a1..a3a28f7e8 100644
--- a/front/package.json
+++ b/front/package.json
@@ -36,6 +36,7 @@
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
+ "eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-webpack-plugin": "^3.1.1",
diff --git a/front/src/App.js b/front/src/App.js
index 2a18a24a0..05d428c0a 100644
--- a/front/src/App.js
+++ b/front/src/App.js
@@ -1,13 +1,14 @@
+import Columns from "components/Content/Columns/Columns";
+import Content from "components/Content/Content";
+import Header from "components/Header/Header";
+import Modal from "components/Modal/Modal";
+import SideContent from "components/SideContent/SideContent";
+import peact from "core/peact";
+import columnApi from "service/columnApi";
+import logApi from "service/logApi";
+import todoApi from "service/todoApi";
+
import styles from "./App.module.css";
-import Columns from "./components/Content/Columns/Columns";
-import Content from "./components/Content/Content";
-import Header from "./components/Header/Header";
-import Modal from "./components/Modal/Modal";
-import SideContent from "./components/SideContent/SideContent";
-import peact from "./core/peact";
-import columnApi from "./service/columnApi";
-import logApi from "./service/logApi";
-import todoApi from "./service/todoApi";
const App = () => {
const [todos, setTodos] = peact.useState([]);
diff --git a/front/src/components/Content/Card/Card.js b/front/src/components/Content/Card/Card.js
index b1c18615a..d16a788ce 100644
--- a/front/src/components/Content/Card/Card.js
+++ b/front/src/components/Content/Card/Card.js
@@ -1,4 +1,5 @@
-import peact from "../../../core/peact";
+import peact from "core/peact";
+
import styles from "./card.module.css";
const Card = ({ todo, handlers, ref }) => {
diff --git a/front/src/components/Content/CardWritable/CardWritable.js b/front/src/components/Content/CardWritable/CardWritable.js
index 11b16529a..167209353 100644
--- a/front/src/components/Content/CardWritable/CardWritable.js
+++ b/front/src/components/Content/CardWritable/CardWritable.js
@@ -1,5 +1,6 @@
-import peact from "../../../core/peact";
-import Button from "../../../tagComponents/Button";
+import peact from "core/peact";
+import Button from "tagComponents/Button";
+
import styles from "./cardWritable.module.css";
const activateButton = ($button, deactiveClassName) => {
@@ -17,13 +18,18 @@ const CardWritable = ({
handleSubmitForm,
inputValues,
columnId,
+ isVisible,
ref,
}) => {
const addButtonRef = peact.useRef();
+ const inputTitleRef = peact.useRef();
+ const inputDescRef = peact.useRef();
- const handleKeyUpInput = ({ target }) => {
+ const handleKeyUpInput = () => {
const $addButton = addButtonRef.current;
- const isInputEmpty = target.value === "";
+ const $inputTitle = inputTitleRef.current;
+ const $inputDesc = inputDescRef.current;
+ const isInputEmpty = $inputTitle.value === "" || $inputDesc.value === "";
const isInputActive = !$addButton.classList.contains(styles.deactiveButton);
if (isInputEmpty && isInputActive) {
deactivateButton($addButton, styles.deactiveButton);
@@ -54,6 +60,7 @@ const CardWritable = ({
onKeyUp: handleKeyUpInput,
},
child: [],
+ ref: inputDescRef,
});
const $inputTitle = peact.createElement({
@@ -67,6 +74,7 @@ const CardWritable = ({
onKeyUp: handleKeyUpInput,
},
child: [],
+ ref: inputTitleRef,
});
const $cardWritableHeader = peact.createElement({
@@ -107,7 +115,7 @@ const CardWritable = ({
return peact.createElement({
tag: "form",
- className: styles.cardWritable,
+ className: [styles.cardWritable, ...(isVisible ? [styles.show] : [])],
attrs: {
"data-column-id": columnId,
onSubmit: handleSubmitForm,
diff --git a/front/src/components/Content/CardWritable/cardWritable.module.css b/front/src/components/Content/CardWritable/cardWritable.module.css
index 0168e28c2..4d80afc75 100644
--- a/front/src/components/Content/CardWritable/cardWritable.module.css
+++ b/front/src/components/Content/CardWritable/cardWritable.module.css
@@ -11,6 +11,10 @@
border-radius: 6px;
}
+.cardWritable.show {
+ display: flex;
+}
+
.headerArea {
display: flex;
height: 20px;
diff --git a/front/src/components/Content/Cards/Cards.js b/front/src/components/Content/Cards/Cards.js
index 543e0eae7..a6fa98cf7 100644
--- a/front/src/components/Content/Cards/Cards.js
+++ b/front/src/components/Content/Cards/Cards.js
@@ -1,9 +1,10 @@
-import { getISODateDiff } from "../../../common/dateUtils";
-import peact from "../../../core/peact";
-import todoApi from "../../../service/todoApi";
-import Card from "../Card/Card";
-import cardStyles from "../Card/card.module.css";
-import CardWritable from "../CardWritable/CardWritable";
+import { getISODateDiff } from "common/dateUtils";
+import Card from "components/Content/Card/Card";
+import cardStyles from "components/Content/Card/card.module.css";
+import CardWritable from "components/Content/CardWritable/CardWritable";
+import peact from "core/peact";
+import todoApi from "service/todoApi";
+
import styles from "./cards.module.css";
const getSortedDatabyLatest = (data) => {
@@ -53,11 +54,9 @@ const Cards = ({ $newCard, todos, handlers }) => {
toggleCardVisible,
handleSubmitForm,
inputValues,
+ isVisible: true,
ref: cardWritableRef,
});
- // TODO: CardWritable 만들 때 display 속성 props 로 넘겨서 만드는게 좋을 듯
- $cardWritable.style.display = "flex";
- //
cardsRef.current.insertBefore($cardWritable, $card);
$card.classList.toggle(cardStyles.hide);
};
diff --git a/front/src/components/Content/ColumnHeader/ColumnHeader.js b/front/src/components/Content/ColumnHeader/ColumnHeader.js
index 42e94abb8..daa7e6589 100644
--- a/front/src/components/Content/ColumnHeader/ColumnHeader.js
+++ b/front/src/components/Content/ColumnHeader/ColumnHeader.js
@@ -1,4 +1,5 @@
-import peact from "../../../core/peact";
+import peact from "core/peact";
+
import styles from "./columnHeader.module.css";
const ColumnHeader = ({ column, todos, toggleCardVisible }) => {
diff --git a/front/src/components/Content/Columns/Columns.js b/front/src/components/Content/Columns/Columns.js
index 4b3e4f1ea..cca214fe0 100644
--- a/front/src/components/Content/Columns/Columns.js
+++ b/front/src/components/Content/Columns/Columns.js
@@ -1,8 +1,9 @@
-import peact from "../../../core/peact";
-import todoApi from "../../../service/todoApi";
-import Cards from "../Cards/Cards";
-import CardWritable from "../CardWritable/CardWritable";
-import ColumnHeader from "../ColumnHeader/ColumnHeader";
+import Cards from "components/Content/Cards/Cards";
+import CardWritable from "components/Content/CardWritable/CardWritable";
+import ColumnHeader from "components/Content/ColumnHeader/ColumnHeader";
+import peact from "core/peact";
+import todoApi from "service/todoApi";
+
import styles from "./columns.module.css";
const Columns = ({ columns, todos, handlers }) => {
@@ -49,11 +50,13 @@ const Columns = ({ columns, todos, handlers }) => {
const toggleCardVisible = () => {
newCardRef.current.classList.toggle(styles.visible);
};
+
const $newCard = CardWritable({
toggleCardVisible,
- ref: newCardRef,
handleSubmitForm,
columnId: column._id,
+ isVisible: false,
+ ref: newCardRef,
});
return peact.createElement({
diff --git a/front/src/components/Content/Content.js b/front/src/components/Content/Content.js
index 66c076856..567e59de5 100644
--- a/front/src/components/Content/Content.js
+++ b/front/src/components/Content/Content.js
@@ -1,4 +1,4 @@
-import peact from "../../core/peact";
+import peact from "core/peact";
const Content = ({ content }) => {
return peact.createElement({
diff --git a/front/src/components/Header/Header.js b/front/src/components/Header/Header.js
index 300d9048f..b43da4d2b 100644
--- a/front/src/components/Header/Header.js
+++ b/front/src/components/Header/Header.js
@@ -1,4 +1,5 @@
-import peact from "../../core/peact";
+import peact from "core/peact";
+
import styles from "./header.module.css";
const Header = () => {
diff --git a/front/src/components/Modal/Modal.js b/front/src/components/Modal/Modal.js
index 6d565390c..6e9508c01 100644
--- a/front/src/components/Modal/Modal.js
+++ b/front/src/components/Modal/Modal.js
@@ -1,5 +1,6 @@
-import peact from "../../core/peact";
-import todoApi from "../../service/todoApi";
+import peact from "core/peact";
+import todoApi from "service/todoApi";
+
import styles from "./modal.module.css";
const Modal = ({ handlers, isModalVisible, selectedTodoId, ref }) => {
diff --git a/front/src/components/SideContent/Action/Action.js b/front/src/components/SideContent/Action/Action.js
index 951302c32..ad68cbda5 100644
--- a/front/src/components/SideContent/Action/Action.js
+++ b/front/src/components/SideContent/Action/Action.js
@@ -1,6 +1,7 @@
-import { LOG_TYPE } from "../../../common/constants";
-import { getDateDiffFormat, getMongoNow } from "../../../common/dateUtils";
-import peact from "../../../core/peact";
+import { LOG_TYPE } from "common/constants";
+import { getDateDiffFormat, getMongoNow } from "common/dateUtils";
+import peact from "core/peact";
+
import styles from "./action.module.css";
/*
diff --git a/front/src/components/SideContent/SideContent.js b/front/src/components/SideContent/SideContent.js
index 37f079c21..2fb7d71cc 100644
--- a/front/src/components/SideContent/SideContent.js
+++ b/front/src/components/SideContent/SideContent.js
@@ -1,8 +1,9 @@
-import { getISODateDiff } from "../../common/dateUtils";
-import { pipe } from "../../common/utils";
-import peact from "../../core/peact";
-import Button from "../../tagComponents/Button";
-import Action from "./Action/Action";
+import { getISODateDiff } from "common/dateUtils";
+import { pipe } from "common/utils";
+import Action from "components/SideContent/Action/Action";
+import peact from "core/peact";
+import Button from "tagComponents/Button";
+
import styles from "./sideContent.module.css";
const menuBtnImageTemplate = `
@@ -47,15 +48,15 @@ const SideContent = ({ todoLogs, columns }) => {
const menuBtnRef = peact.useRef();
const closeBtnRef = peact.useRef();
- const insertColumnTitle = (todoLogs) => {
- return todoLogs.map((todoLog) => {
+ const insertColumnTitle = (originTodoLogs) => {
+ return originTodoLogs.map((todoLog) => {
const column = columns?.find((col) => col._id === todoLog.columnId);
return { ...todoLog, columnTitle: column?.title };
});
};
- const sortTodoLogs = (todoLogs) => {
- return todoLogs.sort((aTodo, bTodo) =>
+ const sortTodoLogs = (todoLogsWithColumnTitle) => {
+ return todoLogsWithColumnTitle.sort((aTodo, bTodo) =>
getISODateDiff(bTodo.createdAt, aTodo.createdAt)
);
};
diff --git a/front/src/index.js b/front/src/index.js
index 90159f621..c316fa753 100644
--- a/front/src/index.js
+++ b/front/src/index.js
@@ -1,5 +1,6 @@
+import peact from "core/peact";
+
import App from "./App";
-import peact from "./core/peact";
peact.setRoot(document.getElementById("root"));
peact.render(App);
diff --git a/front/src/tagComponents/Button.js b/front/src/tagComponents/Button.js
index 96e63a740..6da42173e 100644
--- a/front/src/tagComponents/Button.js
+++ b/front/src/tagComponents/Button.js
@@ -1,5 +1,5 @@
-import peact from "../core/peact";
-import { useId } from "../hooks/useId";
+import peact from "core/peact";
+import { useId } from "hooks/useId";
const Button = ({ onClick, className, innerHTML, ref, ...rest }) => {
const id = useId("button");
diff --git a/front/webpack.config.js b/front/webpack.config.js
index 4bfffe403..8aa3774fa 100644
--- a/front/webpack.config.js
+++ b/front/webpack.config.js
@@ -52,6 +52,16 @@ module.exports = (env) => {
},
],
},
+ resolve: {
+ alias: {
+ common: path.resolve(__dirname, "./src/common/"),
+ components: path.resolve(__dirname, "./src/components/"),
+ core: path.resolve(__dirname, "./src/core/"),
+ hooks: path.resolve(__dirname, "./src/hooks/"),
+ service: path.resolve(__dirname, "./src/service/"),
+ tagComponents: path.resolve(__dirname, "./src/tagComponents/"),
+ },
+ },
...(isDeploy ? {} : { devtool: "source-map" }),
};
};