Skip to content

Commit

Permalink
Remove browsers from query and state in TestQueue and DataManagement …
Browse files Browse the repository at this point in the history
…in favor of at.browsers
  • Loading branch information
stalgiag committed Nov 16, 2023
1 parent 7dd31e1 commit 9319e37
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 26 deletions.
10 changes: 1 addition & 9 deletions client/components/DataManagement/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand Down Expand Up @@ -131,7 +124,6 @@ const DataManagement = () => {

<ManageTestQueue
ats={ats}
browsers={browsers}
testPlanVersions={testPlanVersions}
triggerUpdate={refetch}
/>
Expand Down
4 changes: 0 additions & 4 deletions client/components/DataManagement/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export const DATA_MANAGEMENT_PAGE_QUERY = gql`
id
}
}
browsers {
id
name
}
testPlans {
id
directory
Expand Down
10 changes: 5 additions & 5 deletions client/components/ManageTestQueue/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const DisclosureContainer = styled.div`

const ManageTestQueue = ({
ats = [],
browsers = [],
testPlanVersions = [],
triggerUpdate = () => {}
}) => {
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -738,7 +739,6 @@ const ManageTestQueue = ({

ManageTestQueue.propTypes = {
ats: PropTypes.array,
browsers: PropTypes.array,
testPlanVersions: PropTypes.array,
triggerUpdate: PropTypes.func
};
Expand Down
4 changes: 0 additions & 4 deletions client/components/TestQueue/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand All @@ -45,7 +44,6 @@ const TestQueue = () => {
const {
users = [],
ats = [],
browsers = [],
testPlanVersions = [],
testPlanReports = [],
testPlans = []
Expand All @@ -60,7 +58,6 @@ const TestQueue = () => {
setAts(ats);
setTestPlanVersions(testPlanVersions);
setTestPlanReports(testPlanReports);
setBrowsers(browsers);
setLatestTestPlanVersions(testPlans);
setPageReady(true);
}
Expand Down Expand Up @@ -254,7 +251,6 @@ const TestQueue = () => {
{isAdmin && (
<ManageTestQueue
ats={ats}
browsers={browsers}
testPlanVersions={testPlanVersions}
triggerUpdate={refetch}
/>
Expand Down
4 changes: 0 additions & 4 deletions client/components/TestQueue/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ export const TEST_QUEUE_PAGE_QUERY = gql`
name
}
}
browsers {
id
name
}
testPlanVersions {
id
title
Expand Down

0 comments on commit 9319e37

Please sign in to comment.