16073: Make default view icon optional, hide tabs when panel is empty
[arvados.git] / src / views / process-panel / process-io-card.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React, { ReactElement, useState } from 'react';
6 import { Dispatch } from 'redux';
7 import {
8     StyleRulesCallback,
9     WithStyles,
10     withStyles,
11     Card,
12     CardHeader,
13     IconButton,
14     CardContent,
15     Tooltip,
16     Typography,
17     Tabs,
18     Tab,
19     Table,
20     TableHead,
21     TableBody,
22     TableRow,
23     TableCell,
24     Paper,
25     Grid,
26     Chip,
27 } from '@material-ui/core';
28 import { ArvadosTheme } from 'common/custom-theme';
29 import { CloseIcon, ImageIcon, InfoIcon, InputIcon, ImageOffIcon, OutputIcon } from 'components/icon/icon';
30 import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view';
31 import {
32   BooleanCommandInputParameter,
33   CommandInputParameter,
34   CWLType,
35   Directory,
36   DirectoryArrayCommandInputParameter,
37   DirectoryCommandInputParameter,
38   EnumCommandInputParameter,
39   FileArrayCommandInputParameter,
40   FileCommandInputParameter,
41   FloatArrayCommandInputParameter,
42   FloatCommandInputParameter,
43   IntArrayCommandInputParameter,
44   IntCommandInputParameter,
45   isArrayOfType,
46   isPrimitiveOfType,
47   StringArrayCommandInputParameter,
48   StringCommandInputParameter,
49 } from "models/workflow";
50 import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
51 import { File } from 'models/workflow';
52 import { getInlineFileUrl } from 'views-components/context-menu/actions/helpers';
53 import { AuthState } from 'store/auth/auth-reducer';
54 import mime from 'mime';
55 import { DefaultView } from 'components/default-view/default-view';
56 import { getNavUrl } from 'routes/routes';
57 import { Link as RouterLink } from 'react-router-dom';
58 import { Link as MuiLink } from '@material-ui/core';
59 import { InputCollectionMount } from 'store/processes/processes-actions';
60 import { connect } from 'react-redux';
61 import { RootState } from 'store/store';
62 import { ProcessOutputCollectionFiles } from './process-output-collection-files';
63 import { Process } from 'store/processes/process';
64 import { navigateTo } from 'store/navigation/navigation-action';
65
66 type CssRules = 'card' | 'content' | 'title' | 'header' | 'avatar' | 'iconHeader' | 'tableWrapper' | 'tableRoot' | 'paramValue' | 'keepLink' | 'collectionLink' | 'imagePreview' | 'valArray' | 'emptyValue' | 'halfRow' | 'symmetricTabs' | 'imagePlaceholder' | 'rowWithPreview';
67
68 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
69     card: {
70         height: '100%'
71     },
72     header: {
73         paddingTop: theme.spacing.unit,
74         paddingBottom: theme.spacing.unit,
75     },
76     iconHeader: {
77         fontSize: '1.875rem',
78         color: theme.customs.colors.green700,
79     },
80     avatar: {
81         alignSelf: 'flex-start',
82         paddingTop: theme.spacing.unit * 0.5
83     },
84     content: {
85         padding: theme.spacing.unit * 1.0,
86         paddingTop: theme.spacing.unit * 0.5,
87         '&:last-child': {
88             paddingBottom: theme.spacing.unit * 1,
89         }
90     },
91     title: {
92         overflow: 'hidden',
93         paddingTop: theme.spacing.unit * 0.5
94     },
95     tableWrapper: {
96         overflow: 'auto',
97     },
98     tableRoot: {
99         width: '100%',
100         '& thead th': {
101             verticalAlign: 'bottom',
102             paddingBottom: '10px',
103         }
104     },
105     paramValue: {
106         display: 'flex',
107         alignItems: 'flex-start',
108         flexDirection: 'column',
109     },
110     keepLink: {
111         color: theme.palette.primary.main,
112         textDecoration: 'none',
113         overflowWrap: 'break-word',
114         cursor: 'pointer',
115     },
116     collectionLink: {
117         margin: '10px',
118         '& a': {
119             color: theme.palette.primary.main,
120             textDecoration: 'none',
121             overflowWrap: 'break-word',
122             cursor: 'pointer',
123         }
124     },
125     imagePreview: {
126         maxHeight: '15em',
127         maxWidth: '15em',
128         marginBottom: theme.spacing.unit,
129     },
130     valArray: {
131         display: 'flex',
132         gap: '10px',
133         flexWrap: 'wrap',
134         '& span': {
135             display: 'inline',
136         }
137     },
138     emptyValue: {
139         color: theme.customs.colors.grey500,
140     },
141     halfRow: {
142         '& td': {
143             borderBottom: 'none',
144         }
145     },
146     symmetricTabs: {
147         '& button': {
148             flexBasis: '0',
149         }
150     },
151     imagePlaceholder: {
152         width: '60px',
153         height: '60px',
154         display: 'flex',
155         alignItems: 'center',
156         justifyContent: 'center',
157         backgroundColor: '#cecece',
158         borderRadius: '10px',
159     },
160     rowWithPreview: {
161         verticalAlign: 'bottom',
162     }
163 });
164
165 export enum ProcessIOCardType {
166     INPUT = 'Inputs',
167     OUTPUT = 'Outputs',
168 }
169 export interface ProcessIOCardDataProps {
170     process: Process;
171     label: ProcessIOCardType;
172     params: ProcessIOParameter[];
173     raw?: any;
174     mounts?: InputCollectionMount[];
175     outputUuid?: string;
176 }
177
178 export interface ProcessIOCardActionProps {
179     navigateTo: (uuid: string) => void;
180 }
181
182 const mapDispatchToProps = (dispatch: Dispatch): ProcessIOCardActionProps => ({
183     navigateTo: (uuid) => dispatch<any>(navigateTo(uuid)),
184 });
185
186 type ProcessIOCardProps = ProcessIOCardDataProps & ProcessIOCardActionProps & WithStyles<CssRules> & MPVPanelProps;
187
188 export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps)(
189     ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, panelName, process, navigateTo }: ProcessIOCardProps) => {
190         const [mainProcTabState, setMainProcTabState] = useState(0);
191         const handleMainProcTabChange = (event: React.MouseEvent<HTMLElement>, value: number) => {
192             setMainProcTabState(value);
193         }
194
195         const [showImagePreview, setShowImagePreview] = useState(false);
196
197         const PanelIcon = label === ProcessIOCardType.INPUT ? InputIcon : OutputIcon;
198         const mainProcess = !process.containerRequest.requestingContainerUuid;
199
200         return <Card className={classes.card} data-cy="process-io-card">
201             <CardHeader
202                 className={classes.header}
203                 classes={{
204                     content: classes.title,
205                     avatar: classes.avatar,
206                 }}
207                 avatar={<PanelIcon className={classes.iconHeader} />}
208                 title={
209                     <Typography noWrap variant='h6' color='inherit'>
210                         {label}
211                     </Typography>
212                 }
213                 action={
214                     <div>
215                         { mainProcess && <Tooltip title={"Toggle Image Preview"} disableFocusListener>
216                             <IconButton data-cy="io-preview-image-toggle" onClick={() =>{setShowImagePreview(!showImagePreview)}}>{showImagePreview ? <ImageIcon /> : <ImageOffIcon />}</IconButton>
217                         </Tooltip> }
218                         { doHidePanel &&
219                         <Tooltip title={`Close ${panelName || 'panel'}`} disableFocusListener>
220                             <IconButton onClick={doHidePanel}><CloseIcon /></IconButton>
221                         </Tooltip> }
222                     </div>
223                 } />
224             <CardContent className={classes.content}>
225                 <div>
226                     {mainProcess ?
227                         (<>
228                             {params.length ?
229                                 <>
230                                     <Tabs value={mainProcTabState} onChange={handleMainProcTabChange} variant="fullWidth" className={classes.symmetricTabs}>
231                                         <Tab label="Parameters" />
232                                         <Tab label="JSON" />
233                                     </Tabs>
234                                     {mainProcTabState === 0 && <div className={classes.tableWrapper}>
235                                             <ProcessIOPreview data={params} showImagePreview={showImagePreview} />
236                                         </div>}
237                                     {mainProcTabState === 1 && <div className={classes.tableWrapper}>
238                                             <ProcessIORaw data={raw || params} />
239                                         </div>}
240                                 </> :
241                                 <Grid container item alignItems='center' justify='center'>
242                                     <DefaultView messages={["No parameters found"]} />
243                                 </Grid>
244                             }
245                         </>) :
246                         (<>
247                             {((mounts && mounts.length) || outputUuid) ?
248                                 <>
249                                     <Tabs value={0} variant="fullWidth" className={classes.symmetricTabs}>
250                                         {label === ProcessIOCardType.INPUT && <Tab label="Collections" />}
251                                         {label === ProcessIOCardType.OUTPUT && <Tab label="Collection" />}
252                                     </Tabs>
253                                     <div className={classes.tableWrapper}>
254                                         {label === ProcessIOCardType.INPUT && <ProcessInputMounts mounts={mounts || []} />}
255                                         {label === ProcessIOCardType.OUTPUT && <>
256                                             {outputUuid && <Typography className={classes.collectionLink}>
257                                                 Output Collection: <MuiLink className={classes.keepLink} onClick={() => {navigateTo(outputUuid || "")}}>
258                                                 {outputUuid}
259                                             </MuiLink></Typography>}
260                                             <ProcessOutputCollectionFiles isWritable={false} currentItemUuid={outputUuid} />
261                                         </>}
262                                     </div>
263                                 </> :
264                                 <Grid container item alignItems='center' justify='center'>
265                                     <DefaultView messages={["No collection(s) found"]} />
266                                 </Grid>
267                             }
268                         </>)
269                     }
270                 </div>
271             </CardContent>
272         </Card>;
273     }
274 ));
275
276 export type ProcessIOValue = {
277     display: ReactElement<any, any>;
278     imageUrl?: string;
279     collection?: ReactElement<any, any>;
280 }
281
282 export type ProcessIOParameter = {
283     id: string;
284     label: string;
285     value: ProcessIOValue[];
286 }
287
288 interface ProcessIOPreviewDataProps {
289     data: ProcessIOParameter[];
290     showImagePreview: boolean;
291 }
292
293 type ProcessIOPreviewProps = ProcessIOPreviewDataProps & WithStyles<CssRules>;
294
295 const ProcessIOPreview = withStyles(styles)(
296     ({ classes, data, showImagePreview }: ProcessIOPreviewProps) =>
297         <Table className={classes.tableRoot} aria-label="Process IO Preview">
298             <TableHead>
299                 <TableRow>
300                     <TableCell>Name</TableCell>
301                     <TableCell>Label</TableCell>
302                     <TableCell>Value</TableCell>
303                     <TableCell>Collection</TableCell>
304                 </TableRow>
305             </TableHead>
306             <TableBody>
307                 {data.map((param: ProcessIOParameter) => {
308                     const firstVal = param.value.length > 0 ? param.value[0] : undefined;
309                     const rest = param.value.slice(1);
310                     const rowClass = rest.length > 0 ? classes.halfRow : undefined;
311
312                     return <>
313                         <TableRow className={rowClass} data-cy="process-io-param">
314                             <TableCell>
315                                 {param.id}
316                             </TableCell>
317                             <TableCell >{param.label}</TableCell>
318                             <TableCell>
319                                 {firstVal && <ProcessValuePreview value={firstVal} showImagePreview={showImagePreview} />}
320                             </TableCell>
321                             <TableCell className={firstVal?.imageUrl ? classes.rowWithPreview : undefined}>
322                                 <Typography className={classes.paramValue}>
323                                     {firstVal?.collection}
324                                 </Typography>
325                             </TableCell>
326                         </TableRow>
327                         {rest.map((val, i) => (
328                             <TableRow className={(i < rest.length-1) ? rowClass : undefined}>
329                                 <TableCell />
330                                 <TableCell />
331                                 <TableCell>
332                                     <ProcessValuePreview value={val} showImagePreview={showImagePreview} />
333                                 </TableCell>
334                                 <TableCell className={firstVal?.imageUrl ? classes.rowWithPreview : undefined}>
335                                     <Typography className={classes.paramValue}>
336                                         {val.collection}
337                                     </Typography>
338                                 </TableCell>
339                             </TableRow>
340                         ))}
341                     </>;
342                 })}
343             </TableBody>
344         </Table>
345 );
346
347 interface ProcessValuePreviewProps {
348     value: ProcessIOValue;
349     showImagePreview: boolean;
350 }
351
352 const ProcessValuePreview = withStyles(styles)(
353     ({value, showImagePreview, classes}: ProcessValuePreviewProps & WithStyles<CssRules>) =>
354         <Typography className={classes.paramValue}>
355             {value.imageUrl && showImagePreview ? <img className={classes.imagePreview} src={value.imageUrl} alt="Inline Preview" /> : ""}
356             {value.imageUrl && !showImagePreview ? <ImagePlaceholder /> : ""}
357             <span className={classes.valArray}>
358                 {value.display}
359             </span>
360         </Typography>
361 )
362
363 const handleClick = (url) => {
364     window.open(url, '_blank');
365 }
366
367
368 interface ProcessIORawDataProps {
369     data: ProcessIOParameter[];
370 }
371
372 const ProcessIORaw = withStyles(styles)(
373     ({ data }: ProcessIORawDataProps) =>
374         <Paper elevation={0}>
375             <pre>
376                 {JSON.stringify(data, null, 2)}
377             </pre>
378         </Paper>
379 );
380
381 interface ProcessInputMountsDataProps {
382     mounts: InputCollectionMount[];
383 }
384
385 type ProcessInputMountsProps = ProcessInputMountsDataProps & WithStyles<CssRules>;
386
387 const ProcessInputMounts = withStyles(styles)(connect((state: RootState) => ({
388     auth: state.auth,
389 }))(({ mounts, classes, auth }: ProcessInputMountsProps & { auth: AuthState }) => (
390     <Table className={classes.tableRoot} aria-label="Process Input Mounts">
391         <TableHead>
392             <TableRow>
393                 <TableCell>Path</TableCell>
394                 <TableCell>Portable Data Hash</TableCell>
395             </TableRow>
396         </TableHead>
397         <TableBody>
398             {mounts.map(mount => (
399                 <TableRow key={mount.path}>
400                     <TableCell><pre>{mount.path}</pre></TableCell>
401                     <TableCell>
402                         <RouterLink to={getNavUrl(mount.pdh, auth)} className={classes.keepLink}>{mount.pdh}</RouterLink>
403                     </TableCell>
404                 </TableRow>
405             ))}
406         </TableBody>
407     </Table>
408 )));
409
410 type FileWithSecondaryFiles = {
411     secondaryFiles: File[];
412 }
413
414 export const getIOParamDisplayValue = (auth: AuthState, input: CommandInputParameter | CommandOutputParameter, pdh?: string): ProcessIOValue[] => {
415     switch (true) {
416         case isPrimitiveOfType(input, CWLType.BOOLEAN):
417             const boolValue = (input as BooleanCommandInputParameter).value;
418
419             return boolValue !== undefined &&
420                     !(Array.isArray(boolValue) && boolValue.length === 0) ?
421                 [{display: <pre>{String(boolValue)}</pre> }] :
422                 [{display: <EmptyValue />}];
423
424         case isPrimitiveOfType(input, CWLType.INT):
425         case isPrimitiveOfType(input, CWLType.LONG):
426             const intValue = (input as IntCommandInputParameter).value;
427
428             return intValue !== undefined &&
429                     // Missing values are empty array
430                     !(Array.isArray(intValue) && intValue.length === 0) ?
431                 [{display: <pre>{String(intValue)}</pre> }]
432                 : [{display: <EmptyValue />}];
433
434         case isPrimitiveOfType(input, CWLType.FLOAT):
435         case isPrimitiveOfType(input, CWLType.DOUBLE):
436             const floatValue = (input as FloatCommandInputParameter).value;
437
438             return floatValue !== undefined &&
439                     !(Array.isArray(floatValue) && floatValue.length === 0) ?
440                 [{display: <pre>{String(floatValue)}</pre> }]:
441                 [{display: <EmptyValue />}];
442
443         case isPrimitiveOfType(input, CWLType.STRING):
444             const stringValue = (input as StringCommandInputParameter).value || undefined;
445
446             return stringValue !== undefined &&
447                     !(Array.isArray(stringValue) && stringValue.length === 0) ?
448                 [{display: <pre>{stringValue}</pre> }] :
449                 [{display: <EmptyValue />}];
450
451         case isPrimitiveOfType(input, CWLType.FILE):
452             const mainFile = (input as FileCommandInputParameter).value;
453             // secondaryFiles: File[] is not part of CommandOutputParameter so we cast to access secondaryFiles
454             const secondaryFiles = ((mainFile as unknown) as FileWithSecondaryFiles)?.secondaryFiles || [];
455             const files = [
456                 ...(mainFile && !(Array.isArray(mainFile) && mainFile.length === 0) ? [mainFile] : []),
457                 ...secondaryFiles
458             ];
459
460             return files.length ?
461                 files.map(file => fileToProcessIOValue(file, auth, pdh)) :
462                 [{display: <EmptyValue />}];
463
464         case isPrimitiveOfType(input, CWLType.DIRECTORY):
465             const directory = (input as DirectoryCommandInputParameter).value;
466
467             return directory !== undefined &&
468                     !(Array.isArray(directory) && directory.length === 0) ?
469                 [directoryToProcessIOValue(directory, auth, pdh)] :
470                 [{display: <EmptyValue />}];
471
472         case typeof input.type === 'object' &&
473             !(input.type instanceof Array) &&
474             input.type.type === 'enum':
475             const enumValue = (input as EnumCommandInputParameter).value;
476
477             return enumValue !== undefined ?
478                 [{ display: <pre>{(input as EnumCommandInputParameter).value || ''}</pre> }] :
479                 [{display: <EmptyValue />}];
480
481         case isArrayOfType(input, CWLType.STRING):
482             const strArray = (input as StringArrayCommandInputParameter).value || [];
483             return strArray.length ?
484                 [{ display: <>{((input as StringArrayCommandInputParameter).value || []).map((val) => <Chip label={val} />)}</> }] :
485                 [{display: <EmptyValue />}];
486
487         case isArrayOfType(input, CWLType.INT):
488         case isArrayOfType(input, CWLType.LONG):
489             const intArray = (input as IntArrayCommandInputParameter).value || [];
490
491             return intArray.length ?
492                 [{ display: <>{((input as IntArrayCommandInputParameter).value || []).map((val) => <Chip label={val} />)}</> }] :
493                 [{display: <EmptyValue />}];
494
495         case isArrayOfType(input, CWLType.FLOAT):
496         case isArrayOfType(input, CWLType.DOUBLE):
497             const floatArray = (input as FloatArrayCommandInputParameter).value || [];
498
499             return floatArray.length ?
500                 [{ display: <>{floatArray.map((val) => <Chip label={val} />)}</> }] :
501                 [{display: <EmptyValue />}];
502
503         case isArrayOfType(input, CWLType.FILE):
504             const fileArrayMainFile = ((input as FileArrayCommandInputParameter).value || []);
505             const fileArraySecondaryFiles = fileArrayMainFile.map((file) => (
506                 ((file as unknown) as FileWithSecondaryFiles)?.secondaryFiles || []
507             )).reduce((acc: File[], params: File[]) => (acc.concat(params)), []);
508
509             const fileArrayFiles = [
510                 ...fileArrayMainFile,
511                 ...fileArraySecondaryFiles
512             ];
513
514             return fileArrayFiles.length ?
515                 fileArrayFiles.map(file => fileToProcessIOValue(file, auth, pdh)) :
516                 [{display: <EmptyValue />}];
517
518         case isArrayOfType(input, CWLType.DIRECTORY):
519             const directories = (input as DirectoryArrayCommandInputParameter).value || [];
520
521             return directories.length ?
522                 directories.map(directory => directoryToProcessIOValue(directory, auth, pdh)) :
523                 [{display: <EmptyValue />}];
524
525         default:
526             return [];
527     }
528 };
529
530 const getKeepUrl = (file: File | Directory, pdh?: string): string => {
531     const isKeepUrl = file.location?.startsWith('keep:') || false;
532     const keepUrl = isKeepUrl ? file.location : pdh ? `keep:${pdh}/${file.location}` : file.location;
533     return keepUrl || '';
534 };
535
536 interface KeepUrlProps {
537     auth: AuthState;
538     res: File | Directory;
539     pdh?: string;
540 }
541
542 const KeepUrlBase = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps & WithStyles<CssRules>) => {
543     const keepUrl = getKeepUrl(res, pdh);
544     const pdhUrl = keepUrl ? keepUrl.split('/').slice(0, 1)[0] : '';
545     // Passing a pdh always returns a relative wb2 collection url
546     const pdhWbPath = getNavUrl(pdhUrl.replace('keep:', ''), auth);
547     return pdhUrl && pdhWbPath ?
548         <Tooltip title={"View collection in Workbench"}><RouterLink to={pdhWbPath} className={classes.keepLink}>{pdhUrl}</RouterLink></Tooltip> :
549         <></>;
550 });
551
552 const KeepUrlPath = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps & WithStyles<CssRules>) => {
553     const keepUrl = getKeepUrl(res, pdh);
554     const keepUrlParts = keepUrl ? keepUrl.split('/') : [];
555     const keepUrlPath = keepUrlParts.length > 1 ? keepUrlParts.slice(1).join('/') : '';
556
557     const keepUrlPathNav = getKeepNavUrl(auth, res, pdh);
558     return keepUrlPath && keepUrlPathNav ?
559         <Tooltip title={"View in keep-web"}><MuiLink className={classes.keepLink} onClick={() => handleClick(keepUrlPathNav)}>{keepUrlPath}</MuiLink></Tooltip> :
560         // Show No value for root collection io that lacks path part
561         <EmptyValue />;
562 });
563
564 const getKeepNavUrl = (auth: AuthState, file: File | Directory, pdh?: string): string => {
565     let keepUrl = getKeepUrl(file, pdh).replace('keep:', '');
566     return (getInlineFileUrl(`${auth.config.keepWebServiceUrl}/c=${keepUrl}?api_token=${auth.apiToken}`, auth.config.keepWebServiceUrl, auth.config.keepWebInlineServiceUrl));
567 };
568
569 const getImageUrl = (auth: AuthState, file: File, pdh?: string): string => {
570     const keepUrl = getKeepUrl(file, pdh).replace('keep:', '');
571     return getInlineFileUrl(`${auth.config.keepWebServiceUrl}/c=${keepUrl}?api_token=${auth.apiToken}`, auth.config.keepWebServiceUrl, auth.config.keepWebInlineServiceUrl);
572 };
573
574 const isFileImage = (basename?: string): boolean => {
575     return basename ? (mime.getType(basename) || "").startsWith('image/') : false;
576 };
577
578 const normalizeDirectoryLocation = (directory: Directory): Directory => {
579     if (!directory.location) {
580         return directory;
581     }
582     return {
583         ...directory,
584         location: (directory.location || '').endsWith('/') ? directory.location : directory.location + '/',
585     };
586 };
587
588 const directoryToProcessIOValue = (directory: Directory, auth: AuthState, pdh?: string): ProcessIOValue => {
589     const normalizedDirectory = normalizeDirectoryLocation(directory);
590     return {
591         display: <KeepUrlPath auth={auth} res={normalizedDirectory} pdh={pdh}/>,
592         collection: <KeepUrlBase auth={auth} res={normalizedDirectory} pdh={pdh}/>,
593     };
594 };
595
596 const fileToProcessIOValue = (file: File, auth: AuthState, pdh?: string): ProcessIOValue => {
597     return {
598         display: <KeepUrlPath auth={auth} res={file} pdh={pdh}/>,
599         imageUrl: isFileImage(file.basename) ? getImageUrl(auth, file, pdh) : undefined,
600         collection: <KeepUrlBase auth={auth} res={file} pdh={pdh}/>,
601     }
602 };
603
604 const EmptyValue = withStyles(styles)(
605     ({classes}: WithStyles<CssRules>) => <span className={classes.emptyValue}>No value</span>
606 );
607
608 const ImagePlaceholder = withStyles(styles)(
609     ({classes}: WithStyles<CssRules>) => <span className={classes.imagePlaceholder}><ImageIcon /></span>
610 );