| @@ -81,19 +81,19 @@ const CreateScrapeRequest = ({ handleRequest }) => { | |||
| </div> | |||
| <div className="col-md-2"> | |||
| <div className="form-group"> | |||
| <Select options={prices} value={{ name: requestObject.price, label: requestObject.price }} onChange={handleChangePriceType} /> | |||
| <Select options={prices} onChange={handleChangePriceType} placeholder={t('createScrapeRequest.PricePlaceholder')} /> | |||
| </div> | |||
| </div> | |||
| <div className="col-md-2"> | |||
| <div className="form-group"> | |||
| <Select className="cursor-pointer" value={{ name: requestObject.beds, label: requestObject.beds }} options={beds} onChange={handleChangeBedType} /> | |||
| <Select className="cursor-pointer" options={beds} onChange={handleChangeBedType} placeholder={t('createScrapeRequest.BedsPlaceholder')}/> | |||
| </div> | |||
| </div> | |||
| <div className="col-md-2"> | |||
| <Select className="cursor-pointer" value={{ name: requestObject.type, label: requestObject.type }} options={types} onChange={handleChangeFilterType} /> | |||
| <Select className="cursor-pointer" options={types} onChange={handleChangeFilterType} placeholder={t('createScrapeRequest.TypePlaceholder')} /> | |||
| </div> | |||
| <div className="col-md-2"> | |||
| <Select className="cursor-pointer" value={{ name: requestObject.lifestyle, label: requestObject.lifestyle }} options={lifeStyles} onChange={handleChangeLifeStyleType} /> | |||
| <Select className="cursor-pointer" options={lifeStyles} onChange={handleChangeLifeStyleType} placeholder={t('createScrapeRequest.LifestylePlaceholder')}/> | |||
| </div> | |||
| <div className="col-md-1"> | |||
| <button type="button" onClick={() => { handleRequest(requestObject); setRequestObject({ location: '' }) }} className="btn btn-outline-primary cursor-pointer">Request</button> | |||
| @@ -12,8 +12,9 @@ const ScrapeRequest = ({ scrape, index, handleExecute }) => { | |||
| <tr> | |||
| <td> | |||
| <p> | |||
| {console.log(scrape)} | |||
| </p><h3><Link to={{ | |||
| pathname: SCRAPE_RESULTS_PAGE, | |||
| pathname: SCRAPE_RESULTS_PAGE.replace(':id', scrape._id), | |||
| id: scrape._id | |||
| }}>#{index} {scrape.location}</Link></h3> | |||
| <span className="text-muted">Count {scrape.count} +</span> | |||
| @@ -4,4 +4,4 @@ export const FORGOT_PASSWORD_PAGE = '/forgot-password'; | |||
| export const HOME_PAGE = '/home'; | |||
| export const ERROR_PAGE = '/error-page'; | |||
| export const NOT_FOUND_PAGE = '/not-found'; | |||
| export const SCRAPE_RESULTS_PAGE = '/scrape-results'; | |||
| export const SCRAPE_RESULTS_PAGE = '/scrape-results/:id'; | |||
| @@ -3,17 +3,20 @@ import {WorkingDayType, SaturdayType,SundayType }from '../constants/workingHours | |||
| export default function getHours(officeHours) { | |||
| var day = new Date().getDay(); | |||
| var value = null; | |||
| if(officeHours === undefined && officeHours.length < 3 ){ | |||
| return null; | |||
| value = null; | |||
| } | |||
| else if(day === Saturday){ | |||
| return officeHours[SaturdayType].hours; | |||
| value = officeHours[SaturdayType]; | |||
| } | |||
| else if(day === Sunday){ | |||
| return officeHours[SundayType].hours; | |||
| value = officeHours[SundayType]; | |||
| } | |||
| else { | |||
| return officeHours[WorkingDayType].hours; | |||
| value = officeHours[WorkingDayType]; | |||
| } | |||
| return value !== null && value !==undefined ? value.hours: null ; | |||
| } | |||
| @@ -87,7 +87,12 @@ export default { | |||
| }, | |||
| createScrapeRequest: { | |||
| Title: "Request new scrappe", | |||
| LocationPlaceholder : "Location or Point of Interest" | |||
| LocationPlaceholder : "Location or Point of Interest", | |||
| PricePlaceholder: "price", | |||
| BedsPlaceholder:"beds", | |||
| LifestylePlaceholder :"lifestyle", | |||
| TypePlaceholder: "type" | |||
| }, | |||
| scrapeRequests: { | |||
| Title: "Scrappes", | |||
| @@ -1,19 +1,25 @@ | |||
| import React, { useEffect, useState } from 'react'; | |||
| import { getByIdScrappe } from '../../request/scrappe'; | |||
| import { Link } from "react-router-dom"; | |||
| import { Link , useParams } from "react-router-dom"; | |||
| import ScrappeDetails from '../../components/ScrappeDetails/ScrappeDetails' | |||
| import ScrappeResult from '../../components/ScrappeResult/ScrappeResult' | |||
| import PropTypes from 'prop-types'; | |||
| //import PropTypes from 'prop-types'; | |||
| const ScrapeResultsPage = ({ location }) => { | |||
| const ScrapeResultsPage = () => { | |||
| let { id } = useParams() | |||
| const [scrappeResults, setScrappeResults] = useState() | |||
| const [scrappeDetails, setScrappeDetails] = useState() | |||
| useEffect(() => { | |||
| <<<<<<< HEAD | |||
| getByIdScrappe(location.id) | |||
| .then(res => { | |||
| ======= | |||
| getByIdScrappe(id) | |||
| .then(res => { | |||
| >>>>>>> 7774b91b3ce86cc28579305f9cdcae42501ac95c | |||
| setScrappeDetails(res.data) | |||
| if (res.data.status === 'done') | |||
| @@ -25,6 +31,10 @@ const ScrapeResultsPage = ({ location }) => { | |||
| return ( | |||
| <> | |||
| <<<<<<< HEAD | |||
| ======= | |||
| {console.log(id)} | |||
| >>>>>>> 7774b91b3ce86cc28579305f9cdcae42501ac95c | |||
| <nav className="main-header navbar navbar-expand-md navbar-light navbar-white"> | |||
| <div className="container"> | |||
| @@ -52,8 +62,8 @@ const ScrapeResultsPage = ({ location }) => { | |||
| ); | |||
| }; | |||
| ScrapeResultsPage.propTypes = { | |||
| location: PropTypes.object | |||
| }; | |||
| // ScrapeResultsPage.propTypes = { | |||
| // location: PropTypes.object | |||
| // }; | |||
| export default ScrapeResultsPage; | |||