diff --git a/package.json b/package.json index a1e9909..0d82088 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "ag-grid-react": "^31.3.2", "antd": "^5.17.3", "axios": "^1.7.2", - "dayjs": "^1.11.11", + "moment": "^2.30.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.51.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1114eb8..ebb7568 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,13 +22,13 @@ dependencies: version: 31.3.2(react-dom@18.3.1)(react@18.3.1) antd: specifier: ^5.17.3 - version: 5.17.3(react-dom@18.3.1)(react@18.3.1) + version: 5.17.3(moment@2.30.1)(react-dom@18.3.1)(react@18.3.1) axios: specifier: ^1.7.2 version: 1.7.2 - dayjs: - specifier: ^1.11.11 - version: 1.11.11 + moment: + specifier: ^2.30.1 + version: 2.30.1 react: specifier: ^18.2.0 version: 18.3.1 @@ -87,7 +87,7 @@ devDependencies: version: 0.4.7(eslint@8.57.0) msw: specifier: ^2.3.0 - version: 2.3.0(typescript@5.4.5) + version: 2.3.1(typescript@5.4.5) prettier: specifier: ^3.2.5 version: 3.2.5 @@ -165,11 +165,17 @@ packages: /@bundled-es-modules/cookie@2.0.0: resolution: {integrity: sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==} + dependencies: + cookie: 0.5.0 + dev: true - '@bundled-es-modules/statuses@1.0.1': + /@bundled-es-modules/statuses@1.0.1: resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} + dependencies: + statuses: 2.0.1 + dev: true - '@ctrl/tinycolor@3.6.1': + /@ctrl/tinycolor@3.6.1: resolution: {integrity: sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==} engines: {node: '>=10'} dev: false @@ -460,19 +466,39 @@ packages: resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} dev: true - '@inquirer/confirm@3.1.9': + /@inquirer/confirm@3.1.9: resolution: {integrity: sha512-UF09aejxCi4Xqm6N/jJAiFXArXfi9al52AFaSD+2uIHnhZGtd1d6lIGTRMPouVSJxbGEi+HkOWSYaiEY/+szUw==} engines: {node: '>=18'} + dependencies: + '@inquirer/core': 8.2.2 + '@inquirer/type': 1.3.3 + dev: true - '@inquirer/core@8.2.2': + /@inquirer/core@8.2.2: resolution: {integrity: sha512-K8SuNX45jEFlX3EBJpu9B+S2TISzMPGXZIuJ9ME924SqbdW6Pt6fIkKvXg7mOEOKJ4WxpQsxj0UTfcL/A434Ww==} engines: {node: '>=18'} + dependencies: + '@inquirer/figures': 1.0.3 + '@inquirer/type': 1.3.3 + '@types/mute-stream': 0.0.4 + '@types/node': 20.14.2 + '@types/wrap-ansi': 3.0.0 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + cli-spinners: 2.9.2 + cli-width: 4.1.0 + mute-stream: 1.0.0 + signal-exit: 4.1.0 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + dev: true - '@inquirer/figures@1.0.3': + /@inquirer/figures@1.0.3: resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} engines: {node: '>=18'} + dev: true - '@inquirer/type@1.3.3': + /@inquirer/type@1.3.3: resolution: {integrity: sha512-xTUt0NulylX27/zMx04ZYar/kr1raaiFTVvQ5feljQsiAgdm0WPj4S73/ye0fbslh+15QrIuDvfCXTek7pMY5A==} engines: {node: '>=18'} dev: true @@ -480,12 +506,21 @@ packages: /@mswjs/cookies@1.1.0: resolution: {integrity: sha512-0ZcCVQxifZmhwNBoQIrystCb+2sWBY2Zw8lpfJBPCHGCA/HWqehITeCRVIv4VMy8MPlaHo2w2pTHFV2pFfqKPw==} engines: {node: '>=18'} + dev: true - '@mswjs/interceptors@0.29.1': + /@mswjs/interceptors@0.29.1: resolution: {integrity: sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw==} engines: {node: '>=18'} + dependencies: + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 + outvariant: 1.4.2 + strict-event-emitter: 0.5.1 + dev: true - '@nodelib/fs.scandir@2.1.5': + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: @@ -506,16 +541,22 @@ packages: fastq: 1.17.1 dev: true - '@open-draft/deferred-promise@2.2.0': + /@open-draft/deferred-promise@2.2.0: resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + dev: true - '@open-draft/logger@0.3.0': + /@open-draft/logger@0.3.0: resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} + dependencies: + is-node-process: 1.2.0 + outvariant: 1.4.2 + dev: true - '@open-draft/until@2.1.0': + /@open-draft/until@2.1.0: resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} + dev: true - '@pkgr/core@0.1.1': + /@pkgr/core@0.1.1: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dev: true @@ -909,16 +950,20 @@ packages: /@types/cookie@0.6.0: resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} + dev: true - '@types/estree@1.0.5': + /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true - '@types/mute-stream@0.0.4': + /@types/mute-stream@0.0.4: resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} + dependencies: + '@types/node': 20.14.2 + dev: true - /@types/node@20.12.12: - resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} + /@types/node@20.14.2: + resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} dependencies: undici-types: 5.26.5 dev: true @@ -1089,7 +1134,7 @@ packages: vite: ^4 || ^5 dependencies: '@swc/core': 1.5.7 - vite: 5.2.11(@types/node@20.14.2) + vite: 5.2.11 transitivePeerDependencies: - '@swc/helpers' dev: true @@ -1133,9 +1178,12 @@ packages: uri-js: 4.4.1 dev: true - ansi-escapes@4.3.2: + /ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} dependencies: type-fest: 0.21.3 + dev: true /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -1149,7 +1197,7 @@ packages: color-convert: 2.0.1 dev: true - /antd@5.17.3(react-dom@18.3.1)(react@18.3.1): + /antd@5.17.3(moment@2.30.1)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-U99hyy7t8dOQtNHzHifmwAXJLgmPMadavFBsd2mnfICD6m8l7u/NvCefRhd2jOf/SBNE2579YhwCEwTUiX2GnQ==} peerDependencies: react: '>=16.9.0' @@ -1184,7 +1232,7 @@ packages: rc-motion: 2.9.1(react-dom@18.3.1)(react@18.3.1) rc-notification: 5.4.0(react-dom@18.3.1)(react@18.3.1) rc-pagination: 4.0.4(react-dom@18.3.1)(react@18.3.1) - rc-picker: 4.5.0(dayjs@1.11.11)(react-dom@18.3.1)(react@18.3.1) + rc-picker: 4.5.0(dayjs@1.11.11)(moment@2.30.1)(react-dom@18.3.1)(react@18.3.1) rc-progress: 4.0.0(react-dom@18.3.1)(react@18.3.1) rc-rate: 2.12.0(react-dom@18.3.1)(react@18.3.1) rc-resize-observer: 1.4.0(react-dom@18.3.1)(react@18.3.1) @@ -1224,7 +1272,23 @@ packages: engines: {node: '>=8'} dev: true - asynckit@0.4.0: {} + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + + /axios@1.7.2: + resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==} + dependencies: + follow-redirects: 1.15.6 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -1267,11 +1331,19 @@ packages: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} dev: false - cli-spinners@2.9.2: {} + /cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} + dev: true - cli-width@4.1.0: {} + /cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + dev: true - cliui@8.0.1: + /cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 @@ -1289,19 +1361,28 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true - combined-stream@1.0.8: + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 + dev: false + + /compute-scroll-into-view@3.1.0: + resolution: {integrity: sha512-rj8l8pD4bJ1nx+dAkMhV1xB5RuZEyVysfxJqB1pRchh1KVvwOv9b7CGB8ZfjTImVv2oF+sYMUkMZq6Na5Ftmbg==} + dev: false /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - concat-map@0.0.1: {} - - cookie@0.5.0: {} + /cookie@0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: true - copy-to-clipboard@3.3.3: + /copy-to-clipboard@3.3.3: + resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} dependencies: toggle-selection: 1.0.6 dev: false @@ -1351,9 +1432,14 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true - delayed-stream@1.0.0: {} + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false - dir-glob@3.0.1: + /dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} dependencies: path-type: 4.0.0 dev: true @@ -1365,9 +1451,15 @@ packages: esutils: 2.0.3 dev: true - emoji-regex@8.0.0: {} + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true - esbuild@0.20.2: + /esbuild@0.20.2: + resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true optionalDependencies: '@esbuild/aix-ppc64': 0.20.2 '@esbuild/android-arm': 0.20.2 @@ -1602,7 +1694,28 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true - follow-redirects@1.15.6: {} + /follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} @@ -1612,9 +1725,14 @@ packages: dev: true optional: true - get-caller-file@2.0.5: {} + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true - glob-parent@5.1.2: + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 dev: true @@ -1668,16 +1786,28 @@ packages: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true - graphql@16.8.1: {} + /graphql@16.8.1: + resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + dev: true + + /hamt_plus@1.0.2: + resolution: {integrity: sha512-t2JXKaehnMb9paaYA7J0BX8QQAY8lwfQ9Gjf4pg/mk4krt+cmwmU652HOoWonf+7+EQV97ARPMhhVgU1ra2GhA==} + dev: false /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} dev: true - headers-polyfill@4.0.3: {} + /headers-polyfill@4.0.3: + resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} + dev: true - ignore@5.3.1: {} + /ignore@5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + engines: {node: '>= 4'} + dev: true /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -1709,16 +1839,26 @@ packages: engines: {node: '>=0.10.0'} dev: true - is-fullwidth-code-point@3.0.0: {} + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true - is-glob@4.0.3: + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 dev: true - is-node-process@1.2.0: {} + /is-node-process@1.2.0: + resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} + dev: true - is-number@7.0.0: {} + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} @@ -1732,7 +1872,7 @@ packages: /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: false - + /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -1803,13 +1943,20 @@ packages: picomatch: 2.3.1 dev: true - mime-db@1.52.0: {} + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false - mime-types@2.1.35: + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 + dev: false - minimatch@3.1.2: + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 dev: true @@ -1821,11 +1968,24 @@ packages: brace-expansion: 2.0.1 dev: true + /moment@2.30.1: + resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==} + dev: false + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - msw@2.3.1(typescript@5.4.5): + /msw@2.3.1(typescript@5.4.5): + resolution: {integrity: sha512-ocgvBCLn/5l3jpl1lssIb3cniuACJLoOfZu01e3n5dbJrpA5PeeWn28jCLgQDNt6d7QT8tF2fYRzm9JoEHtiig==} + engines: {node: '>=18'} + hasBin: true + requiresBuild: true + peerDependencies: + typescript: '>= 4.7.x' + peerDependenciesMeta: + typescript: + optional: true dependencies: '@bundled-es-modules/cookie': 2.0.0 '@bundled-es-modules/statuses': 1.0.1 @@ -1843,13 +2003,19 @@ packages: path-to-regexp: 6.2.2 strict-event-emitter: 0.5.1 type-fest: 4.20.0 - yargs: 17.7.2 - optionalDependencies: typescript: 5.4.5 + yargs: 17.7.2 + dev: true - mute-stream@1.0.0: {} + /mute-stream@1.0.0: + resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true - nanoid@3.3.7: {} + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -1878,9 +2044,13 @@ packages: word-wrap: 1.2.5 dev: true - outvariant@1.4.2: {} + /outvariant@1.4.2: + resolution: {integrity: sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==} + dev: true - p-limit@3.1.0: + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 dev: true @@ -1914,9 +2084,14 @@ packages: engines: {node: '>=8'} dev: true - path-to-regexp@6.2.2: {} + /path-to-regexp@6.2.2: + resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} + dev: true - path-type@4.0.0: {} + /path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true /picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} @@ -1964,7 +2139,14 @@ packages: react-is: 16.13.1 dev: false - proxy-from-env@1.1.0: {} + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: true /qrcode.react@3.1.0(react@18.3.1): resolution: {integrity: sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==} @@ -2211,7 +2393,7 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false - /rc-picker@4.5.0(dayjs@1.11.11)(react-dom@18.3.1)(react@18.3.1): + /rc-picker@4.5.0(dayjs@1.11.11)(moment@2.30.1)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-suqz9bzuhBQlf7u+bZd1bJLPzhXpk12w6AjQ9BTPTiFwexVZgUKViG1KNLyfFvW6tCUZZK0HmCCX7JAyM+JnCg==} engines: {node: '>=8.x'} peerDependencies: @@ -2235,6 +2417,7 @@ packages: '@rc-component/trigger': 2.1.1(react-dom@18.3.1)(react@18.3.1) classnames: 2.5.1 dayjs: 1.11.11 + moment: 2.30.1 rc-overflow: 1.3.2(react-dom@18.3.1)(react@18.3.1) rc-resize-observer: 1.4.0(react-dom@18.3.1)(react@18.3.1) rc-util: 5.41.0(react-dom@18.3.1)(react@18.3.1) @@ -2590,9 +2773,14 @@ packages: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} dev: false - require-directory@2.1.1: {} + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true - resize-observer-polyfill@1.5.1: {} + /resize-observer-polyfill@1.5.1: + resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} + dev: false /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} @@ -2677,25 +2865,45 @@ packages: engines: {node: '>=8'} dev: true - signal-exit@4.1.0: {} + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + dev: true - slash@3.0.0: {} + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true /source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} - strict-event-emitter@0.5.1: {} + /statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true - string-convert@0.2.1: {} + /strict-event-emitter@0.5.1: + resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} + dev: true - string-width@4.2.3: + /string-convert@0.2.1: + resolution: {integrity: sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==} + dev: false + + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + dev: true - strip-ansi@6.0.1: + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 dev: true @@ -2788,15 +2996,28 @@ packages: engines: {node: '>=10'} dev: true - type-fest@0.21.3: {} + /type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + dev: true - type-fest@4.20.0: {} + /type-fest@4.20.0: + resolution: {integrity: sha512-MBh+PHUHHisjXf4tlx0CFWoMdjx8zCMLJHOjnV1prABYZFHqtFOyauCIK2/7w4oIfwkF8iNhLtnJEfVY2vn3iw==} + engines: {node: '>=16'} + dev: true - typescript@5.4.5: {} + /typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} + engines: {node: '>=14.17'} + hasBin: true + dev: true - undici-types@5.26.5: {} + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true - uri-js@4.4.1: + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.1 dev: true @@ -2850,25 +3071,41 @@ packages: engines: {node: '>=0.10.0'} dev: true - wrap-ansi@6.2.0: + /wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true - wrap-ansi@7.0.0: + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true - wrappy@1.0.2: {} + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true - y18n@5.0.8: {} + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true - yargs-parser@21.1.1: {} + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true - yargs@17.7.2: + /yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} dependencies: cliui: 8.0.1 escalade: 3.1.2 @@ -2877,8 +3114,12 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + dev: true - yocto-queue@0.1.0: {} + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true /zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js index bdfdb11..24fe3a2 100644 --- a/public/mockServiceWorker.js +++ b/public/mockServiceWorker.js @@ -8,7 +8,7 @@ * - Please do NOT serve this file on production. */ -const PACKAGE_VERSION = '2.3.0' +const PACKAGE_VERSION = '2.3.1' const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423' const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') const activeClientIds = new Set() diff --git a/src/apis/colOption/useGetType.ts b/src/apis/colOption/useGetType.ts new file mode 100644 index 0000000..4924746 --- /dev/null +++ b/src/apis/colOption/useGetType.ts @@ -0,0 +1,17 @@ +import { axiosClient } from '@finnect/apis/AxiosClient'; + +interface IGetTypeProps { + status: number; + result: { type: string; filterConditions: string[] }[]; +} + +export const useGetType = async (): Promise => { + try { + const response = await axiosClient.get(`/types`); + + return response.data; + } catch (error) { + console.error(error); + throw error; + } +}; diff --git a/src/apis/companies/usePWcpCellsHook.ts b/src/apis/colOption/usePWcpCellsHook.ts similarity index 100% rename from src/apis/companies/usePWcpCellsHook.ts rename to src/apis/colOption/usePWcpCellsHook.ts diff --git a/src/apis/colOption/usePWcpCellsPHook.ts b/src/apis/colOption/usePWcpCellsPHook.ts new file mode 100644 index 0000000..7771d4a --- /dev/null +++ b/src/apis/colOption/usePWcpCellsPHook.ts @@ -0,0 +1,26 @@ +import { axiosClient } from '../AxiosClient'; + +export const UsePWcpCellsPHook = async ({ + columnId, + rowId, + value, + companyId, +}: { + columnId: number; + rowId: number; + value: string; + companyId: number; +}) => { + try { + const response = await axiosClient.patch(`/workspaces/cells`, { + columnId, + rowId, + value, + companyId, + }); + + return response.data; + } catch (error) { + console.error(error); + } +}; diff --git a/src/apis/colOption/usePWcpCellsPsHook.ts b/src/apis/colOption/usePWcpCellsPsHook.ts new file mode 100644 index 0000000..b0b9379 --- /dev/null +++ b/src/apis/colOption/usePWcpCellsPsHook.ts @@ -0,0 +1,26 @@ +import { axiosClient } from '../AxiosClient'; + +export const UsePWcpCellsPsHook = async ({ + columnId, + rowId, + value, + peopleId, +}: { + columnId: number; + rowId: number; + value: string; + peopleId: number; +}) => { + try { + const response = await axiosClient.patch(`/workspaces/cells`, { + columnId, + rowId, + value, + peopleId, + }); + + return response.data; + } catch (error) { + console.error(error); + } +}; diff --git a/src/apis/companies/usePostCompanyCol.ts b/src/apis/companies/usePostCompanyCol.ts index 277f8de..a0f1623 100644 --- a/src/apis/companies/usePostCompanyCol.ts +++ b/src/apis/companies/usePostCompanyCol.ts @@ -1,19 +1,16 @@ import { axiosClient } from '../AxiosClient'; export const postWCCol = async ({ - workspaceId, columnName, columnType, isHided, }: { - workspaceId: number; columnName: string; columnType: string; isHided: boolean; }) => { try { const response = await axiosClient.post(`/workspaces/companies/columns`, { - workspaceId, columnName, columnType, isHided, diff --git a/src/components/common/columnOption/CustomCellEditor.tsx b/src/components/common/columnOption/CustomCellEditor.tsx index 86a072c..b3ce46f 100644 --- a/src/components/common/columnOption/CustomCellEditor.tsx +++ b/src/components/common/columnOption/CustomCellEditor.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { Input } from 'antd'; -import { usePWcpCellQ } from '@finnect/hooks/queries/company/usePWcpCellQ'; +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; const CustomCellEditor = (props: any) => { diff --git a/src/components/common/columnOption/CustomCheckBoxEditor.tsx b/src/components/common/columnOption/CustomCheckBoxEditor.tsx new file mode 100644 index 0000000..2cd1cff --- /dev/null +++ b/src/components/common/columnOption/CustomCheckBoxEditor.tsx @@ -0,0 +1,41 @@ +import { useState } from 'react'; +import { Checkbox } from 'antd'; +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; +import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; + +import { CheckboxChangeEvent } from 'antd/es/checkbox'; + +const CustomCheckBoxEditor = (props: any) => { + const { refetch } = useGetCV(); + const { mutate, isPending } = usePWcpCellQ(() => { + refetch(); + }); + const [value, setValue] = useState(props.value); + + const handleChange = async (e: CheckboxChangeEvent) => { + const newValue = e.target.checked ? 'true' : 'false'; + setValue(newValue); + mutate({ + columnId: props.colDef.columnId, + rowId: props.data.rowId, + value: newValue, + }); + }; + + return ( +
+ + {isPending && Loading...} +
+ ); +}; + +export default CustomCheckBoxEditor; diff --git a/src/components/common/columnOption/CustomCurrenctyEditor.tsx b/src/components/common/columnOption/CustomCurrenctyEditor.tsx new file mode 100644 index 0000000..a1111a3 --- /dev/null +++ b/src/components/common/columnOption/CustomCurrenctyEditor.tsx @@ -0,0 +1,42 @@ +import { useState } from 'react'; + +import { Input } from 'antd'; + +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; +import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; + +const CustomCurrencyEditor = (props: any) => { + const { refetch } = useGetCV(); + + const { mutate, isPending } = usePWcpCellQ(() => { + refetch(); + }); + const [value, setValue] = useState(props.value); + + const handleChange = (e: React.ChangeEvent) => { + setValue(e.target.value.replace('$', '')); + }; + + const handleSave = async () => { + mutate({ + columnId: props.colDef.columnId, + rowId: props.data.rowId, + value: `$${value}`, + }); + }; + + return ( + <> + + {isPending && Loading...} + + ); +}; + +export default CustomCurrencyEditor; diff --git a/src/components/common/columnOption/CustomDateEditor.tsx b/src/components/common/columnOption/CustomDateEditor.tsx index 1b87a0d..26fb3d0 100644 --- a/src/components/common/columnOption/CustomDateEditor.tsx +++ b/src/components/common/columnOption/CustomDateEditor.tsx @@ -1,9 +1,8 @@ import { useState } from 'react'; - import { DatePicker } from 'antd'; -import dayjs from 'dayjs'; +import moment, { Moment } from 'moment'; -import { usePWcpCellQ } from '@finnect/hooks/queries/company/usePWcpCellQ'; +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; const CustomDateEditor = (props: any) => { @@ -11,26 +10,30 @@ const CustomDateEditor = (props: any) => { const { mutate, isPending } = usePWcpCellQ(() => { refetch(); }); - const [value, setValue] = useState(dayjs(props.value)); - const handleChange = (date: any) => { - setValue(dayjs(date)); + const [value, setValue] = useState(moment(props.value)); // 초기값은 moment 또는 null로 설정 + + const handleChange = (date: Moment | null) => { + setValue(date); // 선택된 moment 객체나 null을 설정 }; const handleSave = async () => { - await mutate({ - columnId: props.colDef.columnId, - rowId: props.data.rowId, - value: value.format('YYYY-MM-DD'), - }); - refetch(); + if (value) { + mutate({ + columnId: props.colDef.columnId, + rowId: props.data.rowId, + value: value.format('YYYY-MM-DD'), + }); + refetch(); + } }; return ( <> {isPending && Loading...} diff --git a/src/components/common/columnOption/CustomNumberEditor.tsx b/src/components/common/columnOption/CustomNumberEditor.tsx new file mode 100644 index 0000000..d5c4b3d --- /dev/null +++ b/src/components/common/columnOption/CustomNumberEditor.tsx @@ -0,0 +1,41 @@ +import { useState } from 'react'; + +import { Input } from 'antd'; + +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; +import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; + +const CustomNumberEditor = (props: any) => { + const { refetch } = useGetCV(); + + const { mutate, isPending } = usePWcpCellQ(() => { + refetch(); + }); + const [value, setValue] = useState(props.value); + + const handleChange = (e: React.ChangeEvent) => { + setValue(e.target.value); + }; + + const handleSave = async () => { + mutate({ + columnId: props.colDef.columnId, + rowId: props.data.rowId, + value, + }); + }; + + return ( + <> + + {isPending && Loading...} + + ); +}; + +export default CustomNumberEditor; diff --git a/src/components/common/columnOption/CustomPartnerEditor.tsx b/src/components/common/columnOption/CustomPartnerEditor.tsx new file mode 100644 index 0000000..6eb3645 --- /dev/null +++ b/src/components/common/columnOption/CustomPartnerEditor.tsx @@ -0,0 +1,52 @@ +import { Select } from 'antd'; +import { useState } from 'react'; + +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; +import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; + +import { useGetWC } from '@finnect/hooks/queries/company/useGetWC'; +import { RowData } from '@finnect/interface/CompanyInterface'; + +const { Option } = Select; + +const CustomPartnerEditor = (props: any) => { + const { refetch } = useGetCV(); + const { mutate, isPending } = usePWcpCellQ(() => { + refetch(); + }); + const { data } = useGetWC(); + const [value, setValue] = useState(props.value); + + const handleChange = (newValue: string) => { + setValue(newValue); + }; + + const handleSave = async () => { + mutate({ + columnId: props.colDef.columnId, + rowId: props.data.rowId, + value, + }); + refetch(); + }; + + return ( + <> + + {isPending && Loading...} + + ); +}; + +export default CustomPartnerEditor; diff --git a/src/components/common/columnOption/CustomPersonEditor.tsx b/src/components/common/columnOption/CustomPersonEditor.tsx new file mode 100644 index 0000000..fbdfd9a --- /dev/null +++ b/src/components/common/columnOption/CustomPersonEditor.tsx @@ -0,0 +1,53 @@ +import { Select } from 'antd'; +import { useState } from 'react'; + +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; +import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; + +import { useGetPeopleQuery } from '@finnect/hooks/queries/people/useGetPeopleQuery'; + +import { IPeopleAxiosProps } from '@finnect/interface/PeopleInterface'; + +const { Option } = Select; + +const CustomPersonEditor = (props: any) => { + const { refetch } = useGetCV(); + const { mutate, isPending } = usePWcpCellQ(() => { + refetch(); + }); + const { data } = useGetPeopleQuery(); + const [value, setValue] = useState(props.value); + + const handleChange = (newValue: string) => { + setValue(newValue); + }; + + const handleSave = async () => { + mutate({ + columnId: props.colDef.columnId, + rowId: props.data.rowId, + value, + }); + refetch(); + }; + + return ( + <> + + {isPending && Loading...} + + ); +}; + +export default CustomPersonEditor; diff --git a/src/components/common/columnOption/CustomRatingEditor.tsx b/src/components/common/columnOption/CustomRatingEditor.tsx new file mode 100644 index 0000000..48b436b --- /dev/null +++ b/src/components/common/columnOption/CustomRatingEditor.tsx @@ -0,0 +1,40 @@ +import { useState } from 'react'; +import { Rate } from 'antd'; // Rate 컴포넌트 임포트 +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; +import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; + +const CustomRatingEditor = (props: any) => { + const { refetch } = useGetCV(); + + const { mutate, isPending } = usePWcpCellQ(() => { + refetch(); + }); + + const [value, setValue] = useState(props.value); + + const handleChange = (newValue: number) => { + setValue(newValue); + }; + + const handleSave = async () => { + mutate({ + columnId: props.colDef.columnId, + rowId: props.data.rowId, + value, + }); + }; + + return ( + <> + + {isPending && Loading...} + + ); +}; + +export default CustomRatingEditor; diff --git a/src/components/common/columnOption/CustomStatusEditor.tsx b/src/components/common/columnOption/CustomStatusEditor.tsx index bec1157..344cb0e 100644 --- a/src/components/common/columnOption/CustomStatusEditor.tsx +++ b/src/components/common/columnOption/CustomStatusEditor.tsx @@ -1,10 +1,10 @@ import { Select } from 'antd'; import { useState } from 'react'; -import { usePWcpCellQ } from '@finnect/hooks/queries/company/usePWcpCellQ'; +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; -import StatusCategory from '@finnect/components/common/columnOption/CustomStatusEditor'; +import { StatusCategory } from '@finnect/components/common/columnOption/StatusCategory'; const { Option } = Select; @@ -20,7 +20,7 @@ const CustomCategoryEditor = (props: any) => { }; const handleSave = async () => { - await mutate({ + mutate({ columnId: props.colDef.columnId, rowId: props.data.rowId, value, @@ -30,13 +30,17 @@ const CustomCategoryEditor = (props: any) => { return ( <> - + {StatusCategory.map((category: string) => ( + + ))} {isPending && Loading...} diff --git a/src/components/common/modal/company/ColumnForm.tsx b/src/components/common/modal/company/ColumnForm.tsx index be68fab..cc0639d 100644 --- a/src/components/common/modal/company/ColumnForm.tsx +++ b/src/components/common/modal/company/ColumnForm.tsx @@ -2,13 +2,18 @@ import { Form, Input, Select, Button, Checkbox } from 'antd'; import { usePostWCCol } from '@finnect/hooks/queries/company/usePostWCCol'; import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; +import { useGetColQ } from '@finnect/hooks/queries/colOption/useGetColQ'; + +import { useCompanyModal } from '@finnect/hooks/custom-hooks/company/useCompanyModal'; const { Option } = Select; const ColumnForm = () => { const [form] = Form.useForm(); const { refetch } = useGetCV(); + const { data } = useGetColQ(); const { mutate, isPending, isError, error } = usePostWCCol(); + const { hideColumnModal } = useCompanyModal(); const handleFinish = (values: { workspaceId: number; @@ -16,14 +21,12 @@ const ColumnForm = () => { columnType: string; isHided: boolean; }) => { - values.workspaceId = parseInt( - localStorage.getItem('selectedWorkSpaceId') || '0' - ); - + // console.log('values:', values); mutate(values, { onSuccess: () => { refetch(); form.resetFields(); + hideColumnModal(); }, onError: (error) => { console.error('Error adding column:', error); @@ -46,15 +49,11 @@ const ColumnForm = () => { rules={[{ required: true, message: 'Please select the type!' }]} > { const [rowData, setRowData] = useRecoilState(rowDataState); const [columnDefs, setColumnDefs] = useRecoilState(columnDefsState); @@ -24,18 +33,64 @@ export const useCompanyViewData = () => { data.result.viewColumns && data.result.viewCompanies ) { - const columnsFromApi = data.result.viewColumns.map((col) => ({ - headerName: col.columnName, - field: col.columnName, - sortable: true, - filter: true, - hide: col.hided, - columnId: col.columnId, - cellEditor: - col.columnName === 'Category' - ? CustomCategoryEditor - : CustomCellEditor, - })); + const columnsFromApi = data.result.viewColumns.map((col) => { + let cellEditor; + + if (col.columnType) { + switch (col.columnType?.type) { + case 'SELECT': + cellEditor = CustomCategoryEditor; + break; + case 'PERSON': + cellEditor = CustomPersonEditor; + break; + case 'PARTNER': + cellEditor = CustomPartnerEditor; + break; + case 'CHECKBOX': + cellEditor = CustomCheckBoxEditor; + break; + case 'RATING': + cellEditor = CustomRatingEditor; + break; + case 'CURRENCY': + cellEditor = CustomCurrencyEditor; + break; + case 'TEXT': + cellEditor = CustomCellEditor; + break; + case 'NUMBER': + cellEditor = CustomNumberEditor; + break; + case 'STATUS': + cellEditor = CustomStatusEditor; + break; + case 'DATE': + cellEditor = CustomDateEditor; + break; + case 'URL': + cellEditor = CustomCellEditor; + break; + default: + cellEditor = CustomCellEditor; + break; + } + } else { + cellEditor = CustomCellEditor; + } + + const column = { + headerName: col.columnName, + field: col.columnName, + sortable: true, + filter: true, + hide: col.hided, + columnId: col.columnId, + cellEditor: cellEditor, + }; + + return column; + }); const newColumns = columnsFromApi.filter((col) => columnDefs.every((existingCol) => existingCol.field !== col.field) diff --git a/src/hooks/queries/colOption/useGetColQ.ts b/src/hooks/queries/colOption/useGetColQ.ts new file mode 100644 index 0000000..d633b62 --- /dev/null +++ b/src/hooks/queries/colOption/useGetColQ.ts @@ -0,0 +1,12 @@ +import { useQuery } from '@tanstack/react-query'; + +import { useGetType } from '@finnect/apis/colOption/useGetType'; + +export const useGetColQ = () => { + const { data, isPending, isError, error, refetch } = useQuery({ + queryKey: ['getC'], + queryFn: useGetType, + }); + + return { data, isPending, isError, error, refetch }; +}; diff --git a/src/hooks/queries/colOption/usePWcpCellPQ.ts b/src/hooks/queries/colOption/usePWcpCellPQ.ts new file mode 100644 index 0000000..f31afb5 --- /dev/null +++ b/src/hooks/queries/colOption/usePWcpCellPQ.ts @@ -0,0 +1,27 @@ +import { useMutation } from '@tanstack/react-query'; + +import { UsePWcpCellsPHook } from '@finnect/apis/colOption/usePWcpCellsPHook'; + +import { queryClient } from '@finnect/hooks/queries/Http'; + +export const usePWcpCellPQ = (onSuccessCallback: () => void) => { + const { mutate, isPending, isError, error } = useMutation({ + mutationFn: ({ + columnId, + rowId, + value, + companyId, + }: { + columnId: number; + rowId: number; + value: string; + companyId: number; + }) => UsePWcpCellsPHook({ columnId, rowId, value, companyId }), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['postCellPCell'] }); + onSuccessCallback(); + }, + }); + + return { mutate, isPending, isError, error }; +}; diff --git a/src/hooks/queries/colOption/usePWcpCellPsQ.ts b/src/hooks/queries/colOption/usePWcpCellPsQ.ts new file mode 100644 index 0000000..0a6b901 --- /dev/null +++ b/src/hooks/queries/colOption/usePWcpCellPsQ.ts @@ -0,0 +1,27 @@ +import { useMutation } from '@tanstack/react-query'; + +import { UsePWcpCellsPsHook } from '@finnect/apis/colOption/usePWcpCellsPsHook'; + +import { queryClient } from '@finnect/hooks/queries/Http'; + +export const usePWcpCellPQ = (onSuccessCallback: () => void) => { + const { mutate, isPending, isError, error } = useMutation({ + mutationFn: ({ + columnId, + rowId, + value, + peopleId, + }: { + columnId: number; + rowId: number; + value: string; + peopleId: number; + }) => UsePWcpCellsPsHook({ columnId, rowId, value, peopleId }), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['postCellPsCell'] }); + onSuccessCallback(); + }, + }); + + return { mutate, isPending, isError, error }; +}; diff --git a/src/hooks/queries/company/usePWcpCellQ.ts b/src/hooks/queries/colOption/usePWcpCellQ.ts similarity index 80% rename from src/hooks/queries/company/usePWcpCellQ.ts rename to src/hooks/queries/colOption/usePWcpCellQ.ts index a1d8fdc..9483071 100644 --- a/src/hooks/queries/company/usePWcpCellQ.ts +++ b/src/hooks/queries/colOption/usePWcpCellQ.ts @@ -1,6 +1,6 @@ import { useMutation } from '@tanstack/react-query'; -import { UsePWcpCellsHook } from '@finnect/apis/companies/usePWcpCellsHook'; +import { UsePWcpCellsHook } from '@finnect/apis/colOption/usePWcpCellsHook'; import { queryClient } from '@finnect/hooks/queries/Http'; @@ -16,7 +16,7 @@ export const usePWcpCellQ = (onSuccessCallback: () => void) => { value: string; }) => UsePWcpCellsHook({ columnId, rowId, value }), onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['postCellCompany'] }); + queryClient.invalidateQueries({ queryKey: ['postCell'] }); onSuccessCallback(); }, }); diff --git a/src/hooks/queries/company/usePostWCCol.ts b/src/hooks/queries/company/usePostWCCol.ts index 5e29bd2..6211da6 100644 --- a/src/hooks/queries/company/usePostWCCol.ts +++ b/src/hooks/queries/company/usePostWCCol.ts @@ -7,7 +7,6 @@ import { queryClient } from '@finnect/hooks/queries/Http'; export const usePostWCCol = () => { const { mutate, isPending, isError, error } = useMutation({ mutationFn: ({ - workspaceId, columnName, columnType, isHided, @@ -18,7 +17,6 @@ export const usePostWCCol = () => { isHided: boolean; }) => postWCCol({ - workspaceId, columnName, columnType, isHided, diff --git a/src/interface/CompanyInterface.ts b/src/interface/CompanyInterface.ts index 0cf35ae..1765809 100644 --- a/src/interface/CompanyInterface.ts +++ b/src/interface/CompanyInterface.ts @@ -29,11 +29,16 @@ export interface IViewCompany { }[]; } +export interface IViewColumnType { + type: string; + filterConditions: string[]; +} + export interface IViewColumn { columnId: number; index: number; hided: boolean; - columnType: string; + columnType: IViewColumnType; columnName: string; sorting: string; } diff --git a/src/pages/companies/components/CompanyColumnType.tsx b/src/pages/companies/components/CompanyColumnType.tsx index e8e313d..33935cc 100644 --- a/src/pages/companies/components/CompanyColumnType.tsx +++ b/src/pages/companies/components/CompanyColumnType.tsx @@ -1,9 +1,14 @@ import { Tag } from 'antd'; - import { ICVDetailDataProps } from '@finnect/interface/CompanyInterface'; - import styled from 'styled-components'; +const Container = styled.div` + max-height: 460px; + overflow-y: auto; + overflow-x: hidden; + padding-right: 15px; +`; + const TextWrapper = styled.div` display: flex; flex-direction: row; @@ -19,6 +24,23 @@ const TypeText = styled.span` color: ${(props) => props.theme.colors.explain}; `; +const tagColors = [ + 'magenta', + 'red', + 'volcano', + 'orange', + 'gold', + 'lime', + 'green', + 'cyan', + 'blue', + 'geekblue', + 'purple', +]; + +const getRandomColor = () => + tagColors[Math.floor(Math.random() * tagColors.length)]; + const CompanyColumnType = ({ cellData }: { cellData: ICVDetailDataProps }) => { const { result } = cellData; @@ -31,28 +53,30 @@ const CompanyColumnType = ({ cellData }: { cellData: ICVDetailDataProps }) => { return (

속성 정보

- - - companyName - - {company?.companyName} - - - - domain - - {company?.domain} - - {cells?.map((cell) => ( -
- - - {cell.columnName} - - {cell.value} - -
- ))} + + + + companyName + + {company?.companyName} + + + + domain + + {company?.domain} + + {cells?.map((cell) => ( +
+ + + {cell.columnName} + + {cell.value} + +
+ ))} +
); }; diff --git a/src/pages/companies/components/CustomCategoryEditor.tsx b/src/pages/companies/components/CustomCategoryEditor.tsx index ae650b4..bef7f91 100644 --- a/src/pages/companies/components/CustomCategoryEditor.tsx +++ b/src/pages/companies/components/CustomCategoryEditor.tsx @@ -1,7 +1,8 @@ -import { Select } from 'antd'; import { useState } from 'react'; -import { usePWcpCellQ } from '@finnect/hooks/queries/company/usePWcpCellQ'; +import { Select } from 'antd'; + +import { usePWcpCellQ } from '@finnect/hooks/queries/colOption/usePWcpCellQ'; import { useGetCV } from '@finnect/hooks/queries/company/useGetCV'; import { CompanyCategories } from '@finnect/pages/companies/components/CompanyCategories';