diff --git a/package-lock.json b/package-lock.json index 54bfdff..c357dd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1890,6 +1890,24 @@ } } }, + "@popperjs/core": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.2.tgz", + "integrity": "sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==" + }, + "@restart/context": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==" + }, + "@restart/hooks": { + "version": "0.3.27", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.3.27.tgz", + "integrity": "sha512-s984xV/EapUIfkjlf8wz9weP2O9TNKR96C68FfMEy2bE69+H4cNv3RD4Mf97lW7Htt7PjZrYTjSC8f3SB9VCXw==", + "requires": { + "dequal": "^2.0.2" + } + }, "@rollup/plugin-node-resolve": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz", @@ -2307,6 +2325,11 @@ "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz", "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, + "@types/invariant": { + "version": "2.2.34", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.34.tgz", + "integrity": "sha512-lYUtmJ9BqUN688fGY1U1HZoWT1/Jrmgigx2loq4ZcJpICECm/Om3V314BxdzypO0u5PORKGMM6x0OXaljV1YFg==" + }, "@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", @@ -2342,6 +2365,11 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==" }, + "@types/lodash": { + "version": "4.14.171", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.171.tgz", + "integrity": "sha512-7eQ2xYLLI/LsicL2nejW9Wyko3lcpN6O/z0ZLHrEQsg280zIdCv1t/0m6UtBjUHokCGBQ3gYTbHzDkZ1xOBwwg==" + }, "@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -2367,11 +2395,34 @@ "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog==" }, + "@types/prop-types": { + "version": "15.7.4", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz", + "integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==" + }, "@types/q": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz", "integrity": "sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==" }, + "@types/react": { + "version": "17.0.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.14.tgz", + "integrity": "sha512-0WwKHUbWuQWOce61UexYuWTGuGY/8JvtUe/dtQ6lR4sZ3UiylHotJeWpf3ArP9+DSGUoLY3wbU59VyMrJps5VQ==", + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-transition-group": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.2.tgz", + "integrity": "sha512-KibDWL6nshuOJ0fu8ll7QnV/LVTo3PzQ9aCPnRUYPfX7eZohHwLIdNHj7pftanREzHNP4/nJa8oeM73uSiavMQ==", + "requires": { + "@types/react": "*" + } + }, "@types/resolve": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", @@ -2380,6 +2431,11 @@ "@types/node": "*" } }, + "@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + }, "@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -2418,6 +2474,11 @@ } } }, + "@types/warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", + "integrity": "sha1-DSUBJorY+ZYrdA04fEZU9fjiPlI=" + }, "@types/webpack": { "version": "4.41.30", "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.30.tgz", @@ -3086,6 +3147,14 @@ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.3.0.tgz", "integrity": "sha512-99FZt8qS/xukgxU/8daV8WT7wAakqBzt6lF3XCweO6pwcf50/NgxxBj6ZC7/ejR+F4PWeFpkb9lAMH3y2quBXA==" }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.0" + } + }, "axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -3699,6 +3768,11 @@ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, + "bootstrap": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.2.tgz", + "integrity": "sha512-1Ge963tyEQWJJ+8qtXFU6wgmAVj9gweEjibUdbmcCEYsn38tVwRk8107rk2vzt6cfQcRr3SlZ8aQBqaD8aqf+Q==" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -4090,6 +4164,11 @@ } } }, + "classnames": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz", + "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==" + }, "clean-css": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", @@ -4780,6 +4859,11 @@ } } }, + "csstype": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.8.tgz", + "integrity": "sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==" + }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -4809,6 +4893,11 @@ "whatwg-url": "^8.0.0" } }, + "date-fns": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.22.1.tgz", + "integrity": "sha512-yUFPQjrxEmIsMqlHhAhmxkuH769baF21Kk+nZwZGyrMoyLA+LugaQtC0+Tqf9CBUUULWwUJt6Q5ySI3LJDDCGg==" + }, "debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -4980,6 +5069,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "dequal": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", + "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==" + }, "des.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", @@ -5101,6 +5195,15 @@ "utila": "~0.4" } }, + "dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "requires": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -6702,6 +6805,27 @@ "mime-types": "^2.1.12" } }, + "formik": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/formik/-/formik-2.2.9.tgz", + "integrity": "sha512-LQLcISMmf1r5at4/gyJigGn0gOwFbeEAlji+N9InZF6LIMXnFNkO42sCI8Jt84YZggpD4cPWObAZaxpEFtSzNA==", + "requires": { + "deepmerge": "^2.1.1", + "hoist-non-react-statics": "^3.3.0", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "react-fast-compare": "^2.0.1", + "tiny-warning": "^1.0.2", + "tslib": "^1.10.0" + }, + "dependencies": { + "deepmerge": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", + "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==" + } + } + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -7026,6 +7150,19 @@ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" }, + "history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "requires": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -7036,6 +7173,14 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + }, "hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -7511,6 +7656,14 @@ "side-channel": "^1.0.4" } }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -9633,6 +9786,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "lodash._reinterpolate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", @@ -9878,6 +10036,15 @@ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" }, + "mini-create-react-context": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", + "requires": { + "@babel/runtime": "^7.12.1", + "tiny-warning": "^1.0.3" + } + }, "mini-css-extract-plugin": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz", @@ -10069,6 +10236,11 @@ "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" }, + "nanoclone": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/nanoclone/-/nanoclone-0.2.1.tgz", + "integrity": "sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==" + }, "nanoid": { "version": "3.1.23", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", @@ -11958,6 +12130,20 @@ "react-is": "^16.8.1" } }, + "prop-types-extra": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", + "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", + "requires": { + "react-is": "^16.3.2", + "warning": "^4.0.0" + } + }, + "property-expr": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.4.tgz", + "integrity": "sha512-sFPkHQjVKheDNnPvotjQmm3KD3uk1fWKUN7CrpdbwmUx3CrG3QiM8QpTSimvig5vTXmTvjz7+TDvXOI9+4rkcg==" + }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -12141,6 +12327,30 @@ "whatwg-fetch": "^3.4.1" } }, + "react-bootstrap": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.1.tgz", + "integrity": "sha512-ojEPQ6OtyIMdLg0Smofk+85PKN6MLKQX3bU0Vwmok/4yNa8DQ2vCGhO2IgHJvT+ERQZ4X+gAQcdn6msAHSwLBg==", + "requires": { + "@babel/runtime": "^7.14.0", + "@restart/context": "^2.1.4", + "@restart/hooks": "^0.3.26", + "@types/invariant": "^2.2.33", + "@types/prop-types": "^15.7.3", + "@types/react": ">=16.14.8", + "@types/react-transition-group": "^4.4.1", + "@types/warning": "^3.0.0", + "classnames": "^2.3.1", + "dom-helpers": "^5.2.1", + "invariant": "^2.2.4", + "prop-types": "^15.7.2", + "prop-types-extra": "^1.1.0", + "react-overlays": "^5.0.1", + "react-transition-group": "^4.4.1", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "react-dev-utils": { "version": "11.0.4", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz", @@ -12302,16 +12512,87 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz", "integrity": "sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==" }, + "react-fast-compare": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", + "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" + }, "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + }, + "react-overlays": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.1.1.tgz", + "integrity": "sha512-eCN2s2/+GVZzpnId4XVWtvDPYYBD2EtOGP74hE+8yDskPzFy9+pV1H3ZZihxuRdEbQzzacySaaDkR7xE0ydl4Q==", + "requires": { + "@babel/runtime": "^7.13.8", + "@popperjs/core": "^2.8.6", + "@restart/hooks": "^0.3.26", + "@types/warning": "^3.0.0", + "dom-helpers": "^5.2.0", + "prop-types": "^15.7.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "react-refresh": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz", "integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==" }, + "react-router": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + } + } + } + }, + "react-router-dom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + } + }, "react-scripts": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz", @@ -12378,6 +12659,17 @@ "workbox-webpack-plugin": "5.1.4" } }, + "react-transition-group": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", + "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", + "requires": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + } + }, "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -12730,6 +13022,11 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, + "resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -14288,6 +14585,16 @@ "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" }, + "tiny-invariant": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" + }, + "tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -14345,6 +14652,11 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha1-riF2gXXRVZ1IvvNUILL0li8JwzA=" + }, "tough-cookie": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", @@ -14464,6 +14776,17 @@ "which-boxed-primitive": "^1.0.2" } }, + "uncontrollable": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", + "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", + "requires": { + "@babel/runtime": "^7.6.3", + "@types/react": ">=16.9.11", + "invariant": "^2.2.4", + "react-lifecycles-compat": "^3.0.4" + } + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -14737,6 +15060,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -14776,6 +15104,14 @@ "makeerror": "1.0.x" } }, + "warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "watchpack": { "version": "1.7.5", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", @@ -16212,6 +16548,20 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + }, + "yup": { + "version": "0.32.9", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.32.9.tgz", + "integrity": "sha512-Ci1qN+i2H0XpY7syDQ0k5zKQ/DoxO0LzPg8PAR/X4Mpj6DqaeCoIYEEjDJwhArh3Fa7GWbQQVDZKeXYlSH4JMg==", + "requires": { + "@babel/runtime": "^7.10.5", + "@types/lodash": "^4.14.165", + "lodash": "^4.17.20", + "lodash-es": "^4.17.15", + "nanoclone": "^0.2.1", + "property-expr": "^2.0.4", + "toposort": "^2.0.2" + } } } } diff --git a/package.json b/package.json index d870f97..6730357 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,17 @@ "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", + "axios": "^0.21.1", + "bootstrap": "^5.0.2", + "date-fns": "^2.22.1", + "formik": "^2.2.9", "react": "^17.0.2", + "react-bootstrap": "^1.6.1", "react-dom": "^17.0.2", + "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", - "web-vitals": "^1.1.2" + "web-vitals": "^1.1.2", + "yup": "^0.32.9" }, "scripts": { "start": "react-scripts start", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index a11777c..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/index.html b/public/index.html index aa069f2..896bb8f 100644 --- a/public/index.html +++ b/public/index.html @@ -9,7 +9,7 @@ name="description" content="Web site created using create-react-app" /> - + - React App + ActionSys diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..6e667b8 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -2,21 +2,7 @@ "short_name": "React App", "name": "Create React App Sample", "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } + ], "start_url": ".", "display": "standalone", diff --git a/src/App.css b/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.js b/src/App.js deleted file mode 100644 index 3784575..0000000 --- a/src/App.js +++ /dev/null @@ -1,25 +0,0 @@ -import logo from './logo.svg'; -import './App.css'; - -function App() { - return ( -
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
-
- ); -} - -export default App; diff --git a/src/App.test.js b/src/App.test.js deleted file mode 100644 index 1f03afe..0000000 --- a/src/App.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/src/api/axios.config.js b/src/api/axios.config.js new file mode 100644 index 0000000..83a1798 --- /dev/null +++ b/src/api/axios.config.js @@ -0,0 +1,15 @@ +import axios from 'axios' + +const apis = { + development: 'http://localhost:4000', + production: 'https://.herokuapp.com' +} + +// Configura axios para receber url base automaticamente, evitando repetição nas requisições. +const api = axios.create({ + baseURL: apis[process.env.NODE_ENV] +}) + + +export default api + diff --git a/src/components/App/App.css b/src/components/App/App.css new file mode 100644 index 0000000..7c6ec3c --- /dev/null +++ b/src/components/App/App.css @@ -0,0 +1,9 @@ +.App { + text-align: center; +} + +.App-logo { + height: 40vmin; + pointer-events: none; +} + diff --git a/src/components/App/App.js b/src/components/App/App.js new file mode 100644 index 0000000..1ba8ae9 --- /dev/null +++ b/src/components/App/App.js @@ -0,0 +1,36 @@ +import { BrowserRouter, Route, Switch } from "react-router-dom"; + +import './App.css'; +import "bootstrap/dist/css/bootstrap.min.css"; +import NavbarComponent from "../NavbarComponent/NavbarComponent" +import NovoFuncionario from "../NovoFuncionario/NovoFuncionario" +import AtualizarFuncionario from "../AtualizarFuncionario/AtualizarFuncionario" +import ListarFuncionarios from "../ListarFuncionarios/ListarFuncionarios" +import DeletarFuncionario from "../DeletarFuncionario" +import ListarUmFuncionario from "../ListarUmFuncioanrio/ListarUmFuncionario" + + +function App() { + return ( +
+ + + + +
+ + + + + + + +
+ +
+
+
+ ); +} + +export default App; diff --git a/src/components/AtualizarFuncionario/AtualizarFuncionario.js b/src/components/AtualizarFuncionario/AtualizarFuncionario.js new file mode 100644 index 0000000..5c7d626 --- /dev/null +++ b/src/components/AtualizarFuncionario/AtualizarFuncionario.js @@ -0,0 +1,289 @@ +import { useEffect, useState } from "react"; +import { useParams, useHistory } from "react-router-dom"; +import { Formik, Form, Field, ErrorMessage } from "formik"; + +import api from "../../api/axios.config"; +import { InputFeedback, NovoFuncionarioSchema } from "../InputFeedback"; +import ConfirmationModal from "../ConfirmationModal"; + +function AtualizarFuncionario(props) { + const { id } = useParams(); + const history = useHistory(); + const [showModal, setShowModal] = useState(false); + + const [state, setState] = useState({ + nome: "", + email: "", + setor: "", + cargo: "", + nivel: "", + data_admissao: "", + data_nascimento: "", + image_url: "" + }); + + // Pré-popula o formulário com os dados do produto através do id da URL + useEffect(() => { + async function buscarFuncionario() { + try { + const response = await api.get(`/funcionario/${id}`); + + setState({ ...response.data }); + } catch (err) { + console.error(err); + } + } + buscarFuncionario(); + }, [id]); + + console.log(state); + return ( +
+ { + setSubmitting(true); + + try { + await api.put(`/funcionario/${id}`, { ...values }); + + setSubmitting(false); + + history.push("/"); + } catch (err) { + console.error(err); + setSubmitting(false); + } + }} + > + {({ isSubmitting, errors, touched }) => ( +
+

Atualize Funcionario

+

Dados Pessoais do Funcionario

+
+ +
+ + + ( + + {msg} + + )} + /> +
+ +
+ + + ( + + {msg} + + )} + /> +
+ +
+ + + ( + + {msg} + + )} + /> +
+ +

