Browse Source

Last commit for demo

master
Nikola Ignjatovic 4 years ago
parent
commit
ebc2ea70e9

+ 6
- 4
src/components/ScrapeRequest/ScrapeRequest.js View File

@@ -12,16 +12,18 @@ const ScrapeRequest = ({ scrape, index, handleExecute }) => {
<tr>
<td>
<p>
{console.log(scrape)}
{console.log(scrape)}
</p><h3><Link to={{
pathname: SCRAPE_RESULTS_PAGE.replace(':id', scrape._id),
id: scrape._id
}}>#{index} {scrape.location}</Link> </h3>

}}>#{index} {scrape.location}</Link></h3>
<p>
<a className='text-sm mr-3' href={scrape.sourceUrl}><i className="fas fa-external-link-square-alt"></i> https://www.apartments.com</a>
<span className="lead mr-2">Count : <span className='text-info'>{scrape.count}</span></span>
<span className="lead mr-2">{t('scrapeRequest.EstimatedTime')} <span className='text-info'>{(new Date(scrape.estimate)).toLocaleString()}</span></span>
{ (scrape.startDate !== undefined && scrape.startDate !== null) ?
<span className="lead mr-2">Time: <span className="text-info">{(new Date(scrape.startDate)).toLocaleString() } - {(scrape.endDate != undefined && scrape.endDate!==null) ? (new Date(scrape.endDate)).toLocaleString():''}</span> </span>
:<span className="lead mr-2">{t('scrapeRequest.EstimatedTime')} <span className='text-info'>{(new Date(scrape.estimate)).toLocaleString()}</span></span>
}
</p>
</td>
<td>

+ 1
- 1
src/components/ScrapeRequests/ScrapeRequests.js View File

@@ -22,7 +22,7 @@ const ScrapeRequests = ({ scrappes, handleExecute }) => {
</tr>
</thead>
<tbody>
{scrappes.map((scrape, i) => <ScrapeRequest handleExecute={handleExecute} index={i + 1} key={scrape._id} scrape={scrape} />)}
{scrappes.sort((a, b) => (new Date(b.estimate)) - (new Date(a.estimate))).map((scrape, i) => <ScrapeRequest handleExecute={handleExecute} index={i + 1} key={scrape._id} scrape={scrape} />)}
</tbody>
</table>
</div>}

+ 5
- 2
src/components/ScrappeDetails/ScrappeDetails.js View File

@@ -18,9 +18,12 @@ const ScrappeDetails = ({ details }) => {
<h3>{details.location}</h3>
: ''}
{
(details.estimate) ?
(details.startDate !== undefined && details.startDate !== null) ?
<span className="mr-2">Time: <span className="">{(new Date(details.startDate)).toLocaleString() } - {(details.endDate != undefined && details.endDate!==null) ? (new Date(details.endDate)).toLocaleString():''}</span> </span>
:(details.estimate) ?
<span className="text-muted">{t('scrapeRequest.EstimatedTime')} {(new Date(details.estimate)).toLocaleString()}</span>
: ''}
: ''
}
</div>
<div className="col-md-4">
{

Loading…
Cancel
Save