diff --git a/containers/homer/assets/config.yml b/containers/homer/assets/config.yml index 6663cc415d..be9f8a3b00 100644 --- a/containers/homer/assets/config.yml +++ b/containers/homer/assets/config.yml @@ -53,7 +53,7 @@ message: links: - name: "Github" icon: "fab fa-github" - url: "https://github.com/gettakaro/takaro" + url: "https://aka.takaro.io/github" target: "_blank" - name: "Docs" icon: "fa fa-book" @@ -137,4 +137,4 @@ services: - name: "Redis Insight" icon: "fas fa-database" subtitle: "Redis UI" - url: "http://127.0.0.1:5540" \ No newline at end of file + url: "http://127.0.0.1:5540" diff --git a/package-lock.json b/package-lock.json index bda09a3cf9..162539ad30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "class-validator-jsonschema": "5.0.1", "concurrently": "9.0.1", "convict": "6.2.4", + "cronstrue": "2.51.0", "csv": "6.3.10", "discord-api-types": "0.37.101", "discord.js": "14.16.3", @@ -1254,8 +1255,7 @@ }, "node_modules/@babel/code-frame": { "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz", - "integrity": "sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g==", + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "js-tokens": "^4.0.0", @@ -1267,16 +1267,14 @@ }, "node_modules/@babel/compat-data": { "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz", - "integrity": "sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", - "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.0", @@ -1307,11 +1305,10 @@ "license": "MIT" }, "node_modules/@babel/generator": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz", - "integrity": "sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w==", + "version": "7.26.2", + "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.0", + "@babel/parser": "^7.26.2", "@babel/types": "^7.26.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", @@ -1344,8 +1341,7 @@ }, "node_modules/@babel/helper-compilation-targets": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", - "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.25.9", "@babel/helper-validator-option": "^7.25.9", @@ -1418,8 +1414,7 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", - "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "license": "MIT", "dependencies": { "@babel/traverse": "^7.25.9", "@babel/types": "^7.25.9" @@ -1430,8 +1425,7 @@ }, "node_modules/@babel/helper-module-transforms": { "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", - "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9", @@ -1456,8 +1450,7 @@ }, "node_modules/@babel/helper-plugin-utils": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", - "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -1516,24 +1509,21 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", - "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -1552,8 +1542,7 @@ }, "node_modules/@babel/helpers": { "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "license": "MIT", "dependencies": { "@babel/template": "^7.25.9", "@babel/types": "^7.26.0" @@ -1563,9 +1552,8 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.1.tgz", - "integrity": "sha512-reoQYNiAJreZNsJzyrDNzFQ+IQ5JFiIzAHJg9bn94S3l+4++J7RsIhNMoB+lgP/9tpmiAQqspv+xfdxTSzREOw==", + "version": "7.26.2", + "license": "MIT", "dependencies": { "@babel/types": "^7.26.0" }, @@ -1831,8 +1819,7 @@ }, "node_modules/@babel/plugin-syntax-jsx": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", - "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, @@ -1931,8 +1918,7 @@ }, "node_modules/@babel/plugin-syntax-typescript": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", - "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.25.9" }, @@ -3093,8 +3079,7 @@ }, "node_modules/@babel/template": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", - "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.25.9", "@babel/parser": "^7.25.9", @@ -3106,8 +3091,7 @@ }, "node_modules/@babel/traverse": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.25.9", "@babel/generator": "^7.25.9", @@ -3123,8 +3107,7 @@ }, "node_modules/@babel/types": { "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -3140,8 +3123,6 @@ }, "node_modules/@bull-board/api": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/@bull-board/api/-/api-6.2.3.tgz", - "integrity": "sha512-WwXb6A4St4G7brf9l0ye/dtDHqerC4iAX2d7MTkIGihPVXfCGqmjKhbsWrBLAAdL0kep6SfDlWuN0YTvgYL0xA==", "license": "MIT", "dependencies": { "redis-info": "^3.0.8" @@ -3152,8 +3133,6 @@ }, "node_modules/@bull-board/express": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/@bull-board/express/-/express-6.2.3.tgz", - "integrity": "sha512-Z2UgT3nUTfo9cx6LAsnVwc8a3ZzGXm64Q12lZ0h7vUfhtIicygx8KvigLDW9Xp3d+zh29gi9A3r/+pGschjJxw==", "license": "MIT", "dependencies": { "@bull-board/api": "6.2.3", @@ -3164,8 +3143,6 @@ }, "node_modules/@bull-board/ui": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-6.2.3.tgz", - "integrity": "sha512-xRFcB+8IvaEt4JmJmhxtrmVY0lf5NcHPvTphpeFv9ib39nFU/EfuslT5CWhMsbDb27agTaq5FjUXEw72cD72yA==", "license": "MIT", "dependencies": { "@bull-board/api": "6.2.3" @@ -14677,8 +14654,6 @@ }, "node_modules/@eslint/js": { "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", "devOptional": true, "license": "MIT", "engines": { @@ -14838,8 +14813,6 @@ }, "node_modules/@humanfs/core": { "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", - "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", "devOptional": true, "license": "Apache-2.0", "engines": { @@ -14848,8 +14821,6 @@ }, "node_modules/@humanfs/node": { "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", - "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", "devOptional": true, "license": "Apache-2.0", "dependencies": { @@ -14874,8 +14845,6 @@ }, "node_modules/@humanwhocodes/retry": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", "devOptional": true, "license": "Apache-2.0", "engines": { @@ -21302,8 +21271,6 @@ }, "node_modules/@storybook/types/node_modules/@types/express": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21803,7 +21770,9 @@ "link": true }, "node_modules/@tanstack/history": { - "version": "1.58.15", + "version": "1.61.1", + "resolved": "https://registry.npmjs.org/@tanstack/history/-/history-1.61.1.tgz", + "integrity": "sha512-2CqERleeqO3hkhJmyJm37tiL3LYgeOpmo8szqdjgtnnG0z7ZpvzkZz6HkfOr9Ca/ha7mhAiouSvLYuLkM37AMg==", "license": "MIT", "peer": true, "engines": { @@ -21815,12 +21784,14 @@ } }, "node_modules/@tanstack/react-router": { - "version": "1.58.15", + "version": "1.79.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.79.0.tgz", + "integrity": "sha512-v+0+Y3mCsd6waphnG0dloU9cDtSbB5k/LwbkhqXd2uGhwZyI1/nvvOcSOnuTB8CDEvC6WFNBt+fKOPVqNZ3ezw==", "license": "MIT", "peer": true, "dependencies": { - "@tanstack/history": "1.58.15", - "@tanstack/react-store": "^0.5.5", + "@tanstack/history": "1.61.1", + "@tanstack/react-store": "^0.5.6", "tiny-invariant": "^1.3.3", "tiny-warning": "^1.0.3" }, @@ -21832,7 +21803,7 @@ "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/router-generator": "1.58.12", + "@tanstack/router-generator": "1.79.0", "react": ">=18", "react-dom": ">=18" }, @@ -21843,7 +21814,9 @@ } }, "node_modules/@tanstack/react-store": { - "version": "0.5.5", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@tanstack/react-store/-/react-store-0.5.6.tgz", + "integrity": "sha512-SitIpS5jTj28DajjLpWbIX+YetmJL+6PRY0DKKiCGBKfYIqj3ryODQYF3jB3SNoR9ifUA/jFkqbJdBKFtWd+AQ==", "license": "MIT", "dependencies": { "@tanstack/store": "0.5.5", @@ -21878,14 +21851,16 @@ } }, "node_modules/@tanstack/router-generator": { - "version": "1.58.12", + "version": "1.79.0", + "resolved": "https://registry.npmjs.org/@tanstack/router-generator/-/router-generator-1.79.0.tgz", + "integrity": "sha512-HJxmYs7GAA1AJQzyfy4Hiygmg93qCCDiAxQ//zCRMbzVntwpqtZ96o9UGOPjT3Lw0SxbyzbKgpo3zqCdwlv8Ew==", "license": "MIT", "optional": true, "peer": true, "dependencies": { - "@tanstack/virtual-file-routes": "^1.56.0", + "@tanstack/virtual-file-routes": "^1.64.0", "prettier": "^3.3.3", - "tsx": "^4.19.1", + "tsx": "^4.19.2", "zod": "^3.23.8" }, "engines": { @@ -21918,8 +21893,7 @@ }, "node_modules/@tanstack/virtual-file-routes": { "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@tanstack/virtual-file-routes/-/virtual-file-routes-1.64.0.tgz", - "integrity": "sha512-soW+gE9QTmMaqXM17r7y1p8NiQVIIECjdTaYla8BKL5Flj030m3KuxEQoiG1XgjtA0O7ayznFz2YvPcXIy3qDg==", + "license": "MIT", "optional": true, "peer": true, "engines": { @@ -22366,8 +22340,6 @@ }, "node_modules/@types/express": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", - "integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==", "license": "MIT", "dependencies": { "@types/body-parser": "*", @@ -22388,8 +22360,6 @@ }, "node_modules/@types/express/node_modules/@types/express-serve-static-core": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.1.tgz", - "integrity": "sha512-CRICJIl0N5cXDONAdlTv5ShATZ4HEwk6kDDIW2/w9qOWKg+NU/5F8wYRWCrONad0/UKkloNSmmyN/wX4rtpbVA==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -22893,8 +22863,6 @@ }, "node_modules/@types/supertest": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-6.0.2.tgz", - "integrity": "sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg==", "dev": true, "license": "MIT", "dependencies": { @@ -23184,14 +23152,12 @@ }, "node_modules/@use-gesture/core": { "version": "10.3.1", - "resolved": "https://registry.npmjs.org/@use-gesture/core/-/core-10.3.1.tgz", - "integrity": "sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw==", + "license": "MIT", "peer": true }, "node_modules/@use-gesture/react": { "version": "10.3.1", - "resolved": "https://registry.npmjs.org/@use-gesture/react/-/react-10.3.1.tgz", - "integrity": "sha512-Yy19y6O2GJq8f7CHf7L0nxL8bf4PZCPaVOCgJrusOeFHY1LvHgYXnmnXg6N5iwAnbgbZCDjo60SiM6IPJi9C5g==", + "license": "MIT", "peer": true, "dependencies": { "@use-gesture/core": "10.3.1" @@ -23487,6 +23453,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/@visx/zoom/-/zoom-3.3.0.tgz", "integrity": "sha512-ijSitmJWbhupAe1F0LTsusg/WWEvYBcxV9iOHmTbGHhgpdKuhmZCXYg2zGAF4oT3lTuhofUA678jQt5+U9FlWA==", + "license": "MIT", "peer": true, "dependencies": { "@types/react": "*", @@ -26639,6 +26606,15 @@ "node": ">=18.0" } }, + "node_modules/cronstrue": { + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/cronstrue/-/cronstrue-2.51.0.tgz", + "integrity": "sha512-7EG9VaZZ5SRbZ7m25dmP6xaS0qe9ay6wywMskFOU/lMDKa+3gZr2oeT5OUfXwRP/Bcj8wxdYJ65AHU70CI3tsw==", + "license": "MIT", + "bin": { + "cronstrue": "bin/cli.js" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "license": "MIT", @@ -28649,8 +28625,6 @@ }, "node_modules/eslint": { "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", "devOptional": true, "license": "MIT", "dependencies": { @@ -28919,8 +28893,6 @@ }, "node_modules/eslint-scope": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", "devOptional": true, "license": "BSD-2-Clause", "dependencies": { @@ -28996,8 +28968,6 @@ }, "node_modules/eslint/node_modules/eslint-visitor-keys": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", "devOptional": true, "license": "Apache-2.0", "engines": { @@ -29040,8 +29010,6 @@ }, "node_modules/espree": { "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", "devOptional": true, "license": "BSD-2-Clause", "dependencies": { @@ -29069,8 +29037,6 @@ }, "node_modules/espree/node_modules/eslint-visitor-keys": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", "devOptional": true, "license": "Apache-2.0", "engines": { @@ -30370,19 +30336,6 @@ "version": "1.0.0", "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "license": "MIT", @@ -30991,7 +30944,9 @@ "license": "MIT" }, "node_modules/goober": { - "version": "2.1.14", + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/goober/-/goober-2.1.16.tgz", + "integrity": "sha512-erjk19y1U33+XAMe1VTvIONHYoSqE4iS7BYUZfHaqeohLmnC0FdxEh7rQU+6MZ4OajItzjZFSRtVANrQwNq6/g==", "license": "MIT", "peerDependencies": { "csstype": "^3.0.10" @@ -35268,8 +35223,6 @@ }, "node_modules/maxmind": { "version": "4.3.22", - "resolved": "https://registry.npmjs.org/maxmind/-/maxmind-4.3.22.tgz", - "integrity": "sha512-dfLO11mE77ELTEIXNezfW0eslodsFLsZ1lQkLauP+5Zsg1m7kCGtljqRyVOd9E5Ne2RJgvY6UU09qvnVocOZvA==", "license": "MIT", "dependencies": { "mmdb-lib": "2.1.1", @@ -38673,20 +38626,6 @@ "node": ">=18" } }, - "node_modules/playwright/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/polished": { "version": "4.3.1", "license": "MIT", @@ -39436,8 +39375,6 @@ }, "node_modules/re-resizable": { "version": "6.10.0", - "resolved": "https://registry.npmjs.org/re-resizable/-/re-resizable-6.10.0.tgz", - "integrity": "sha512-hysSK0xmA5nz24HBVztlk4yCqCLCvS32E6ZpWxVKop9x3tqCa4yAj1++facrmkOf62JsJHjmjABdKxXofYioCw==", "license": "MIT", "peerDependencies": { "react": "^16.13.1 || ^17.0.0 || ^18.0.0", @@ -43853,8 +43790,7 @@ }, "node_modules/tsx": { "version": "4.19.2", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz", - "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==", + "license": "MIT", "optional": true, "peer": true, "dependencies": { @@ -45376,8 +45312,6 @@ }, "node_modules/webpack-dev-server/node_modules/@types/express": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "license": "MIT", "dependencies": { "@types/body-parser": "*", @@ -46550,7 +46484,7 @@ "@rjsf/utils": "5.20.0", "@rjsf/validator-ajv8": "5.20.0", "@sentry/react": "8.32.0", - "@tanstack/react-router": "1.58.15", + "@tanstack/react-router": "1.79.0", "@tanstack/react-table": "8.20.5", "@types/luxon": "3.4.2", "@visx/axis": "3.10.1", @@ -46569,7 +46503,7 @@ "@visx/shape": "3.5.0", "@visx/tooltip": "3.3.0", "@visx/vendor": "3.5.0", - "@visx/zoom": "^3.3.0", + "@visx/zoom": "3.3.0", "framer-motion": "11.9.0", "luxon": "3.5.0", "notistack": "3.0.1", @@ -46997,8 +46931,6 @@ }, "packages/lib-components/node_modules/@types/express": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "license": "MIT", "dependencies": { @@ -48623,9 +48555,9 @@ "@sentry/tracing": "7.114.0", "@tanstack/react-query": "5.56.2", "@tanstack/react-query-devtools": "5.58.0", - "@tanstack/react-router": "1.58.15", - "@tanstack/router-devtools": "1.58.15", - "@tanstack/router-vite-plugin": "1.58.12", + "@tanstack/react-router": "1.79.0", + "@tanstack/router-devtools": "1.79.0", + "@tanstack/router-vite-plugin": "1.79.0", "luxon": "3.5.0", "react-dnd": "16.0.1", "react-dnd-html5-backend": "16.0.1", diff --git a/package.json b/package.json index 176a916338..6f08492173 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,7 @@ "class-validator-jsonschema": "5.0.1", "concurrently": "9.0.1", "convict": "6.2.4", + "cronstrue": "2.51.0", "csv": "6.3.10", "discord-api-types": "0.37.101", "discord.js": "14.16.3", diff --git a/packages/e2e/src/web-main/pages/GameServersPage.ts b/packages/e2e/src/web-main/pages/GameServersPage.ts index 5c2d42b27b..2b0376ff44 100644 --- a/packages/e2e/src/web-main/pages/GameServersPage.ts +++ b/packages/e2e/src/web-main/pages/GameServersPage.ts @@ -52,9 +52,6 @@ export class GameServersPage extends BasePage { await this.page.getByRole('option', { name: value }).locator('div').click(); } - async clickTestConnection() { - await this.page.getByRole('button', { name: 'Test connection' }).click(); - } async clickSave() { await this.page.getByRole('button', { name: 'Save changes' }).click(); } diff --git a/packages/e2e/src/web-main/views/gameservers.spec.ts b/packages/e2e/src/web-main/views/gameservers.spec.ts index 71fcfaa98c..bbf6fe243e 100644 --- a/packages/e2e/src/web-main/views/gameservers.spec.ts +++ b/packages/e2e/src/web-main/views/gameservers.spec.ts @@ -14,9 +14,6 @@ test('Can create gameserver', async ({ page, takaro }) => { const hostInput = page.getByPlaceholder('Http://127.0.0.1:3002'); await hostInput.click(); await hostInput.fill(integrationConfig.get('mockGameserver.host')); - - // test connection - await GameServersPage.clickTestConnection(); await GameServersPage.clickSave(); await expect(page.getByRole('heading', { name: serverName })).toBeVisible(); @@ -32,7 +29,6 @@ test('Should show error when creating a gameserver with name that already exists const hostInputs1 = page.getByPlaceholder('Http://127.0.0.1:3002'); await hostInputs1.click(); await hostInputs1.fill(integrationConfig.get('mockGameserver.host')); - await GameServersPage.clickTestConnection(); await GameServersPage.clickSave(); await expect(page.getByRole('heading', { name: serverName })).toBeVisible(); @@ -42,7 +38,6 @@ test('Should show error when creating a gameserver with name that already exists const hostInputs2 = page.getByPlaceholder('Http://127.0.0.1:3002'); await hostInputs2.click(); await hostInputs2.fill(integrationConfig.get('mockGameserver.host')); - await GameServersPage.clickTestConnection(); await GameServersPage.clickSave(); await expect(page.getByText('Game server with this name already exists')).toBeVisible(); }); @@ -58,14 +53,12 @@ test('Should show error when updating a gameserver with name that already exists const hostInputs1 = page.getByPlaceholder('Http://127.0.0.1:3002'); await hostInputs1.click(); await hostInputs1.fill(integrationConfig.get('mockGameserver.host')); - await GameServersPage.clickTestConnection(); await GameServersPage.clickSave(); await expect(page.getByRole('heading', { name: serverName })).toBeVisible(); // this will edit the first server and try to set the name to the same as the second server await GameServersPage.action('Edit'); await GameServersPage.nameCreateEdit(serverName); - await GameServersPage.clickTestConnection(); await GameServersPage.clickSave(); await expect(page.getByText('Game server with this name already exists')).toBeVisible(); }); @@ -82,7 +75,6 @@ test('Can edit gameserver', async ({ page, takaro }) => { const newGameServerName = 'My edited mock server'; await GameServersPage.nameCreateEdit(newGameServerName); - await GameServersPage.clickTestConnection(); await GameServersPage.clickSave(); await expect(page.getByText(newGameServerName)).toBeVisible(); }); diff --git a/packages/lib-apiclient/src/generated/api.ts b/packages/lib-apiclient/src/generated/api.ts index 743f31a3f9..1038c81e52 100644 --- a/packages/lib-apiclient/src/generated/api.ts +++ b/packages/lib-apiclient/src/generated/api.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 113fb57eed0f5d322a110ccec38b872a84a11b26 + * The version of the OpenAPI document: development - c3c169ee2703ed3d5c50c1bb88ccfdd588028ca2 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/base.ts b/packages/lib-apiclient/src/generated/base.ts index 3d5477ca17..6d43a79e62 100644 --- a/packages/lib-apiclient/src/generated/base.ts +++ b/packages/lib-apiclient/src/generated/base.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 113fb57eed0f5d322a110ccec38b872a84a11b26 + * The version of the OpenAPI document: development - c3c169ee2703ed3d5c50c1bb88ccfdd588028ca2 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/common.ts b/packages/lib-apiclient/src/generated/common.ts index 3365df4d93..9e88e581bc 100644 --- a/packages/lib-apiclient/src/generated/common.ts +++ b/packages/lib-apiclient/src/generated/common.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 113fb57eed0f5d322a110ccec38b872a84a11b26 + * The version of the OpenAPI document: development - c3c169ee2703ed3d5c50c1bb88ccfdd588028ca2 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/configuration.ts b/packages/lib-apiclient/src/generated/configuration.ts index 1bbdefa708..0667c72e4f 100644 --- a/packages/lib-apiclient/src/generated/configuration.ts +++ b/packages/lib-apiclient/src/generated/configuration.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 113fb57eed0f5d322a110ccec38b872a84a11b26 + * The version of the OpenAPI document: development - c3c169ee2703ed3d5c50c1bb88ccfdd588028ca2 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-apiclient/src/generated/index.ts b/packages/lib-apiclient/src/generated/index.ts index 12452fd5e3..9862529dfa 100644 --- a/packages/lib-apiclient/src/generated/index.ts +++ b/packages/lib-apiclient/src/generated/index.ts @@ -4,7 +4,7 @@ * Takaro app-api * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: development - 113fb57eed0f5d322a110ccec38b872a84a11b26 + * The version of the OpenAPI document: development - c3c169ee2703ed3d5c50c1bb88ccfdd588028ca2 * Contact: support@takaro.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/lib-components/package.json b/packages/lib-components/package.json index 6ccb83c730..8b2e83ae5b 100644 --- a/packages/lib-components/package.json +++ b/packages/lib-components/package.json @@ -33,7 +33,7 @@ "@rjsf/validator-ajv8": "5.20.0", "@sentry/react": "8.32.0", "@tanstack/react-table": "8.20.5", - "@tanstack/react-router": "1.58.15", + "@tanstack/react-router": "1.79.0", "@types/luxon": "3.4.2", "@visx/axis": "3.10.1", "@visx/brush": "3.10.4", @@ -51,7 +51,7 @@ "@visx/shape": "3.5.0", "@visx/tooltip": "3.3.0", "@visx/vendor": "3.5.0", - "@visx/zoom": "^3.3.0", + "@visx/zoom": "3.3.0", "framer-motion": "11.9.0", "luxon": "3.5.0", "notistack": "3.0.1", diff --git a/packages/lib-components/src/components/actions/Button/style.ts b/packages/lib-components/src/components/actions/Button/style.ts index e009961df6..ffe4703d67 100644 --- a/packages/lib-components/src/components/actions/Button/style.ts +++ b/packages/lib-components/src/components/actions/Button/style.ts @@ -34,6 +34,7 @@ export const Default = styled.button<{ span { font-size: 1.25rem; font-weight: 600; + white-space: nowrap; color: ${({ theme, color }) => { switch (color) { case 'white': diff --git a/packages/lib-components/src/components/actions/ToggleButton/ToggleButtonGroup.tsx b/packages/lib-components/src/components/actions/ToggleButton/ToggleButtonGroup.tsx index 490883de82..c4ac6c5299 100644 --- a/packages/lib-components/src/components/actions/ToggleButton/ToggleButtonGroup.tsx +++ b/packages/lib-components/src/components/actions/ToggleButton/ToggleButtonGroup.tsx @@ -47,7 +47,6 @@ export const ToggleButtonGroup: FC & SubComponents = ({ const m = new Map(); Children.forEach(children, (child) => { if (isValidElement(child)) { - console.log(child.props.value, defaultValue); if (child.props.value === defaultValue) { m.set(child.props.value, true); } else { diff --git a/packages/lib-components/src/components/charts/GeoMercator/index.tsx b/packages/lib-components/src/components/charts/GeoMercator/index.tsx index 9c13f76b2e..125080706d 100644 --- a/packages/lib-components/src/components/charts/GeoMercator/index.tsx +++ b/packages/lib-components/src/components/charts/GeoMercator/index.tsx @@ -84,9 +84,9 @@ const Chart = ({ const theme = useTheme(); const { hideTooltip, showTooltip, tooltipData, tooltipLeft = 0, tooltipTop = 0 } = useTooltip(); - const centerX = width / 2 + 50; - const centerY = height / 2 + 150; - const scale = (width / 1000) * 100; + const centerX = width / 2; + const centerY = height / 2; + const scale = Math.min(width, height) * 0.25; const colorScale = scaleLinear({ domain: [Math.min(...data.map((d) => yAccessor(d))), Math.max(...data.map((d) => yAccessor(d)))], diff --git a/packages/lib-components/src/components/data/Table/index.tsx b/packages/lib-components/src/components/data/Table/index.tsx index 2dd25b9c46..c8e25e056d 100644 --- a/packages/lib-components/src/components/data/Table/index.tsx +++ b/packages/lib-components/src/components/data/Table/index.tsx @@ -28,6 +28,7 @@ import { AiOutlinePicRight as TightDensityIcon, AiOutlineRight as ExpandIcon, AiOutlineUp as CollapseIcon, + AiOutlineSearch as SearchIcon, } from 'react-icons/ai'; import { ColumnHeader } from './subcomponents/ColumnHeader'; import { ColumnVisibility } from './subcomponents/ColumnVisibility'; @@ -37,7 +38,8 @@ import { PageSizeSelect } from './subcomponents/Pagination/PageSizeSelect'; import { ColumnFilter, PageOptions } from '../../../hooks/useTableActions'; import { GenericCheckBox as CheckBox } from '../../inputs/CheckBox/Generic'; -import { useLocalStorage } from '../../../hooks'; +import { useDebounce, useLocalStorage } from '../../../hooks'; +import { UnControlledTextField } from '../../../components'; export interface TableProps { id: string; @@ -58,6 +60,10 @@ export interface TableProps { /// Renders actions that are only visible when one or more rows are selected. renderRowSelectionActions?: () => JSX.Element; + /// When callback is assigned, an input field will appear in the toolbar. + onSearchInputChanged?: (input: string) => void; + searchInputPlaceholder?: string; + title?: string; rowSelection?: { @@ -95,6 +101,8 @@ export function Table({ rowSelection, columnSearch, renderDetailPanel, + onSearchInputChanged, + searchInputPlaceholder = 'Search...', renderToolbar, canExpand = () => false, renderRowSelectionActions, @@ -127,6 +135,15 @@ export function Table({ const [columnPinning, setColumnPinning] = useState({}); const { storedValue: density, setValue: setDensity } = useLocalStorage(`table-density-${id}`, 'tight'); + const [searchInput, setSearchInput] = useState(''); + const debouncedValue = useDebounce(searchInput, 350); + + useEffect(() => { + if (onSearchInputChanged) { + onSearchInputChanged(debouncedValue); + table.resetPagination(); + } + }, [debouncedValue]); // Might because potentially none fullfil the canExpand condtion. const rowsMightExpand = renderDetailPanel ? true : false; @@ -246,6 +263,18 @@ export function Table({ {renderToolbar && renderToolbar()} + {onSearchInputChanged && ( + } + onChange={(e) => setSearchInput(e.currentTarget.value)} + /> + )} {!isLoading && } ({ control={control} name={`filters.${index}.column`} label="Column" - inPortal render={(selectedItems) => { if (selectedItems.length === 0) { return 'Select a column'; @@ -95,7 +94,6 @@ export function FilterRow({ control={control} name={`filters.${index}.operator`} label="Condition" - inPortal render={() => { const operator = currentOperator?.toString(); diff --git a/packages/lib-components/src/components/data/Table/subcomponents/Pagination/PageSizeSelect.tsx b/packages/lib-components/src/components/data/Table/subcomponents/Pagination/PageSizeSelect.tsx index d9d0f13189..520f966cb4 100644 --- a/packages/lib-components/src/components/data/Table/subcomponents/Pagination/PageSizeSelect.tsx +++ b/packages/lib-components/src/components/data/Table/subcomponents/Pagination/PageSizeSelect.tsx @@ -14,7 +14,6 @@ export const PageSizeSelect: FC = ({ onPageSizeChange, page id="page-size" multiple={false} name="pageSize" - inPortal={true} value={pageSize.toString() || '10'} onChange={onPageSizeChange} render={(selectedItems) => { diff --git a/packages/lib-components/src/components/inputs/Date/DateRangePicker/QuickSelect/index.tsx b/packages/lib-components/src/components/inputs/Date/DateRangePicker/QuickSelect/index.tsx index 8322e12f85..3358141cb4 100644 --- a/packages/lib-components/src/components/inputs/Date/DateRangePicker/QuickSelect/index.tsx +++ b/packages/lib-components/src/components/inputs/Date/DateRangePicker/QuickSelect/index.tsx @@ -99,7 +99,6 @@ export const QuickSelect: FC = ({ id }) => { ( @@ -120,7 +119,6 @@ export const QuickSelect: FC = ({ id }) => { ( diff --git a/packages/lib-components/src/components/inputs/Date/subcomponents/RelativePicker/index.tsx b/packages/lib-components/src/components/inputs/Date/subcomponents/RelativePicker/index.tsx index 5ca5533757..571077bded 100644 --- a/packages/lib-components/src/components/inputs/Date/subcomponents/RelativePicker/index.tsx +++ b/packages/lib-components/src/components/inputs/Date/subcomponents/RelativePicker/index.tsx @@ -99,7 +99,6 @@ export const RelativePicker: FC = ({ onChange, id, timeDire = ({ onChange, id, timeDire ( diff --git a/packages/lib-components/src/components/inputs/DurationField/Generic.tsx b/packages/lib-components/src/components/inputs/DurationField/Generic.tsx index 0dfd3098d8..251d7a5d1c 100644 --- a/packages/lib-components/src/components/inputs/DurationField/Generic.tsx +++ b/packages/lib-components/src/components/inputs/DurationField/Generic.tsx @@ -136,7 +136,6 @@ export const GenericDurationField = forwardRef - {prefix && {prefix}} - {icon && cloneElement(icon, { size: 18, className: 'icon' })} - - {type === 'password' && - (showPassword ? ( - { - setShowPassword(false); - }} - size={18} - /> - ) : ( - { - setShowPassword(true); - }} - size={18} - /> - ))} - {suffix && {suffix}} - + + + {prefix && {prefix}} + {icon && cloneElement(icon, { size: 18, className: 'icon' })} + + {type === 'password' && + (showPassword ? ( + { + setShowPassword(false); + }} + size={18} + /> + ) : ( + { + setShowPassword(true); + }} + size={18} + /> + ))} + {suffix && {suffix}} + + {cronOutput && ( + {cronOutput.value} + )} + ); }, ); + +function showHumanReadableCron(cron: string) { + if (cron === '') { + return { value: '', isError: false }; + } + + try { + return { value: cronstrue.toString(cron), isError: false }; + } catch (e) { + return { value: `${e}`, isError: true }; + } +} diff --git a/packages/lib-components/src/components/inputs/TextField/TextField.stories.tsx b/packages/lib-components/src/components/inputs/TextField/TextField.stories.tsx index 72d683603c..f70ea89a93 100644 --- a/packages/lib-components/src/components/inputs/TextField/TextField.stories.tsx +++ b/packages/lib-components/src/components/inputs/TextField/TextField.stories.tsx @@ -48,7 +48,7 @@ export const OnChange: StoryFn = (args) => { return ( <> { ); }; + +export const Cron: StoryFn = () => { + const [value, setValue] = useState(''); + + return ( + setValue(e.target.value)} + placeholder="placeholder" + required={false} + name="name" + value={value} + id="generic-text-field" + hasDescription={false} + disabled={false} + readOnly={false} + /> + ); +}; diff --git a/packages/lib-components/src/components/inputs/TextField/style.ts b/packages/lib-components/src/components/inputs/TextField/style.ts index 0ca453a8a0..858c5a4499 100644 --- a/packages/lib-components/src/components/inputs/TextField/style.ts +++ b/packages/lib-components/src/components/inputs/TextField/style.ts @@ -5,6 +5,8 @@ export const Container = styled.div` position: relative; `; +export const InputWrapper = styled.div``; + export const InputContainer = styled.div` width: 100%; position: relative; @@ -66,6 +68,10 @@ export const SuffixContainer = styled.div<{ hasError: boolean }>` white-space: nowrap; `; +export const HumanReadableCronContainer = styled.div<{ isError: boolean }>` + color: ${({ theme, isError }) => (isError ? theme.colors.error : theme.colors.textAlt)}; +`; + export const Input = styled.input<{ hasIcon: boolean; hasError: boolean; diff --git a/packages/lib-components/src/components/inputs/TextField/util.ts b/packages/lib-components/src/components/inputs/TextField/util.ts index b4a0c802a0..04311cd922 100644 --- a/packages/lib-components/src/components/inputs/TextField/util.ts +++ b/packages/lib-components/src/components/inputs/TextField/util.ts @@ -3,7 +3,7 @@ import { TextFieldType } from './Generic'; export const getFieldType = (type: TextFieldType, passwordVisible: boolean) => { // we only use the type number to transform the output to number // so that zod is happy - if (passwordVisible || type === 'number') { + if (passwordVisible || type === 'number' || type === 'cron') { return 'text'; } @@ -13,7 +13,7 @@ export const getFieldType = (type: TextFieldType, passwordVisible: boolean) => { type InputModes = 'text' | 'email' | 'search' | 'tel' | 'url' | 'none' | 'numeric' | 'decimal'; export const getInputMode = (type: TextFieldType): InputModes => { - if (type === 'password') return 'text'; + if (type === 'password' || type === 'cron') return 'text'; if (type === 'number') return 'numeric'; return type; }; diff --git a/packages/lib-components/src/components/inputs/selects/SelectField/Controlled.tsx b/packages/lib-components/src/components/inputs/selects/SelectField/Controlled.tsx index b7d41e0cc7..d626d2a09f 100644 --- a/packages/lib-components/src/components/inputs/selects/SelectField/Controlled.tsx +++ b/packages/lib-components/src/components/inputs/selects/SelectField/Controlled.tsx @@ -30,7 +30,6 @@ export const ControlledSelectField: FC & SubComponen control, loading, enableFilter, - inPortal, canClear, } = defaultsApplier(props); @@ -114,7 +113,6 @@ export const ControlledSelectField: FC & SubComponen onFocus={handleOnFocus} render={render} value={field.value} - inPortal={inPortal} > {children} diff --git a/packages/lib-components/src/components/inputs/selects/SelectField/Generic/index.tsx b/packages/lib-components/src/components/inputs/selects/SelectField/Generic/index.tsx index 4c027799d9..0afd169c75 100644 --- a/packages/lib-components/src/components/inputs/selects/SelectField/Generic/index.tsx +++ b/packages/lib-components/src/components/inputs/selects/SelectField/Generic/index.tsx @@ -12,7 +12,7 @@ import { MouseEvent, } from 'react'; import { GroupContainer, GroupLabel } from '../style'; -import { SelectContainer, StyledFloatingOverlay, StyledArrowIcon, SelectButton } from '../../sharedStyle'; +import { SelectContainer, StyledArrowIcon, SelectButton } from '../../sharedStyle'; import { FilterInput } from './FilterInput'; import { AiOutlineClose as ClearIcon } from 'react-icons/ai'; @@ -40,9 +40,6 @@ import { IconButton } from '../../../../../components/'; interface SharedSelectFieldProps { render: (selectedItems: SelectItem[]) => React.ReactNode; enableFilter?: boolean; - /// Rendering in portal will render the selectDropdown independent from its parent container. - /// this is useful when select is rendered in other floating elements with limited space. - inPortal?: boolean; /// When true, The select icon will be replaced by a cross icon to clear the selected value. canClear?: boolean; @@ -85,7 +82,6 @@ export const GenericSelectField: FC & SubComponentTypes hasError, hasDescription, name, - inPortal = false, disabled, enableFilter = false, multiple = false, @@ -116,14 +112,17 @@ export const GenericSelectField: FC & SubComponentTypes size({ apply({ availableHeight, elements, availableWidth }) { const refWidth = elements.reference.getBoundingClientRect().width; + const floatingContentWidth = elements.floating.scrollWidth; Object.assign(elements.floating.style, { // Note: we cannot use the rects.reference.width here because if the referenced item is very small compared to the other options, there will be horizontal overflow. // fit-content isn't the perfect solution either, because if there is no space available it might render outside the viewport. - width: availableWidth < refWidth ? `${availableWidth}px` : `${refWidth}px`, + minWidth: + availableWidth > refWidth ? `${availableWidth}px` : `${Math.max(refWidth, floatingContentWidth)}px`, maxHeight: `${Math.max(150, availableHeight)}px`, }); }, + padding: 10, }), flip({ fallbackStrategy: 'bestFit', @@ -286,14 +285,7 @@ export const GenericSelectField: FC & SubComponentTypes )} - {open && - (!inPortal ? ( - - {renderSelect()} - - ) : ( - {renderSelect()} - ))} + {open && {renderSelect()}} ); }; diff --git a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Controlled.tsx b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Controlled.tsx index 0aed75ecc0..6909a37160 100644 --- a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Controlled.tsx +++ b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Controlled.tsx @@ -26,7 +26,6 @@ export const ControlledSelectQueryField: FC & S name, multiple, control, - inPortal, debounce, isLoadingData, hasNextPage, @@ -83,7 +82,6 @@ export const ControlledSelectQueryField: FC & S multiple={multiple} required={required} size={componentSize} - inPortal={inPortal} onChange={field.onChange} onBlur={handleOnBlur} canClear={canClear} diff --git a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx index c989a50811..e578e60307 100644 --- a/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx +++ b/packages/lib-components/src/components/inputs/selects/SelectQueryField/Generic/index.tsx @@ -16,6 +16,7 @@ import { FloatingPortal, size, useDismiss, + flip, useFloating, useInteractions, useRole, @@ -32,7 +33,7 @@ import { PaginationProps } from '../../../'; /* The SearchField depends on a few things of