From 46249041bb037184444e7065ebb1b2743aba841d Mon Sep 17 00:00:00 2001 From: Caleb McQuaid Date: Mon, 8 Jun 2026 01:05:50 -0400 Subject: [PATCH] Expose db settings (#709) * feat: expose MRT settings as individual GraphQL mutations * feat: add default job sort order for review queues * feat: add org-level settings GraphQL mutations * test: other unassociated test fixes * feat: consolidate settings into single tabbed page * test: add settings/sidebar tests * fix: add constraint to job sort order and cleanup types * fix: one more type fix * fix: failing server check * fix: correct ignore_callback_url null handling * fix: remove defaultJobSortOrder * fix: increase height/width of textarea components in settings * fix: back out textarea width changes * fix: rename Moderator Console -> Review Console * hook up partial items UI to back-end. Ensure we do upsert for settings over updates for old orgs. Cleanup old pages and move graphql to the appropriate tabs * code review changes * copilot code review changes * code review fix --------- Co-authored-by: Juan S. Mrad --- client/eslint/__tests__/customRules.test.js | 16 +- client/package-lock.json | 523 +++++ client/package.json | 1 + client/src/components/Sidebar.test.tsx | 152 ++ client/src/components/Sidebar.tsx | 7 +- client/src/coop-ui/Calendar.test.tsx | 18 +- client/src/coop-ui/Slider.test.tsx | 10 - client/src/coop-ui/Toast.tsx | 4 +- client/src/graphql/generated.ts | 1807 +++++++++++------ client/src/graphql/inputHelpers.test.ts | 14 +- client/src/icons/lni/User/review-console.svg | 6 + client/src/lib/utils.ts | 32 +- client/src/setupTests.ts | 8 +- client/src/webpages/dashboard/Dashboard.tsx | 49 +- .../mrt/ManualReviewAppealSettings.tsx | 219 -- .../rules/rule_form/RuleFormUtils.test.ts | 35 +- client/src/webpages/settings/OrgSettings.tsx | 270 --- client/src/webpages/settings/SSOSettings.tsx | 229 --- .../webpages/settings/SettingsPage.test.tsx | 763 +++++++ client/src/webpages/settings/SettingsPage.tsx | 157 ++ .../src/webpages/settings/tabs/AppealsTab.tsx | 236 +++ .../settings/tabs/OrganizationTab.tsx | 200 ++ .../src/webpages/settings/tabs/OtherTab.tsx | 255 +++ .../settings/tabs/ReviewConsoleTab.tsx | 218 ++ client/src/webpages/settings/tabs/SSOTab.tsx | 254 +++ .../WellnessTab.tsx} | 144 +- docs/development/deployment.md | 4 +- server/graphql/generated.ts | 142 ++ server/graphql/modules/org.ts | 277 ++- .../manualReviewToolService/dbTypes.ts | 4 +- .../manualReviewToolService.test.ts | 40 + .../manualReviewToolService.ts | 36 + .../modules/JobDecisioning.ts | 2 +- .../modules/ManualReviewToolSettings.ts | 65 +- .../orgSettingsService/orgSettingsService.ts | 125 +- server/test/integ/rule-change.integ.test.ts | 1 + 36 files changed, 4791 insertions(+), 1532 deletions(-) create mode 100644 client/src/components/Sidebar.test.tsx create mode 100644 client/src/icons/lni/User/review-console.svg delete mode 100644 client/src/webpages/dashboard/mrt/ManualReviewAppealSettings.tsx delete mode 100644 client/src/webpages/settings/OrgSettings.tsx delete mode 100644 client/src/webpages/settings/SSOSettings.tsx create mode 100644 client/src/webpages/settings/SettingsPage.test.tsx create mode 100644 client/src/webpages/settings/SettingsPage.tsx create mode 100644 client/src/webpages/settings/tabs/AppealsTab.tsx create mode 100644 client/src/webpages/settings/tabs/OrganizationTab.tsx create mode 100644 client/src/webpages/settings/tabs/OtherTab.tsx create mode 100644 client/src/webpages/settings/tabs/ReviewConsoleTab.tsx create mode 100644 client/src/webpages/settings/tabs/SSOTab.tsx rename client/src/webpages/settings/{OrgSafetySettings.tsx => tabs/WellnessTab.tsx} (56%) diff --git a/client/eslint/__tests__/customRules.test.js b/client/eslint/__tests__/customRules.test.js index 6f3ad6f..bdd26c4 100644 --- a/client/eslint/__tests__/customRules.test.js +++ b/client/eslint/__tests__/customRules.test.js @@ -2,23 +2,27 @@ const { Linter } = require('eslint'); const rule = require('../no-casting-in-getFieldValueForRole'); const linter = new Linter(); -linter.defineRule('no-casting-in-getFieldValueForRole', rule); const runLint = (code) => { const messages = linter.verify(code, { + plugins: { + custom: { + rules: { + 'no-casting-in-getFieldValueForRole': rule, + }, + }, + }, rules: { - 'no-casting-in-getFieldValueForRole': 'error', + 'custom/no-casting-in-getFieldValueForRole': 'error', }, - parserOptions: { ecmaVersion: 2015, sourceType: 'module' }, + languageOptions: { ecmaVersion: 2015, sourceType: 'module' }, }); return messages; }; describe('no-casting-in-getFieldValueForRole rule', () => { it('should pass on valid cases', () => { - const validCodes = [ - `getFieldValueForRole(reportedItem, 'displayName')`, - ]; + const validCodes = [`getFieldValueForRole(reportedItem, 'displayName')`]; validCodes.forEach((code) => { expect(runLint(code)).toHaveLength(0); diff --git a/client/package-lock.json b/client/package-lock.json index e5cabba..ec820a9 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -102,6 +102,7 @@ "eslint-plugin-custom-rules": "file:./eslint", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^7.0.1", + "jsdom": "^29.1.1", "postcss": "^8.5.10", "prop-types": "^15.8.1", "source-map-explorer": "^2.5.3", @@ -227,6 +228,57 @@ } } }, + "node_modules/@asamuzakjp/css-color": { + "version": "5.1.11", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-5.1.11.tgz", + "integrity": "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/generational-cache": "^1.0.1", + "@csstools/css-calc": "^3.2.0", + "@csstools/css-color-parser": "^4.1.0", + "@csstools/css-parser-algorithms": "^4.0.0", + "@csstools/css-tokenizer": "^4.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + } + }, + "node_modules/@asamuzakjp/dom-selector": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-7.1.1.tgz", + "integrity": "sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/generational-cache": "^1.0.1", + "@asamuzakjp/nwsapi": "^2.3.9", + "bidi-js": "^1.0.3", + "css-tree": "^3.2.1", + "is-potential-custom-element-name": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + } + }, + "node_modules/@asamuzakjp/generational-cache": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@asamuzakjp/generational-cache/-/generational-cache-1.0.1.tgz", + "integrity": "sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + } + }, + "node_modules/@asamuzakjp/nwsapi": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@asamuzakjp/nwsapi/-/nwsapi-2.3.9.tgz", + "integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@babel/code-frame": { "version": "7.29.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", @@ -555,6 +607,159 @@ "node": ">=6.9.0" } }, + "node_modules/@bramus/specificity": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@bramus/specificity/-/specificity-2.4.2.tgz", + "integrity": "sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "css-tree": "^3.0.0" + }, + "bin": { + "specificity": "bin/cli.js" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.0.2.tgz", + "integrity": "sha512-LMGQLS9EuADloEFkcTBR3BwV/CGHV7zyDxVRtVDTwdI2Ca4it0CCVTT9wCkxSgokjE5Ho41hEPgb8OEUwoXr6Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/@csstools/css-calc": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.2.1.tgz", + "integrity": "sha512-DtdHlgXh5ZkA43cwBcAm+huzgJiwx3ZTWVjBs94kwz2xKqSimDA3lBgCjphYgwgVUMWatSM0pDd8TILB1yrVVg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.0", + "@csstools/css-tokenizer": "^4.0.0" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.1.1.tgz", + "integrity": "sha512-eZ5XOtyhK+mggRafYUWzA0tvaYOFgdY8AkgQiCJF9qNAePnUo/zmsqqYubBBb3sQ8uNUaSKTY9s9klfRaAXL0g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^6.0.2", + "@csstools/css-calc": "^3.2.1" + }, + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.0", + "@csstools/css-tokenizer": "^4.0.0" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.0.tgz", + "integrity": "sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^4.0.0" + } + }, + "node_modules/@csstools/css-syntax-patches-for-csstree": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.5.tgz", + "integrity": "sha512-oNjBvzLq2GPZtJphCjLqXow/cHySHSgtxvKZb7OqSZ/xHgw6NWNhfad+6AB9cLeVm6eA9d/qMll3JdEHjy6M+A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "peerDependencies": { + "css-tree": "^3.2.1" + }, + "peerDependenciesMeta": { + "css-tree": { + "optional": true + } + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.0.tgz", + "integrity": "sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, "node_modules/@ctrl/tinycolor": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.5.0.tgz", @@ -1183,6 +1388,24 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@exodus/bytes": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@exodus/bytes/-/bytes-1.15.1.tgz", + "integrity": "sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@noble/hashes": "^1.8.0 || ^2.0.0" + }, + "peerDependenciesMeta": { + "@noble/hashes": { + "optional": true + } + } + }, "node_modules/@faker-js/faker": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.1.tgz", @@ -5746,6 +5969,16 @@ "node": ">=12.0.0" } }, + "node_modules/bidi-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -6188,6 +6421,20 @@ "tiny-invariant": "^1.0.6" } }, + "node_modules/css-tree": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdn-data": "2.27.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, "node_modules/css-unit-converter": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.2.tgz", @@ -6253,6 +6500,20 @@ "d3-time": "1" } }, + "node_modules/data-urls": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-7.0.0.tgz", + "integrity": "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^16.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + } + }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", @@ -6338,6 +6599,13 @@ } } }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, "node_modules/decimal.js-light": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", @@ -7964,6 +8232,19 @@ "react-is": "^16.7.0" } }, + "node_modules/html-encoding-sniffer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-6.0.0.tgz", + "integrity": "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@exodus/bytes": "^1.6.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + } + }, "node_modules/html-url-attributes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.0.tgz", @@ -8394,6 +8675,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -8818,6 +9106,57 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdom": { + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-29.1.1.tgz", + "integrity": "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^5.1.11", + "@asamuzakjp/dom-selector": "^7.1.1", + "@bramus/specificity": "^2.4.2", + "@csstools/css-syntax-patches-for-csstree": "^1.1.3", + "@exodus/bytes": "^1.15.0", + "css-tree": "^3.2.1", + "data-urls": "^7.0.0", + "decimal.js": "^10.6.0", + "html-encoding-sniffer": "^6.0.0", + "is-potential-custom-element-name": "^1.0.1", + "lru-cache": "^11.3.5", + "parse5": "^8.0.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^6.0.1", + "undici": "^7.25.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^8.0.1", + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^16.0.1", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24.0.0" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/lru-cache": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz", + "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", @@ -9253,6 +9592,13 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdn-data": { + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz", + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", @@ -10182,6 +10528,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz", + "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^8.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-8.0.0.tgz", + "integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -12043,6 +12415,16 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-in-the-middle": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.4.0.tgz", @@ -12264,6 +12646,19 @@ "node": ">=10" } }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, "node_modules/scheduler": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", @@ -13130,6 +13525,13 @@ "node": ">=0.10" } }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, "node_modules/tailwind-merge": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.2.tgz", @@ -13433,6 +13835,26 @@ "@popperjs/core": "^2.9.0" } }, + "node_modules/tldts": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.4.2.tgz", + "integrity": "sha512-kCwffuaH8ntKtygnWe1b4BJKWiCUH30n5KfoTr6IchcXOwR7chAOFJxFrH3vjANafUYrIA4a7SDL+nn7SiR4Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^7.4.2" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.4.2.tgz", + "integrity": "sha512-nwEyF4vl4RSJjwSjBUmOSxc3BFPoIFdlRthJ6e+5v9P3bHNsoD06UjuqMUspqp7vsEZ1beaHi1km+optiE17yA==", + "dev": true, + "license": "MIT" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -13450,6 +13872,32 @@ "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==" }, + "node_modules/tough-cookie": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.0.1.tgz", + "integrity": "sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^7.0.5" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-6.0.0.tgz", + "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", @@ -13699,6 +14147,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.27.1.tgz", + "integrity": "sha512-UDdpiex+mzigiyrXrGbiUaF4HzTNhKbh2vRNFaTMzcqmLIPrZxaCtwo/1TMSuWoM1Xz3WiTo9KdgI3kRqYzJGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/undici-types": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", @@ -15114,11 +15572,34 @@ "license": "MIT", "peer": true }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/web-vitals": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-1.1.2.tgz", "integrity": "sha512-PFMKIY+bRSXlMxVAQ+m2aw9c/ioUYfDgrYot0YUa+/xa0sakubWhSDyxAKwzymvXVdF4CZI71g06W+mqhzu6ig==" }, + "node_modules/webidl-conversions": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.1.tgz", + "integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=20" + } + }, "node_modules/webpack-sources": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", @@ -15135,6 +15616,31 @@ "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==", "dev": true }, + "node_modules/whatwg-mimetype": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz", + "integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/whatwg-url": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-16.0.1.tgz", + "integrity": "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@exodus/bytes": "^1.11.0", + "tr46": "^6.0.0", + "webidl-conversions": "^8.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -15329,6 +15835,23 @@ } } }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/client/package.json b/client/package.json index 019c517..0019c4d 100644 --- a/client/package.json +++ b/client/package.json @@ -109,6 +109,7 @@ "eslint-plugin-custom-rules": "file:./eslint", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^7.0.1", + "jsdom": "^29.1.1", "postcss": "^8.5.10", "prop-types": "^15.8.1", "source-map-explorer": "^2.5.3", diff --git a/client/src/components/Sidebar.test.tsx b/client/src/components/Sidebar.test.tsx new file mode 100644 index 0000000..699d246 --- /dev/null +++ b/client/src/components/Sidebar.test.tsx @@ -0,0 +1,152 @@ +import { TooltipProvider } from '@/coop-ui/Tooltip'; +import { fireEvent, render, screen } from '@testing-library/react'; +import { MemoryRouter } from 'react-router-dom'; + +import '@testing-library/jest-dom/extend-expect'; + +import { GQLUserPermission } from '@/graphql/generated'; +import { vi } from 'vitest'; + +import Sidebar, { type MenuItem } from './Sidebar'; + +const menuItems: MenuItem[] = [ + { + title: 'Overview', + urlPath: 'overview', + requiredPermissions: [], + }, + { + title: 'Review Console', + urlPath: 'manual_review', + requiredPermissions: [], + }, +]; + +const settingsMenuItems: MenuItem[] = [ + { + title: 'Settings', + urlPath: 'settings', + requiredPermissions: [], + subItems: [ + { + title: 'Item Types', + urlPath: 'item_types', + requiredPermissions: [GQLUserPermission.ManageOrg], + }, + { + title: 'Actions', + urlPath: 'actions', + requiredPermissions: [GQLUserPermission.ManageOrg], + }, + { + title: 'Users', + urlPath: 'users', + requiredPermissions: [GQLUserPermission.ManageOrg], + }, + { + title: 'Settings', + urlPath: '', + requiredPermissions: [GQLUserPermission.ManageOrg], + }, + ], + }, +]; + +const allPermissions = [GQLUserPermission.ManageOrg]; + +function renderSidebar( + initialPath = '/dashboard/overview', + selectedMenuItem: string | null = null, + overrides: { + permissions?: GQLUserPermission[]; + } = {}, +) { + const setSelectedMenuItem = vi.fn(); + const logout = vi.fn(); + + const result = render( + + + + + , + ); + + return { ...result, setSelectedMenuItem, logout }; +} + +function getSettingsLink() { + return screen + .getAllByRole('link') + .find((el) => el.getAttribute('href') === '/dashboard/settings'); +} + +describe('Sidebar', () => { + it('renders main menu items and footer links', () => { + renderSidebar(); + expect(screen.getByText('Overview')).toBeInTheDocument(); + expect(screen.getByText('Review Console')).toBeInTheDocument(); + expect(getSettingsLink()).toBeDefined(); + }); + + it('shows settings sub-items when on a settings page', () => { + renderSidebar('/dashboard/settings', 'Settings'); + expect(screen.getByText('Item Types')).toBeVisible(); + expect(screen.getByText('Actions')).toBeVisible(); + expect(screen.getByText('Users')).toBeVisible(); + }); + + it('hides settings sub-items when not on a settings page', () => { + renderSidebar('/dashboard/overview', 'Overview'); + const itemTypes = screen.getByText('Item Types'); + const parent = itemTypes.closest('[class*="overflow-hidden"]'); + expect(parent).toHaveClass('max-h-0'); + }); + + it('highlights gear icon on settings pages but not elsewhere', () => { + const { unmount } = renderSidebar('/dashboard/settings', 'Settings'); + expect(getSettingsLink()!.className).toContain('text-primary'); + unmount(); + + renderSidebar('/dashboard/overview', 'Overview'); + expect(getSettingsLink()!.className).not.toContain('text-primary'); + }); + + it('sets selectedMenuItem to Settings when gear icon is clicked', () => { + const { setSelectedMenuItem } = renderSidebar( + '/dashboard/overview', + 'Overview', + ); + fireEvent.click(getSettingsLink()!); + expect(setSelectedMenuItem).toHaveBeenCalledWith('Settings'); + }); + + describe('path-based menu selection', () => { + it.each([ + ['/dashboard/overview', 'Overview'], + ['/dashboard/settings', 'Settings'], + ['/dashboard/settings/item_types', 'Item Types'], + ['/dashboard/settings/actions', 'Actions'], + ])('%s → %s', (path, expected) => { + const { setSelectedMenuItem } = renderSidebar(path); + expect(setSelectedMenuItem).toHaveBeenCalledWith(expected); + }); + }); + + it('hides gear icon when user lacks ManageOrg permission', () => { + renderSidebar('/dashboard/overview', 'Overview', { permissions: [] }); + expect(getSettingsLink()).toBeUndefined(); + }); + + it('hides sub-items when user lacks permissions', () => { + renderSidebar('/dashboard/settings', 'Settings', { permissions: [] }); + expect(screen.queryByText('Item Types')).not.toBeInTheDocument(); + }); +}); diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx index 5c4276e..2d450a3 100644 --- a/client/src/components/Sidebar.tsx +++ b/client/src/components/Sidebar.tsx @@ -99,7 +99,11 @@ export default function Sidebar(props: SidebarProps) { return; } if (item.subItems) { - items = item.subItems; + if (i === pathParts.length - 1) { + setSelectedMenuItem(item.title); + } else { + items = item.subItems; + } } else { setSelectedMenuItem(item.title); } @@ -118,6 +122,7 @@ export default function Sidebar(props: SidebarProps) { const isSettingsSelected = useMemo( () => + selectedMenuItem === 'Settings' || accessibleSettingsSubItems.some( (item) => item.title === selectedMenuItem, ), diff --git a/client/src/coop-ui/Calendar.test.tsx b/client/src/coop-ui/Calendar.test.tsx index ce1f401..32772c5 100644 --- a/client/src/coop-ui/Calendar.test.tsx +++ b/client/src/coop-ui/Calendar.test.tsx @@ -1,30 +1,28 @@ import { Calendar, CalendarProps } from '@/coop-ui/Calendar'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import * as React from 'react'; import '@testing-library/jest-dom/extend-expect'; +import { vi } from 'vitest'; + describe('Calendar Component', () => { const renderCalendar = (props: CalendarProps) => render(); test('renders calendar with single mode and selected date', () => { - const selectedDate = new Date(); + const selectedDate = new Date(2026, 5, 15); renderCalendar({ mode: 'single', selected: selectedDate, }); - const selectedDay = screen.getByText(selectedDate.getDate().toString()); + const selectedDay = screen.getByText('15'); expect(selectedDay).toHaveAttribute('aria-selected', 'true'); }); test('renders calendar with multiple mode and selected dates', () => { - const selectedDates = [ - new Date(), - new Date(new Date().setDate(new Date().getDate() + 1)), - ]; + const selectedDates = [new Date(2026, 5, 15), new Date(2026, 5, 16)]; renderCalendar({ mode: 'multiple', selected: selectedDates, @@ -37,7 +35,7 @@ describe('Calendar Component', () => { }); test('calls onSelect when a date is clicked in single mode', () => { - const onSelect = jest.fn(); + const onSelect = vi.fn(); renderCalendar({ mode: 'single', onSelect, @@ -51,7 +49,7 @@ describe('Calendar Component', () => { }); test('calls onSelect with multiple dates in multiple mode', () => { - const onSelect = jest.fn(); + const onSelect = vi.fn(); renderCalendar({ mode: 'multiple', onSelect, @@ -68,7 +66,7 @@ describe('Calendar Component', () => { }); test('calls onSelect with a date range in range mode', async () => { - const onSelect = jest.fn(); + const onSelect = vi.fn(); renderCalendar({ mode: 'range', onSelect, diff --git a/client/src/coop-ui/Slider.test.tsx b/client/src/coop-ui/Slider.test.tsx index 989a850..ce20494 100644 --- a/client/src/coop-ui/Slider.test.tsx +++ b/client/src/coop-ui/Slider.test.tsx @@ -5,16 +5,6 @@ import '@testing-library/jest-dom/extend-expect'; import { Slider } from '@/coop-ui/Slider'; -// Mock ResizeObserver which is not available in jsdom -beforeAll(() => { - class ResizeObserverMock { - observe() {} - unobserve() {} - disconnect() {} - } - global.ResizeObserver = ResizeObserverMock as any; -}); - describe('Slider Component', () => { test('renders the slider component', () => { render(); diff --git a/client/src/coop-ui/Toast.tsx b/client/src/coop-ui/Toast.tsx index b24b190..a8aa24f 100644 --- a/client/src/coop-ui/Toast.tsx +++ b/client/src/coop-ui/Toast.tsx @@ -16,11 +16,13 @@ const Toast = ({ ...props }: ToastProps) => { return ( ; readonly updateAction: GQLMutateActionResponse; + readonly updateAllowMultiplePoliciesPerAction: Scalars['Boolean']['output']; readonly updateAppealSettings: GQLAppealSettings; readonly updateContentItemType: GQLMutateContentItemTypeResponse; readonly updateContentRule: GQLUpdateContentRuleResponse; readonly updateExchangeCredentials: Scalars['Boolean']['output']; + readonly updateHasAppealsEnabled: Scalars['Boolean']['output']; + readonly updateHasReportingRulesEnabled: Scalars['Boolean']['output']; readonly updateHashBank: GQLMutateHashBankResponse; + readonly updateHideSkipButtonForNonAdmins: Scalars['Boolean']['output']; + readonly updateIgnoreCallbackUrl: Scalars['Boolean']['output']; readonly updateLocationBank: GQLMutateLocationBankResponse; readonly updateManualReviewQueue: GQLUpdateManualReviewQueueQueueResponse; readonly updateNcmecOrgSettings: GQLUpdateNcmecOrgSettingsResponse; readonly updateOrgInfo: GQLUpdateOrgInfoSuccessResponse; + readonly updatePartialItemsSettings: Scalars['Boolean']['output']; readonly updatePolicy: GQLUpdatePolicyResponse; + readonly updatePreviewJobsViewEnabled: Scalars['Boolean']['output']; readonly updateReportingRule: GQLUpdateReportingRuleResponse; + readonly updateRequiresDecisionReason: Scalars['Boolean']['output']; + readonly updateRequiresPolicyForDecisions: Scalars['Boolean']['output']; readonly updateRole?: Maybe; readonly updateRolePermissions: GQLRole; readonly updateRoutingRule: GQLUpdateRoutingRuleResponse; readonly updateSSOCredentials: Scalars['Boolean']['output']; + readonly updateSamlEnabled: Scalars['Boolean']['output']; readonly updateTextBank: GQLMutateBankResponse; readonly updateThreadItemType: GQLMutateThreadItemTypeResponse; readonly updateUserItemType: GQLMutateUserItemTypeResponse; @@ -2783,6 +2793,10 @@ export type GQLMutationUpdateActionArgs = { input: GQLUpdateActionInput; }; +export type GQLMutationUpdateAllowMultiplePoliciesPerActionArgs = { + enabled: Scalars['Boolean']['input']; +}; + export type GQLMutationUpdateAppealSettingsArgs = { input: GQLAppealSettingsInput; }; @@ -2800,10 +2814,26 @@ export type GQLMutationUpdateExchangeCredentialsArgs = { credentialsJson: Scalars['String']['input']; }; +export type GQLMutationUpdateHasAppealsEnabledArgs = { + enabled: Scalars['Boolean']['input']; +}; + +export type GQLMutationUpdateHasReportingRulesEnabledArgs = { + enabled: Scalars['Boolean']['input']; +}; + export type GQLMutationUpdateHashBankArgs = { input: GQLUpdateHashBankInput; }; +export type GQLMutationUpdateHideSkipButtonForNonAdminsArgs = { + enabled: Scalars['Boolean']['input']; +}; + +export type GQLMutationUpdateIgnoreCallbackUrlArgs = { + url?: InputMaybe; +}; + export type GQLMutationUpdateLocationBankArgs = { input: GQLUpdateLocationBankInput; }; @@ -2820,14 +2850,30 @@ export type GQLMutationUpdateOrgInfoArgs = { input: GQLUpdateOrgInfoInput; }; +export type GQLMutationUpdatePartialItemsSettingsArgs = { + input: GQLUpdatePartialItemsSettingsInput; +}; + export type GQLMutationUpdatePolicyArgs = { input: GQLUpdatePolicyInput; }; +export type GQLMutationUpdatePreviewJobsViewEnabledArgs = { + enabled: Scalars['Boolean']['input']; +}; + export type GQLMutationUpdateReportingRuleArgs = { input: GQLUpdateReportingRuleInput; }; +export type GQLMutationUpdateRequiresDecisionReasonArgs = { + enabled: Scalars['Boolean']['input']; +}; + +export type GQLMutationUpdateRequiresPolicyForDecisionsArgs = { + enabled: Scalars['Boolean']['input']; +}; + export type GQLMutationUpdateRoleArgs = { input: GQLUpdateRoleInput; }; @@ -2844,6 +2890,10 @@ export type GQLMutationUpdateSsoCredentialsArgs = { input: GQLUpdateSsoCredentialsInput; }; +export type GQLMutationUpdateSamlEnabledArgs = { + enabled: Scalars['Boolean']['input']; +}; + export type GQLMutationUpdateTextBankArgs = { input: GQLUpdateTextBankInput; }; @@ -3134,6 +3184,7 @@ export type GQLOrg = { readonly hasReportingRulesEnabled: Scalars['Boolean']['output']; readonly hideSkipButtonForNonAdmins: Scalars['Boolean']['output']; readonly id: Scalars['ID']['output']; + readonly ignoreCallbackUrl?: Maybe; readonly integrationConfigs: ReadonlyArray; readonly isDemoOrg: Scalars['Boolean']['output']; readonly itemTypes: ReadonlyArray; @@ -3141,6 +3192,8 @@ export type GQLOrg = { readonly name: Scalars['String']['output']; readonly ncmecReports: ReadonlyArray; readonly onCallAlertEmail?: Maybe; + readonly partialItemsEndpoint?: Maybe; + readonly partialItemsRequestHeaders?: Maybe; readonly pendingInvites: ReadonlyArray; readonly policies: ReadonlyArray; readonly previewJobsViewEnabled: Scalars['Boolean']['output']; @@ -3150,6 +3203,7 @@ export type GQLOrg = { readonly requiresPolicyForDecisionsInMrt: Scalars['Boolean']['output']; readonly routingRules: ReadonlyArray; readonly rules: ReadonlyArray; + readonly samlEnabled: Scalars['Boolean']['output']; readonly signals: ReadonlyArray; readonly ssoCert?: Maybe; readonly ssoUrl?: Maybe; @@ -4688,6 +4742,13 @@ export type GQLUpdateOrgInfoSuccessResponse = { readonly _?: Maybe; }; +export type GQLUpdatePartialItemsSettingsInput = { + readonly partialItemsEndpoint?: InputMaybe; + readonly partialItemsRequestHeaders?: InputMaybe< + Scalars['JSONObject']['input'] + >; +}; + export type GQLUpdatePolicyInput = { readonly applyUserStrikeCountConfigToChildren?: InputMaybe< Scalars['Boolean']['input'] @@ -9555,36 +9616,6 @@ export type GQLGetAverageTimeToReviewQuery = { }> | null; }; -export type GQLAppealSettingsQueryVariables = Exact<{ [key: string]: never }>; - -export type GQLAppealSettingsQuery = { - readonly __typename: 'Query'; - readonly appealSettings?: { - readonly __typename: 'AppealSettings'; - readonly appealsCallbackUrl?: string | null; - readonly appealsCallbackHeaders?: JsonObject | null; - readonly appealsCallbackBody?: JsonObject | null; - } | null; - readonly me?: { - readonly __typename: 'User'; - readonly permissions: ReadonlyArray; - } | null; -}; - -export type GQLUpdateAppealSettingsMutationVariables = Exact<{ - input: GQLAppealSettingsInput; -}>; - -export type GQLUpdateAppealSettingsMutation = { - readonly __typename: 'Mutation'; - readonly updateAppealSettings: { - readonly __typename: 'AppealSettings'; - readonly appealsCallbackUrl?: string | null; - readonly appealsCallbackHeaders?: JsonObject | null; - readonly appealsCallbackBody?: JsonObject | null; - }; -}; - export type GQLGetDecisionsTableQueryVariables = Exact<{ input: GQLGetDecisionCountsTableInput; }>; @@ -24623,70 +24654,6 @@ export type GQLUpdateNcmecOrgSettingsMutation = { }; }; -export type GQLOrgDefaultSafetySettingsQueryVariables = Exact<{ - [key: string]: never; -}>; - -export type GQLOrgDefaultSafetySettingsQuery = { - readonly __typename: 'Query'; - readonly me?: { - readonly __typename: 'User'; - readonly permissions: ReadonlyArray; - } | null; - readonly myOrg?: { - readonly __typename: 'Org'; - readonly defaultInterfacePreferences: { - readonly __typename: 'UserInterfacePreferences'; - readonly moderatorSafetyMuteVideo: boolean; - readonly moderatorSafetyGrayscale: boolean; - readonly moderatorSafetyBlurLevel: number; - }; - } | null; -}; - -export type GQLSetOrgDefaultSafetySettingsMutationVariables = Exact<{ - orgDefaultSafetySettings: GQLModeratorSafetySettingsInput; -}>; - -export type GQLSetOrgDefaultSafetySettingsMutation = { - readonly __typename: 'Mutation'; - readonly setOrgDefaultSafetySettings?: { - readonly __typename: 'SetModeratorSafetySettingsSuccessResponse'; - readonly _?: boolean | null; - } | null; -}; - -export type GQLOrgSettingsQueryVariables = Exact<{ [key: string]: never }>; - -export type GQLOrgSettingsQuery = { - readonly __typename: 'Query'; - readonly myOrg?: { - readonly __typename: 'Org'; - readonly id: string; - readonly name: string; - readonly email: string; - readonly websiteUrl: string; - readonly onCallAlertEmail?: string | null; - } | null; - readonly me?: { - readonly __typename: 'User'; - readonly id: string; - readonly permissions: ReadonlyArray; - } | null; -}; - -export type GQLUpdateOrgInfoMutationVariables = Exact<{ - input: GQLUpdateOrgInfoInput; -}>; - -export type GQLUpdateOrgInfoMutation = { - readonly __typename: 'Mutation'; - readonly updateOrgInfo: { - readonly __typename: 'UpdateOrgInfoSuccessResponse'; - readonly _?: boolean | null; - }; -}; - export type GQLPermissionGroupsQueryVariables = Exact<{ [key: string]: never }>; export type GQLPermissionGroupsQuery = { @@ -24743,24 +24710,178 @@ export type GQLRenameRoleMutation = { }; }; -export type GQLGetSsoCredentialsQueryVariables = Exact<{ +export type GQLDeploymentSettingsQueryVariables = Exact<{ [key: string]: never; }>; -export type GQLGetSsoCredentialsQuery = { +export type GQLDeploymentSettingsQuery = { readonly __typename: 'Query'; readonly me?: { readonly __typename: 'User'; + readonly id: string; readonly permissions: ReadonlyArray; } | null; readonly myOrg?: { readonly __typename: 'Org'; readonly id: string; + readonly hasAppealsEnabled: boolean; + readonly hasReportingRulesEnabled: boolean; + readonly allowMultiplePoliciesPerAction: boolean; + readonly requiresPolicyForDecisionsInMrt: boolean; + readonly requiresDecisionReasonInMrt: boolean; + readonly previewJobsViewEnabled: boolean; + readonly hideSkipButtonForNonAdmins: boolean; + readonly userStrikeTTL: number; + readonly samlEnabled: boolean; readonly ssoUrl?: string | null; readonly ssoCert?: string | null; + readonly ignoreCallbackUrl?: string | null; + readonly partialItemsEndpoint?: string | null; + readonly partialItemsRequestHeaders?: JsonObject | null; + } | null; + readonly appealSettings?: { + readonly __typename: 'AppealSettings'; + readonly appealsCallbackUrl?: string | null; + readonly appealsCallbackHeaders?: JsonObject | null; + readonly appealsCallbackBody?: JsonObject | null; + } | null; +}; + +export type GQLUpdateHasAppealsEnabledMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdateHasAppealsEnabledMutation = { + readonly __typename: 'Mutation'; + readonly updateHasAppealsEnabled: boolean; +}; + +export type GQLUpdateHasReportingRulesEnabledMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdateHasReportingRulesEnabledMutation = { + readonly __typename: 'Mutation'; + readonly updateHasReportingRulesEnabled: boolean; +}; + +export type GQLUpdateAllowMultiplePoliciesPerActionMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdateAllowMultiplePoliciesPerActionMutation = { + readonly __typename: 'Mutation'; + readonly updateAllowMultiplePoliciesPerAction: boolean; +}; + +export type GQLUpdateSamlEnabledMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdateSamlEnabledMutation = { + readonly __typename: 'Mutation'; + readonly updateSamlEnabled: boolean; +}; + +export type GQLUpdateRequiresPolicyForDecisionsMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdateRequiresPolicyForDecisionsMutation = { + readonly __typename: 'Mutation'; + readonly updateRequiresPolicyForDecisions: boolean; +}; + +export type GQLUpdateRequiresDecisionReasonMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdateRequiresDecisionReasonMutation = { + readonly __typename: 'Mutation'; + readonly updateRequiresDecisionReason: boolean; +}; + +export type GQLUpdateHideSkipButtonForNonAdminsMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdateHideSkipButtonForNonAdminsMutation = { + readonly __typename: 'Mutation'; + readonly updateHideSkipButtonForNonAdmins: boolean; +}; + +export type GQLUpdatePreviewJobsViewEnabledMutationVariables = Exact<{ + enabled: Scalars['Boolean']['input']; +}>; + +export type GQLUpdatePreviewJobsViewEnabledMutation = { + readonly __typename: 'Mutation'; + readonly updatePreviewJobsViewEnabled: boolean; +}; + +export type GQLUpdateIgnoreCallbackUrlMutationVariables = Exact<{ + url?: InputMaybe; +}>; + +export type GQLUpdateIgnoreCallbackUrlMutation = { + readonly __typename: 'Mutation'; + readonly updateIgnoreCallbackUrl: boolean; +}; + +export type GQLUpdateAppealSettingsMutationVariables = Exact<{ + input: GQLAppealSettingsInput; +}>; + +export type GQLUpdateAppealSettingsMutation = { + readonly __typename: 'Mutation'; + readonly updateAppealSettings: { + readonly __typename: 'AppealSettings'; + readonly appealsCallbackUrl?: string | null; + readonly appealsCallbackHeaders?: JsonObject | null; + readonly appealsCallbackBody?: JsonObject | null; + }; +}; + +export type GQLOrgSettingsQueryVariables = Exact<{ [key: string]: never }>; + +export type GQLOrgSettingsQuery = { + readonly __typename: 'Query'; + readonly myOrg?: { + readonly __typename: 'Org'; + readonly id: string; + readonly name: string; + readonly email: string; + readonly websiteUrl: string; + readonly onCallAlertEmail?: string | null; + } | null; + readonly me?: { + readonly __typename: 'User'; + readonly id: string; + readonly permissions: ReadonlyArray; } | null; }; +export type GQLUpdateOrgInfoMutationVariables = Exact<{ + input: GQLUpdateOrgInfoInput; +}>; + +export type GQLUpdateOrgInfoMutation = { + readonly __typename: 'Mutation'; + readonly updateOrgInfo: { + readonly __typename: 'UpdateOrgInfoSuccessResponse'; + readonly _?: boolean | null; + }; +}; + +export type GQLUpdatePartialItemsSettingsMutationVariables = Exact<{ + input: GQLUpdatePartialItemsSettingsInput; +}>; + +export type GQLUpdatePartialItemsSettingsMutation = { + readonly __typename: 'Mutation'; + readonly updatePartialItemsSettings: boolean; +}; + export type GQLUpdateSsoCredentialsMutationVariables = Exact<{ input: GQLUpdateSsoCredentialsInput; }>; @@ -24770,6 +24891,39 @@ export type GQLUpdateSsoCredentialsMutation = { readonly updateSSOCredentials: boolean; }; +export type GQLOrgDefaultSafetySettingsQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type GQLOrgDefaultSafetySettingsQuery = { + readonly __typename: 'Query'; + readonly me?: { + readonly __typename: 'User'; + readonly permissions: ReadonlyArray; + } | null; + readonly myOrg?: { + readonly __typename: 'Org'; + readonly defaultInterfacePreferences: { + readonly __typename: 'UserInterfacePreferences'; + readonly moderatorSafetyMuteVideo: boolean; + readonly moderatorSafetyGrayscale: boolean; + readonly moderatorSafetyBlurLevel: number; + }; + } | null; +}; + +export type GQLSetOrgDefaultSafetySettingsMutationVariables = Exact<{ + orgDefaultSafetySettings: GQLModeratorSafetySettingsInput; +}>; + +export type GQLSetOrgDefaultSafetySettingsMutation = { + readonly __typename: 'Mutation'; + readonly setOrgDefaultSafetySettings?: { + readonly __typename: 'SetModeratorSafetySettingsSuccessResponse'; + readonly _?: boolean | null; + } | null; +}; + export const GQLCustomActionFragmentFragmentDoc = gql` fragment CustomActionFragment on CustomAction { id @@ -31827,161 +31981,6 @@ export type GQLGetAverageTimeToReviewQueryResult = Apollo.QueryResult< GQLGetAverageTimeToReviewQuery, GQLGetAverageTimeToReviewQueryVariables >; -export const GQLAppealSettingsDocument = gql` - query AppealSettings { - appealSettings { - appealsCallbackUrl - appealsCallbackHeaders - appealsCallbackBody - } - me { - permissions - } - } -`; - -/** - * __useGQLAppealSettingsQuery__ - * - * To run a query within a React component, call `useGQLAppealSettingsQuery` and pass it any options that fit your needs. - * When your component renders, `useGQLAppealSettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGQLAppealSettingsQuery({ - * variables: { - * }, - * }); - */ -export function useGQLAppealSettingsQuery( - baseOptions?: Apollo.QueryHookOptions< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >(GQLAppealSettingsDocument, options); -} -export function useGQLAppealSettingsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >(GQLAppealSettingsDocument, options); -} -// @ts-ignore -export function useGQLAppealSettingsSuspenseQuery( - baseOptions?: Apollo.SuspenseQueryHookOptions< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >, -): Apollo.UseSuspenseQueryResult< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables ->; -export function useGQLAppealSettingsSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >, -): Apollo.UseSuspenseQueryResult< - GQLAppealSettingsQuery | undefined, - GQLAppealSettingsQueryVariables ->; -export function useGQLAppealSettingsSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >, -) { - const options = - baseOptions === Apollo.skipToken - ? baseOptions - : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables - >(GQLAppealSettingsDocument, options); -} -export type GQLAppealSettingsQueryHookResult = ReturnType< - typeof useGQLAppealSettingsQuery ->; -export type GQLAppealSettingsLazyQueryHookResult = ReturnType< - typeof useGQLAppealSettingsLazyQuery ->; -export type GQLAppealSettingsSuspenseQueryHookResult = ReturnType< - typeof useGQLAppealSettingsSuspenseQuery ->; -export type GQLAppealSettingsQueryResult = Apollo.QueryResult< - GQLAppealSettingsQuery, - GQLAppealSettingsQueryVariables ->; -export const GQLUpdateAppealSettingsDocument = gql` - mutation UpdateAppealSettings($input: AppealSettingsInput!) { - updateAppealSettings(input: $input) { - appealsCallbackUrl - appealsCallbackHeaders - appealsCallbackBody - } - } -`; -export type GQLUpdateAppealSettingsMutationFn = Apollo.MutationFunction< - GQLUpdateAppealSettingsMutation, - GQLUpdateAppealSettingsMutationVariables ->; - -/** - * __useGQLUpdateAppealSettingsMutation__ - * - * To run a mutation, you first call `useGQLUpdateAppealSettingsMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useGQLUpdateAppealSettingsMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [gqlUpdateAppealSettingsMutation, { data, loading, error }] = useGQLUpdateAppealSettingsMutation({ - * variables: { - * input: // value for 'input' - * }, - * }); - */ -export function useGQLUpdateAppealSettingsMutation( - baseOptions?: Apollo.MutationHookOptions< - GQLUpdateAppealSettingsMutation, - GQLUpdateAppealSettingsMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - GQLUpdateAppealSettingsMutation, - GQLUpdateAppealSettingsMutationVariables - >(GQLUpdateAppealSettingsDocument, options); -} -export type GQLUpdateAppealSettingsMutationHookResult = ReturnType< - typeof useGQLUpdateAppealSettingsMutation ->; -export type GQLUpdateAppealSettingsMutationResult = - Apollo.MutationResult; -export type GQLUpdateAppealSettingsMutationOptions = Apollo.BaseMutationOptions< - GQLUpdateAppealSettingsMutation, - GQLUpdateAppealSettingsMutationVariables ->; export const GQLGetDecisionsTableDocument = gql` query getDecisionsTable($input: GetDecisionCountsTableInput!) { getDecisionsTable(input: $input) { @@ -43421,322 +43420,6 @@ export type GQLUpdateNcmecOrgSettingsMutationOptions = GQLUpdateNcmecOrgSettingsMutation, GQLUpdateNcmecOrgSettingsMutationVariables >; -export const GQLOrgDefaultSafetySettingsDocument = gql` - query OrgDefaultSafetySettings { - me { - permissions - } - myOrg { - defaultInterfacePreferences { - moderatorSafetyMuteVideo - moderatorSafetyGrayscale - moderatorSafetyBlurLevel - } - } - } -`; - -/** - * __useGQLOrgDefaultSafetySettingsQuery__ - * - * To run a query within a React component, call `useGQLOrgDefaultSafetySettingsQuery` and pass it any options that fit your needs. - * When your component renders, `useGQLOrgDefaultSafetySettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGQLOrgDefaultSafetySettingsQuery({ - * variables: { - * }, - * }); - */ -export function useGQLOrgDefaultSafetySettingsQuery( - baseOptions?: Apollo.QueryHookOptions< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >(GQLOrgDefaultSafetySettingsDocument, options); -} -export function useGQLOrgDefaultSafetySettingsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >(GQLOrgDefaultSafetySettingsDocument, options); -} -// @ts-ignore -export function useGQLOrgDefaultSafetySettingsSuspenseQuery( - baseOptions?: Apollo.SuspenseQueryHookOptions< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >, -): Apollo.UseSuspenseQueryResult< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables ->; -export function useGQLOrgDefaultSafetySettingsSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >, -): Apollo.UseSuspenseQueryResult< - GQLOrgDefaultSafetySettingsQuery | undefined, - GQLOrgDefaultSafetySettingsQueryVariables ->; -export function useGQLOrgDefaultSafetySettingsSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >, -) { - const options = - baseOptions === Apollo.skipToken - ? baseOptions - : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables - >(GQLOrgDefaultSafetySettingsDocument, options); -} -export type GQLOrgDefaultSafetySettingsQueryHookResult = ReturnType< - typeof useGQLOrgDefaultSafetySettingsQuery ->; -export type GQLOrgDefaultSafetySettingsLazyQueryHookResult = ReturnType< - typeof useGQLOrgDefaultSafetySettingsLazyQuery ->; -export type GQLOrgDefaultSafetySettingsSuspenseQueryHookResult = ReturnType< - typeof useGQLOrgDefaultSafetySettingsSuspenseQuery ->; -export type GQLOrgDefaultSafetySettingsQueryResult = Apollo.QueryResult< - GQLOrgDefaultSafetySettingsQuery, - GQLOrgDefaultSafetySettingsQueryVariables ->; -export const GQLSetOrgDefaultSafetySettingsDocument = gql` - mutation SetOrgDefaultSafetySettings( - $orgDefaultSafetySettings: ModeratorSafetySettingsInput! - ) { - setOrgDefaultSafetySettings( - orgDefaultSafetySettings: $orgDefaultSafetySettings - ) { - _ - } - } -`; -export type GQLSetOrgDefaultSafetySettingsMutationFn = Apollo.MutationFunction< - GQLSetOrgDefaultSafetySettingsMutation, - GQLSetOrgDefaultSafetySettingsMutationVariables ->; - -/** - * __useGQLSetOrgDefaultSafetySettingsMutation__ - * - * To run a mutation, you first call `useGQLSetOrgDefaultSafetySettingsMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useGQLSetOrgDefaultSafetySettingsMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [gqlSetOrgDefaultSafetySettingsMutation, { data, loading, error }] = useGQLSetOrgDefaultSafetySettingsMutation({ - * variables: { - * orgDefaultSafetySettings: // value for 'orgDefaultSafetySettings' - * }, - * }); - */ -export function useGQLSetOrgDefaultSafetySettingsMutation( - baseOptions?: Apollo.MutationHookOptions< - GQLSetOrgDefaultSafetySettingsMutation, - GQLSetOrgDefaultSafetySettingsMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - GQLSetOrgDefaultSafetySettingsMutation, - GQLSetOrgDefaultSafetySettingsMutationVariables - >(GQLSetOrgDefaultSafetySettingsDocument, options); -} -export type GQLSetOrgDefaultSafetySettingsMutationHookResult = ReturnType< - typeof useGQLSetOrgDefaultSafetySettingsMutation ->; -export type GQLSetOrgDefaultSafetySettingsMutationResult = - Apollo.MutationResult; -export type GQLSetOrgDefaultSafetySettingsMutationOptions = - Apollo.BaseMutationOptions< - GQLSetOrgDefaultSafetySettingsMutation, - GQLSetOrgDefaultSafetySettingsMutationVariables - >; -export const GQLOrgSettingsDocument = gql` - query OrgSettings { - myOrg { - id - name - email - websiteUrl - onCallAlertEmail - } - me { - id - permissions - } - } -`; - -/** - * __useGQLOrgSettingsQuery__ - * - * To run a query within a React component, call `useGQLOrgSettingsQuery` and pass it any options that fit your needs. - * When your component renders, `useGQLOrgSettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGQLOrgSettingsQuery({ - * variables: { - * }, - * }); - */ -export function useGQLOrgSettingsQuery( - baseOptions?: Apollo.QueryHookOptions< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery( - GQLOrgSettingsDocument, - options, - ); -} -export function useGQLOrgSettingsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery( - GQLOrgSettingsDocument, - options, - ); -} -// @ts-ignore -export function useGQLOrgSettingsSuspenseQuery( - baseOptions?: Apollo.SuspenseQueryHookOptions< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables - >, -): Apollo.UseSuspenseQueryResult< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables ->; -export function useGQLOrgSettingsSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables - >, -): Apollo.UseSuspenseQueryResult< - GQLOrgSettingsQuery | undefined, - GQLOrgSettingsQueryVariables ->; -export function useGQLOrgSettingsSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables - >, -) { - const options = - baseOptions === Apollo.skipToken - ? baseOptions - : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables - >(GQLOrgSettingsDocument, options); -} -export type GQLOrgSettingsQueryHookResult = ReturnType< - typeof useGQLOrgSettingsQuery ->; -export type GQLOrgSettingsLazyQueryHookResult = ReturnType< - typeof useGQLOrgSettingsLazyQuery ->; -export type GQLOrgSettingsSuspenseQueryHookResult = ReturnType< - typeof useGQLOrgSettingsSuspenseQuery ->; -export type GQLOrgSettingsQueryResult = Apollo.QueryResult< - GQLOrgSettingsQuery, - GQLOrgSettingsQueryVariables ->; -export const GQLUpdateOrgInfoDocument = gql` - mutation UpdateOrgInfo($input: UpdateOrgInfoInput!) { - updateOrgInfo(input: $input) { - _ - } - } -`; -export type GQLUpdateOrgInfoMutationFn = Apollo.MutationFunction< - GQLUpdateOrgInfoMutation, - GQLUpdateOrgInfoMutationVariables ->; - -/** - * __useGQLUpdateOrgInfoMutation__ - * - * To run a mutation, you first call `useGQLUpdateOrgInfoMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useGQLUpdateOrgInfoMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [gqlUpdateOrgInfoMutation, { data, loading, error }] = useGQLUpdateOrgInfoMutation({ - * variables: { - * input: // value for 'input' - * }, - * }); - */ -export function useGQLUpdateOrgInfoMutation( - baseOptions?: Apollo.MutationHookOptions< - GQLUpdateOrgInfoMutation, - GQLUpdateOrgInfoMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - GQLUpdateOrgInfoMutation, - GQLUpdateOrgInfoMutationVariables - >(GQLUpdateOrgInfoDocument, options); -} -export type GQLUpdateOrgInfoMutationHookResult = ReturnType< - typeof useGQLUpdateOrgInfoMutation ->; -export type GQLUpdateOrgInfoMutationResult = - Apollo.MutationResult; -export type GQLUpdateOrgInfoMutationOptions = Apollo.BaseMutationOptions< - GQLUpdateOrgInfoMutation, - GQLUpdateOrgInfoMutationVariables ->; export const GQLPermissionGroupsDocument = gql` query PermissionGroups { permissionGroups { @@ -43957,85 +43640,704 @@ export type GQLRenameRoleMutationOptions = Apollo.BaseMutationOptions< GQLRenameRoleMutation, GQLRenameRoleMutationVariables >; -export const GQLGetSsoCredentialsDocument = gql` - query GetSSOCredentials { +export const GQLDeploymentSettingsDocument = gql` + query DeploymentSettings { me { + id permissions } myOrg { id + hasAppealsEnabled + hasReportingRulesEnabled + allowMultiplePoliciesPerAction + requiresPolicyForDecisionsInMrt + requiresDecisionReasonInMrt + previewJobsViewEnabled + hideSkipButtonForNonAdmins + userStrikeTTL + samlEnabled ssoUrl ssoCert + ignoreCallbackUrl + partialItemsEndpoint + partialItemsRequestHeaders + } + appealSettings { + appealsCallbackUrl + appealsCallbackHeaders + appealsCallbackBody } } `; /** - * __useGQLGetSsoCredentialsQuery__ + * __useGQLDeploymentSettingsQuery__ * - * To run a query within a React component, call `useGQLGetSsoCredentialsQuery` and pass it any options that fit your needs. - * When your component renders, `useGQLGetSsoCredentialsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useGQLDeploymentSettingsQuery` and pass it any options that fit your needs. + * When your component renders, `useGQLDeploymentSettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useGQLGetSsoCredentialsQuery({ + * const { data, loading, error } = useGQLDeploymentSettingsQuery({ * variables: { * }, * }); */ -export function useGQLGetSsoCredentialsQuery( +export function useGQLDeploymentSettingsQuery( baseOptions?: Apollo.QueryHookOptions< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables >, ) { const options = { ...defaultOptions, ...baseOptions }; return Apollo.useQuery< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables - >(GQLGetSsoCredentialsDocument, options); + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables + >(GQLDeploymentSettingsDocument, options); } -export function useGQLGetSsoCredentialsLazyQuery( +export function useGQLDeploymentSettingsLazyQuery( baseOptions?: Apollo.LazyQueryHookOptions< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables >, ) { const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables - >(GQLGetSsoCredentialsDocument, options); + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables + >(GQLDeploymentSettingsDocument, options); +} +// @ts-ignore +export function useGQLDeploymentSettingsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables +>; +export function useGQLDeploymentSettingsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + GQLDeploymentSettingsQuery | undefined, + GQLDeploymentSettingsQueryVariables +>; +export function useGQLDeploymentSettingsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables + >, +) { + const options = + baseOptions === Apollo.skipToken + ? baseOptions + : { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables + >(GQLDeploymentSettingsDocument, options); +} +export type GQLDeploymentSettingsQueryHookResult = ReturnType< + typeof useGQLDeploymentSettingsQuery +>; +export type GQLDeploymentSettingsLazyQueryHookResult = ReturnType< + typeof useGQLDeploymentSettingsLazyQuery +>; +export type GQLDeploymentSettingsSuspenseQueryHookResult = ReturnType< + typeof useGQLDeploymentSettingsSuspenseQuery +>; +export type GQLDeploymentSettingsQueryResult = Apollo.QueryResult< + GQLDeploymentSettingsQuery, + GQLDeploymentSettingsQueryVariables +>; +export const GQLUpdateHasAppealsEnabledDocument = gql` + mutation UpdateHasAppealsEnabled($enabled: Boolean!) { + updateHasAppealsEnabled(enabled: $enabled) + } +`; +export type GQLUpdateHasAppealsEnabledMutationFn = Apollo.MutationFunction< + GQLUpdateHasAppealsEnabledMutation, + GQLUpdateHasAppealsEnabledMutationVariables +>; + +/** + * __useGQLUpdateHasAppealsEnabledMutation__ + * + * To run a mutation, you first call `useGQLUpdateHasAppealsEnabledMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateHasAppealsEnabledMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateHasAppealsEnabledMutation, { data, loading, error }] = useGQLUpdateHasAppealsEnabledMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdateHasAppealsEnabledMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateHasAppealsEnabledMutation, + GQLUpdateHasAppealsEnabledMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateHasAppealsEnabledMutation, + GQLUpdateHasAppealsEnabledMutationVariables + >(GQLUpdateHasAppealsEnabledDocument, options); +} +export type GQLUpdateHasAppealsEnabledMutationHookResult = ReturnType< + typeof useGQLUpdateHasAppealsEnabledMutation +>; +export type GQLUpdateHasAppealsEnabledMutationResult = + Apollo.MutationResult; +export type GQLUpdateHasAppealsEnabledMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdateHasAppealsEnabledMutation, + GQLUpdateHasAppealsEnabledMutationVariables + >; +export const GQLUpdateHasReportingRulesEnabledDocument = gql` + mutation UpdateHasReportingRulesEnabled($enabled: Boolean!) { + updateHasReportingRulesEnabled(enabled: $enabled) + } +`; +export type GQLUpdateHasReportingRulesEnabledMutationFn = + Apollo.MutationFunction< + GQLUpdateHasReportingRulesEnabledMutation, + GQLUpdateHasReportingRulesEnabledMutationVariables + >; + +/** + * __useGQLUpdateHasReportingRulesEnabledMutation__ + * + * To run a mutation, you first call `useGQLUpdateHasReportingRulesEnabledMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateHasReportingRulesEnabledMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateHasReportingRulesEnabledMutation, { data, loading, error }] = useGQLUpdateHasReportingRulesEnabledMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdateHasReportingRulesEnabledMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateHasReportingRulesEnabledMutation, + GQLUpdateHasReportingRulesEnabledMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateHasReportingRulesEnabledMutation, + GQLUpdateHasReportingRulesEnabledMutationVariables + >(GQLUpdateHasReportingRulesEnabledDocument, options); +} +export type GQLUpdateHasReportingRulesEnabledMutationHookResult = ReturnType< + typeof useGQLUpdateHasReportingRulesEnabledMutation +>; +export type GQLUpdateHasReportingRulesEnabledMutationResult = + Apollo.MutationResult; +export type GQLUpdateHasReportingRulesEnabledMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdateHasReportingRulesEnabledMutation, + GQLUpdateHasReportingRulesEnabledMutationVariables + >; +export const GQLUpdateAllowMultiplePoliciesPerActionDocument = gql` + mutation UpdateAllowMultiplePoliciesPerAction($enabled: Boolean!) { + updateAllowMultiplePoliciesPerAction(enabled: $enabled) + } +`; +export type GQLUpdateAllowMultiplePoliciesPerActionMutationFn = + Apollo.MutationFunction< + GQLUpdateAllowMultiplePoliciesPerActionMutation, + GQLUpdateAllowMultiplePoliciesPerActionMutationVariables + >; + +/** + * __useGQLUpdateAllowMultiplePoliciesPerActionMutation__ + * + * To run a mutation, you first call `useGQLUpdateAllowMultiplePoliciesPerActionMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateAllowMultiplePoliciesPerActionMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateAllowMultiplePoliciesPerActionMutation, { data, loading, error }] = useGQLUpdateAllowMultiplePoliciesPerActionMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdateAllowMultiplePoliciesPerActionMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateAllowMultiplePoliciesPerActionMutation, + GQLUpdateAllowMultiplePoliciesPerActionMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateAllowMultiplePoliciesPerActionMutation, + GQLUpdateAllowMultiplePoliciesPerActionMutationVariables + >(GQLUpdateAllowMultiplePoliciesPerActionDocument, options); +} +export type GQLUpdateAllowMultiplePoliciesPerActionMutationHookResult = + ReturnType; +export type GQLUpdateAllowMultiplePoliciesPerActionMutationResult = + Apollo.MutationResult; +export type GQLUpdateAllowMultiplePoliciesPerActionMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdateAllowMultiplePoliciesPerActionMutation, + GQLUpdateAllowMultiplePoliciesPerActionMutationVariables + >; +export const GQLUpdateSamlEnabledDocument = gql` + mutation UpdateSamlEnabled($enabled: Boolean!) { + updateSamlEnabled(enabled: $enabled) + } +`; +export type GQLUpdateSamlEnabledMutationFn = Apollo.MutationFunction< + GQLUpdateSamlEnabledMutation, + GQLUpdateSamlEnabledMutationVariables +>; + +/** + * __useGQLUpdateSamlEnabledMutation__ + * + * To run a mutation, you first call `useGQLUpdateSamlEnabledMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateSamlEnabledMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateSamlEnabledMutation, { data, loading, error }] = useGQLUpdateSamlEnabledMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdateSamlEnabledMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateSamlEnabledMutation, + GQLUpdateSamlEnabledMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateSamlEnabledMutation, + GQLUpdateSamlEnabledMutationVariables + >(GQLUpdateSamlEnabledDocument, options); +} +export type GQLUpdateSamlEnabledMutationHookResult = ReturnType< + typeof useGQLUpdateSamlEnabledMutation +>; +export type GQLUpdateSamlEnabledMutationResult = + Apollo.MutationResult; +export type GQLUpdateSamlEnabledMutationOptions = Apollo.BaseMutationOptions< + GQLUpdateSamlEnabledMutation, + GQLUpdateSamlEnabledMutationVariables +>; +export const GQLUpdateRequiresPolicyForDecisionsDocument = gql` + mutation UpdateRequiresPolicyForDecisions($enabled: Boolean!) { + updateRequiresPolicyForDecisions(enabled: $enabled) + } +`; +export type GQLUpdateRequiresPolicyForDecisionsMutationFn = + Apollo.MutationFunction< + GQLUpdateRequiresPolicyForDecisionsMutation, + GQLUpdateRequiresPolicyForDecisionsMutationVariables + >; + +/** + * __useGQLUpdateRequiresPolicyForDecisionsMutation__ + * + * To run a mutation, you first call `useGQLUpdateRequiresPolicyForDecisionsMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateRequiresPolicyForDecisionsMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateRequiresPolicyForDecisionsMutation, { data, loading, error }] = useGQLUpdateRequiresPolicyForDecisionsMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdateRequiresPolicyForDecisionsMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateRequiresPolicyForDecisionsMutation, + GQLUpdateRequiresPolicyForDecisionsMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateRequiresPolicyForDecisionsMutation, + GQLUpdateRequiresPolicyForDecisionsMutationVariables + >(GQLUpdateRequiresPolicyForDecisionsDocument, options); +} +export type GQLUpdateRequiresPolicyForDecisionsMutationHookResult = ReturnType< + typeof useGQLUpdateRequiresPolicyForDecisionsMutation +>; +export type GQLUpdateRequiresPolicyForDecisionsMutationResult = + Apollo.MutationResult; +export type GQLUpdateRequiresPolicyForDecisionsMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdateRequiresPolicyForDecisionsMutation, + GQLUpdateRequiresPolicyForDecisionsMutationVariables + >; +export const GQLUpdateRequiresDecisionReasonDocument = gql` + mutation UpdateRequiresDecisionReason($enabled: Boolean!) { + updateRequiresDecisionReason(enabled: $enabled) + } +`; +export type GQLUpdateRequiresDecisionReasonMutationFn = Apollo.MutationFunction< + GQLUpdateRequiresDecisionReasonMutation, + GQLUpdateRequiresDecisionReasonMutationVariables +>; + +/** + * __useGQLUpdateRequiresDecisionReasonMutation__ + * + * To run a mutation, you first call `useGQLUpdateRequiresDecisionReasonMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateRequiresDecisionReasonMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateRequiresDecisionReasonMutation, { data, loading, error }] = useGQLUpdateRequiresDecisionReasonMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdateRequiresDecisionReasonMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateRequiresDecisionReasonMutation, + GQLUpdateRequiresDecisionReasonMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateRequiresDecisionReasonMutation, + GQLUpdateRequiresDecisionReasonMutationVariables + >(GQLUpdateRequiresDecisionReasonDocument, options); +} +export type GQLUpdateRequiresDecisionReasonMutationHookResult = ReturnType< + typeof useGQLUpdateRequiresDecisionReasonMutation +>; +export type GQLUpdateRequiresDecisionReasonMutationResult = + Apollo.MutationResult; +export type GQLUpdateRequiresDecisionReasonMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdateRequiresDecisionReasonMutation, + GQLUpdateRequiresDecisionReasonMutationVariables + >; +export const GQLUpdateHideSkipButtonForNonAdminsDocument = gql` + mutation UpdateHideSkipButtonForNonAdmins($enabled: Boolean!) { + updateHideSkipButtonForNonAdmins(enabled: $enabled) + } +`; +export type GQLUpdateHideSkipButtonForNonAdminsMutationFn = + Apollo.MutationFunction< + GQLUpdateHideSkipButtonForNonAdminsMutation, + GQLUpdateHideSkipButtonForNonAdminsMutationVariables + >; + +/** + * __useGQLUpdateHideSkipButtonForNonAdminsMutation__ + * + * To run a mutation, you first call `useGQLUpdateHideSkipButtonForNonAdminsMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateHideSkipButtonForNonAdminsMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateHideSkipButtonForNonAdminsMutation, { data, loading, error }] = useGQLUpdateHideSkipButtonForNonAdminsMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdateHideSkipButtonForNonAdminsMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateHideSkipButtonForNonAdminsMutation, + GQLUpdateHideSkipButtonForNonAdminsMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateHideSkipButtonForNonAdminsMutation, + GQLUpdateHideSkipButtonForNonAdminsMutationVariables + >(GQLUpdateHideSkipButtonForNonAdminsDocument, options); +} +export type GQLUpdateHideSkipButtonForNonAdminsMutationHookResult = ReturnType< + typeof useGQLUpdateHideSkipButtonForNonAdminsMutation +>; +export type GQLUpdateHideSkipButtonForNonAdminsMutationResult = + Apollo.MutationResult; +export type GQLUpdateHideSkipButtonForNonAdminsMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdateHideSkipButtonForNonAdminsMutation, + GQLUpdateHideSkipButtonForNonAdminsMutationVariables + >; +export const GQLUpdatePreviewJobsViewEnabledDocument = gql` + mutation UpdatePreviewJobsViewEnabled($enabled: Boolean!) { + updatePreviewJobsViewEnabled(enabled: $enabled) + } +`; +export type GQLUpdatePreviewJobsViewEnabledMutationFn = Apollo.MutationFunction< + GQLUpdatePreviewJobsViewEnabledMutation, + GQLUpdatePreviewJobsViewEnabledMutationVariables +>; + +/** + * __useGQLUpdatePreviewJobsViewEnabledMutation__ + * + * To run a mutation, you first call `useGQLUpdatePreviewJobsViewEnabledMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdatePreviewJobsViewEnabledMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdatePreviewJobsViewEnabledMutation, { data, loading, error }] = useGQLUpdatePreviewJobsViewEnabledMutation({ + * variables: { + * enabled: // value for 'enabled' + * }, + * }); + */ +export function useGQLUpdatePreviewJobsViewEnabledMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdatePreviewJobsViewEnabledMutation, + GQLUpdatePreviewJobsViewEnabledMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdatePreviewJobsViewEnabledMutation, + GQLUpdatePreviewJobsViewEnabledMutationVariables + >(GQLUpdatePreviewJobsViewEnabledDocument, options); +} +export type GQLUpdatePreviewJobsViewEnabledMutationHookResult = ReturnType< + typeof useGQLUpdatePreviewJobsViewEnabledMutation +>; +export type GQLUpdatePreviewJobsViewEnabledMutationResult = + Apollo.MutationResult; +export type GQLUpdatePreviewJobsViewEnabledMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdatePreviewJobsViewEnabledMutation, + GQLUpdatePreviewJobsViewEnabledMutationVariables + >; +export const GQLUpdateIgnoreCallbackUrlDocument = gql` + mutation UpdateIgnoreCallbackUrl($url: String) { + updateIgnoreCallbackUrl(url: $url) + } +`; +export type GQLUpdateIgnoreCallbackUrlMutationFn = Apollo.MutationFunction< + GQLUpdateIgnoreCallbackUrlMutation, + GQLUpdateIgnoreCallbackUrlMutationVariables +>; + +/** + * __useGQLUpdateIgnoreCallbackUrlMutation__ + * + * To run a mutation, you first call `useGQLUpdateIgnoreCallbackUrlMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateIgnoreCallbackUrlMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateIgnoreCallbackUrlMutation, { data, loading, error }] = useGQLUpdateIgnoreCallbackUrlMutation({ + * variables: { + * url: // value for 'url' + * }, + * }); + */ +export function useGQLUpdateIgnoreCallbackUrlMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateIgnoreCallbackUrlMutation, + GQLUpdateIgnoreCallbackUrlMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateIgnoreCallbackUrlMutation, + GQLUpdateIgnoreCallbackUrlMutationVariables + >(GQLUpdateIgnoreCallbackUrlDocument, options); +} +export type GQLUpdateIgnoreCallbackUrlMutationHookResult = ReturnType< + typeof useGQLUpdateIgnoreCallbackUrlMutation +>; +export type GQLUpdateIgnoreCallbackUrlMutationResult = + Apollo.MutationResult; +export type GQLUpdateIgnoreCallbackUrlMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdateIgnoreCallbackUrlMutation, + GQLUpdateIgnoreCallbackUrlMutationVariables + >; +export const GQLUpdateAppealSettingsDocument = gql` + mutation UpdateAppealSettings($input: AppealSettingsInput!) { + updateAppealSettings(input: $input) { + appealsCallbackUrl + appealsCallbackHeaders + appealsCallbackBody + } + } +`; +export type GQLUpdateAppealSettingsMutationFn = Apollo.MutationFunction< + GQLUpdateAppealSettingsMutation, + GQLUpdateAppealSettingsMutationVariables +>; + +/** + * __useGQLUpdateAppealSettingsMutation__ + * + * To run a mutation, you first call `useGQLUpdateAppealSettingsMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateAppealSettingsMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateAppealSettingsMutation, { data, loading, error }] = useGQLUpdateAppealSettingsMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useGQLUpdateAppealSettingsMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateAppealSettingsMutation, + GQLUpdateAppealSettingsMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateAppealSettingsMutation, + GQLUpdateAppealSettingsMutationVariables + >(GQLUpdateAppealSettingsDocument, options); +} +export type GQLUpdateAppealSettingsMutationHookResult = ReturnType< + typeof useGQLUpdateAppealSettingsMutation +>; +export type GQLUpdateAppealSettingsMutationResult = + Apollo.MutationResult; +export type GQLUpdateAppealSettingsMutationOptions = Apollo.BaseMutationOptions< + GQLUpdateAppealSettingsMutation, + GQLUpdateAppealSettingsMutationVariables +>; +export const GQLOrgSettingsDocument = gql` + query OrgSettings { + myOrg { + id + name + email + websiteUrl + onCallAlertEmail + } + me { + id + permissions + } + } +`; + +/** + * __useGQLOrgSettingsQuery__ + * + * To run a query within a React component, call `useGQLOrgSettingsQuery` and pass it any options that fit your needs. + * When your component renders, `useGQLOrgSettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGQLOrgSettingsQuery({ + * variables: { + * }, + * }); + */ +export function useGQLOrgSettingsQuery( + baseOptions?: Apollo.QueryHookOptions< + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GQLOrgSettingsDocument, + options, + ); +} +export function useGQLOrgSettingsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + GQLOrgSettingsDocument, + options, + ); } // @ts-ignore -export function useGQLGetSsoCredentialsSuspenseQuery( +export function useGQLOrgSettingsSuspenseQuery( baseOptions?: Apollo.SuspenseQueryHookOptions< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables >, ): Apollo.UseSuspenseQueryResult< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables >; -export function useGQLGetSsoCredentialsSuspenseQuery( +export function useGQLOrgSettingsSuspenseQuery( baseOptions?: | Apollo.SkipToken | Apollo.SuspenseQueryHookOptions< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables >, ): Apollo.UseSuspenseQueryResult< - GQLGetSsoCredentialsQuery | undefined, - GQLGetSsoCredentialsQueryVariables + GQLOrgSettingsQuery | undefined, + GQLOrgSettingsQueryVariables >; -export function useGQLGetSsoCredentialsSuspenseQuery( +export function useGQLOrgSettingsSuspenseQuery( baseOptions?: | Apollo.SkipToken | Apollo.SuspenseQueryHookOptions< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables >, ) { const options = @@ -44043,23 +44345,124 @@ export function useGQLGetSsoCredentialsSuspenseQuery( ? baseOptions : { ...defaultOptions, ...baseOptions }; return Apollo.useSuspenseQuery< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables - >(GQLGetSsoCredentialsDocument, options); + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables + >(GQLOrgSettingsDocument, options); } -export type GQLGetSsoCredentialsQueryHookResult = ReturnType< - typeof useGQLGetSsoCredentialsQuery +export type GQLOrgSettingsQueryHookResult = ReturnType< + typeof useGQLOrgSettingsQuery >; -export type GQLGetSsoCredentialsLazyQueryHookResult = ReturnType< - typeof useGQLGetSsoCredentialsLazyQuery +export type GQLOrgSettingsLazyQueryHookResult = ReturnType< + typeof useGQLOrgSettingsLazyQuery >; -export type GQLGetSsoCredentialsSuspenseQueryHookResult = ReturnType< - typeof useGQLGetSsoCredentialsSuspenseQuery +export type GQLOrgSettingsSuspenseQueryHookResult = ReturnType< + typeof useGQLOrgSettingsSuspenseQuery >; -export type GQLGetSsoCredentialsQueryResult = Apollo.QueryResult< - GQLGetSsoCredentialsQuery, - GQLGetSsoCredentialsQueryVariables +export type GQLOrgSettingsQueryResult = Apollo.QueryResult< + GQLOrgSettingsQuery, + GQLOrgSettingsQueryVariables >; +export const GQLUpdateOrgInfoDocument = gql` + mutation UpdateOrgInfo($input: UpdateOrgInfoInput!) { + updateOrgInfo(input: $input) { + _ + } + } +`; +export type GQLUpdateOrgInfoMutationFn = Apollo.MutationFunction< + GQLUpdateOrgInfoMutation, + GQLUpdateOrgInfoMutationVariables +>; + +/** + * __useGQLUpdateOrgInfoMutation__ + * + * To run a mutation, you first call `useGQLUpdateOrgInfoMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdateOrgInfoMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdateOrgInfoMutation, { data, loading, error }] = useGQLUpdateOrgInfoMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useGQLUpdateOrgInfoMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdateOrgInfoMutation, + GQLUpdateOrgInfoMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdateOrgInfoMutation, + GQLUpdateOrgInfoMutationVariables + >(GQLUpdateOrgInfoDocument, options); +} +export type GQLUpdateOrgInfoMutationHookResult = ReturnType< + typeof useGQLUpdateOrgInfoMutation +>; +export type GQLUpdateOrgInfoMutationResult = + Apollo.MutationResult; +export type GQLUpdateOrgInfoMutationOptions = Apollo.BaseMutationOptions< + GQLUpdateOrgInfoMutation, + GQLUpdateOrgInfoMutationVariables +>; +export const GQLUpdatePartialItemsSettingsDocument = gql` + mutation UpdatePartialItemsSettings( + $input: UpdatePartialItemsSettingsInput! + ) { + updatePartialItemsSettings(input: $input) + } +`; +export type GQLUpdatePartialItemsSettingsMutationFn = Apollo.MutationFunction< + GQLUpdatePartialItemsSettingsMutation, + GQLUpdatePartialItemsSettingsMutationVariables +>; + +/** + * __useGQLUpdatePartialItemsSettingsMutation__ + * + * To run a mutation, you first call `useGQLUpdatePartialItemsSettingsMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLUpdatePartialItemsSettingsMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlUpdatePartialItemsSettingsMutation, { data, loading, error }] = useGQLUpdatePartialItemsSettingsMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useGQLUpdatePartialItemsSettingsMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLUpdatePartialItemsSettingsMutation, + GQLUpdatePartialItemsSettingsMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLUpdatePartialItemsSettingsMutation, + GQLUpdatePartialItemsSettingsMutationVariables + >(GQLUpdatePartialItemsSettingsDocument, options); +} +export type GQLUpdatePartialItemsSettingsMutationHookResult = ReturnType< + typeof useGQLUpdatePartialItemsSettingsMutation +>; +export type GQLUpdatePartialItemsSettingsMutationResult = + Apollo.MutationResult; +export type GQLUpdatePartialItemsSettingsMutationOptions = + Apollo.BaseMutationOptions< + GQLUpdatePartialItemsSettingsMutation, + GQLUpdatePartialItemsSettingsMutationVariables + >; export const GQLUpdateSsoCredentialsDocument = gql` mutation UpdateSSOCredentials($input: UpdateSSOCredentialsInput!) { updateSSOCredentials(input: $input) @@ -44108,6 +44511,166 @@ export type GQLUpdateSsoCredentialsMutationOptions = Apollo.BaseMutationOptions< GQLUpdateSsoCredentialsMutation, GQLUpdateSsoCredentialsMutationVariables >; +export const GQLOrgDefaultSafetySettingsDocument = gql` + query OrgDefaultSafetySettings { + me { + permissions + } + myOrg { + defaultInterfacePreferences { + moderatorSafetyMuteVideo + moderatorSafetyGrayscale + moderatorSafetyBlurLevel + } + } + } +`; + +/** + * __useGQLOrgDefaultSafetySettingsQuery__ + * + * To run a query within a React component, call `useGQLOrgDefaultSafetySettingsQuery` and pass it any options that fit your needs. + * When your component renders, `useGQLOrgDefaultSafetySettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGQLOrgDefaultSafetySettingsQuery({ + * variables: { + * }, + * }); + */ +export function useGQLOrgDefaultSafetySettingsQuery( + baseOptions?: Apollo.QueryHookOptions< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >(GQLOrgDefaultSafetySettingsDocument, options); +} +export function useGQLOrgDefaultSafetySettingsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >(GQLOrgDefaultSafetySettingsDocument, options); +} +// @ts-ignore +export function useGQLOrgDefaultSafetySettingsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables +>; +export function useGQLOrgDefaultSafetySettingsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + GQLOrgDefaultSafetySettingsQuery | undefined, + GQLOrgDefaultSafetySettingsQueryVariables +>; +export function useGQLOrgDefaultSafetySettingsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >, +) { + const options = + baseOptions === Apollo.skipToken + ? baseOptions + : { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables + >(GQLOrgDefaultSafetySettingsDocument, options); +} +export type GQLOrgDefaultSafetySettingsQueryHookResult = ReturnType< + typeof useGQLOrgDefaultSafetySettingsQuery +>; +export type GQLOrgDefaultSafetySettingsLazyQueryHookResult = ReturnType< + typeof useGQLOrgDefaultSafetySettingsLazyQuery +>; +export type GQLOrgDefaultSafetySettingsSuspenseQueryHookResult = ReturnType< + typeof useGQLOrgDefaultSafetySettingsSuspenseQuery +>; +export type GQLOrgDefaultSafetySettingsQueryResult = Apollo.QueryResult< + GQLOrgDefaultSafetySettingsQuery, + GQLOrgDefaultSafetySettingsQueryVariables +>; +export const GQLSetOrgDefaultSafetySettingsDocument = gql` + mutation SetOrgDefaultSafetySettings( + $orgDefaultSafetySettings: ModeratorSafetySettingsInput! + ) { + setOrgDefaultSafetySettings( + orgDefaultSafetySettings: $orgDefaultSafetySettings + ) { + _ + } + } +`; +export type GQLSetOrgDefaultSafetySettingsMutationFn = Apollo.MutationFunction< + GQLSetOrgDefaultSafetySettingsMutation, + GQLSetOrgDefaultSafetySettingsMutationVariables +>; + +/** + * __useGQLSetOrgDefaultSafetySettingsMutation__ + * + * To run a mutation, you first call `useGQLSetOrgDefaultSafetySettingsMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGQLSetOrgDefaultSafetySettingsMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [gqlSetOrgDefaultSafetySettingsMutation, { data, loading, error }] = useGQLSetOrgDefaultSafetySettingsMutation({ + * variables: { + * orgDefaultSafetySettings: // value for 'orgDefaultSafetySettings' + * }, + * }); + */ +export function useGQLSetOrgDefaultSafetySettingsMutation( + baseOptions?: Apollo.MutationHookOptions< + GQLSetOrgDefaultSafetySettingsMutation, + GQLSetOrgDefaultSafetySettingsMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GQLSetOrgDefaultSafetySettingsMutation, + GQLSetOrgDefaultSafetySettingsMutationVariables + >(GQLSetOrgDefaultSafetySettingsDocument, options); +} +export type GQLSetOrgDefaultSafetySettingsMutationHookResult = ReturnType< + typeof useGQLSetOrgDefaultSafetySettingsMutation +>; +export type GQLSetOrgDefaultSafetySettingsMutationResult = + Apollo.MutationResult; +export type GQLSetOrgDefaultSafetySettingsMutationOptions = + Apollo.BaseMutationOptions< + GQLSetOrgDefaultSafetySettingsMutation, + GQLSetOrgDefaultSafetySettingsMutationVariables + >; export const namedOperations = { Query: { ApiAuth: 'ApiAuth', @@ -44148,7 +44711,6 @@ export const namedOperations = { getDecidedJobFromJobId: 'getDecidedJobFromJobId', ManualReviewMetrics: 'ManualReviewMetrics', getAverageTimeToReview: 'getAverageTimeToReview', - AppealSettings: 'AppealSettings', getDecisionsTable: 'getDecisionsTable', QueueFormData: 'QueueFormData', ManualReviewQueue: 'ManualReviewQueue', @@ -44232,10 +44794,10 @@ export const namedOperations = { ManageUsers: 'ManageUsers', HasNcmecReportingEnabled: 'HasNcmecReportingEnabled', NcmecOrgSettings: 'NcmecOrgSettings', - OrgDefaultSafetySettings: 'OrgDefaultSafetySettings', - OrgSettings: 'OrgSettings', PermissionGroups: 'PermissionGroups', - GetSSOCredentials: 'GetSSOCredentials', + DeploymentSettings: 'DeploymentSettings', + OrgSettings: 'OrgSettings', + OrgDefaultSafetySettings: 'OrgDefaultSafetySettings', }, Mutation: { RotateApiKey: 'RotateApiKey', @@ -44269,7 +44831,6 @@ export const namedOperations = { UpdateUserType: 'UpdateUserType', CreateThreadType: 'CreateThreadType', UpdateThreadType: 'UpdateThreadType', - UpdateAppealSettings: 'UpdateAppealSettings', CreateManualReviewQueue: 'CreateManualReviewQueue', UpdateManualReviewQueue: 'UpdateManualReviewQueue', DeleteManualReviewQueue: 'DeleteManualReviewQueue', @@ -44315,11 +44876,23 @@ export const namedOperations = { GeneratePasswordResetToken: 'GeneratePasswordResetToken', InviteUser: 'InviteUser', UpdateNcmecOrgSettings: 'UpdateNcmecOrgSettings', - SetOrgDefaultSafetySettings: 'SetOrgDefaultSafetySettings', - UpdateOrgInfo: 'UpdateOrgInfo', UpdateRolePermissions: 'UpdateRolePermissions', RenameRole: 'RenameRole', + UpdateHasAppealsEnabled: 'UpdateHasAppealsEnabled', + UpdateHasReportingRulesEnabled: 'UpdateHasReportingRulesEnabled', + UpdateAllowMultiplePoliciesPerAction: + 'UpdateAllowMultiplePoliciesPerAction', + UpdateSamlEnabled: 'UpdateSamlEnabled', + UpdateRequiresPolicyForDecisions: 'UpdateRequiresPolicyForDecisions', + UpdateRequiresDecisionReason: 'UpdateRequiresDecisionReason', + UpdateHideSkipButtonForNonAdmins: 'UpdateHideSkipButtonForNonAdmins', + UpdatePreviewJobsViewEnabled: 'UpdatePreviewJobsViewEnabled', + UpdateIgnoreCallbackUrl: 'UpdateIgnoreCallbackUrl', + UpdateAppealSettings: 'UpdateAppealSettings', + UpdateOrgInfo: 'UpdateOrgInfo', + UpdatePartialItemsSettings: 'UpdatePartialItemsSettings', UpdateSSOCredentials: 'UpdateSSOCredentials', + SetOrgDefaultSafetySettings: 'SetOrgDefaultSafetySettings', }, Fragment: { CustomActionFragment: 'CustomActionFragment', diff --git a/client/src/graphql/inputHelpers.test.ts b/client/src/graphql/inputHelpers.test.ts index 8206990..ffcbf31 100644 --- a/client/src/graphql/inputHelpers.test.ts +++ b/client/src/graphql/inputHelpers.test.ts @@ -15,8 +15,8 @@ describe('GraphQL input helpers', () => { }, ); expect(res).toMatchInlineSnapshot(` - Object { - "contentField": Object { + { + "contentField": { "contentTypeId": "abc", "name": "hi", }, @@ -34,8 +34,8 @@ describe('GraphQL input helpers', () => { ); expect(res).toMatchInlineSnapshot(` - Object { - "contentFullObject": Object {}, + { + "contentFullObject": {}, } `); }); @@ -52,9 +52,9 @@ describe('GraphQL input helpers', () => { }, ]), ).toMatchInlineSnapshot(` - Array [ - Object { - "otherKey": Object { + [ + { + "otherKey": { "otherOtherKey": true, }, "someKey": true, diff --git a/client/src/icons/lni/User/review-console.svg b/client/src/icons/lni/User/review-console.svg new file mode 100644 index 0000000..87ce0fe --- /dev/null +++ b/client/src/icons/lni/User/review-console.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/client/src/lib/utils.ts b/client/src/lib/utils.ts index d084cca..13c98ef 100644 --- a/client/src/lib/utils.ts +++ b/client/src/lib/utils.ts @@ -1,6 +1,32 @@ -import { type ClassValue, clsx } from "clsx" -import { twMerge } from "tailwind-merge" +import { clsx, type ClassValue } from 'clsx'; +import { twMerge } from 'tailwind-merge'; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) + return twMerge(clsx(inputs)); +} + +export function isValidUrl(value: string) { + if (!value) return true; + try { + const { protocol } = new URL(value); + return protocol === 'http:' || protocol === 'https:'; + } catch { + return false; + } +} + +export function validateJSON(value: string | undefined) { + if (!value || value.length === 0) { + return true; + } + try { + const parsed = JSON.parse(value); + // These fields map to a GraphQL JSONObject (key-value map), so arrays and + // primitives are not valid even though `typeof [] === 'object'`. + return ( + typeof parsed === 'object' && parsed != null && !Array.isArray(parsed) + ); + } catch { + return false; + } } diff --git a/client/src/setupTests.ts b/client/src/setupTests.ts index 1b93852..ef39deb 100644 --- a/client/src/setupTests.ts +++ b/client/src/setupTests.ts @@ -1,3 +1,9 @@ -import { vi } from 'vitest' +import { vi } from 'vitest'; global.jest = vi as any; + +global.ResizeObserver = class { + observe() {} + unobserve() {} + disconnect() {} +}; diff --git a/client/src/webpages/dashboard/Dashboard.tsx b/client/src/webpages/dashboard/Dashboard.tsx index 75745da..aaf0bb9 100644 --- a/client/src/webpages/dashboard/Dashboard.tsx +++ b/client/src/webpages/dashboard/Dashboard.tsx @@ -325,13 +325,7 @@ export function DashboardRoutes() { }, { path: 'settings/appeal_settings', - handle: { - isUsingLegacyCSS: true, - error: { - buttonTitle: 'Back to Manual Review Queues', - }, - }, - lazy: lazyRoute(async () => import('./mrt/ManualReviewAppealSettings')), + element: , }, // Redirect old Bulk Actioning Tool and Investigation paths @@ -375,8 +369,8 @@ export function DashboardRoutes() { // Settings { path: 'settings', - element: , - handle: { isUsingLegacyCSS: true }, + handle: { isUsingLegacyCSS: false }, + lazy: lazyRoute(async () => import('../settings/SettingsPage')), }, { path: 'settings/item_types', @@ -442,8 +436,7 @@ export function DashboardRoutes() { }, { path: 'settings/org_safety_settings', - handle: { isUsingLegacyCSS: false }, - lazy: lazyRoute(async () => import('../settings/OrgSafetySettings')), + element: , }, { path: 'settings/ncmec', @@ -457,13 +450,15 @@ export function DashboardRoutes() { }, { path: 'settings/sso', - handle: { isUsingLegacyCSS: true }, - lazy: lazyRoute(async () => import('../settings/SSOSettings')), + element: , }, { path: 'settings/organization', - handle: { isUsingLegacyCSS: false }, - lazy: lazyRoute(async () => import('../settings/OrgSettings')), + element: , + }, + { + path: 'settings/deployment', + element: , }, // Account { @@ -640,21 +635,9 @@ export default function Dashboard() { urlPath: 'users', requiredPermissions: [GQLUserPermission.ManageOrg], }, - data?.myOrg?.hasAppealsEnabled - ? { - title: 'Appeal Settings' as const, - urlPath: 'appeal_settings', - requiredPermissions: [], - } - : null, - { - title: 'Wellness' as const, - urlPath: 'org_safety_settings', - requiredPermissions: [GQLUserPermission.ManageOrg], - }, { - title: 'Organization' as const, - urlPath: 'organization', + title: 'Settings' as const, + urlPath: '', requiredPermissions: [GQLUserPermission.ManageOrg], }, { @@ -690,10 +673,12 @@ export default function Dashboard() { return; } if (item.subItems) { - // If the item has subItems, we should continue searching down that path - items = item.subItems; + if (i === pathParts.length - 1) { + setSelectedMenuItem(item.title); + } else { + items = item.subItems; + } } else { - // If the item has no subItems, just return the item's title setSelectedMenuItem(item.title); } } diff --git a/client/src/webpages/dashboard/mrt/ManualReviewAppealSettings.tsx b/client/src/webpages/dashboard/mrt/ManualReviewAppealSettings.tsx deleted file mode 100644 index ca4cae6..0000000 --- a/client/src/webpages/dashboard/mrt/ManualReviewAppealSettings.tsx +++ /dev/null @@ -1,219 +0,0 @@ -import { DOCS_URL } from '@/lib/config'; -import { userHasPermissions } from '@/routing/permissions'; -import { gql } from '@apollo/client'; -import { Input, notification } from 'antd'; -import Link from 'antd/lib/typography/Link'; -import { useEffect, useState } from 'react'; -import { Helmet } from 'react-helmet-async'; - -import FullScreenLoading from '../../../components/common/FullScreenLoading'; -import CoopButton from '../components/CoopButton'; -import FormHeader from '../components/FormHeader'; -import FormSectionHeader from '../components/FormSectionHeader'; - -import { - GQLUserPermission, - useGQLAppealSettingsQuery, - useGQLUpdateAppealSettingsMutation, -} from '../../../graphql/generated'; -import { prettyPrintJsonValue } from '../../../utils/string'; - -gql` - query AppealSettings { - appealSettings { - appealsCallbackUrl - appealsCallbackHeaders - appealsCallbackBody - } - me { - permissions - } - } - - mutation UpdateAppealSettings($input: AppealSettingsInput!) { - updateAppealSettings(input: $input) { - appealsCallbackUrl - appealsCallbackHeaders - appealsCallbackBody - } - } -`; - -export default function ManualReviewAppealSettings() { - const [appealsCallbackUrl, setAppealsCallbackUrl] = useState< - string | undefined - >(undefined); - const [appealsCallbackHeaders, setAppealsCallbackHeaders] = useState< - string | undefined - >(undefined); - const [appealsCallbackBody, setAppealsCallbackBody] = useState< - string | undefined - >(undefined); - - const [notificationApi, notificationContextHolder] = - notification.useNotification(); - - const { loading, data } = useGQLAppealSettingsQuery({ - fetchPolicy: 'network-only', - nextFetchPolicy: 'cache-and-network', - }); - - useEffect(() => { - if (data?.appealSettings != null) { - if (data.appealSettings.appealsCallbackUrl != null) { - setAppealsCallbackUrl(data.appealSettings.appealsCallbackUrl); - } - if (data.appealSettings.appealsCallbackHeaders != null) { - setAppealsCallbackHeaders( - prettyPrintJsonValue(data.appealSettings.appealsCallbackHeaders), - ); - } - if (data.appealSettings.appealsCallbackBody != null) { - setAppealsCallbackBody( - prettyPrintJsonValue(data.appealSettings.appealsCallbackBody), - ); - } - } - }, [data]); - const [updateAppealSettings, { loading: updateLoading }] = - useGQLUpdateAppealSettingsMutation({ - onCompleted: () => - notificationApi.success({ message: 'Settings saved!' }), - onError() { - notificationApi.error({ - message: 'Your settings failed to save. Please try again.', - }); - }, - }); - - if (loading) { - return ; - } - - const canManageOrg = userHasPermissions(data?.me?.permissions, [ - GQLUserPermission.ManageOrg, - ]); - - const onUpdateAppealSettings = async () => - updateAppealSettings({ - variables: { - input: { - appealsCallbackUrl, - appealsCallbackHeaders: JSON.parse(appealsCallbackHeaders ?? '{}'), - appealsCallbackBody: JSON.parse(appealsCallbackBody ?? '{}'), - }, - }, - }); - - const callbackSectionHeader = (content: string) => ( -
{content}
- ); - - const callbackUrlInput = ( -
- - setAppealsCallbackUrl(e.target.value)} - value={appealsCallbackUrl} - /> -
- Note: For each HTTP request we - send to that URL, we will include a JSON body with information about the - appeal. See the{' '} - documentation for more - information. -
- {callbackSectionHeader('Headers (Optional)')} -
- If necessary, you can specify HTTP headers that we will attach to every - request we send to the Callback URL above. For example, if an API key is - required to access your API, you can add it below, in the normal HTTP - header JSON format. -
- setAppealsCallbackHeaders(e.target.value)} - value={appealsCallbackHeaders} - /> - {callbackSectionHeader('Body (Optional)')} -
- If necessary, you can specify HTTP body parameters that we will attach - to every request we send to the Callback URL above. -
- setAppealsCallbackBody(e.target.value)} - value={appealsCallbackBody} - /> -
- ); - - return ( -
- - Appeal Settings - - -
- {callbackUrlInput} - { - if (!canManageOrg) { - return 'You do not have permission to edit appeal settings. Ask your organization administrator for access.'; - } - if (!appealsCallbackUrl) { - return 'The Callback URL is required.'; - } - if (!validateJSON(appealsCallbackHeaders)) { - return 'The Callback Headers must be valid JSON.'; - } - if (!validateJSON(appealsCallbackBody)) { - return 'The Callback Body must be valid JSON.'; - } - - return 'Please fill out all required fields correctly.'; - })()} - disabledTooltipPlacement="top" - onClick={onUpdateAppealSettings} - /> - {notificationContextHolder} -
- ); -} - -const validateJSON = (value: string | undefined) => { - // missing is fine. - if (value == null || value.length === 0) { - return true; - } - - try { - const parsed = JSON.parse(value); - return typeof parsed === 'object' && parsed != null; - } catch (e) { - return false; - } -}; diff --git a/client/src/webpages/dashboard/rules/rule_form/RuleFormUtils.test.ts b/client/src/webpages/dashboard/rules/rule_form/RuleFormUtils.test.ts index 73443fb..9cf2f76 100644 --- a/client/src/webpages/dashboard/rules/rule_form/RuleFormUtils.test.ts +++ b/client/src/webpages/dashboard/rules/rule_form/RuleFormUtils.test.ts @@ -1,3 +1,5 @@ +import { vi } from 'vitest'; + import { GQLConditionConjunction, GQLScalarType, @@ -12,9 +14,10 @@ import { shouldConditionPromptForComparatorAndThreshold, } from './RuleFormUtils'; -jest.mock('./RuleFormUtils', () => { - const origin = jest.requireActual('./RuleFormUtils'); - return { ...origin, getConditionInputScalarType: jest.fn() }; +vi.mock('./RuleFormUtils', async () => { + const origin = + await vi.importActual('./RuleFormUtils'); + return { ...origin, getConditionInputScalarType: vi.fn() }; }); // NB: See docs above shouldConditionPromptForComparatorAndThreshold @@ -73,9 +76,9 @@ describe('Test Rule Form Utils', () => { eligibleSignals: [sampleSignal], }; - (getConditionInputScalarType as jest.Mock).mockReturnValue([ - sampleSignal, - ]); + vi.mocked(getConditionInputScalarType).mockReturnValue( + GQLScalarType.Boolean, + ); expect(shouldConditionPromptForComparatorAndThreshold(condition)).toEqual( false, ); @@ -92,9 +95,9 @@ describe('Test Rule Form Utils', () => { signal: sampleSignal, }; - (getConditionInputScalarType as jest.Mock).mockReturnValue([ - sampleSignal, - ]); + vi.mocked(getConditionInputScalarType).mockReturnValue( + GQLScalarType.Boolean, + ); expect(shouldConditionPromptForComparatorAndThreshold(condition)).toEqual( false, ); @@ -111,17 +114,9 @@ describe('Test Rule Form Utils', () => { signal: sampleSignal, }; - const nonBooleanSignal = { - ...sampleSignal, - outputType: { - __typename: 'ScalarSignalOutputType', - scalarType: GQLScalarType.Number, - }, - }; - - (getConditionInputScalarType as jest.Mock).mockReturnValue([ - nonBooleanSignal, - ]); + vi.mocked(getConditionInputScalarType).mockReturnValue( + GQLScalarType.Number, + ); expect(shouldConditionPromptForComparatorAndThreshold(condition)).toEqual( false, ); diff --git a/client/src/webpages/settings/OrgSettings.tsx b/client/src/webpages/settings/OrgSettings.tsx deleted file mode 100644 index 000d198..0000000 --- a/client/src/webpages/settings/OrgSettings.tsx +++ /dev/null @@ -1,270 +0,0 @@ -import { Button } from '@/coop-ui/Button'; -import { Input } from '@/coop-ui/Input'; -import { Label } from '@/coop-ui/Label'; -import { toast } from '@/coop-ui/Toast'; -import { Heading, Text } from '@/coop-ui/Typography'; -import { gql } from '@apollo/client'; -import { useCallback, useEffect, useState } from 'react'; -import { Helmet } from 'react-helmet-async'; -import { useNavigate } from 'react-router-dom'; - -import FullScreenLoading from '../../components/common/FullScreenLoading'; - -import { - GQLUserPermission, - useGQLOrgSettingsQuery, - useGQLUpdateOrgInfoMutation, -} from '../../graphql/generated'; -import { userHasPermissions } from '../../routing/permissions'; - -gql` - query OrgSettings { - myOrg { - id - name - email - websiteUrl - onCallAlertEmail - } - me { - id - permissions - } - } - - mutation UpdateOrgInfo($input: UpdateOrgInfoInput!) { - updateOrgInfo(input: $input) { - _ - } - } -`; - -export default function OrgSettings() { - const navigate = useNavigate(); - const { data, loading, error } = useGQLOrgSettingsQuery(); - const [updateOrgInfo, { loading: isUpdating }] = useGQLUpdateOrgInfoMutation( - { - onCompleted: () => { - toast.success('Organization information updated successfully'); - }, - onError: (err) => { - const errorMessage = - err.message ?? 'Failed to update organization information'; - toast.error(errorMessage); - }, - }, - ); - - const [name, setName] = useState(''); - const [email, setEmail] = useState(''); - const [websiteUrl, setWebsiteUrl] = useState(''); - const [onCallAlertEmail, setOnCallAlertEmail] = useState(''); - - const [hasChanges, setHasChanges] = useState(false); - - useEffect(() => { - if (data?.myOrg) { - setName(data.myOrg.name); - setEmail(data.myOrg.email); - setWebsiteUrl(data.myOrg.websiteUrl); - setOnCallAlertEmail(data.myOrg.onCallAlertEmail ?? ''); - } - }, [data]); - - useEffect(() => { - if (data?.myOrg) { - const changed = - name !== data.myOrg.name || - email !== data.myOrg.email || - websiteUrl !== data.myOrg.websiteUrl || - onCallAlertEmail !== (data.myOrg.onCallAlertEmail ?? ''); - setHasChanges(changed); - } - }, [name, email, websiteUrl, onCallAlertEmail, data]); - - const handleNameChange = useCallback( - (e: React.ChangeEvent) => { - setName(e.target.value); - }, - [], - ); - - const handleEmailChange = useCallback( - (e: React.ChangeEvent) => { - setEmail(e.target.value); - }, - [], - ); - - const handleWebsiteUrlChange = useCallback( - (e: React.ChangeEvent) => { - setWebsiteUrl(e.target.value); - }, - [], - ); - - const handleOnCallAlertEmailChange = useCallback( - (e: React.ChangeEvent) => { - setOnCallAlertEmail(e.target.value); - }, - [], - ); - - const handleSave = useCallback(async () => { - await updateOrgInfo({ - variables: { - input: { - name, - email, - websiteUrl, - onCallAlertEmail: onCallAlertEmail || null, - }, - }, - refetchQueries: ['OrgSettings'], - }); - }, [name, email, websiteUrl, onCallAlertEmail, updateOrgInfo]); - - const handleCancel = useCallback(() => { - if (data?.myOrg) { - setName(data.myOrg.name); - setEmail(data.myOrg.email); - setWebsiteUrl(data.myOrg.websiteUrl); - setOnCallAlertEmail(data.myOrg.onCallAlertEmail ?? ''); - } - }, [data]); - - if (loading) { - return ; - } - - if (error) { - return
Error loading organization settings
; - } - - const requiredPermissions = [GQLUserPermission.ManageOrg]; - const permissions = data?.me?.permissions; - if (!userHasPermissions(permissions, requiredPermissions)) { - navigate('/dashboard/settings'); - return null; - } - - const isEmailValid = email && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); - const isWebsiteValid = - websiteUrl && /^https?:\/\/.+\..+/.test(websiteUrl); - const isOnCallEmailValid = - !onCallAlertEmail || - /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(onCallAlertEmail); - const isSaveButtonDisabled = - !name?.trim() || - !isEmailValid || - !isWebsiteValid || - !isOnCallEmailValid || - !hasChanges; - - return ( - <> - - Organization Settings - - -
- - Organization Settings - - - Manage your organization's information. Only administrators can edit - these settings. - - -
-
- - - {!name?.trim() && ( - - Organization name is required - - )} -
- -
- - - {email && !isEmailValid && ( - - Please enter a valid email address - - )} -
- -
- - - {websiteUrl && !isWebsiteValid && ( - - Please enter a valid URL (must start with http:// or https://) - - )} -
- -
- - - - Optional email for receiving urgent alerts - - {onCallAlertEmail && !isOnCallEmailValid && ( - - Please enter a valid email address - - )} -
- -
- - -
-
-
- - ); -} - diff --git a/client/src/webpages/settings/SSOSettings.tsx b/client/src/webpages/settings/SSOSettings.tsx deleted file mode 100644 index b62ea5b..0000000 --- a/client/src/webpages/settings/SSOSettings.tsx +++ /dev/null @@ -1,229 +0,0 @@ -import { Button } from '@/coop-ui/Button'; -import { Input } from '@/coop-ui/Input'; -import { Label } from '@/coop-ui/Label'; -import { Textarea } from '@/coop-ui/Textarea'; -import { toast } from '@/coop-ui/Toast'; -import { Tooltip, TooltipContent, TooltipTrigger } from '@/coop-ui/Tooltip'; -import { Heading, Text } from '@/coop-ui/Typography'; -import { HOST_URL } from '@/lib/config'; -import { userHasPermissions } from '@/routing/permissions'; -import { gql } from '@apollo/client'; -import { Clipboard } from 'lucide-react'; -import { useEffect, useState } from 'react'; -import { Helmet } from 'react-helmet-async'; -import { Navigate } from 'react-router-dom'; - -import FullScreenLoading from '@/components/common/FullScreenLoading'; - -import { - GQLUserPermission, - useGQLGetSsoCredentialsQuery, - useGQLUpdateSsoCredentialsMutation, -} from '../../graphql/generated'; - -gql` - query GetSSOCredentials { - me { - permissions - } - myOrg { - id - ssoUrl - ssoCert - } - } - - mutation UpdateSSOCredentials($input: UpdateSSOCredentialsInput!) { - updateSSOCredentials(input: $input) - } -`; - -export default function SSOSettings() { - const [ssoUrl, setSsoUrl] = useState(undefined); - const [ssoCert, setSsoCert] = useState(undefined); - - const { data, loading, error } = useGQLGetSsoCredentialsQuery({ - errorPolicy: 'all', - }); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [updateSSOCredentials, { loading: updateLoading, error: updateError }] = - useGQLUpdateSsoCredentialsMutation(); - - useEffect(() => { - if (data?.myOrg == null) { - return; - } - - if (data.myOrg.ssoUrl != null) { - setSsoUrl(data.myOrg.ssoUrl); - } - - if (data.myOrg.ssoCert != null) { - setSsoCert(data.myOrg.ssoCert); - } - }, [data]); - - if (loading) { - return ; - } - - const permissions = data?.me?.permissions; - if ( - !permissions || - !userHasPermissions(permissions, [GQLUserPermission.ManageOrg]) - ) { - return ; - } - - if (error) { - return
; - } - - const copyText = (text: string) => { - navigator.clipboard.writeText(text); - }; - const callbackUri = `${HOST_URL}/api/v1/saml/login/${data?.myOrg?.id}/callback`; - - return ( -
- - SSO Settings - - - SSO Settings - - SSO Configuration - - Enter this information into your identity provider's "Service Provider - Details" setup. - -
- - - - - - - Copy to clipboard - -
- } - /> - - - - - - - Copy to clipboard - -
- } - /> -
- Identity Provider Metadata -
- - setSsoUrl(e.target.value)} - /> -
-
- - - This is the certificate used to verify the identity of your - organization when users attempt to log in via SSO. Please ensure this - certificate matches the one provided by your identity provider. - -
-