From a4ab922066f30eb417e785126729d254f2df1727 Mon Sep 17 00:00:00 2001 From: Vitalik Date: Thu, 10 Mar 2022 14:27:37 +0200 Subject: [PATCH] FIX | Tasks list --- .babelrc | 7 +- ios/taskme.xcodeproj/project.pbxproj | 4 +- package-lock.json | 264 +++++++++++++----- package.json | 1 + src/modules/home/screens/home.screen.tsx | 9 +- .../my-tasks-list.smart-component.tsx | 2 +- .../tasks-list-with-header.component.tsx | 1 + .../tasks/config/task-card-buttons.config.ts | 97 ++++--- .../hooks/use-create-update-task.hook.ts | 6 +- .../hooks/use-fetch-task-executors.hook.ts | 32 +-- .../tasks/screens/add-update-task.screen.tsx | 9 +- .../screens/filter-tasks-result.screen.tsx | 1 + .../screens/select-task-executors.screen.tsx | 2 +- .../swipable-task-card.smart-component.tsx | 10 +- .../tasks-list.smart-component.tsx | 1 + .../components/user-select-list.component.tsx | 5 +- .../screen-layout-content.component.tsx | 10 +- .../layouts/screen-layout.component.tsx | 2 +- src/shared/hooks/use-flat-list.hook.ts | 1 + 19 files changed, 316 insertions(+), 148 deletions(-) diff --git a/.babelrc b/.babelrc index 3825c49b..7b64b252 100644 --- a/.babelrc +++ b/.babelrc @@ -20,5 +20,10 @@ ] } ] - ] + ], + "env": { + "production": { + "plugins": ["transform-remove-console"] + } + } } \ No newline at end of file diff --git a/ios/taskme.xcodeproj/project.pbxproj b/ios/taskme.xcodeproj/project.pbxproj index 6f2b8c01..aab78c1d 100644 --- a/ios/taskme.xcodeproj/project.pbxproj +++ b/ios/taskme.xcodeproj/project.pbxproj @@ -763,7 +763,7 @@ CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 49; + CURRENT_PROJECT_VERSION = 52; DEVELOPMENT_TEAM = HQ3J3TDPR2; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; @@ -801,7 +801,7 @@ CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 49; + CURRENT_PROJECT_VERSION = 52; DEVELOPMENT_TEAM = HQ3J3TDPR2; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; diff --git a/package-lock.json b/package-lock.json index c8c5fe6d..e89f0da2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2253,16 +2253,6 @@ "@sinonjs/commons": "^1.7.0" } }, - "@socket.io/base64-arraybuffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==" - }, - "@socket.io/component-emitter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.0.0.tgz", - "integrity": "sha512-2pTGuibAXJswAPJjaKisthqS/NOK5ypG4LYT6tEAV0S/mxW0zOIvYvGK0V8w8+SHxAm6vRMSjqSalFXeBAqs+Q==" - }, "@svgr/babel-plugin-add-jsx-attribute": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz", @@ -2768,6 +2758,11 @@ "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2958,6 +2953,11 @@ "function-bind": "^1.1.1" } }, + "arraybuffer.slice": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" + }, "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -3162,6 +3162,12 @@ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz", "integrity": "sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ==" }, + "babel-plugin-transform-remove-console": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", + "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=", + "dev": true + }, "babel-preset-current-node-syntax": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", @@ -3286,6 +3292,11 @@ } } }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" + }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -3300,6 +3311,14 @@ "tweetnacl": "^0.14.3" } }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "requires": { + "callsite": "1.0.0" + } + }, "big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -3329,6 +3348,11 @@ } } }, + "blob": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", + "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" + }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -3464,6 +3488,11 @@ "caller-callsite": "^2.0.0" } }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" + }, "callsites": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", @@ -3761,11 +3790,21 @@ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" + }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -4282,47 +4321,73 @@ } }, "engine.io-client": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.1.1.tgz", - "integrity": "sha512-V05mmDo4gjimYW+FGujoGmmmxRaDsrVr7AXA3ZIfa04MWM1jOfZfUwou0oNqhNwy/votUDvGDt4JA4QF4e0b4g==", - "requires": { - "@socket.io/component-emitter": "~3.0.0", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.0", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.4.tgz", + "integrity": "sha512-iU4CRr38Fecj8HoZEnFtm2EiKGbYZcPn3cHxqNGl/tmdWRf60KhK+9vE0JeSjgnlS/0oynEfLgKbT9ALpim0sQ==", + "requires": { + "component-emitter": "~1.3.0", + "component-inherit": "0.0.3", + "debug": "~3.1.0", + "engine.io-parser": "~2.2.0", "has-cors": "1.1.0", + "indexof": "0.0.1", "parseqs": "0.0.6", "parseuri": "0.0.6", - "ws": "~8.2.3", - "xmlhttprequest-ssl": "~2.0.0", + "ws": "~6.1.0", + "xmlhttprequest-ssl": "~1.5.4", "yeast": "0.1.2" }, "dependencies": { "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "requires": { - "ms": "2.1.2" + "ms": "2.0.0" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "parseqs": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", + "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" + }, + "parseuri": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", + "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" }, "ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==" + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", + "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "requires": { + "async-limiter": "~1.0.0" + } } } }, "engine.io-parser": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", - "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", + "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", "requires": { - "@socket.io/base64-arraybuffer": "~1.0.2" + "after": "0.8.2", + "arraybuffer.slice": "~0.0.7", + "base64-arraybuffer": "0.1.4", + "blob": "0.0.5", + "has-binary2": "~1.0.2" + }, + "dependencies": { + "base64-arraybuffer": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", + "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=" + } } }, "enquirer": { @@ -5540,6 +5605,21 @@ "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", "dev": true }, + "has-binary2": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", + "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", + "requires": { + "isarray": "2.0.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + } + } + }, "has-cors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", @@ -5873,6 +5953,11 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -7937,8 +8022,7 @@ "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" }, "nanoid": { "version": "3.1.25", @@ -8214,6 +8298,11 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -8513,14 +8602,20 @@ "dev": true }, "parseqs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", - "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "requires": { + "better-assert": "~1.0.0" + } }, "parseuri": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", - "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "requires": { + "better-assert": "~1.0.0" + } }, "parseurl": { "version": "1.3.3", @@ -10342,54 +10437,68 @@ } }, "socket.io-client": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.4.1.tgz", - "integrity": "sha512-N5C/L5fLNha5Ojd7Yeb/puKcPWWcoB/A09fEjjNsg91EDVr5twk/OEyO6VT9dlLSUNY85NpW6KBhVMvaLKQ3vQ==", - "requires": { - "@socket.io/component-emitter": "~3.0.0", - "backo2": "~1.0.2", - "debug": "~4.3.2", - "engine.io-client": "~6.1.1", - "parseuri": "0.0.6", - "socket.io-parser": "~4.1.1" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", + "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", + "requires": { + "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "engine.io-client": "~3.4.0", + "has-binary2": "~1.0.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "socket.io-parser": "~3.3.0", + "to-array": "0.1.4" }, "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { - "ms": "2.1.2" + "ms": "^2.1.1" } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, "socket.io-parser": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.1.2.tgz", - "integrity": "sha512-j3kk71QLJuyQ/hh5F/L2t1goqzdTL0gvDzuhTuNSwihfuFUrcSji0qFZmJJPtG6Rmug153eOPsUizeirf1IIog==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", + "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", "requires": { - "@socket.io/component-emitter": "~3.0.0", - "debug": "~4.3.1" + "component-emitter": "~1.3.0", + "debug": "~3.1.0", + "isarray": "2.0.1" }, "dependencies": { "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "requires": { - "ms": "2.1.2" + "ms": "2.0.0" } }, + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, @@ -10990,6 +11099,11 @@ "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=" }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -11663,9 +11777,9 @@ } }, "xmlhttprequest-ssl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", - "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==" + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", + "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" }, "xtend": { "version": "4.0.2", diff --git a/package.json b/package.json index 36f354c2..9a8a89e5 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "babel-jest": "^26.6.3", "babel-plugin-inline-import": "^3.0.0", "babel-plugin-module-resolver": "^4.1.0", + "babel-plugin-transform-remove-console": "^6.9.4", "eslint": "7.14.0", "icon-set-creator": "^0.1.3", "jest": "^26.6.3", diff --git a/src/modules/home/screens/home.screen.tsx b/src/modules/home/screens/home.screen.tsx index 9dd9b853..3b4e93c6 100644 --- a/src/modules/home/screens/home.screen.tsx +++ b/src/modules/home/screens/home.screen.tsx @@ -81,7 +81,7 @@ export const HomeScreen: FC = ({ navigation }) => { ) } - return + return }, [respGroups]) const executorsMemoRender = useMemo(() => { @@ -92,7 +92,12 @@ export const HomeScreen: FC = ({ navigation }) => { ) } - return + return ( + + ) }, [respExecutors]) return ( diff --git a/src/modules/home/smart-components/my-tasks-list.smart-component.tsx b/src/modules/home/smart-components/my-tasks-list.smart-component.tsx index 3a07f8f2..3a48bae5 100644 --- a/src/modules/home/smart-components/my-tasks-list.smart-component.tsx +++ b/src/modules/home/smart-components/my-tasks-list.smart-component.tsx @@ -79,7 +79,7 @@ export const MyTasksListSmart: FC = () => { renderItem: TRenderTaskPreviewItem, ) => { return ( - + {_.isEmpty(selectedTasks) ? ( = ({ isChecked={_.includes(selectedItems, item)} onPress={() => onPressTask(item)} onSelect={() => onSelectTask(item)} + status={item.status} /> ) }} diff --git a/src/modules/tasks/config/task-card-buttons.config.ts b/src/modules/tasks/config/task-card-buttons.config.ts index ae2af40d..6a244950 100644 --- a/src/modules/tasks/config/task-card-buttons.config.ts +++ b/src/modules/tasks/config/task-card-buttons.config.ts @@ -1,49 +1,68 @@ -import { appEvents, FullTaskActions, ITaskActionPayload } from '@/shared' +import { + appEvents, + FullTaskActions, + ITaskActionPayload, + TaskStatus, +} from '@/shared' import { getTheme } from './../../../shared/themes/index' -export const getTaskCardButtons = (id: number, date: string, isTaskFavorite: boolean, onPress: (action: FullTaskActions, payload: ITaskActionPayload) => void) => { - return [ - { - title: 'Видалити', - bgColor: getTheme().$deleteBtn, - txtColor: getTheme().$deleteText, - iconName: 'bin', - onPress: () => console.log(`Видалити ${id}`), - }, - - { - title: 'Виконати', - bgColor: getTheme().$doneBtn, - txtColor: getTheme().$doneText, - iconName: 'checks-1', - onPress: () => appEvents.emit('openFinishTasksModal', { - taskIds: [id], - startDates: [date], - onPressOk: (date: Date) => { - setTimeout(() => { - onPress(FullTaskActions.Done, { doneDate: date }) - }, 500) - } - }), - }, - +export const getTaskCardButtons = ( + id: number, + date: string, + isTaskFavorite: boolean, + onPress: (action: FullTaskActions, payload: ITaskActionPayload) => void, + status: TaskStatus, +) => { + const deleteBtn = { + title: 'Видалити', + bgColor: getTheme().$deleteBtn, + txtColor: getTheme().$deleteText, + iconName: 'bin', + onPress: () => console.log(`Видалити ${id}`), + } + const result = [ { title: 'Обрана', bgColor: getTheme().$pinBtn, txtColor: getTheme().$pinText, iconName: 'vectorstart', - onPress: () => appEvents.emit('openConfirmModal', { - title: isTaskFavorite ? 'Видалити задачу з обраних?' : 'Додати задачу до обраних?', - buttonToHighlight: 'notAllow', - allowBtnAction: () => { - setTimeout(() => { - if (isTaskFavorite) - onPress(FullTaskActions.RemoveFavorite, {}) - else onPress(FullTaskActions.AddFavorite, {}) - }, 500) - }, - notAllowBtnAction: () => {}, - }), + onPress: () => + appEvents.emit('openConfirmModal', { + title: isTaskFavorite + ? 'Видалити задачу з обраних?' + : 'Додати задачу до обраних?', + buttonToHighlight: 'notAllow', + allowBtnAction: () => { + setTimeout(() => { + if (isTaskFavorite) + onPress(FullTaskActions.RemoveFavorite, {}) + else onPress(FullTaskActions.AddFavorite, {}) + }, 500) + }, + notAllowBtnAction: () => {}, + }), }, ] + if (status === TaskStatus.Finished) { + result.unshift(deleteBtn) + } else if (status === TaskStatus.Active) { + result.unshift(deleteBtn) + result.unshift({ + title: 'Виконати', + bgColor: getTheme().$doneBtn, + txtColor: getTheme().$doneText, + iconName: 'checks-1', + onPress: () => + appEvents.emit('openFinishTasksModal', { + taskIds: [id], + startDates: [date], + onPressOk: (date: Date) => { + setTimeout(() => { + onPress(FullTaskActions.Done, { doneDate: date }) + }, 500) + }, + }), + }) + } + return result } diff --git a/src/modules/tasks/hooks/use-create-update-task.hook.ts b/src/modules/tasks/hooks/use-create-update-task.hook.ts index aab5c282..7e43965f 100644 --- a/src/modules/tasks/hooks/use-create-update-task.hook.ts +++ b/src/modules/tasks/hooks/use-create-update-task.hook.ts @@ -6,10 +6,7 @@ import { useSelector } from 'react-redux' import { tasksService } from '@/services/domain' import { appEvents, getMessageByExceptionKey, useForm } from '@/shared' import { simpleDispatch } from '@/store/store-helpers' -import { - selectSelectedUsers, - UnselectAllUsers, -} from '@/store/users' +import { selectSelectedUsers, UnselectAllUsers } from '@/store/users' import { useEffect, useMemo, useState } from 'react' import { CreatingTaskErrors, TaskEditMode } from '../enum' import { validateCreateTask } from '../validations' @@ -67,7 +64,6 @@ export const useCreateUpdateTask = (mode: TaskEditMode, taskId?: number) => { ) useEffect(() => { - console.log('task', task) if (task) setForm({ reasonId: task?.reasonId?.toString(), diff --git a/src/modules/tasks/hooks/use-fetch-task-executors.hook.ts b/src/modules/tasks/hooks/use-fetch-task-executors.hook.ts index 8d8b0f81..26900279 100644 --- a/src/modules/tasks/hooks/use-fetch-task-executors.hook.ts +++ b/src/modules/tasks/hooks/use-fetch-task-executors.hook.ts @@ -1,4 +1,4 @@ -import { useEffect } from 'react'; +import { useEffect } from 'react' import { useState } from 'react' import { IShortUser, useFlatList } from '@/shared' import { tasksService } from '@/services/domain' @@ -6,27 +6,27 @@ import { ITaskExecutorResponse } from '@/api/tasks/responses.interface' import { transformExecutorsToShortUsers } from '@/api/tasks/transform' export const useFetchTaskExecutors = () => { - const [searchString, setSearchVal] = useState() + const [searchString, setSearchVal] = useState(null) - const { items, isLoading, isLoadingNext, loadMore, setLoadParams } = useFlatList({ - fetchItems: tasksService.getTaskExecutors, - needInit: true, - serrializatorItems: (_items: ITaskExecutorResponse[]) => transformExecutorsToShortUsers(_items), - loadParams: { - sort: 'DESC', - sortField: 'id', - searchString - }, - limit: 20, - }) + const { items, isLoading, isLoadingNext, loadMore, setLoadParams } = + useFlatList({ + fetchItems: tasksService.getTaskExecutors, + needInit: true, + serrializatorItems: (_items: ITaskExecutorResponse[]) => + transformExecutorsToShortUsers(_items), + loadParams: { + sort: 'DESC', + sortField: 'id', + }, + limit: 10, + }) useEffect(() => { - setLoadParams({ searchString }) + if (searchString !== null) setLoadParams({ searchString }) }, [searchString]) - return { - items: (items as IShortUser[]), + items: items as IShortUser[], isLoading, isLoadingNext, searchString, diff --git a/src/modules/tasks/screens/add-update-task.screen.tsx b/src/modules/tasks/screens/add-update-task.screen.tsx index 2b91e6b8..3f0118b4 100644 --- a/src/modules/tasks/screens/add-update-task.screen.tsx +++ b/src/modules/tasks/screens/add-update-task.screen.tsx @@ -137,6 +137,13 @@ export const AddUpdateTaskScreen: FC = ({ route, navigation }) => { simpleDispatch(new UnselectExecutor()) } + const submit = async () => { + await onSubmit() + setTimeout(() => { + selectReason(null) + }, 200) + } + return ( = ({ route, navigation }) => { title={buttonTitle} type={'primary'} style={styles.submitBtn} - onPress={onSubmit} + onPress={submit} showLoadingIndicator={isLoading} /> diff --git a/src/modules/tasks/screens/filter-tasks-result.screen.tsx b/src/modules/tasks/screens/filter-tasks-result.screen.tsx index 57548210..242621d8 100644 --- a/src/modules/tasks/screens/filter-tasks-result.screen.tsx +++ b/src/modules/tasks/screens/filter-tasks-result.screen.tsx @@ -214,6 +214,7 @@ export const FilterTasksResultScreen: FC = ({ route, navigation }) => { } as never, ) } + status={item.status} /> ) }, diff --git a/src/modules/tasks/screens/select-task-executors.screen.tsx b/src/modules/tasks/screens/select-task-executors.screen.tsx index caf5c348..42f75a10 100644 --- a/src/modules/tasks/screens/select-task-executors.screen.tsx +++ b/src/modules/tasks/screens/select-task-executors.screen.tsx @@ -44,7 +44,7 @@ export const SelectTaskExecutorsScreen: FC = ({ ) selectedUsers.push(selectedExecutor) - if (isLoading) return + // if (isLoading) return const unselectUser = (id: number) => { simpleDispatch(new UnselectUser({ id })) diff --git a/src/modules/tasks/smart-components/swipable-task-card.smart-component.tsx b/src/modules/tasks/smart-components/swipable-task-card.smart-component.tsx index 5392d446..e8cd35e5 100644 --- a/src/modules/tasks/smart-components/swipable-task-card.smart-component.tsx +++ b/src/modules/tasks/smart-components/swipable-task-card.smart-component.tsx @@ -1,7 +1,13 @@ -import { FullTaskActions, ITaskActionPayload, SquareButton } from '@/shared' +import { + FullTaskActions, + ITaskActionPayload, + SquareButton, + TaskStatus, +} from '@/shared' import { useTheme } from '@/shared/hooks/use-theme.hook' import { PartialTheme } from '@/shared/themes/interfaces' import { useFocusEffect } from '@react-navigation/native' +import _ from 'lodash' import React, { FC, useEffect, useMemo, useRef } from 'react' import { StyleSheet, View } from 'react-native' import { Swipeable } from 'react-native-gesture-handler' @@ -30,6 +36,7 @@ interface IProps { ) => void taskContainerStyles?: any noIcons?: boolean + status?: TaskStatus } export const SwipableTaskCard: FC = ({ onPress, ...props }) => { @@ -40,6 +47,7 @@ export const SwipableTaskCard: FC = ({ onPress, ...props }) => { props.startTaskDate, props.isFavorite, props.onPressActionButton, + _.defaultTo(props.status, TaskStatus.Active), ) props.isFinished ? btnsConfig.splice(1, 1) : null diff --git a/src/modules/tasks/smart-components/tasks-list.smart-component.tsx b/src/modules/tasks/smart-components/tasks-list.smart-component.tsx index f2619f0e..b36b9212 100644 --- a/src/modules/tasks/smart-components/tasks-list.smart-component.tsx +++ b/src/modules/tasks/smart-components/tasks-list.smart-component.tsx @@ -72,6 +72,7 @@ export const TasksListSmart = ({ isChecked={_.includes(selectedItems, item)} onPress={() => onPressItem(item)} onSelect={() => onSelectItem(item)} + status={item.status} /> ) return renderList(items, renderItem) diff --git a/src/modules/users/components/user-select-list.component.tsx b/src/modules/users/components/user-select-list.component.tsx index 39654e3e..ec9f2f2c 100644 --- a/src/modules/users/components/user-select-list.component.tsx +++ b/src/modules/users/components/user-select-list.component.tsx @@ -28,8 +28,11 @@ export const UsersSelectList: FC = ({ loadMore()} + keyExtractor={item => `${item.id}`} renderItem={({ item }) => ( = ({ if (needScroll) { return ( - + {header && header()} = ({ ) } else { return ( - + {header && header()} { const { styles, themeTitle } = useTheme(createStyles) const layout = ( - + (props: IProps) => { blockLoadingRef.current = true try { setItems([]) + console.log(loadParams.current) const response = props.serrializatorResponse( await props.fetchItems({ params: loadParams.current }), )