From 9319e3780ec1bc82edc81b8073682fe1848e8452 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Thu, 16 Nov 2023 11:16:37 -0800 Subject: [PATCH] Remove browsers from query and state in TestQueue and DataManagement in favor of at.browsers --- client/components/DataManagement/index.jsx | 10 +--------- client/components/DataManagement/queries.js | 4 ---- client/components/ManageTestQueue/index.jsx | 10 +++++----- client/components/TestQueue/index.jsx | 4 ---- client/components/TestQueue/queries.js | 4 ---- 5 files changed, 6 insertions(+), 26 deletions(-) diff --git a/client/components/DataManagement/index.jsx b/client/components/DataManagement/index.jsx index 3c68d48d7..5f4cc2414 100644 --- a/client/components/DataManagement/index.jsx +++ b/client/components/DataManagement/index.jsx @@ -30,7 +30,6 @@ const DataManagement = () => { const [pageReady, setPageReady] = useState(false); const [ats, setAts] = useState([]); - const [browsers, setBrowsers] = useState([]); const [testPlans, setTestPlans] = useState([]); const [testPlanVersions, setTestPlanVersions] = useState([]); const [filter, setFilter] = useState( @@ -42,14 +41,8 @@ const DataManagement = () => { useEffect(() => { if (data) { - const { - ats = [], - browsers = [], - testPlanVersions = [], - testPlans = [] - } = data; + const { ats = [], testPlanVersions = [], testPlans = [] } = data; setAts(ats); - setBrowsers(browsers); setTestPlans(testPlans); setTestPlanVersions(testPlanVersions); setPageReady(true); @@ -131,7 +124,6 @@ const DataManagement = () => { diff --git a/client/components/DataManagement/queries.js b/client/components/DataManagement/queries.js index 0f2aa05a1..413bb0ce5 100644 --- a/client/components/DataManagement/queries.js +++ b/client/components/DataManagement/queries.js @@ -26,10 +26,6 @@ export const DATA_MANAGEMENT_PAGE_QUERY = gql` id } } - browsers { - id - name - } testPlans { id directory diff --git a/client/components/ManageTestQueue/index.jsx b/client/components/ManageTestQueue/index.jsx index 513480016..cd5aee9c2 100644 --- a/client/components/ManageTestQueue/index.jsx +++ b/client/components/ManageTestQueue/index.jsx @@ -91,7 +91,6 @@ const DisclosureContainer = styled.div` const ManageTestQueue = ({ ats = [], - browsers = [], testPlanVersions = [], triggerUpdate = () => {} }) => { @@ -667,9 +666,11 @@ const ManageTestQueue = ({ item => item.id === selectedTestPlanVersionId )} at={ats.find(item => item.id === selectedAtId)} - browser={browsers.find( - item => item.id === selectedBrowserId - )} + browser={ats + .find(at => at.id === selectedAtId) + ?.browsers.find( + browser => browser.id === selectedBrowserId + )} triggerUpdate={triggerUpdate} disabled={ !selectedTestPlanVersionId || @@ -738,7 +739,6 @@ const ManageTestQueue = ({ ManageTestQueue.propTypes = { ats: PropTypes.array, - browsers: PropTypes.array, testPlanVersions: PropTypes.array, triggerUpdate: PropTypes.func }; diff --git a/client/components/TestQueue/index.jsx b/client/components/TestQueue/index.jsx index 2fb8ef344..da9f8a3fd 100644 --- a/client/components/TestQueue/index.jsx +++ b/client/components/TestQueue/index.jsx @@ -21,7 +21,6 @@ const TestQueue = () => { const [pageReady, setPageReady] = useState(false); const [testers, setTesters] = useState([]); const [ats, setAts] = useState([]); - const [browsers, setBrowsers] = useState([]); const [testPlanVersions, setTestPlanVersions] = useState([]); const [testPlanReports, setTestPlanReports] = useState([]); const [latestTestPlanVersions, setLatestTestPlanVersions] = useState([]); @@ -45,7 +44,6 @@ const TestQueue = () => { const { users = [], ats = [], - browsers = [], testPlanVersions = [], testPlanReports = [], testPlans = [] @@ -60,7 +58,6 @@ const TestQueue = () => { setAts(ats); setTestPlanVersions(testPlanVersions); setTestPlanReports(testPlanReports); - setBrowsers(browsers); setLatestTestPlanVersions(testPlans); setPageReady(true); } @@ -254,7 +251,6 @@ const TestQueue = () => { {isAdmin && ( diff --git a/client/components/TestQueue/queries.js b/client/components/TestQueue/queries.js index 37f6b2d52..2393b1ac3 100644 --- a/client/components/TestQueue/queries.js +++ b/client/components/TestQueue/queries.js @@ -33,10 +33,6 @@ export const TEST_QUEUE_PAGE_QUERY = gql` name } } - browsers { - id - name - } testPlanVersions { id title