Sadum1 commited on
Commit
a28de30
·
verified ·
1 Parent(s): 1f9a744

Update frontend/src/components/ProtocolDetail.tsx

Browse files
frontend/src/components/ProtocolDetail.tsx CHANGED
@@ -6,6 +6,9 @@ import type {
6
  Protocol,
7
  ProtocolDraft,
8
  RankingResult,
 
 
 
9
  RobAssessmentEntry,
10
  RobSummaryItem,
11
  ScreeningRecordEntry,
@@ -13,7 +16,6 @@ import type {
13
  SynthesisResult,
14
  } from "../types";
15
  import { ALL_SOURCES } from "../types";
16
- import type { ReviewDomain, ReviewOptions, ReviewType } from "../types";
17
  import { CriteriaListEditor } from "./CriteriaListEditor";
18
  import { SearchStrategyEditor } from "./SearchStrategyEditor";
19
  import { SearchResults } from "./SearchResults";
@@ -35,6 +37,7 @@ import { ConfidencePanel } from "./ConfidencePanel";
35
  import { SEARCH_FIELDS, changedFields, draftFromProtocol } from "../utils/protocolChanges";
36
  import {
37
  getPrismaCounts,
 
38
  getRobSummary,
39
  getSearchRun,
40
  listConfidenceGroups,
@@ -42,7 +45,6 @@ import {
42
  getSynthesis,
43
  listExtractionRecords,
44
  listScreeningRecords,
45
- getReviewOptions,
46
  runSearch,
47
  } from "../api/protocols";
48
 
@@ -117,13 +119,13 @@ export function ProtocolDetail({
117
  const [confidenceGroups, setConfidenceGroups] = useState<ConfidenceGroup[]>([]);
118
  const [ranking, setRanking] = useState<RankingResult | null>(null);
119
  const [useRanking, setUseRanking] = useState(false);
 
120
  const [tab, setTab] = useState<TabId>(readTabFromUrl);
121
- const [options, setOptions] = useState<ReviewOptions | null>(null);
122
 
123
  useEffect(() => {
124
  getReviewOptions().then(setOptions).catch(() => {});
125
  }, []);
126
- const [visitedTabs, setVisitedTabs] = useState<Set<TabId>>(() => new Set([readTabFromUrl()]));
127
 
128
  // Records in the order the screening list should use. With ranking on, the
129
  // highest-scoring records come first; the order only changes when the
@@ -354,7 +356,7 @@ export function ProtocolDetail({
354
  />
355
  <div className="pico-grid">
356
  <div>
357
- <label className="field-label">Review type</label>
358
  <select
359
  value={draft.review_type ?? ""}
360
  onChange={(e) =>
@@ -386,6 +388,8 @@ export function ProtocolDetail({
386
  </select>
387
  </div>
388
  </div>
 
 
389
  <label className="field-label">Population</label>
390
  <textarea
391
  value={draft.population}
@@ -503,7 +507,7 @@ export function ProtocolDetail({
503
  "Not set"}
504
  </span>
505
  </div>
506
- <div className="readout-row">
507
  <span className="readout-label">Population</span>
508
  <span>{protocol.population}</span>
509
  </div>
 
6
  Protocol,
7
  ProtocolDraft,
8
  RankingResult,
9
+ ReviewDomain,
10
+ ReviewOptions,
11
+ ReviewType,
12
  RobAssessmentEntry,
13
  RobSummaryItem,
14
  ScreeningRecordEntry,
 
16
  SynthesisResult,
17
  } from "../types";
18
  import { ALL_SOURCES } from "../types";
 
19
  import { CriteriaListEditor } from "./CriteriaListEditor";
20
  import { SearchStrategyEditor } from "./SearchStrategyEditor";
21
  import { SearchResults } from "./SearchResults";
 
37
  import { SEARCH_FIELDS, changedFields, draftFromProtocol } from "../utils/protocolChanges";
38
  import {
39
  getPrismaCounts,
40
+ getReviewOptions,
41
  getRobSummary,
42
  getSearchRun,
43
  listConfidenceGroups,
 
45
  getSynthesis,
46
  listExtractionRecords,
47
  listScreeningRecords,
 
48
  runSearch,
49
  } from "../api/protocols";
50
 
 
119
  const [confidenceGroups, setConfidenceGroups] = useState<ConfidenceGroup[]>([]);
120
  const [ranking, setRanking] = useState<RankingResult | null>(null);
121
  const [useRanking, setUseRanking] = useState(false);
122
+ const [options, setOptions] = useState<ReviewOptions | null>(null);
123
  const [tab, setTab] = useState<TabId>(readTabFromUrl);
124
+ const [visitedTabs, setVisitedTabs] = useState<Set<TabId>>(() => new Set([readTabFromUrl()]));
125
 
126
  useEffect(() => {
127
  getReviewOptions().then(setOptions).catch(() => {});
128
  }, []);
 
129
 
130
  // Records in the order the screening list should use. With ranking on, the
131
  // highest-scoring records come first; the order only changes when the
 
356
  />
357
  <div className="pico-grid">
358
  <div>
359
+ <label className="field-label">Review type</label>
360
  <select
361
  value={draft.review_type ?? ""}
362
  onChange={(e) =>
 
388
  </select>
389
  </div>
390
  </div>
391
+ <div className="pico-grid">
392
+ <div>
393
  <label className="field-label">Population</label>
394
  <textarea
395
  value={draft.population}
 
507
  "Not set"}
508
  </span>
509
  </div>
510
+ <div className="readout-row">
511
  <span className="readout-label">Population</span>
512
  <span>{protocol.population}</span>
513
  </div>