Data de Admissão e Cargo

+
+ +
+ + + ( + + {msg} + + )} + /> +
+ +
+ + + + + + + + + + ( + + {msg} + + )} + /> +
+ +
+ + + + + + + + + ( + + {msg} + + )} + /> +
+ +
+ + + + + + + + + + ( + + {msg} + + )} + /> +
+ +
+
+ +
+
+ )} +
+
+ +
+ setShowModal(false)} + handleConfirm={() => history.push(`/funcionario/deletar/${id}`)} + title="Tem certeza que deseja deletar este funcionario?" + > +

Esta ação é irreversível! Clique em Confirmar para "Deletar".

+
+
+ ); +} + +export default AtualizarFuncionario; diff --git a/src/components/CardFuncionario/CardFuncionario.css b/src/components/CardFuncionario/CardFuncionario.css new file mode 100644 index 0000000..e69de29 diff --git a/src/components/CardFuncionario/CardFuncionario.js b/src/components/CardFuncionario/CardFuncionario.js new file mode 100644 index 0000000..9fc204b --- /dev/null +++ b/src/components/CardFuncionario/CardFuncionario.js @@ -0,0 +1,55 @@ +import React from "react"; +import { Link } from "react-router-dom"; + +function CardFuncionario(props) { + return ( +
+
+ +
+ foto funcionario +
+ +
+
+ {props.funcionarios.nome} +
+
+
+ email: {props.funcionarios.email} +
+
+ Nascimento: {props.funcionarios.data_nascimento} +
+
+ Setor: {props.funcionarios.setor.toUpperCase()} +
+
+ Cargo: {props.funcionarios.cargo.toUpperCase()} +
+
+ Nivel: {props.funcionarios.nivel.toUpperCase()} +
+
+
+ Admitido em: {props.funcionarios.data_admissao} +
+
+ + Atualizar + +
+ +
+
+ ); +} + +export default CardFuncionario; diff --git a/src/components/ConfirmationModal.js b/src/components/ConfirmationModal.js new file mode 100644 index 0000000..c95e195 --- /dev/null +++ b/src/components/ConfirmationModal.js @@ -0,0 +1,22 @@ +import { Modal } from "react-bootstrap"; + +function ConfirmationModal(props) { + return ( + + + {props.title} + + {props.children} + + + + + + ); +} + +export default ConfirmationModal; \ No newline at end of file diff --git a/src/components/DeletarFuncionario.js b/src/components/DeletarFuncionario.js new file mode 100644 index 0000000..41e41ec --- /dev/null +++ b/src/components/DeletarFuncionario.js @@ -0,0 +1,26 @@ +import { useEffect } from "react"; +import { useParams, useHistory } from "react-router-dom"; + +import api from "../api/axios.config"; + +function DeletarFuncionario() { + const { id } = useParams(); + const history = useHistory(); + + useEffect(() => { + async function deletarFuncionario() { + try { + await api.delete(`/funcionario/${id}`); + + history.push("/"); + } catch (err) { + console.error(err); + } + } + deletarFuncionario(); + }, [id, history]); + + return

Deletando...

; +} + +export default DeletarFuncionario; \ No newline at end of file diff --git a/src/components/InputFeedback.js b/src/components/InputFeedback.js new file mode 100644 index 0000000..99b349e --- /dev/null +++ b/src/components/InputFeedback.js @@ -0,0 +1,47 @@ +import { parse, isDate } from "date-fns"; +import * as Yup from "yup"; + + +const InputFeedback = (props) => { + return ( +
+ {props.children} +
+ ); +} + + +// Funcao para configurar a data para chegar no backend na forma correta +function parseDateString(value, originalValue) { + const parsedDate = isDate(originalValue) + ? originalValue + : parse(originalValue, "yyyy-MM-dd", new Date()); + + return parsedDate; + } + + +// Schema de controle para validar campos do formulario +const NovoFuncionarioSchema = Yup.object().shape({ + nome: Yup.string() + .required("Por favor informe nome.") + .max(200, "Nome deve conter no maximo 200 caracteres"), + email: Yup.string().email("Insira um email valido").required("Por favor informe email."), + data_nascimento: Yup.date() + .transform(parseDateString) + .required("Por favor informe data de nascimento."), + data_admissao: Yup.date() + .transform(parseDateString) + .required("Por favor informe data de admissão"), + setor: Yup.string() + .required("Campo exigido") + .max(100, "Setor deve conter no maximo 100 caracteres"), + cargo: Yup.string() + .required("Campo exigido") + .max(100, "Cargo deve conter no maximo 100 caracteres"), + nivel: Yup.string() + .required("Campo exigido") + .max(100, "Cargo deve conter no maximo 100 caracteres"), +}); + +export {InputFeedback, NovoFuncionarioSchema}; diff --git a/src/components/ListarFuncionarios/ListarFuncionarios.js b/src/components/ListarFuncionarios/ListarFuncionarios.js new file mode 100644 index 0000000..564a8f6 --- /dev/null +++ b/src/components/ListarFuncionarios/ListarFuncionarios.js @@ -0,0 +1,74 @@ +import { React, useEffect, useState } from "react"; + +import api from "../../api/axios.config"; +import CardFuncionario from "../CardFuncionario/CardFuncionario"; + +function ListarFuncionarios() { + const [funcionarios, setFuncionarios] = useState([]); + const [filteredFuncionarios, setFilteredFuncionarios] = useState([]); + const [searchWord, setSearchWord] = useState(""); + + useEffect(() => { + async function buscarFuncionarios() { + try { + const response = await api.get("/funcionarios"); + + setFuncionarios([...response.data]); + } catch (err) { + console.error(err); + } + } + buscarFuncionarios(); + }, []); + console.log(funcionarios); + + useEffect(() => { + async function buscarFuncionarios() { + try { + let filteredArray = []; + + if (funcionarios.length !== 0 && searchWord.length !== 0) { + filteredArray = funcionarios.filter((funcionario) => + funcionario.nome.toLowerCase().includes(searchWord.toLowerCase()) + ); + } + setFilteredFuncionarios([...filteredArray]); + } catch (err) { + console.error(err); + } + } + buscarFuncionarios(); + }, [funcionarios, searchWord]); + + function handleChange(event) { + setSearchWord(event.target.value); + } + + return ( +
+
+ +
+ {searchWord && filteredFuncionarios.map((funcionario, i) => ( +
+ ))} + + {funcionarios && + funcionarios.map((funcionario, i) => ( + + ))} + + +
+ ); +} + +export default ListarFuncionarios; diff --git a/src/components/ListarUmFuncioanrio/ListarUmFuncionario.js b/src/components/ListarUmFuncioanrio/ListarUmFuncionario.js new file mode 100644 index 0000000..8ee1a31 --- /dev/null +++ b/src/components/ListarUmFuncioanrio/ListarUmFuncionario.js @@ -0,0 +1,92 @@ +import { React, useEffect, useState } from "react"; +import api from "../../api/axios.config"; +import { useParams, useHistory, Link } from "react-router-dom"; + +import ConfirmationModal from "../ConfirmationModal"; + +function ListarUmFuncionario() { + const [funcionario, setFuncionario] = useState({}); + const { id } = useParams(); + const [showModal, setShowModal] = useState(false); + const history = useHistory(); + useEffect(() => { + async function buscarFuncionarios() { + try { + const response = await api.get(`/funcionario/${id}`); + console.log(response.data); + setFuncionario(response.data); + } catch (err) { + console.error(err); + } + } + buscarFuncionarios(); + }, [id]); + + console.log(funcionario); + return ( +
+ {funcionario && ( + + +
+ +
+
+ foto funcionario +
+
+ {funcionario.nome} +
+
+ email: {funcionario.email} +
+
+ Nascimento: {funcionario.data_nascimento} +
+
+ Setor: {funcionario.setor} +
+
+ Cargo: {funcionario.cargo} +
+
+ Nivel: {funcionario.nivel} +
+ +
+ Admitido em: {funcionario.data_admissao} +
+
+
+ + )} + +
+
+ + Atualizar + +
+
+ +
+
+ + setShowModal(false)} + handleConfirm={() => history.push(`/funcionario/deletar/${id}`)} + title="Tem certeza que deseja deletar este funcionario?" + > +

Esta ação é irreversível! Clique em Confirmar para "Deletar".

+
+
+ ); +} + +export default ListarUmFuncionario; diff --git a/src/components/NavbarComponent/NavbarComponent.js b/src/components/NavbarComponent/NavbarComponent.js new file mode 100644 index 0000000..ba893b3 --- /dev/null +++ b/src/components/NavbarComponent/NavbarComponent.js @@ -0,0 +1,62 @@ +import { NavLink } from "react-router-dom"; +import { Nav, Navbar } from "react-bootstrap"; +import { useState } from "react"; +import logo from '../../images/logo.jpg' + +function NavbarComponent() { + const [expanded, setExpanded] = useState(false); + + function expand() { + if (expanded === false) { + setExpanded(true); + } else if (expanded === true) setExpanded(false); + } + + return ( + + + + logo + + + + + + + + ); +} + +export default NavbarComponent; diff --git a/src/components/NovoFuncionario/NovoFuncionario.js b/src/components/NovoFuncionario/NovoFuncionario.js new file mode 100644 index 0000000..a4010e0 --- /dev/null +++ b/src/components/NovoFuncionario/NovoFuncionario.js @@ -0,0 +1,276 @@ +import { useHistory } from "react-router-dom"; +import { Formik, Form, Field, ErrorMessage } from "formik"; + +import api from "../../api/axios.config"; + +import { InputFeedback, NovoFuncionarioSchema } from "../InputFeedback"; + +function NovoFuncionario() { + const history = useHistory(); + + async function handleFileUpload(file) { + try { + console.log(file); + const uploadData = new FormData(); + uploadData.append("image", file); + const response = await api.post("/image-upload", uploadData); + console.log(uploadData); + return response.data.fileUrl; + } catch (err) { + console.error(err); + } + } + + return ( + { + setSubmitting(true); + console.log(values) + try { + + let uploadedImageUrl = ""; + if (values.image) { + uploadedImageUrl = await handleFileUpload(values.image); + } + console.log(uploadedImageUrl) + const response = await api.post("/funcionario", { + ...values, + image_url: uploadedImageUrl, + image: "", + }); + + setSubmitting(false); + console.log(response); + //history.push("/"); + } catch (err) { + console.error(err); + setSubmitting(false); + } + }} + > + {({ isSubmitting, errors, touched, setFieldValue }) => ( +
+

Cadastre Novo Funcionario

+

Dados Pessoais do Funcionario

+
+
+
+ + setFieldValue("image", event.target.files[0])} + /> +
+
+ + + ( + + {msg} + + )} + /> +
+ +
+ + + ( + + {msg} + + )} + /> +
+ +
+ + + ( + + {msg} + + )} + /> +
+ +

Data de Admissão e Cargo

+
+ +
+ + + ( + + {msg} + + )} + /> +
+ +
+ + + + + + + + + + ( + + {msg} + + )} + /> +
+ +
+ + + + + + + + + ( + + {msg} + + )} + /> +
+ +
+ + + + + + + + + + ( + + {msg} + + )} + /> +
+ +
+
+ +
+
+ )} +
+ ); +} + +export default NovoFuncionario; diff --git a/src/images/logo.jpg b/src/images/logo.jpg new file mode 100644 index 0000000..f31c24d Binary files /dev/null and b/src/images/logo.jpg differ diff --git a/src/index.js b/src/index.js index ef2edf8..0754be4 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; +import App from './components/App/App'; ReactDOM.render( @@ -11,7 +10,3 @@ ReactDOM.render( document.getElementById('root') ); -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/reportWebVitals.js b/src/reportWebVitals.js deleted file mode 100644 index 5253d3a..0000000 --- a/src/reportWebVitals.js +++ /dev/null @@ -1,13 +0,0 @@ -const reportWebVitals = onPerfEntry => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/src/setupTests.js b/src/setupTests.js deleted file mode 100644 index 8f2609b..0000000 --- a/src/setupTests.js +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom';