@@ -107,7 +107,7 @@ import moment from 'moment';
107
107
108
108
const useStyles = makeStyles ( theme => ( {
109
109
table : {
110
- minWidth : 360 ,
110
+ minWidth : 430 ,
111
111
tableLayout : 'auto' ,
112
112
marginTop : '8px'
113
113
} ,
@@ -139,13 +139,14 @@ export const TargetList = memo(() => {
139
139
const [ page , setPage ] = useState ( 0 ) ;
140
140
const [ isResizing , setIsResizing ] = useState ( false ) ;
141
141
const [ isResizingTargetAccessString , setIsResizingTargetAccessString ] = useState ( false ) ;
142
+ const [ isResizingInitDate , setIsResizingInitDate ] = useState ( false ) ;
142
143
const [ isResizingSGC , setIsResizingSGC ] = useState ( false ) ;
143
- const [ panelWidth , setPanelWidth ] = useState ( 100 ) ;
144
- const [ panelWidthForTargetAccessString , setPanelWidthForTargetAccessString ] = useState ( 130 ) ;
145
- const [ panelWidthForInitDate , setPanelWidthForInitDate ] = useState ( 100 ) ;
144
+ const [ panelWidth , setPanelWidth ] = useState ( 110 ) ;
145
+ const [ panelWidthForTargetAccessString , setPanelWidthForTargetAccessString ] = useState ( 140 ) ;
146
+ const [ panelWidthForInitDate , setPanelWidthForInitDate ] = useState ( 90 ) ;
146
147
const [ panelWidthForSGC , setPanelWidthForSGC ] = useState ( 130 ) ;
147
148
148
- const [ sortSwitch , setSortSwitch ] = useState ( 0 ) ;
149
+ const [ sortSwitch , setSortSwitch ] = useState ( 21 ) ;
149
150
const [ sortDialogAnchorEl , setSortDialogAnchorEl ] = useState ( null ) ;
150
151
const sortDialogOpen = useSelector ( state => state . targetReducers . targetListFilterDialog ) ;
151
152
@@ -263,8 +264,7 @@ export const TargetList = memo(() => {
263
264
let listOfFilteredTargetsByDate = useSelector ( state => state . targetReducers . listOfFilteredTargetsByDate ) ;
264
265
265
266
const isActiveFilter = ! ! ( filter || { } ) . active ;
266
- let listOfAllTarget = [ ...listOfAllTargetsDefault ] . sort ( compareTargetDesc ) ;
267
-
267
+ let listOfAllTarget = [ ...listOfAllTargetsDefault ] . sort ( compareTargetAsc ) ;
268
268
const initialize = useCallback ( ( ) => {
269
269
let initObject = {
270
270
active : false ,
@@ -322,7 +322,7 @@ export const TargetList = memo(() => {
322
322
</Tooltip> */ }
323
323
< TableCell align = "left" style = { { padding : '0px 10px 0px 0px' , margin : '0px' , padding : '0px' } } >
324
324
< Link to = { preview } >
325
- < div > { target . title } </ div >
325
+ < div style = { { wordBreak : 'break-all' } } > { target . title } </ div >
326
326
</ Link >
327
327
</ TableCell >
328
328
< TableCell style = { { width : '2px' , padding : '0px' , margin : '0px' } } > </ TableCell >
@@ -1036,6 +1036,34 @@ export const TargetList = memo(() => {
1036
1036
} , [ isResizingTargetAccessString ] ) ;
1037
1037
// END RESIZER FOR TARGET ACCESS STRING COLUMN
1038
1038
1039
+ // START RESIZER FOR INIT DATE COLUMN
1040
+ const handleMouseDownResizerInitDate = ( ) => {
1041
+ setIsResizingInitDate ( true ) ;
1042
+ //panelWidth !== undefined ? setPanelWidth(panelWidth) : setPanelWidth(130);
1043
+ } ;
1044
+
1045
+ const handleMouseMoveInitDate = e => {
1046
+ if ( ! isResizingInitDate ) return ;
1047
+ const deltaX = e . clientX - 240 ;
1048
+ setPanelWidthForInitDate ( deltaX ) ;
1049
+ } ;
1050
+
1051
+ const handleMouseUpInitDate = ( ) => {
1052
+ setIsResizingInitDate ( false ) ;
1053
+ window . removeEventListener ( 'mousemove' , handleMouseMoveInitDate ) ;
1054
+ window . removeEventListener ( 'mouseup' , handleMouseUpInitDate ) ;
1055
+ } ;
1056
+
1057
+ useEffect ( ( ) => {
1058
+ if ( isResizingInitDate ) {
1059
+ window . addEventListener ( 'mousemove' , handleMouseMoveInitDate ) ;
1060
+ window . addEventListener ( 'mouseup' , handleMouseUpInitDate ) ;
1061
+ } else {
1062
+ window . removeEventListener ( 'mousemove' , handleMouseMoveInitDate ) ;
1063
+ window . removeEventListener ( 'mouseup' , handleMouseUpInitDate ) ;
1064
+ }
1065
+ } , [ isResizingInitDate ] ) ;
1066
+ // END RESIZER FOR INIT DATE COLUMN
1039
1067
// START RESIZER FOR SGC COLUMN
1040
1068
const handleMouseDownResizerSGC = ( ) => {
1041
1069
setIsResizingSGC ( true ) ;
@@ -1146,25 +1174,35 @@ export const TargetList = memo(() => {
1146
1174
/>
1147
1175
Target
1148
1176
</ Typography >
1149
- < IconButton style = { { padding : '0px' } } onClick = { ( ) => handleHeaderSort ( 'target' ) } >
1150
- < Tooltip title = "Sort" className = { classes . sortButton } >
1151
- { [ 1 , 2 ] . includes ( sortSwitch - offsetTarget ) ? (
1152
- sortSwitch % offsetTarget < 2 ? (
1153
- < KeyboardArrowDown />
1154
- ) : (
1155
- < KeyboardArrowUp />
1156
- )
1177
+ </ TableCell >
1178
+ < div style = { { display : 'flex' } } >
1179
+ < div >
1180
+ < IconButton
1181
+ style = { { padding : '0px' , paddingRight : '5px' } }
1182
+ onClick = { ( ) => handleHeaderSort ( 'target' ) }
1183
+ >
1184
+ < Tooltip title = "Sort" className = { classes . sortButton } >
1185
+ { filter . filter . title . order === - 1 ? (
1186
+ < KeyboardArrowDown />
1187
+ ) : filter . filter . title . order === 1 ? (
1188
+ < KeyboardArrowUp />
1157
1189
) : (
1158
1190
< UnfoldMore />
1159
1191
) }
1160
- </ Tooltip >
1161
- </ IconButton >
1162
- </ TableCell >
1163
- < div
1164
- style = { { cursor : 'col-resize' , width : 3 , height : '20px' , backgroundColor : '#eeeeee' } }
1165
- onMouseDown = { handleMouseDown }
1166
- > </ div >
1167
-
1192
+ </ Tooltip >
1193
+ </ IconButton >
1194
+ </ div >
1195
+ < div
1196
+ style = { {
1197
+ cursor : 'col-resize' ,
1198
+ width : 4 ,
1199
+ height : '21px' ,
1200
+ backgroundColor : '#cccccc' ,
1201
+ borderRadius : '3px'
1202
+ } }
1203
+ onMouseDown = { handleMouseDown }
1204
+ > </ div >
1205
+ </ div >
1168
1206
< TableCell style = { { width : panelWidthForTargetAccessString , padding : '0px' } } >
1169
1207
< Typography variant = "title" >
1170
1208
< input
@@ -1175,49 +1213,80 @@ export const TargetList = memo(() => {
1175
1213
/>
1176
1214
Target access
1177
1215
</ Typography >
1178
- < IconButton style = { { padding : '0px' } } onClick = { ( ) => handleHeaderSort ( 'targetAccessString' ) } >
1179
- < Tooltip title = "Sort" className = { classes . sortButton } >
1180
- { [ 1 , 2 ] . includes ( sortSwitch - offsetTargetAccessString ) ? (
1181
- sortSwitch % offsetTargetAccessString < 2 ? (
1182
- < KeyboardArrowDown />
1183
- ) : (
1184
- < KeyboardArrowUp />
1185
- )
1216
+ </ TableCell >
1217
+ < div style = { { display : 'flex' } } >
1218
+ < div >
1219
+ < IconButton
1220
+ style = { { padding : '0px' , paddingRight : '5px' } }
1221
+ onClick = { ( ) => handleHeaderSort ( 'targetAccessString' ) }
1222
+ >
1223
+ < Tooltip title = "Sort" className = { classes . sortButton } >
1224
+ { filter . filter . targetAccessString . order === - 1 ? (
1225
+ < KeyboardArrowDown />
1226
+ ) : filter . filter . targetAccessString . order === 1 ? (
1227
+ < KeyboardArrowUp />
1186
1228
) : (
1187
1229
< UnfoldMore />
1188
1230
) }
1189
- </ Tooltip >
1190
- </ IconButton >
1191
- </ TableCell >
1192
- < div
1193
- style = { { cursor : 'col-resize' , width : 3 , height : '20px' , backgroundColor : '#eeeeee' } }
1194
- onMouseDown = { handleMouseDownResizerTargetAccessString }
1195
- > </ div >
1196
- < TableCell style = { { width : panelWidthForInitDate , padding : '0px' } } >
1231
+ </ Tooltip >
1232
+ </ IconButton >
1233
+ </ div >
1234
+ < div
1235
+ style = { {
1236
+ cursor : 'col-resize' ,
1237
+ width : 4 ,
1238
+ height : '21px' ,
1239
+ backgroundColor : '#cccccc' ,
1240
+ borderRadius : '3px'
1241
+ } }
1242
+ onMouseDown = { handleMouseDownResizerTargetAccessString }
1243
+ > </ div >
1244
+ </ div >
1245
+ < TableCell
1246
+ style = { { width : panelWidthForInitDate , padding : '0px' , paddingLeft : '5px' , verticalAlign : 'center' } }
1247
+ >
1197
1248
Init date
1198
- < IconButton style = { { padding : '0px' } } onClick = { ( ) => handleHeaderSort ( 'initDate' ) } >
1199
- < Tooltip title = "Sort" className = { classes . sortButton } >
1200
- { [ 1 , 2 ] . includes ( sortSwitch - offsetInitDate ) ? (
1201
- sortSwitch % offsetInitDate < 2 ? (
1202
- < KeyboardArrowDown />
1203
- ) : (
1204
- < KeyboardArrowUp />
1205
- )
1249
+ </ TableCell >
1250
+ < div style = { { display : 'flex' } } >
1251
+ < div style = { { paddingRight : '5px' } } >
1252
+ < IconButton
1253
+ style = { { padding : '0px' , verticalAlign : 'center' } }
1254
+ onClick = { ( ) => handleHeaderSort ( 'initDate' ) }
1255
+ >
1256
+ < Tooltip title = "Sort" className = { classes . sortButton } >
1257
+ { filter . filter . initDate . order === - 1 ? (
1258
+ < KeyboardArrowDown />
1259
+ ) : filter . filter . initDate . order === 1 ? (
1260
+ < KeyboardArrowUp />
1206
1261
) : (
1207
1262
< UnfoldMore />
1208
1263
) }
1209
- </ Tooltip >
1210
- </ IconButton >
1264
+ </ Tooltip >
1265
+ </ IconButton >
1266
+ </ div >
1267
+
1268
+ < div
1269
+ style = { {
1270
+ cursor : 'col-resize' ,
1271
+ width : 4 ,
1272
+ height : '21px' ,
1273
+ backgroundColor : '#cccccc' ,
1274
+ borderRadius : '3px'
1275
+ } }
1276
+ onMouseDown = { handleMouseDownResizerInitDate }
1277
+ > </ div >
1278
+ </ div >
1279
+ < TableCell
1280
+ style = { { width : panelWidthForSGC , padding : '0px' , paddingLeft : '5px' , verticalAlign : 'center' } }
1281
+ >
1282
+ SGC
1211
1283
</ TableCell >
1212
- < div
1213
- style = { { cursor : 'col-resize' , width : 3 , height : '20px' , backgroundColor : '#eeeeee' } }
1214
- onMouseDown = { handleMouseDownResizerTargetAccessString } // TODO change resizer
1215
- > </ div >
1216
- < TableCell style = { { width : panelWidthForSGC , padding : '0px' } } > SGC</ TableCell >
1217
- < div
1218
- style = { { cursor : 'col-resize' , width : 3 , height : '20px' , backgroundColor : '#eeeeee' } }
1219
- onMouseDown = { handleMouseDownResizerSGC }
1220
- > </ div >
1284
+ { /*<div style={{ display: 'flex' }}>
1285
+ <div
1286
+ style={{ cursor: 'col-resize', width: 3, height: '18px', backgroundColor: '#cccccc' }}
1287
+ onMouseDown={handleMouseDownResizerSGC}
1288
+ ></div>
1289
+ </div>*/ }
1221
1290
{ /* <TableCell style={{ padding: '0px' }}>
1222
1291
<Typography variant="title">
1223
1292
<input
0 commit comments