From 1692ba645df3c9fc6e4f4ff736059f5170986496 Mon Sep 17 00:00:00 2001 From: Zibbp Date: Thu, 4 Jan 2024 02:28:48 +0000 Subject: [PATCH] feat(workflows): paginate workflows --- package-lock.json | 192 ++++++++++++----------- package.json | 30 ++-- src/components/Workflows/ActiveTable.tsx | 55 ++++--- src/components/Workflows/ClosedTable.tsx | 53 ++++--- 4 files changed, 190 insertions(+), 140 deletions(-) diff --git a/package-lock.json b/package-lock.json index c557ace..5a21774 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,27 +8,27 @@ "name": "ganymede-frontend-next", "version": "0.1.0", "dependencies": { - "@mantine/carousel": "^7.3.2", - "@mantine/core": "^7.3.2", - "@mantine/dates": "^7.3.2", - "@mantine/form": "^7.3.2", - "@mantine/hooks": "^7.3.2", - "@mantine/notifications": "^7.3.2", - "@tabler/icons-react": "^2.44.0", - "@tanstack/react-query": "^5.14.1", - "@tanstack/react-query-devtools": "^5.14.1", - "@types/node": "20.10.5", - "@types/react": "18.2.45", + "@mantine/carousel": "^7.4.0", + "@mantine/core": "^7.4.0", + "@mantine/dates": "^7.4.0", + "@mantine/form": "^7.4.0", + "@mantine/hooks": "^7.4.0", + "@mantine/notifications": "^7.4.0", + "@tabler/icons-react": "^2.45.0", + "@tanstack/react-query": "^5.17.1", + "@tanstack/react-query-devtools": "^5.17.1", + "@types/node": "20.10.6", + "@types/react": "18.2.46", "@types/react-dom": "18.2.18", "@vidstack/react": "^1.9.8", - "axios": "^1.6.2", - "clsx": "^2.0.0", + "axios": "^1.6.4", + "clsx": "^2.1.0", "cookies-next": "^2.1.1", "dayjs": "^1.11.10", "embla-carousel-react": "^7.1.0", "events": "^3.3.0", "lodash": "^4.17.21", - "mantine-datatable": "^7.3.0", + "mantine-datatable": "^7.3.5", "media-icons": "^0.10.0", "next": "^14.0.4", "plyr-react": "^5.3.0", @@ -41,7 +41,7 @@ }, "devDependencies": { "postcss": "^8.4.32", - "postcss-preset-mantine": "^1.12.0", + "postcss-preset-mantine": "^1.12.3", "postcss-simple-vars": "^7.0.1" } }, @@ -105,21 +105,21 @@ "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" }, "node_modules/@mantine/carousel": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@mantine/carousel/-/carousel-7.3.2.tgz", - "integrity": "sha512-wv6jfh8RU1Fz5iQREYFtHtK/iG1APHkdYmYxRTZdhCZxNPdb4PDQvZJBz+tjYWpKN2IKUu2NlAdmP0hIMI0bHw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mantine/carousel/-/carousel-7.4.0.tgz", + "integrity": "sha512-eWy1oeHc8TMuUxJK7V0lPha+9Hoh1k0LJJKT7VGk1EALdBxmr1Ntwg1SbqW+SbeJbebP+ZzIGTrUcLaMSVzlxw==", "peerDependencies": { - "@mantine/core": "7.3.2", - "@mantine/hooks": "7.3.2", + "@mantine/core": "7.4.0", + "@mantine/hooks": "7.4.0", "embla-carousel-react": ">=7.0.0", "react": "^18.2.0", "react-dom": "^18.2.0" } }, "node_modules/@mantine/core": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.3.2.tgz", - "integrity": "sha512-CwAuQogVLcLR7O9e1eOgi3gtk4XX6cnaqevAxzJJpIOIyCnHiQ3cEGINVXyUUjUUipBlvK3sqz3NPGJ2ekLFDQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.4.0.tgz", + "integrity": "sha512-wnQOz1aSpqVlCpdyY4XyJKRqlW87mexMADQrbCTwg/5BbxKp8XU6sTcnk1piwyR0mM6SI1uo0Yik2qYNGFlyWw==", "dependencies": { "@floating-ui/react": "^0.24.8", "clsx": "2.0.0", @@ -129,30 +129,46 @@ "type-fest": "^3.13.1" }, "peerDependencies": { - "@mantine/hooks": "7.3.2", + "@mantine/hooks": "7.4.0", "react": "^18.2.0", "react-dom": "^18.2.0" } }, + "node_modules/@mantine/core/node_modules/clsx": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", + "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/@mantine/dates": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@mantine/dates/-/dates-7.3.2.tgz", - "integrity": "sha512-mmP0PYpM9GYTXRhEL4Ulb+170vgW8fpGwRdVNuCCE/cyzIKHPJzaI2pEGR/i+sboH+RC1InCy/JaiDkPY6Fzlg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mantine/dates/-/dates-7.4.0.tgz", + "integrity": "sha512-KNRVMSUW4sIk8U5SM2+4PRLqndWNaMtTabENPZUVA/Zl99yk6tDsNsu/CuinE1K5LQo9H6RJho0FRGzmzEsTwA==", "dependencies": { "clsx": "2.0.0" }, "peerDependencies": { - "@mantine/core": "7.3.2", - "@mantine/hooks": "7.3.2", + "@mantine/core": "7.4.0", + "@mantine/hooks": "7.4.0", "dayjs": ">=1.0.0", "react": "^18.2.0", "react-dom": "^18.2.0" } }, + "node_modules/@mantine/dates/node_modules/clsx": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", + "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/@mantine/form": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@mantine/form/-/form-7.3.2.tgz", - "integrity": "sha512-/qa1KQKVC46XWgIU190r3XM3Xld8Lsvz4L/an//TO67RnAGEdC5OCvr2JCb+fprZZi3YdxaKOkVNvP20W23qkg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mantine/form/-/form-7.4.0.tgz", + "integrity": "sha512-JI/o2nECWct/Kvn3GF6VplHyJeaLy0q/jGNEB/F4yt12mAYBsux6vPfAhpWrKKZ8Jt31RI+ikn6R4UcY1HGIAw==", "dependencies": { "fast-deep-equal": "^3.1.3", "klona": "^2.0.6" @@ -162,32 +178,32 @@ } }, "node_modules/@mantine/hooks": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.3.2.tgz", - "integrity": "sha512-xgumuuI3PBWXff5N02HCI7PEy25mDEdyXDQklUYK93J6FKwpcosyZnGVitoUrV1gLtYYa9ZudeAWdhHuh/CpOg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.4.0.tgz", + "integrity": "sha512-Swv23D8XmZqE2hohPBcff+ITwv5l8UlwiiEGMhL+ceUvJLnPzdwlW21qnLBtRtZWyQQ59TAav4M0GFGd93JS8Q==", "peerDependencies": { "react": "^18.2.0" } }, "node_modules/@mantine/notifications": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-7.3.2.tgz", - "integrity": "sha512-XOzgm4pm4XszavVN0QUjN+IP0xiG2IochxJSz/FduTI0r3u1WxdpvDYlOvEJpHhtWvyqI8W8rx6cPJaD2HdAwQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-7.4.0.tgz", + "integrity": "sha512-nRXYIcJpqqKxwYs2r17IBZ8uQZK57x6K2hkzOQ+ZFviO5rejxl4ip+fC+LUhIi3P7D1YSxyoZwumT73gSPz9Xw==", "dependencies": { - "@mantine/store": "7.3.2", + "@mantine/store": "7.4.0", "react-transition-group": "4.4.5" }, "peerDependencies": { - "@mantine/core": "7.3.2", - "@mantine/hooks": "7.3.2", + "@mantine/core": "7.4.0", + "@mantine/hooks": "7.4.0", "react": "^18.2.0", "react-dom": "^18.2.0" } }, "node_modules/@mantine/store": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@mantine/store/-/store-7.3.2.tgz", - "integrity": "sha512-M1eWHzTRCeCFvrpFhXKIM9zblrlIT5/XrMue/fP2HrkA43dpkgq+ArnZkN3LhG9lWR/EKbRwQWDhDIvdLtfD7w==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@mantine/store/-/store-7.4.0.tgz", + "integrity": "sha512-sSaBj6qVU0e5ml70/8e3A9pwAMBL5yKWNdnhw20b+74j85+FUDhDy8bEGZfyS0BtYPGVoxj5yF8/uZhxnDXpbg==", "peerDependencies": { "react": "^18.2.0" } @@ -376,20 +392,20 @@ } }, "node_modules/@tabler/icons": { - "version": "2.44.0", - "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-2.44.0.tgz", - "integrity": "sha512-WPPtihDcAwEm1QZM9MXQw6+r/R2/qx7KMU1eegsi9DsqBLAb0W2kbt6e/syvd6j9c+6XNpRVBW1ziGqSWQAWOg==", + "version": "2.45.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-2.45.0.tgz", + "integrity": "sha512-J10UDghOni9wlrj5CpKAzychDCABCKYq897mGg0wGFsd+tYLaUdz0dt/HZeGnV8gZJo0hIiTPLGwBp5EW42Qsg==", "funding": { "type": "github", "url": "https://github.com/sponsors/codecalm" } }, "node_modules/@tabler/icons-react": { - "version": "2.44.0", - "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-2.44.0.tgz", - "integrity": "sha512-10qwrqJ/QBNgY4YYer9PjWmCwm3wv9aVK8kGAkFKkwu6UJURVLZ2ea+oFh5j6vSXnA1zMtUG+X8anR5fZ67Isw==", + "version": "2.45.0", + "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-2.45.0.tgz", + "integrity": "sha512-1vSBsHnBi9AfMILeJQrQo1XIHtFOxuWNGOeIvNHpDcBXyFTfVvDuh64PjMl57xCh5y/PlQlu3Hpx9vSkpSYXYQ==", "dependencies": { - "@tabler/icons": "2.44.0", + "@tabler/icons": "2.45.0", "prop-types": "^15.7.2" }, "funding": { @@ -401,29 +417,29 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.14.1.tgz", - "integrity": "sha512-TlZarySCVEiap4K7BCvrsYZnX7jBbEkR55YMrk8ELcRbuAx6ydL+qoxqUt8Fq8VMvQyGt52icn6T7eJL1Q35KQ==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.17.1.tgz", + "integrity": "sha512-kUXozQmU7NBtzX5dM6qfFNZN+YK/9Ct37hnG/ogdgI4mExIx7VH/qRepsPhKfNrJz2w81/JykmM3Uug6sVpUSw==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/query-devtools": { - "version": "5.13.5", - "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.13.5.tgz", - "integrity": "sha512-effSYz9AWcZ6sNd+c8LCBYFIuDZApoCTXEpRlEYChBZpMz9QUUVMLToThwCyUY49+T5pANL3XxgZf3HV7hwJlg==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.17.1.tgz", + "integrity": "sha512-gNdt6PYzYlyjtSAoO8Jt9GIFq5VSLLDV2qq0TCi1t/PGnpAIlIHqNZGYkQTPsy0FyGUTX3pCq4bd7v5z/wzf3A==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.14.1.tgz", - "integrity": "sha512-v7jhe/3jhChiR0XJbGHaG5WNPd/cURwzDGBCr4rzpUTeudPzxrtVRKsF1xJRLcJK3qH/0gIwTYHIPZ3gj+01Yw==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.17.1.tgz", + "integrity": "sha512-4JYgX0kU+pvwVQi5eRiHGvBK7WnahEl6lmaxd32ZVSKmByAxLgaewoxBR03cdDNse8lUD2zGOe0sx3M/EGRlmA==", "dependencies": { - "@tanstack/query-core": "5.14.1" + "@tanstack/query-core": "5.17.1" }, "funding": { "type": "github", @@ -434,18 +450,18 @@ } }, "node_modules/@tanstack/react-query-devtools": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.14.1.tgz", - "integrity": "sha512-8fuQs0AMQk8D66JUYqdYA33fOObevuWwm1atOnPbtV8PvIscaU0i/cNTqCl1Y10rgbR/QsqxQSJGBZ5TxxBrlA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.17.1.tgz", + "integrity": "sha512-QWHqdEN2TJpj76r0yzdOJEopmPvdAHOJHAKXaygubRASqCqfcWGkOHGD9pqqHOfTu5eQdV1Csx97EuSjnHMKcA==", "dependencies": { - "@tanstack/query-devtools": "5.13.5" + "@tanstack/query-devtools": "5.17.1" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^5.14.1", + "@tanstack/react-query": "^5.17.1", "react": "^18.0.0" } }, @@ -455,9 +471,9 @@ "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" }, "node_modules/@types/node": { - "version": "20.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", - "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", "dependencies": { "undici-types": "~5.26.4" } @@ -468,9 +484,9 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { - "version": "18.2.45", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.45.tgz", - "integrity": "sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==", + "version": "18.2.46", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.46.tgz", + "integrity": "sha512-nNCvVBcZlvX4NU1nRRNV/mFl1nNRuTuslAJglQsq+8ldXe5Xv0Wd2f7WTE3jOxhLH2BFfiZGC6GCp+kHQbgG+w==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -522,11 +538,11 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.4.tgz", + "integrity": "sha512-heJnIs6N4aa1eSthhN9M5ioILu8Wi8vmQW9iHQ9NUvfkJb0lEEDUiIdQNAuBtfUt3FxReaKdpQA5DbmMOqzF/A==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -588,9 +604,9 @@ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" }, "node_modules/clsx": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", - "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", "engines": { "node": ">=6" } @@ -755,9 +771,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "funding": [ { "type": "individual", @@ -889,9 +905,9 @@ } }, "node_modules/mantine-datatable": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/mantine-datatable/-/mantine-datatable-7.3.0.tgz", - "integrity": "sha512-JcLYuQdG7H0yQm/aSTaGjCbMch64lgfqJLNcygXiM+L2gLJtA9E99jE5aFAr3dIVp7luSddHJgq7aYC4ragzIQ==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/mantine-datatable/-/mantine-datatable-7.3.5.tgz", + "integrity": "sha512-vaITOJJii/ojfbRsyZoXtgFcWIjtTr0ZWm59pVlgrJMuBSnJqBgPfEsU8jvAsXrWpuXfe//pTmwWm9a2uN/aTw==", "funding": { "type": "github", "url": "https://github.com/sponsors/icflorescu" @@ -1200,9 +1216,9 @@ } }, "node_modules/postcss-preset-mantine": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/postcss-preset-mantine/-/postcss-preset-mantine-1.12.0.tgz", - "integrity": "sha512-WLsejZoNtsrpOEi/CItn98e+4NpgT/Av28XWfY0CqiWgd2NDOOxtEUNdPGtB33pGLwaV8FrhTpIhAIO8palTOw==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/postcss-preset-mantine/-/postcss-preset-mantine-1.12.3.tgz", + "integrity": "sha512-cCwowf20mIyRXnV1cSVoMGfhYgy8ZqFJWsEJthdMZ3n7LijjucE9l/HO47gv5gAtr9nY1MkaEkpWS7ulhSTbSg==", "dev": true, "dependencies": { "postcss-mixins": "^9.0.4", diff --git a/package.json b/package.json index 9a7cc23..3666320 100644 --- a/package.json +++ b/package.json @@ -9,27 +9,27 @@ "lint": "next lint" }, "dependencies": { - "@mantine/carousel": "^7.3.2", - "@mantine/core": "^7.3.2", - "@mantine/dates": "^7.3.2", - "@mantine/form": "^7.3.2", - "@mantine/hooks": "^7.3.2", - "@mantine/notifications": "^7.3.2", - "@tabler/icons-react": "^2.44.0", - "@tanstack/react-query": "^5.14.1", - "@tanstack/react-query-devtools": "^5.14.1", - "@types/node": "20.10.5", - "@types/react": "18.2.45", + "@mantine/carousel": "^7.4.0", + "@mantine/core": "^7.4.0", + "@mantine/dates": "^7.4.0", + "@mantine/form": "^7.4.0", + "@mantine/hooks": "^7.4.0", + "@mantine/notifications": "^7.4.0", + "@tabler/icons-react": "^2.45.0", + "@tanstack/react-query": "^5.17.1", + "@tanstack/react-query-devtools": "^5.17.1", + "@types/node": "20.10.6", + "@types/react": "18.2.46", "@types/react-dom": "18.2.18", "@vidstack/react": "^1.9.8", - "axios": "^1.6.2", - "clsx": "^2.0.0", + "axios": "^1.6.4", + "clsx": "^2.1.0", "cookies-next": "^2.1.1", "dayjs": "^1.11.10", "embla-carousel-react": "^7.1.0", "events": "^3.3.0", "lodash": "^4.17.21", - "mantine-datatable": "^7.3.0", + "mantine-datatable": "^7.3.5", "media-icons": "^0.10.0", "next": "^14.0.4", "plyr-react": "^5.3.0", @@ -42,7 +42,7 @@ }, "devDependencies": { "postcss": "^8.4.32", - "postcss-preset-mantine": "^1.12.0", + "postcss-preset-mantine": "^1.12.3", "postcss-simple-vars": "^7.0.1" } } diff --git a/src/components/Workflows/ActiveTable.tsx b/src/components/Workflows/ActiveTable.tsx index 1fb2e36..dc1b938 100644 --- a/src/components/Workflows/ActiveTable.tsx +++ b/src/components/Workflows/ActiveTable.tsx @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import React from 'react' import { useApi } from '../../hooks/useApi'; import GanymedeLoader from '../Utils/GanymedeLoader'; -import { Table } from '@mantine/core'; +import { Box, Button, Table } from '@mantine/core'; import WorkflowStatusCompleted from './Status/Completed'; import WorkflowStatusRunning from './Status/Running'; import dayjs from 'dayjs'; @@ -13,30 +13,44 @@ import WorkflowStatusFailed from './Status/Failed'; type Props = {} +async function fetchActiveWorkflows(nextPageToken: string) { + return useApi( + { + method: "GET", + url: `/api/v1/workflows/active?next_page_token=${nextPageToken}`, + withCredentials: true, + }, + false + ).then((res) => res?.data); +} + const WorkflowsActiveTable = (props: Props) => { + const [nextPageToken, setNextPageToken] = React.useState(""); + const [executions, setExecutions] = React.useState([]) const { isLoading, error, data } = useQuery({ - queryKey: ["workflows-active"], - queryFn: async () => - useApi( - { - method: "GET", - url: "/api/v1/workflows/active", - withCredentials: true, - }, - false - ).then((res) => res?.data), - refetchInterval: 2000, + queryKey: ["workflows-active", nextPageToken], + queryFn: async () => { + const data = await fetchActiveWorkflows(nextPageToken) + // append data.executions to executions + if (data.executions) { + setExecutions([...executions, ...data.executions]) + } + + return data + }, }); if (error) return
Failed to load
; if (isLoading) return ; - if (!data) return
No data
+ if (!executions) return
No data
- console.log(data) + const handleNextPage = (nextPageToken: string) => { + setNextPageToken(nextPageToken) + } - const rows = data.map((workflow: any) => ( + const rows = executions.map((workflow: any) => ( {workflow.status == 1 && } @@ -71,20 +85,23 @@ const WorkflowsActiveTable = (props: Props) => { )); return ( -
- + +
Status Workflow ID Run ID Type - Start Time + Close Time {rows}
-
+ {data.next_page_token && ( + + )} + ) } diff --git a/src/components/Workflows/ClosedTable.tsx b/src/components/Workflows/ClosedTable.tsx index 6efe885..8a16627 100644 --- a/src/components/Workflows/ClosedTable.tsx +++ b/src/components/Workflows/ClosedTable.tsx @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import React from 'react' import { useApi } from '../../hooks/useApi'; import GanymedeLoader from '../Utils/GanymedeLoader'; -import { Table } from '@mantine/core'; +import { Box, Button, Table } from '@mantine/core'; import WorkflowStatusCompleted from './Status/Completed'; import WorkflowStatusRunning from './Status/Running'; import dayjs from 'dayjs'; @@ -13,30 +13,44 @@ import WorkflowStatusFailed from './Status/Failed'; type Props = {} +async function fetchClosedWorkflows(nextPageToken: string) { + return useApi( + { + method: "GET", + url: `/api/v1/workflows/closed?next_page_token=${nextPageToken}`, + withCredentials: true, + }, + false + ).then((res) => res?.data); +} + const WorkflowsClosedTable = (props: Props) => { + const [nextPageToken, setNextPageToken] = React.useState(""); + const [executions, setExecutions] = React.useState([]) const { isLoading, error, data } = useQuery({ - queryKey: ["workflows-closed"], - queryFn: async () => - useApi( - { - method: "GET", - url: "/api/v1/workflows/closed", - withCredentials: true, - }, - false - ).then((res) => res?.data), - refetchInterval: 2000, + queryKey: ["workflows-closed", nextPageToken], + queryFn: async () => { + const data = await fetchClosedWorkflows(nextPageToken) + // append data.executions to executions + if (data.executions) { + setExecutions([...executions, ...data.executions]) + } + + return data + }, }); if (error) return
Failed to load
; if (isLoading) return ; - if (!data) return
No data
+ if (!executions) return
No data
- console.log(data) + const handleNextPage = (nextPageToken: string) => { + setNextPageToken(nextPageToken) + } - const rows = data.map((workflow: any) => ( + const rows = executions.map((workflow: any) => ( {workflow.status == 1 && } @@ -71,8 +85,8 @@ const WorkflowsClosedTable = (props: Props) => { )); return ( -
- + +
Status @@ -84,7 +98,10 @@ const WorkflowsClosedTable = (props: Props) => { {rows}
-
+ {data.next_page_token && ( + + )} + ) }