Skip to content

Commit 9824307

Browse files
committed
- Update search view with uniform bar height
- Move error message to underneath the whole bar and not just errored section - Unhide actions column when auto-hide columns with no values
1 parent 862d16b commit 9824307

File tree

4 files changed

+59
-19
lines changed

4 files changed

+59
-19
lines changed

app/components/DataTable/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ const DataTable = ({
343343
return typeof value !== 'undefined' && value !== null;
344344
});
345345
colApi.setColumnVisible(column.getColId(), !isColumnEmpty);
346+
colApi.setColumnVisible('Open', true);
346347
});
347348
}
348349
}, [colApi, columnDefs, gridApi, isSearch]);

app/components/ReportsTable/searchColumnDefs.ts

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const searchColumnDefs: ColDef[] = [{
8888
},
8989
{
9090
headerName: 'Open',
91+
colId: 'Open',
9192
pinned: 'right',
9293
cellRenderer: 'Launch',
9394
cellRendererParams: {

app/index.scss

+22-10
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ html body {
8080
min-width: 1100px;
8181
position: relative;
8282
right: 16px;
83-
top: 30vh;
83+
top: 35vh;
8484

8585
&__component {
8686
margin-top: 32px;
@@ -92,24 +92,27 @@ html body {
9292
display: flex;
9393
padding-left: 32px;
9494
padding-right: 32px;
95-
height: 100%;
95+
height: inherit;
9696
width: 100%;
9797
}
9898

9999
&__keyword-input {
100100
-webkit-tap-highlight-color: transparent;
101-
height: 100%;
102-
width: 80%;
101+
height: inherit;
102+
width: 850px;
103+
display: flex;
103104
}
104105

105106
&__category-input {
106-
height: 100%;
107-
width: 12%;
107+
height: inherit;
108+
width: 150px;
109+
display: flex;
108110
}
109111

110112
&__threshold-input {
111-
height: 100%;
112-
width: 8%;
113+
height: inherit;
114+
width: 100px;
115+
display: flex;
113116

114117
// Removes arrows in number input
115118
input::-webkit-outer-spin-button,
@@ -122,13 +125,22 @@ html body {
122125
}
123126
}
124127

128+
.error-dialog {
129+
max-width: 1100px;
130+
min-width: 1100px;
131+
margin-top: 8px;
132+
height: auto;
133+
padding-left: 48px;
134+
padding-right: 48px;
135+
}
136+
125137
.help-dialog {
126138
max-width: 1100px;
127139
min-width: 1100px;
128140
height: auto;
129141
margin-top: 16px;
130-
padding-left: 32px;
131-
padding-right: 32px;
142+
padding-left: 48px;
143+
padding-right: 48px;
132144
}
133145
}
134146

app/views/SearchView/index.tsx

+35-9
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,21 @@ const SearchView = () => {
127127
<div className="search-view">
128128
<div className="search-view__bar">
129129
<div className="search-view__category-select">
130-
<FormControl classes={{ root: customCss.categoryBorder }} sx={{ width: '150px' }}>
130+
<FormControl classes={{ root: customCss.categoryBorder }} style={{ height: '100%' }}>
131131
<Select
132132
value={searchCategory}
133133
onChange={handleCategoryChange}
134134
displayEmpty
135-
inputProps={{ sx: { textAlign: 'center' } }}
135+
style={{
136+
height: '100%',
137+
width: '100%',
138+
minWidth: '150px',
139+
}}
140+
inputProps={{
141+
sx: {
142+
textAlign: 'center',
143+
},
144+
}}
136145
>
137146
<MenuItem value="patientId">Patient ID</MenuItem>
138147
<MenuItem value="projectName">Project Name</MenuItem>
@@ -146,19 +155,26 @@ const SearchView = () => {
146155
<TextField
147156
InputLabelProps={{ shrink: true }}
148157
variant="outlined"
149-
helperText={thresholdErrorMessage}
150158
error={Boolean(thresholdErrorMessage)}
151159
onChange={handleThresholdChange}
152160
value={searchThreshold}
153161
defaultValue={DEFAULT_THRESHOLD}
154162
placeholder="0.8"
155163
onKeyDown={handleKeyDown}
156-
inputProps={{ sx: { textAlign: 'center' } }}
164+
inputProps={{
165+
sx: {
166+
textAlign: 'center',
167+
height: 'inherit',
168+
width: '100%',
169+
},
170+
}}
157171
// eslint-disable-next-line react/jsx-no-duplicate-props
158172
InputProps={{
159173
type: 'number',
160174
sx: {
161175
borderRadius: '0px',
176+
height: '100%',
177+
minWidth: '100px',
162178
},
163179
}}
164180
/>
@@ -167,7 +183,6 @@ const SearchView = () => {
167183
<Autocomplete
168184
multiple
169185
options={[]}
170-
defaultValue={[]}
171186
freeSolo
172187
value={searchKey}
173188
disableClearable
@@ -178,6 +193,8 @@ const SearchView = () => {
178193
borderTopRightRadius: '25px',
179194
borderBottomRightRadius: '25px',
180195
},
196+
height: 'inherit',
197+
width: '100%',
181198
}}
182199
limitTags={4}
183200
renderTags={(value) => value.map(({ category, keyword, threshold }: SearchKeyType, index: number) => (
@@ -195,10 +212,9 @@ const SearchView = () => {
195212
name="keyword"
196213
variant="outlined"
197214
error={Boolean(searchErrorMessage)}
198-
helperText={searchErrorMessage}
199215
onChange={handleKeywordChange}
200216
onKeyDown={handleKeyDown}
201-
placeholder={searchKey.length < 1 ? 'Press enter to add search key. Press backspace to delete.' : ''}
217+
placeholder={searchKey.length < 1 ? 'Press enter to add search keyword. Press backspace to delete.' : ''}
202218
InputProps={{
203219
...params.InputProps,
204220
endAdornment: (
@@ -231,10 +247,20 @@ const SearchView = () => {
231247
/>
232248
</div>
233249
</div>
250+
<div className="error-dialog">
251+
<Typography variant="subtitle2" color="error">
252+
{searchErrorMessage}
253+
</Typography>
254+
</div>
255+
<div className="error-dialog">
256+
<Typography variant="subtitle2" color="error">
257+
{thresholdErrorMessage}
258+
</Typography>
259+
</div>
234260
<div className="help-dialog">
235261
<Typography variant="subtitle2" color="primary">
236-
The matching threshold determines the cutoff of similarity between the search key and its matches.
237-
A value of 1 means exact matches or exact substring matches. The default value is 0.8 if not specified.
262+
The matching threshold scales from 0 to 1 and determines the cutoff of similarity between the search keyword and a match value.
263+
A threshold of 1 means the entire match value or a substring of it is identical to the search keyword. The default value is 0.8 if not specified.
238264
</Typography>
239265
</div>
240266
</div>

0 commit comments

Comments
 (0)