diff --git a/.idea/claudeCodeEditorTabs.xml b/.idea/claudeCodeEditorTabs.xml index 598c4b0..e8330c8 100644 --- a/.idea/claudeCodeEditorTabs.xml +++ b/.idea/claudeCodeEditorTabs.xml @@ -1,20 +1,20 @@ - diff --git a/package-lock.json b/package-lock.json index 6bd2aa2..13f6efa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", - "@kri/common": "^0.16.0", + "@kri/common": "^0.18.0", "@radix-ui/react-checkbox": "^1.3.3", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", @@ -83,12 +83,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -97,29 +98,31 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", - "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", - "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.5", - "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-module-transforms": "^7.28.3", - "@babel/helpers": "^7.28.4", - "@babel/parser": "^7.28.5", - "@babel/template": "^7.27.2", - "@babel/traverse": "^7.28.5", - "@babel/types": "^7.28.5", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", @@ -136,13 +139,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", - "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/parser": "^7.28.5", - "@babel/types": "^7.28.5", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -152,13 +156,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", - "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.27.2", - "@babel/helper-validator-option": "^7.27.1", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -168,36 +173,39 @@ } }, "node_modules/@babel/helper-globals": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", - "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", - "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.27.1", - "@babel/types": "^7.27.1" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", - "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.28.3" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -207,52 +215,57 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", - "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", - "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.4" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", - "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.28.5" + "@babel/types": "^7.29.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -262,31 +275,33 @@ } }, "node_modules/@babel/template": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", - "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/parser": "^7.27.2", - "@babel/types": "^7.27.1" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", - "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.5", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.28.5", - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.5", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", "debug": "^4.3.1" }, "engines": { @@ -294,13 +309,14 @@ } }, "node_modules/@babel/types": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", - "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "devOptional": true, + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -1098,9 +1114,9 @@ } }, "node_modules/@kri/common": { - "version": "0.16.0", - "resolved": "https://gitea.kric.com/api/packages/KRi/npm/%40kri%2Fcommon/-/0.16.0/common-0.16.0.tgz", - "integrity": "sha512-414uCJb4eRZ/lwdUxHu5/OyslgAAXcsCJ9ag33Awmq3eCEtnnwOlMai+hvjVF2m0jFfQUrek5en4On1PivacHg==", + "version": "0.18.0", + "resolved": "https://gitea.kric.com/api/packages/KRi/npm/%40kri%2Fcommon/-/0.18.0/common-0.18.0.tgz", + "integrity": "sha512-vd4oDG11GD9ZQmMrx/lDuGiM4CaXb0VVDoNy9zcbplhEbyl8F8eokML9UK9BOhScacF3jiamEEUkVOaqRHLgig==", "license": "UNLICENSED", "dependencies": { "clsx": "^2.1.1", @@ -1137,9 +1153,9 @@ } }, "node_modules/@next/env": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.4.tgz", - "integrity": "sha512-dKkkOzOSwFYe5RX6y26fZgkSpVAlIOJKQHIiydQcrWH6y/97+RceSOAdjZ14Qa3zLduVUy0TXcn+EiM6t4rPgw==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.10.tgz", + "integrity": "sha512-zLPxg9M0MEHmygpj5OuxjQ+vHMiy/K7cSp74G8ecYolmgUWw0RwN02tF56npup/+qaI8JB97hQgS/r2Hb6QwVA==", "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { @@ -1152,9 +1168,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.4.tgz", - "integrity": "sha512-OXTFFox5EKN1Ym08vfrz+OXxmCcEjT4SFMbNRsWZE99dMqt2Kcusl5MqPXcW232RYkMLQTy0hqgAMEsfEd/l2A==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.10.tgz", + "integrity": "sha512-v9IdJCa0H0mbo+8z5zwUpOk1Vj7RjkcI5uNYf5Ws1y6szf/p3Mzl9hLaST8SCt6L9h8NGnruZcd2+o0NTNwDhA==", "cpu": [ "arm64" ], @@ -1168,9 +1184,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.4.tgz", - "integrity": "sha512-XhpVnUfmYWvD3YrXu55XdcAkQtOnvaI6wtQa8fuF5fGoKoxIUZ0kWPtcOfqJEWngFF/lOS9l3+O9CcownhiQxQ==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.10.tgz", + "integrity": "sha512-17IS0jJRViROGmA9uGdNR8VPJpfbnaVG7E9qhso5jDLkmyd0lSDORWxbcKINzcFqzZqGwGtMSnrFRxBpuUYjLQ==", "cpu": [ "x64" ], @@ -1184,9 +1200,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.4.tgz", - "integrity": "sha512-Mx/tjlNA3G8kg14QvuGAJ4xBwPk1tUHq56JxZ8CXnZwz1Etz714soCEzGQQzVMz4bEnGPowzkV6Xrp6wAkEWOQ==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.10.tgz", + "integrity": "sha512-GRQRsRtuciNJvB54AvvuQTiq0oZtFwa1owQqtZD8wwnGpM2L39MV22kpI72YSXLKIyY40LC66EiLFv4PiicXxg==", "cpu": [ "arm64" ], @@ -1200,9 +1216,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.4.tgz", - "integrity": "sha512-iVMMp14514u7Nup2umQS03nT/bN9HurK8ufylC3FZNykrwjtx7V1A7+4kvhbDSCeonTVqV3Txnv0Lu+m2oDXNg==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.10.tgz", + "integrity": "sha512-zkN9MQYS7UQBro+FnISUq1itaQjXI9xqISzuQ+2bc921NcJ1x4yPCqrn77tVN6/dOOXaaWVX3k6/bR07pPwK+A==", "cpu": [ "arm64" ], @@ -1216,9 +1232,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.4.tgz", - "integrity": "sha512-EZOvm1aQWgnI/N/xcWOlnS3RQBk0VtVav5Zo7n4p0A7UKyTDx047k8opDbXgBpHl4CulRqRfbw3QrX2w5UOXMQ==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.10.tgz", + "integrity": "sha512-iCVJnwvrPYECvA6WM/7+oo+OiTvedIKLxtCLAZP4xZR3nXa1zmzZyLPbYCmWvpd4CvMYF1EMTafd0ii3DygLvA==", "cpu": [ "x64" ], @@ -1232,9 +1248,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.4.tgz", - "integrity": "sha512-h9FxsngCm9cTBf71AR4fGznDEDx1hS7+kSEiIRjq5kO1oXWm07DxVGZjCvk0SGx7TSjlUqhI8oOyz7NfwAdPoA==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.10.tgz", + "integrity": "sha512-ov2g4H0dHY9bPoOU83m91hWT7Iq5qy13bUnyyshLU3HGR1Ownn0X9QpmDPc5iIUaahTp7f7LeGAhV4DSFtackw==", "cpu": [ "x64" ], @@ -1248,9 +1264,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.4.tgz", - "integrity": "sha512-3NdJV5OXMSOeJYijX+bjaLge3mJBlh4ybydbT4GFoB/2hAojWHtMhl3CYlYoMrjPuodp0nzFVi4Tj2+WaMg+Ow==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.10.tgz", + "integrity": "sha512-DwAnhLX76HQiFFQNgWlcK+JzlnD1rZ+UK/WY0ZMI/deXpvgnesjNYrqcfo1JzBuz4Kf7o3brIBL0glI1junatA==", "cpu": [ "arm64" ], @@ -1264,9 +1280,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.4.tgz", - "integrity": "sha512-kMVGgsqhO5YTYODD9IPGGhA6iprWidQckK3LmPeW08PIFENRmgfb4MjXHO+p//d+ts2rpjvK5gXWzXSMrPl9cw==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.10.tgz", + "integrity": "sha512-0JXq3b85Jk9Jg4ntLUbXSPvoDw3gpZou7twuKdoFG2jOw635v7+IiXfTaa0TxVMyx78pUjnrVYwLgjKfX4e6/A==", "cpu": [ "x64" ], @@ -3961,9 +3977,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", "dev": true, "license": "MIT", "dependencies": { @@ -4630,9 +4646,9 @@ "dev": true }, "node_modules/baseline-browser-mapping": { - "version": "2.10.23", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.23.tgz", - "integrity": "sha512-xwVXGqevyKPsiuQdLj+dZMVjidjJV508TBqexND5HrF89cGdCYCJFB3qhcxRHSeMctdCfbR1jrxBajhDy7o29g==", + "version": "2.10.43", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", + "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" @@ -4665,9 +4681,9 @@ } }, "node_modules/browserslist": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz", - "integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==", + "version": "4.28.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", + "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", "devOptional": true, "funding": [ { @@ -4683,12 +4699,13 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.8.25", - "caniuse-lite": "^1.0.30001754", - "electron-to-chromium": "^1.5.249", - "node-releases": "^2.0.27", - "update-browserslist-db": "^1.1.4" + "baseline-browser-mapping": "^2.10.42", + "caniuse-lite": "^1.0.30001803", + "electron-to-chromium": "^1.5.389", + "node-releases": "^2.0.51", + "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" @@ -4763,9 +4780,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001754", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001754.tgz", - "integrity": "sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==", + "version": "1.0.30001805", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz", + "integrity": "sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA==", "funding": [ { "type": "opencollective", @@ -4779,7 +4796,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/cfb": { "version": "1.2.2", @@ -5105,9 +5123,9 @@ } }, "node_modules/dompurify": { - "version": "3.4.10", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.10.tgz", - "integrity": "sha512-0xzNv0e7oYC6yyuOGZIABPM4qtg3QxLFniDNPP4ZP90wR8Yq3zgwpRbrNiT4N3IKqDbbYFEJLV+JWEs19aZ//w==", + "version": "3.4.12", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.12.tgz", + "integrity": "sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg==", "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { "@types/trusted-types": "^2.0.7" @@ -5158,10 +5176,11 @@ "license": "0BSD" }, "node_modules/electron-to-chromium": { - "version": "1.5.250", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.250.tgz", - "integrity": "sha512-/5UMj9IiGDMOFBnN4i7/Ry5onJrAGSbOGo3s9FEKmwobGq6xw832ccET0CE3CkkMBZ8GJSlUIesZofpyurqDXw==", - "devOptional": true + "version": "1.5.389", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", + "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", + "devOptional": true, + "license": "ISC" }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -5367,6 +5386,7 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -6755,10 +6775,21 @@ "devOptional": true }, "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -6771,6 +6802,7 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "devOptional": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -7113,9 +7145,20 @@ } }, "node_modules/linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.2.tgz", + "integrity": "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/markdown-it" + } + ], + "license": "MIT", "dependencies": { "uc.micro": "^2.0.0" } @@ -7163,6 +7206,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "devOptional": true, + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } @@ -7185,14 +7229,24 @@ } }, "node_modules/markdown-it": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.1.tgz", - "integrity": "sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.0.tgz", + "integrity": "sha512-RCEsPjR+sr0x+AuYp601tKTkgFG4YEPLCzHST3cQ/fhlJkqAkz1L2/Qbp1j9qw5SBwQHFBoW8+hoN5xssOF0Tw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/markdown-it" + } + ], "license": "MIT", "dependencies": { "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.0", + "entities": "^4.5.0", + "linkify-it": "^5.0.2", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" @@ -7304,12 +7358,12 @@ "dev": true }, "node_modules/next": { - "version": "16.2.4", - "resolved": "https://registry.npmjs.org/next/-/next-16.2.4.tgz", - "integrity": "sha512-kPvz56wF5frc+FxlHI5qnklCzbq53HTwORaWBGdT0vNoKh1Aya9XC8aPauH4NJxqtzbWsS5mAbctm4cr+EkQ2Q==", + "version": "16.2.10", + "resolved": "https://registry.npmjs.org/next/-/next-16.2.10.tgz", + "integrity": "sha512-2som5AVXb3kE6Yjine3/mNbBayYF58eguBWIVVUdr1y/L426xyVEgYxgBG+1QC34P2x5E+tcDup6XkuOAX3dCA==", "license": "MIT", "dependencies": { - "@next/env": "16.2.4", + "@next/env": "16.2.10", "@swc/helpers": "0.5.15", "baseline-browser-mapping": "^2.9.19", "caniuse-lite": "^1.0.30001579", @@ -7323,14 +7377,14 @@ "node": ">=20.9.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "16.2.4", - "@next/swc-darwin-x64": "16.2.4", - "@next/swc-linux-arm64-gnu": "16.2.4", - "@next/swc-linux-arm64-musl": "16.2.4", - "@next/swc-linux-x64-gnu": "16.2.4", - "@next/swc-linux-x64-musl": "16.2.4", - "@next/swc-win32-arm64-msvc": "16.2.4", - "@next/swc-win32-x64-msvc": "16.2.4", + "@next/swc-darwin-arm64": "16.2.10", + "@next/swc-darwin-x64": "16.2.10", + "@next/swc-linux-arm64-gnu": "16.2.10", + "@next/swc-linux-arm64-musl": "16.2.10", + "@next/swc-linux-x64-gnu": "16.2.10", + "@next/swc-linux-x64-musl": "16.2.10", + "@next/swc-win32-arm64-msvc": "16.2.10", + "@next/swc-win32-x64-msvc": "16.2.10", "sharp": "^0.34.5" }, "peerDependencies": { @@ -7393,10 +7447,14 @@ } }, "node_modules/node-releases": { - "version": "2.0.27", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", - "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", - "devOptional": true + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/object-assign": { "version": "4.1.1", @@ -9121,9 +9179,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", - "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "devOptional": true, "funding": [ { @@ -9139,6 +9197,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" @@ -9393,7 +9452,8 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "devOptional": true + "devOptional": true, + "license": "ISC" }, "node_modules/yargs": { "version": "15.4.1", diff --git a/package.json b/package.json index af08ed5..886050e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", - "@kri/common": "^0.16.0", + "@kri/common": "^0.18.0", "@radix-ui/react-checkbox": "^1.3.3", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", diff --git a/src/app/(pages)/(main)/list/manage/page.tsx b/src/app/(pages)/(main)/list/manage/page.tsx index 60ab048..7cb0aba 100644 --- a/src/app/(pages)/(main)/list/manage/page.tsx +++ b/src/app/(pages)/(main)/list/manage/page.tsx @@ -36,6 +36,7 @@ import { type ListFilter, type ListFilterTarget, type listHeader, + type ListSearchUiState, ListResetMode, type ListResetScope, type ListUploadRequest, @@ -64,6 +65,15 @@ const downloadArrayBuffer = (buffer: ArrayBuffer, filename: string, type = 'appl downloadFile(new Blob([buffer], { type }), filename) } +const createEmptySearchUiState = (): ListSearchUiState => ({ + searchText: '', + searchContactResult: [], + searchInterviewResult: [], + searchSurveyResult: [], + filterRows: [], + sorting: [], +}) + const ListManagePage = () => { const router = useRouter() const mounted = useMounted() @@ -75,6 +85,8 @@ const ListManagePage = () => { const [messageSendMode, setMessageSendMode] = useState('email') const [selectedRows, setSelectedRows] = useState([]) const [currentListFilter, setCurrentListFilter] = useState(() => createEmptyListFilter()) + const [filterSummary, setFilterSummary] = useState([]) + const [searchUiState, setSearchUiState] = useState(createEmptySearchUiState) const [listRefreshKey, setListRefreshKey] = useState(0) const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 25 }) const [restoredVisit, setRestoredVisit] = useState(null) @@ -155,7 +167,13 @@ const ListManagePage = () => { const handleStartContact = (row: ListTableRow) => { const sid = String(row.sid ?? '') - setLastListVisit({ prjctIdx, sid, pageIndex: pagination.pageIndex, pageSize: pagination.pageSize }) + setLastListVisit({ + prjctIdx, + sid, + pageIndex: pagination.pageIndex, + pageSize: pagination.pageSize, + ...searchUiState, + }) router.push(`/list/contact?sid=${encodeURIComponent(sid)}`) } @@ -171,10 +189,11 @@ const ListManagePage = () => { const handleResetConfirm = async (payload: { target: ListFilterTarget; scope: ListResetScope }) => { const listFilter = buildTargetFilter(payload.target) - await resetListMutation.mutateAsync({ + const resetCount = await resetListMutation.mutateAsync({ resetMode: payload.scope === 'result-and-history' ? ListResetMode.HIST : ListResetMode.ALL, listFilter, }) + alert(`${resetCount}건 삭제 되었습니다.`) refreshList() } @@ -262,6 +281,7 @@ const ListManagePage = () => { enableBatchEdit={canManageList} refreshKey={listRefreshKey} onCurrentFilterChange={setCurrentListFilter} + onFilterSummaryChange={setFilterSummary} onSelectedRowsChange={setSelectedRows} onRowClick={!canManageList ? handleStartContact : undefined} onRowDoubleClick={canManageList ? handleStartContact : undefined} @@ -271,12 +291,14 @@ const ListManagePage = () => { : undefined } onPaginationChange={setPagination} + initialSearchState={restoredForThisProject} + onSearchStateChange={setSearchUiState} focusRowId={restoredForThisProject?.sid} /> {canManageList && ( <> - + { headerRows={headerManageRows} /> - + diff --git a/src/app/(pages)/(main)/manage/user/page.tsx b/src/app/(pages)/(main)/manage/user/page.tsx index 3e38777..3bf77e9 100644 --- a/src/app/(pages)/(main)/manage/user/page.tsx +++ b/src/app/(pages)/(main)/manage/user/page.tsx @@ -219,7 +219,7 @@ const UserManagePage = () => { columns={columns} data={viewList} isClient={true} - selectMode='single' + selectMode='none' defaultPageSize={10} pageSizeOptions={[10, 20, 30, 50]} getRowId={(row) => row.userId} // row.id = userId diff --git a/src/app/api/message-send/[[...slug]]/route.ts b/src/app/api/message-send/[[...slug]]/route.ts deleted file mode 100644 index ee5b02a..0000000 --- a/src/app/api/message-send/[[...slug]]/route.ts +++ /dev/null @@ -1,53 +0,0 @@ -import {NextRequest, NextResponse} from "next/server"; -import {RouteContext} from "@/types/common"; -import {createNotihubApi} from "@/lib/http-server"; -import {errorToResponse} from "@kri/common/http"; -import type {BulkSendCreateRequest, BulkSendResponse, SendRequestBulk} from "@kri/common/noti-hub"; - -type MessageSendChannel = "sms" | "email"; - -const isSendChannel = (value: string): value is MessageSendChannel => value === "sms" || value === "email"; - -export const PUT = async (req: NextRequest, context: RouteContext) => { - try { - const {slug = []} = await context.params; - const [action, channel] = slug; - const notihubApi = await createNotihubApi(); - - if (action === "create-bulk" && channel && isSendChannel(channel)) { - const body: BulkSendCreateRequest | null = await req.json().catch(() => null); - if (!body) { - return NextResponse.json({message: "요청 바디가 없습니다."}, {status: 400}); - } - - const result = await notihubApi.put(`/send-${channel}/create/bulk`, body); - return NextResponse.json(result, {status: 200}); - } - - return NextResponse.json({message: "Not found"}, {status: 404}); - } catch (error: unknown) { - return errorToResponse(error); - } -}; - -export const POST = async (req: NextRequest, context: RouteContext) => { - try { - const {slug = []} = await context.params; - const [action, channel] = slug; - const notihubApi = await createNotihubApi(); - - if (action === "bulk" && channel && isSendChannel(channel)) { - const body: SendRequestBulk | null = await req.json().catch(() => null); - if (!body) { - return NextResponse.json({message: "요청 바디가 없습니다."}, {status: 400}); - } - - const result = await notihubApi.post(`/send-${channel}/bulk`, body); - return NextResponse.json(result, {status: 200}); - } - - return NextResponse.json({message: "Not found"}, {status: 404}); - } catch (error: unknown) { - return errorToResponse(error); - } -}; diff --git a/src/components/app-shell/AppMainLayout.tsx b/src/components/app-shell/AppMainLayout.tsx index cd102bc..d89904f 100644 --- a/src/components/app-shell/AppMainLayout.tsx +++ b/src/components/app-shell/AppMainLayout.tsx @@ -3,6 +3,7 @@ import { ReactNode, useEffect, useMemo, useState } from "react"; import { usePathname, useRouter } from "next/navigation"; import { useMounted } from "@kri/common/hooks"; +import { getCurrentPositionMeta } from "@kri/common/browser"; import { KriMainLayout } from "@/components/layout/KriMainLayout"; import { AppHeader } from "@/components/app-shell/AppHeader"; import { AppSidebar } from "@/components/app-shell/AppSidebar"; @@ -155,6 +156,13 @@ export default function AppMainLayout({ children, initialFontSize }: AppMainLayo } }, [auth.user, mounted, router]); + // 컨택결과 저장 시점에 GPS 권한 프롬프트가 뜨면 저장이 지연/누락될 수 있어, + // 로그인 후 메인 진입 시점에 미리 권한을 받아 위치를 캐시해둔다(결과는 사용하지 않음). + useEffect(() => { + if (!mounted || !auth.user) return; + void getCurrentPositionMeta(); + }, [mounted, auth.user]); + useEffect(() => { if (!mounted || !auth.user || hasRouteAccess) return; diff --git a/src/components/common/KriDialog.tsx b/src/components/common/KriDialog.tsx index 35db688..1dc2830 100644 --- a/src/components/common/KriDialog.tsx +++ b/src/components/common/KriDialog.tsx @@ -1,6 +1,7 @@ 'use client' import type { ReactNode } from 'react' +import { useAtomValue } from 'jotai' import { Button } from '@/components/ui/button' import { Dialog, @@ -12,6 +13,7 @@ import { DialogTitle, } from '@/components/ui/dialog' import { cn } from '@/lib/utils' +import { loadingAtom } from '@/store/jotai/loading' export interface KriDialogProps { open: boolean @@ -42,6 +44,8 @@ export function KriDialog({ bodyClassName, footerClassName, }: KriDialogProps) { + const isLoading = useAtomValue(loadingAtom) + const renderFooter = () => { if (footer !== undefined) { if (footer === null) return null @@ -63,7 +67,16 @@ export function KriDialog({ return ( - + { + if (isLoading) e.preventDefault() + }} + onEscapeKeyDown={(e) => { + if (isLoading) e.preventDefault() + }} + > {title} {description ? {description} : null} diff --git a/src/components/common/KriLoadingOverlay.tsx b/src/components/common/KriLoadingOverlay.tsx index 8b231a1..7a21180 100644 --- a/src/components/common/KriLoadingOverlay.tsx +++ b/src/components/common/KriLoadingOverlay.tsx @@ -18,6 +18,9 @@ export function KriLoadingOverlay({ open, label = '로딩 중', className, spinn aria-live="polite" aria-label={label} className={cn('fixed inset-0 z-[9999] flex items-center justify-center bg-black/70', className)} + onPointerDown={(e) => e.stopPropagation()} + onMouseDown={(e) => e.stopPropagation()} + onClick={(e) => e.stopPropagation()} >
{label} diff --git a/src/components/data-table/DataTable.tsx b/src/components/data-table/DataTable.tsx index 366d48a..8ccf8b2 100644 --- a/src/components/data-table/DataTable.tsx +++ b/src/components/data-table/DataTable.tsx @@ -74,6 +74,10 @@ export function DataTable({ const pagination = isClient ? internalPagination : (externalPagination ?? internalPagination) + useEffect(() => { + setRowSelection({}) + }, [pagination.pageIndex, pagination.pageSize, sorting]) + const handlePaginationChange = useCallback>( (updater) => { if (isClient) { @@ -193,7 +197,7 @@ export function DataTable({ onClick={drag.wrapClick(() => handleRowClick(row))} onDoubleClick={onRowDoubleClick ? () => handleRowDoubleClick(row) : undefined} className={cn( - 'text-base [&>td]:px-2 [&>td]:py-0', + 'text-base [&>td]:px-2 [&>td]:py-1', (selectMode !== 'none' || onRowDoubleClick) && 'cursor-pointer', 'data-[state=selected]:bg-muted data-[state=selected]:font-semibold', highlightRowIds?.includes(row.id) && 'bg-emerald-50', diff --git a/src/components/data-table/DataTablePagination.tsx b/src/components/data-table/DataTablePagination.tsx index 8f59c92..093ca57 100644 --- a/src/components/data-table/DataTablePagination.tsx +++ b/src/components/data-table/DataTablePagination.tsx @@ -16,12 +16,12 @@ interface DataTablePaginationProps { } export function DataTablePagination({ - table, - isClient, - totalCount, - pageSizeOptions, - paginationItemsToDisplay, -}: DataTablePaginationProps) { + table, + isClient, + totalCount, + pageSizeOptions, + paginationItemsToDisplay, + }: DataTablePaginationProps) { 'use no memo' const currentPage = table.getState().pagination.pageIndex + 1 @@ -33,66 +33,66 @@ export function DataTablePagination({ }) return ( -
-

- Page {currentPage} of{' '} - {pageCount} - {!isClient && totalCount > 0 ? ( - (총 {totalCount}건) - ) : null} -

+
+

+ Page {currentPage} of{' '} + {pageCount} + {!isClient && totalCount > 0 ? ( + (총 {totalCount}건) + ) : null} +

-
- - - - - - - - - {showLeftEllipsis ? : null} - {pages.map((page) => ( - - - ))} - {showRightEllipsis ? : null} - - - - - - - - -
+ + + + {showLeftEllipsis ? : null} + {pages.map((page) => ( + + + + ))} + {showRightEllipsis ? : null} + + + + + + + + +
-
- +
+ +
-
) } diff --git a/src/components/dialog/ListBatchEditDialog.tsx b/src/components/dialog/ListBatchEditDialog.tsx index 5d9362f..f312a1f 100644 --- a/src/components/dialog/ListBatchEditDialog.tsx +++ b/src/components/dialog/ListBatchEditDialog.tsx @@ -1,6 +1,6 @@ 'use client' -import { useEffect, useMemo, useState } from 'react' +import { useEffect, useState } from 'react' import { Plus, X } from 'lucide-react' import { KriDialog } from '@/components/common/KriDialog' import { Button } from '@/components/ui/button' @@ -12,12 +12,19 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select' +import { KriSingleSelect } from '@/components/common/KriAutoComplete' +import ApplyFilterOption from './ListDialogOption/ApplyFilterOption' import { useDialog } from '@/hooks/useDialog' import type { DialogId } from '@/store/jotai/dialog' +import type { FilterValueOption, ListFilterTarget } from '@/types/list' +import { type ResultCode, ResultCodeType } from '@/types/project' +import { ListHeaderConst, LIST_BATCH_EDIT_FILE_DELETE_VALUE } from '@/const/listConst' export type BatchEditOption = { id: number label: string + listHderTy: number + valueOptions?: FilterValueOption[] } export type BatchEditRow = { @@ -26,57 +33,74 @@ export type BatchEditRow = { value: string } +export type BatchEditResultCodes = Partial> + +export type BatchEditPayload = { + rows: BatchEditRow[] + resultCodes: BatchEditResultCodes + target: ListFilterTarget +} + export type ListBatchEditDialogProps = { dialogId?: DialogId open?: boolean onOpenChange?: (open: boolean) => void - appliedFilters?: Record headerOptions: BatchEditOption[] + resultCodes: ResultCode[] + filterSummary?: string[] initialRows?: BatchEditRow[] - onConfirm: (rows: BatchEditRow[]) => void | Promise + initialResultCodes?: BatchEditResultCodes + onConfirm: (payload: BatchEditPayload) => void | Promise } -const createRow = (headerId: number): BatchEditRow => ({ +const createRow = (headerId: number, value = ''): BatchEditRow => ({ id: crypto.randomUUID(), headerId, - value: '', + value, }) +const NO_CHANGE = '__no_change__' + +const resultCodeGroups: { type: ResultCodeType; label: string }[] = [ + { type: ResultCodeType.CONTACT, label: '컨택 결과' }, + { type: ResultCodeType.INTERVIEW, label: '면접 결과' }, + { type: ResultCodeType.SURVEY, label: '설문 결과' }, +] + const ListBatchEditDialog = ({ dialogId = 'listBatchEditDialog', open, onOpenChange, - appliedFilters = {}, headerOptions, + resultCodes, + filterSummary, initialRows = [], + initialResultCodes = {}, onConfirm, }: ListBatchEditDialogProps) => { const { isDialogOpen, showDialog, hideDialog } = useDialog() const [rows, setRows] = useState([]) + const [resultCodeSelections, setResultCodeSelections] = useState({}) + const [target, setTarget] = useState('filtered') const [submitting, setSubmitting] = useState(false) const resolvedOpen = open ?? isDialogOpen(dialogId) const defaultHeaderId = headerOptions[0]?.id ?? 0 + const isFileHeader = (headerId: number) => headerOptions.find((option) => option.id === headerId)?.listHderTy === ListHeaderConst.FILE + useEffect(() => { if (!resolvedOpen) return if (initialRows.length > 0) { setRows(initialRows.map((row) => ({ ...row }))) - return + } else if (defaultHeaderId > 0) { + setRows([createRow(defaultHeaderId, isFileHeader(defaultHeaderId) ? LIST_BATCH_EDIT_FILE_DELETE_VALUE : '')]) + } else { + setRows([]) } - if (defaultHeaderId > 0) { - setRows([createRow(defaultHeaderId)]) - } - }, [resolvedOpen, initialRows, defaultHeaderId]) - - const filterSummary = useMemo(() => { - return Object.entries(appliedFilters) - .map(([headerId, values]) => { - const headerLabel = headerOptions.find((opt) => opt.id === Number(headerId))?.label ?? headerId - return `${headerLabel}: ${values.join(', ')}` - }) - .join(' / ') - }, [appliedFilters, headerOptions]) + setResultCodeSelections({ ...initialResultCodes }) + setTarget('filtered') + }, [resolvedOpen, initialRows, initialResultCodes, defaultHeaderId]) const handleOpenChange = (nextOpen: boolean) => { onOpenChange?.(nextOpen) @@ -89,7 +113,7 @@ const ListBatchEditDialog = ({ const handleAddRow = () => { if (defaultHeaderId <= 0) return - setRows((prev) => [...prev, createRow(defaultHeaderId)]) + setRows((prev) => [...prev, createRow(defaultHeaderId, isFileHeader(defaultHeaderId) ? LIST_BATCH_EDIT_FILE_DELETE_VALUE : '')]) } const handleRemoveRow = (id: string) => { @@ -97,23 +121,38 @@ const ListBatchEditDialog = ({ } const handleChangeHeader = (id: string, headerId: number) => { - setRows((prev) => prev.map((row) => (row.id === id ? { ...row, headerId } : row))) + const value = isFileHeader(headerId) ? LIST_BATCH_EDIT_FILE_DELETE_VALUE : '' + setRows((prev) => prev.map((row) => (row.id === id ? { ...row, headerId, value } : row))) } + const getValueOptions = (headerId: number) => headerOptions.find((option) => option.id === headerId)?.valueOptions + const handleChangeValue = (id: string, value: string) => { setRows((prev) => prev.map((row) => (row.id === id ? { ...row, value } : row))) } + const handleChangeResultCode = (type: ResultCodeType, value: string) => { + setResultCodeSelections((prev) => { + if (value === NO_CHANGE) { + const next = { ...prev } + delete next[type] + return next + } + return { ...prev, [type]: Number(value) } + }) + } + const handleConfirm = async () => { const normalized = rows.filter((row) => row.headerId > 0 && row.value.trim().length > 0) - if (normalized.length === 0) { + const hasResultCodeChange = Object.keys(resultCodeSelections).length > 0 + if (normalized.length === 0 && !hasResultCodeChange) { alert('일괄 수정할 항목을 입력해주세요.') return } setSubmitting(true) try { - await onConfirm(normalized) + await onConfirm({ rows: normalized, resultCodes: resultCodeSelections, target }) handleOpenChange(false) } finally { setSubmitting(false) @@ -138,13 +177,45 @@ const ListBatchEditDialog = ({ } > -
-

적용된 필터

-

- {filterSummary.length > 0 ? filterSummary : '적용된 필터가 없습니다.'} -

+
+

적용 대상

+
+
+

결과값 수정

+
+ {resultCodeGroups.map((group) => ( +
+

{group.label}

+ +
+ ))} +
+
+ +

항목값 수정

헤더 @@ -153,7 +224,11 @@ const ListBatchEditDialog = ({
- {rows.map((row) => ( + {rows.map((row) => { + const valueOptions = getValueOptions(row.headerId) + const isFile = isFileHeader(row.headerId) + + return (
- handleChangeValue(row.id, e.target.value)} - placeholder="수정할 값을 입력해주세요" - /> + {isFile ? ( +

파일 삭제

+ ) : valueOptions !== undefined ? ( + handleChangeValue(row.id, value)} + getValue={(item) => item.value} + getLabel={(item) => item.label} + placeholder="값 선택" + heightClassName="h-9" + widthClassName="w-full" + className="w-full" + /> + ) : ( + handleChangeValue(row.id, e.target.value)} + placeholder="수정할 값을 입력해주세요" + /> + )}
- ))} + ) + })}
diff --git a/src/components/dialog/ListDialogOption/ApplyFilterOption.tsx b/src/components/dialog/ListDialogOption/ApplyFilterOption.tsx index bf1c8ea..f758648 100644 --- a/src/components/dialog/ListDialogOption/ApplyFilterOption.tsx +++ b/src/components/dialog/ListDialogOption/ApplyFilterOption.tsx @@ -11,28 +11,47 @@ type ApplyFilterGroupProps = { value: ApplyFilterOptionValue onValueChange: (value: ApplyFilterOptionValue) => void idPrefix: string + /** '필터 적용 대상만' 선택 시 보여줄, 사람이 읽을 수 있는 현재 필터 조건 목록 */ + filterSummary?: string[] } -const ApplyFilterOption = ({ value, onValueChange, idPrefix }: ApplyFilterGroupProps) => { +const ApplyFilterOption = ({ value, onValueChange, idPrefix, filterSummary }: ApplyFilterGroupProps) => { return ( - onValueChange(next as ApplyFilterOptionValue)} - className="flex items-center gap-6 flex-wrap" - > -
- - -
-
- - -
-
- - -
-
+
+ onValueChange(next as ApplyFilterOptionValue)} + className="flex items-center gap-6 flex-wrap" + > +
+ + +
+
+ + +
+
+ + +
+
+ + {value === 'filtered' && filterSummary !== undefined && ( +
+

적용된 필터

+ {filterSummary.length > 0 ? ( +
    + {filterSummary.map((line, index) => ( +
  • {line}
  • + ))} +
+ ) : ( +

적용된 필터가 없습니다.

+ )} +
+ )} +
) } diff --git a/src/components/dialog/ListDownloadDialog.tsx b/src/components/dialog/ListDownloadDialog.tsx index 1b20ab2..86c2f06 100644 --- a/src/components/dialog/ListDownloadDialog.tsx +++ b/src/components/dialog/ListDownloadDialog.tsx @@ -17,6 +17,7 @@ export type ListDownloadDialogProps = { open?: boolean onOpenChange?: (open: boolean) => void mode: ListDownloadMode + filterSummary?: string[] onDownload: (payload: ListDownloadPayload) => void | Promise } @@ -32,6 +33,7 @@ const ListDownloadDialog = ({ open, onOpenChange, mode, + filterSummary, onDownload, }: ListDownloadDialogProps) => { const { isDialogOpen, showDialog, hideDialog } = useDialog() @@ -116,7 +118,7 @@ const ListDownloadDialog = ({ ) : null}

다운로드 범위

- +
{mode === 'contact-history' ? (
diff --git a/src/components/dialog/ListFilterDialog.tsx b/src/components/dialog/ListFilterDialog.tsx index bcc22dc..3588186 100644 --- a/src/components/dialog/ListFilterDialog.tsx +++ b/src/components/dialog/ListFilterDialog.tsx @@ -26,7 +26,7 @@ export type ListFilterDialogProps = { onConfirm: (rows: FilterRow[]) => void | Promise } -const operatorLabel: Record = { +export const operatorLabel: Record = { eq: '같음', neq: '다름', contains: '포함', @@ -117,7 +117,9 @@ const ListFilterDialog = ({ ) const handleConfirm = async () => { - if (serializedRows.length === 0) { + // rows가 아예 없으면 "필터를 전부 지우겠다"는 의도이므로 그대로 통과시킨다. + // rows는 있는데 값을 안 채워 serializedRows가 비면, 실수로 방치된 조건일 가능성이 높아 알려준다. + if (rows.length > 0 && serializedRows.length === 0) { alert('필터 조건을 입력해주세요.') return } diff --git a/src/components/dialog/ListResetDialog.tsx b/src/components/dialog/ListResetDialog.tsx index 33524b0..047397c 100644 --- a/src/components/dialog/ListResetDialog.tsx +++ b/src/components/dialog/ListResetDialog.tsx @@ -14,6 +14,7 @@ export type ListResetDialogProps = { dialogId?: DialogId open?: boolean onOpenChange?: (open: boolean) => void + filterSummary?: string[] onConfirm: (payload: { target: ListFilterTarget; scope: ListResetScope }) => void | Promise } @@ -21,6 +22,7 @@ const ListResetDialog = ({ dialogId = 'listResetDialog', open, onOpenChange, + filterSummary, onConfirm, }: ListResetDialogProps) => { const { isDialogOpen, showDialog, hideDialog } = useDialog() @@ -73,6 +75,7 @@ const ListResetDialog = ({ value={target} onValueChange={(v) => setTarget(v)} idPrefix="list-reset-target" + filterSummary={filterSummary} />
diff --git a/src/components/dialog/ListUploadDialog.tsx b/src/components/dialog/ListUploadDialog.tsx index d309a62..d349eb5 100644 --- a/src/components/dialog/ListUploadDialog.tsx +++ b/src/components/dialog/ListUploadDialog.tsx @@ -213,7 +213,10 @@ const ListUploadDialog = ({ }), [baseHeaderRows.length, compareRows, excelHeaders, hasCommonHeader], ) - const hasHeaderMismatch = headerCompareList.some(({ serverHeader, isMatched }) => !!serverHeader && !isMatched) + const hasHeaderCountMismatch = + excelHeaders.length < compareRows.length || (hasCommonHeader && excelHeaders.length > compareRows.length) + const hasHeaderMismatch = + hasHeaderCountMismatch || headerCompareList.some(({ serverHeader, isMatched }) => !!serverHeader && !isMatched) const renderHeaderTypeCell = ( serverHeader: listHeader | undefined, @@ -316,6 +319,11 @@ const ListUploadDialog = ({ {selectedFile && excelHeaders.length > 0 && compareRows.length > 0 && (
+ {hasHeaderCountMismatch && ( +

+ 업로드 파일의 헤더 개수({excelHeaders.length}개)가 리스트 헤더 개수({compareRows.length}개)와 일치하지 않습니다. +

+ )}
{headerCompareList.map(({ header, index, isMatched, isSettingRequired, serverHeader }) => { diff --git a/src/components/dialog/MessageHistoryDialog.tsx b/src/components/dialog/MessageHistoryDialog.tsx index eb9cdf2..3e3e670 100644 --- a/src/components/dialog/MessageHistoryDialog.tsx +++ b/src/components/dialog/MessageHistoryDialog.tsx @@ -72,9 +72,14 @@ const MessageHistoryDialog = ({ const visibleRows = useMemo(() => { if (tab === 'email') return emailListQuery.data ?? [] - return [...(smsListQuery.data ?? []), ...(lmsListQuery.data ?? [])].sort((a, b) => - (b.regDt ?? '').localeCompare(a.regDt ?? ''), - ) + + // 문자 길이에 따라 SMS로 발송된 건도 자동으로 LMS/MMS로 전환될 수 있는데, 이 경우 두 목록 API가 + // 같은 bulkSendKey를 각각 반환해 합치면 행이 중복된다. bulkSendKey 기준으로 한 번만 남긴다. + const merged = new Map() + for (const row of [...(smsListQuery.data ?? []), ...(lmsListQuery.data ?? [])]) { + merged.set(row.bulkSendKey, row) + } + return Array.from(merged.values()).sort((a, b) => (b.regDt ?? '').localeCompare(a.regDt ?? '')) }, [tab, emailListQuery.data, smsListQuery.data, lmsListQuery.data]) const detailQuery = useBulkSendDetailQuery( diff --git a/src/components/dialog/MessageSendDialog.tsx b/src/components/dialog/MessageSendDialog.tsx index baff969..89af02b 100644 --- a/src/components/dialog/MessageSendDialog.tsx +++ b/src/components/dialog/MessageSendDialog.tsx @@ -3,23 +3,19 @@ import { useEffect, useMemo, useRef, useState } from 'react' import { KriDialog } from '@/components/common/KriDialog' import { Button } from '@/components/ui/button' -import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group' import { KriDateTimePicker } from '@/components/common/KriDateTimePicker' import { KriSingleSelect } from '@/components/common/KriAutoComplete' import { useDialog } from '@/hooks/useDialog' -import { useAuth } from '@/hooks/useAuth' import { useSelectedProject } from '@/hooks/useSelectedProject' -import { useListSearchQuery } from '@/query/list' import { - useCreateBulkSendKeyMutation, useMainTemplateIdxQuery, - useSendBulkMutation, + useSendBulkMessageMutation, useTemplateListQuery, useTemplateQuery, } from '@/query/message' -import {ChannelType, type DestInfo, TemplateSms, type TemplateSummary} from '@kri/common/noti-hub' +import { ChannelType, TemplateSms, type TemplateSummary } from '@kri/common/noti-hub' import { sanitizeHtmlForPreview } from '@/components/kri-editor/utils/sanitizeHtml' import { cn } from '@/lib/utils' import { getNearestFutureDateTime } from '@/lib/datetime' @@ -28,18 +24,10 @@ import { createEmptyListFilter, type ListFilter, type ListFilterTarget, type lis import { ListHeaderConst } from '@/const/listConst' import type { ListTableRow } from '@/components/table-column/ListTableColumn' import ApplyFilterOption from './ListDialogOption/ApplyFilterOption' -import {KriEditor} from "@/components/kri-editor"; -import {clientEnv} from "@/lib/env.client"; +import { KriEditor } from '@/components/kri-editor' export type MessageSendMode = 'email' | 'sms' -const MAX_TARGET_COUNT = 5000 - -const toTargetRow = (row: ListTableRow): { sid: string; itemList: Record } => ({ - sid: String(row.sid ?? ''), - itemList: (row.itemList as Record | undefined) ?? {}, -}) - export type MessageSendDialogProps = { dialogId?: DialogId open?: boolean @@ -48,6 +36,7 @@ export type MessageSendDialogProps = { listHeaders: listHeader[] currentFilter: ListFilter selectedRows: ListTableRow[] + filterSummary?: string[] onSent?: () => void } @@ -64,18 +53,15 @@ const MessageSendDialog = ({ listHeaders, currentFilter, selectedRows, + filterSummary, onSent, }: MessageSendDialogProps) => { const { isDialogOpen, showDialog, hideDialog } = useDialog() - const { auth } = useAuth() const { selectedProject } = useSelectedProject() const chnnlTy = mode === 'email' ? ChannelType.EMAIL : ChannelType.SMS const [templateIdx, setTemplateIdx] = useState(null) - const [senderEmail, setSenderEmail] = useState('') - const [senderName, setSenderName] = useState('') - const [senderNumber, setSenderNumber] = useState('') const [scheduleType, setScheduleType] = useState<'instant' | 'reserve'>('instant') const [reserveAt, setReserveAt] = useState('') const [targetHeaderId, setTargetHeaderId] = useState(null) @@ -85,7 +71,6 @@ const MessageSendDialog = ({ const resolvedOpen = open ?? isDialogOpen(dialogId) const prjctIdx = selectedProject?.prjctIdx ?? 0 - const prjctCd = selectedProject?.prjctCd ?? '' const itrntPrjctCd = selectedProject?.itrntPrjctCd ?? '' const enabled = resolvedOpen && !!selectedProject && prjctIdx > 0 @@ -96,43 +81,23 @@ const MessageSendDialog = ({ const mainTemplateQuery = useMainTemplateIdxQuery(prjctIdx, chnnlTy, enabled) const mainTemplateIdx = mainTemplateQuery.data ?? null + const templateSenderName = selectedTemplate?.sendNm + const templateSenderEmail = selectedTemplate && 'sendEml' in selectedTemplate ? selectedTemplate.sendEml : undefined + const templateSenderTel = selectedTemplate && 'sendTel' in selectedTemplate ? selectedTemplate.sendTel : undefined + const headerType = mode === 'email' ? ListHeaderConst.EMAIL : ListHeaderConst.TEL_NUM const targetHeaderOptions = useMemo( () => listHeaders.filter((header) => header.listHderTy === headerType), [listHeaders, headerType], ) - // '전체'/'필터 적용 대상'은 현재 페이지에 보이는 행을 넘어설 수 있어 별도로 넓게 조회한다 - const bulkTargetFilter = target === 'all' ? createEmptyListFilter() : currentFilter - const bulkTargetEnabled = enabled && target !== 'selected' - const bulkTargetQuery = useListSearchQuery( - prjctIdx, - { - listFilter: bulkTargetFilter, - pageRequest: { pageIndex: 0, pageSize: MAX_TARGET_COUNT, sortBy: 'sid', sortDir: 'asc' }, - }, - bulkTargetEnabled, - ) - - const targetRows = useMemo(() => { - const rows = target === 'selected' ? selectedRows : (bulkTargetQuery.data?.content ?? []) - return rows.map(toTargetRow) - }, [target, selectedRows, bulkTargetQuery.data]) - - const targetTotalCount = target === 'selected' ? selectedRows.length : (bulkTargetQuery.data?.totalElements ?? 0) - const isTargetTruncated = target !== 'selected' && targetTotalCount > MAX_TARGET_COUNT - - const createBulkKeyMutation = useCreateBulkSendKeyMutation(mode) - const sendBulkMutation = useSendBulkMutation(mode) + const sendBulkMessageMutation = useSendBulkMessageMutation(mode, prjctIdx) const mainTemplateAppliedRef = useRef(false) useEffect(() => { if (!resolvedOpen) return setTemplateIdx(null) - setSenderEmail('') - setSenderName('') - setSenderNumber('') setScheduleType('instant') setReserveAt('') setTarget('selected') @@ -147,14 +112,6 @@ const MessageSendDialog = ({ if (mainTemplateIdx) setTemplateIdx(mainTemplateIdx) }, [enabled, mainTemplateQuery.isSuccess, mainTemplateIdx]) - // 템플릿 상세가 도착하면 발신 정보를 세팅한다 (발송 전 수정 가능) - useEffect(() => { - if (!selectedTemplate) return - setSenderName(selectedTemplate.sendNm) - if ('sendEml' in selectedTemplate) setSenderEmail(selectedTemplate.sendEml) - if ('sendTel' in selectedTemplate) setSenderNumber(selectedTemplate.sendTel) - }, [selectedTemplate]) - useEffect(() => { if (targetHeaderId !== null) return const first = targetHeaderOptions[0] @@ -182,26 +139,15 @@ const MessageSendDialog = ({ setTemplateIdx(Number.isFinite(idx) && idx > 0 ? idx : null) } - const buildMsgParam = (itemList: Record): Record => { - const param: Record = {} - listHeaders.forEach((header) => { - const value = itemList[header.listHderId] - if (value !== undefined) param[header.listHderNm] = value - }) - return param - } - - const buildDestInfoList = (): DestInfo[] => { - if (!targetHeaderId) return [] - return targetRows.map(({ sid, itemList }) => { - const destValue = itemList[targetHeaderId] ?? '' + const buildListFilter = (): ListFilter => { + if (target === 'all') return createEmptyListFilter() + if (target === 'selected') { return { - sid, - destEml: mode === 'email' ? destValue : undefined, - destTel: mode === 'sms' ? destValue : undefined, - msgParam: buildMsgParam(itemList), + ...createEmptyListFilter(), + sidSet: selectedRows.map((row) => String(row.sid ?? '')).filter((sid) => sid.length > 0), } - }) + } + return currentFilter } const handleConfirm = async () => { @@ -213,50 +159,39 @@ const MessageSendDialog = ({ alert(`수신 ${mode === 'email' ? '이메일' : '번호'} 헤더를 선택해 주세요.`) return } - if (mode === 'email' && !senderEmail.trim()) { - alert('발송자 메일을 입력해 주세요.') + if (mode === 'email' && !templateSenderEmail) { + alert('선택한 템플릿에 발송자 메일이 등록되어 있지 않습니다. 템플릿 설정을 확인해 주세요.') return } - if (mode === 'sms' && !senderNumber.trim()) { - alert('발송 번호를 입력해 주세요.') + if (mode === 'sms' && !templateSenderTel) { + alert('선택한 템플릿에 발송 번호가 등록되어 있지 않습니다. 템플릿 설정을 확인해 주세요.') return } if (scheduleType === 'reserve' && !reserveAt) { alert('예약 발송 일시를 선택해 주세요.') return } - if (isTargetTruncated) { - alert(`수신 대상이 ${MAX_TARGET_COUNT}건을 초과합니다. 대상 범위를 좁혀 주세요.`) - return - } - const destInfoList = buildDestInfoList() - if (destInfoList.length === 0) { + const listFilter = buildListFilter() + if (target === 'selected' && listFilter.sidSet.length === 0) { alert('수신 대상이 없습니다.') return } setSubmitting(true) try { - const bulkSendKey = await createBulkKeyMutation.mutateAsync({ - reqstCmpn: auth.user?.userCmpn ?? '', - reqstUser: auth.user?.userId ?? '', - reqstSvc: clientEnv.REQUEST_SVC, - prjctCd, + const res = await sendBulkMessageMutation.mutateAsync({ tmplatIdx: templateIdx, resve: scheduleType === 'reserve', sendDt: scheduleType === 'reserve' ? new Date(reserveAt).toISOString() : undefined, - trgtCnt: destInfoList.length, + listFilter, + destHeaderIds: [targetHeaderId], }) - await sendBulkMutation.mutateAsync({ - sendEml: mode === 'email' ? senderEmail : undefined, - sendTel: mode === 'sms' ? senderNumber : undefined, - sendNm: senderName || undefined, - bulkSendKey, - destInfoList, - }) - - alert('발송 요청이 완료되었습니다.') + if (res.failCount > 0) { + alert(`대상 ${res.targetCount}건 중 ${res.acceptCount}건 접수, ${res.failCount}건 실패했습니다.`) + } else { + alert(`대상 ${res.targetCount}건 발송 요청이 완료되었습니다.`) + } onSent?.() handleOpenChange(false) } catch (e) { @@ -304,17 +239,23 @@ const MessageSendDialog = ({
- setSenderEmail(e.target.value)} /> +

+ {templateSenderEmail || '-'} +

- setSenderName(e.target.value)} /> +

+ {templateSenderName || '-'} +

) : (
- setSenderNumber(e.target.value)} /> +

+ {templateSenderTel || '-'} +

)} @@ -360,11 +301,7 @@ const MessageSendDialog = ({
- -

- 대상 {targetTotalCount.toLocaleString()}건 - {isTargetTruncated ? ` (최대 ${MAX_TARGET_COUNT.toLocaleString()}건까지만 발송 가능합니다)` : ''} -

+
diff --git a/src/components/dialog/UserUpsertDialog.tsx b/src/components/dialog/UserUpsertDialog.tsx index bd6f3d4..ee3e8b9 100644 --- a/src/components/dialog/UserUpsertDialog.tsx +++ b/src/components/dialog/UserUpsertDialog.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState, useEffect } from 'react' +import { useEffect, useMemo, useState } from 'react' import { KriDialog } from '@/components/common/KriDialog' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' @@ -15,6 +15,13 @@ import {apiError} from "@kri/common/http"; import {CONTACT_INTERVIEWER_ROLE, FW_TEAM, USER_NAME_REGEX} from "@/const/userConst"; import {NONE_HTTP_ERROR, UNKNOWN_HTTP_ERROR} from "@kri/common/http"; import type { CmpnInfo } from "@/types/cmpn"; +import { isExternalManager, isFieldWorkUser } from "@/utils/userRole"; + +// 외주사(EXTERNAL_USER_ROLE_GROUP)와 콜센터/컨택원/면접원(FW_USER_ROLE_GROUP)은 배정 체계가 완전히 달라 +// 서로 넘나드는 권한 수정을 지원하지 않는다. 하나 새로 만들어서 넘기는 게 맞다. +const isCrossExternalFwRoleChange = (fromRole: number, toRole: number) => + (isExternalManager(fromRole) && isFieldWorkUser(toRole)) || + (isFieldWorkUser(fromRole) && isExternalManager(toRole)) export type UserUpsertDialogProps = { /** Jotai로 관리할 다이얼로그 ID */ @@ -94,6 +101,13 @@ const UserUpsertDialog = ({ } }, [initialData, mode, resolvedOpen]) + // 수정 모드에서는 최초 권한 기준으로 외주사 ↔ 콜센터/컨택원/면접원 간 이동이 되는 선택지를 아예 뺀다. + const availableRoleArray = useMemo(() => { + if (mode === 'create' || initialData?.userRole == null) return userRoleArray + const initialRole = initialData.userRole + return userRoleArray.filter((item) => !isCrossExternalFwRoleChange(initialRole, Number(item.value))) + }, [mode, initialData?.userRole, userRoleArray]) + const handleInputChange = (field: K, value: UserInfoSaveRequest[K]) => { setFormData(prev => ({ ...prev, @@ -250,7 +264,7 @@ const UserUpsertDialog = ({
item.label} getValue={(item) => String(item.value)} diff --git a/src/components/layout/KriSidebar.tsx b/src/components/layout/KriSidebar.tsx index 367cbc7..7cda553 100644 --- a/src/components/layout/KriSidebar.tsx +++ b/src/components/layout/KriSidebar.tsx @@ -71,7 +71,7 @@ export function KriSidebar({