Ignore:
Timestamp:
01/24/24 17:42:28 (5 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
0f5aa27
Parents:
5528b99
Message:

prefinal fixes

Location:
frontend/src/Components/Resources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/Resources/AddAvailability.js

    r5528b99 r07f4e8b  
    1 import React from "react";
     1 import React from "react";
    22import { Container, Row, Modal, Im } from "react-bootstrap";
    33import { useState } from "react";
     
    4242        <Modal.Body>
    4343            {props.type === "hotel" && <AddHotelForm/>}
    44             {props.type === "room" && <AddRoomAvailablityForm hotelRoomId={props.hotelRoomId}/>}
    45             {props.type === "table" && <AddTableAvailablityForm table={props.table}/>}
     44            {props.type === "room" && <AddRoomAvailablityForm refresh={props.refresh} close={props.closeModal}  hotelRoomId={props.hotelRoomId}/>}
     45            {props.type === "table" && <AddTableAvailablityForm refresh={props.refresh} close={props.closeModal} table={props.table}/>}
    4646            {props.type === "restaurant" && <AddRestaurantForm/>}
    4747            {props.type === "transport" && <AddTransportForm/>}
  • frontend/src/Components/Resources/AddImages.js

    r5528b99 r07f4e8b  
    5353                    {!isLoading && data.map((image) => {
    5454                        let link = image.url;
    55                         console.log("SLIKATAAA")
    56                         console.log(image)
    5755                        if (image.url.includes('Desktop')) {
    5856                            link = 'http://localhost:8080/download?fileName=' + encodeURIComponent(image.url);
  • frontend/src/Components/Resources/AddNew.js

    r5528b99 r07f4e8b  
    5656        </Modal.Header>
    5757        <Modal.Body>
    58             {props.type === "hotel" && <AddHotelForm refresh={props.refresh}/>}
    59             {props.type === "room" && <AddRoomForm refresh={props.refresh} hotelId={props.Id}/>}
    60             {props.type === "restaurant" && <AddRestaurantForm edit="false" refresh={props.refresh}/>}
    61             {props.type === "transport" && <AddTransportForm refresh={props.refresh}/>}
     58            {props.type === "hotel" && <AddHotelForm closeModal={handleClose} refresh={props.refresh}/>}
     59            {props.type === "room" && <AddRoomForm closeModal={handleClose} refresh={props.refresh} hotelId={props.Id}/>}
     60            {props.type === "restaurant" && <AddRestaurantForm edit="false" closeModal={handleClose} refresh={props.refresh}/>}
     61            {props.type === "transport" && <AddTransportForm closeModal={handleClose} refresh={props.refresh}/>}
    6262            {props.type === "menu" && <AddItemMenuForm Id={props.Id} refresh={props.refresh}/>}
    6363            {props.type === "route" && <AddTripForm transportId={props.transport.transportID} setSize={setSizeXl} refresh={props.refresh}/>}
  • frontend/src/Components/Resources/EditModal.js

    r5528b99 r07f4e8b  
    3232        </Modal.Header>
    3333        <Modal.Body>
    34             {props.type === "hotel" && <AddHotelForm/>}
     34            {props.type === "hotel" && <AddHotelForm refresh={props.refresh}/>}
    3535            {props.type === "room" && <EditRoomForm refresh={props.refresh} room={props.room}/>}
    3636            {props.type === "restaurant" && <AddRestaurantForm edit="false" refresh={props.refresh}/>}
  • frontend/src/Components/Resources/ResourceListing.js

    r5528b99 r07f4e8b  
    88
    99const ResourceListing = (props) => {
    10  
    11     console.log("props " + props.id)
    12  
    1310
    1411    const type = props.type == "hotel" ? "сместувањето" : props.type == "restaurant" ? "ресторанот" : "превозот";
    1512    const name = props.type == "hotel" ? props.data.hotelName : props.type == "restaurant" ? props.data.restaurantName : props.data.transportName
    16 <<<<<<< HEAD
    1713    const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.restaurantID : props.data.transportID
    1814    console.log(props.data)
     
    5450                    </Col>
    5551
    56                     <Col className="d-flex flex-column justify-content-center align-content-center">
    57                         <AddImages type={props.type} Id={id} />
    58                     </Col>
     52                    {props.type !== 'transport' && <Col className="d-flex flex-column justify-content-center align-content-center">
     53                        <AddImages type={props.type} Id={id}/>
     54                    </Col>}
    5955                    <Col className="d-flex justify-content-center align-content-center">
    60 =======
    61     const id = props.type == "hotel" ? props.data.hotelId : props.type == "restaurant" ? props.data.resturantId : props.data.transportID
    62     return(<>
    63     <a href={`${props.type}/${id}`} style={{textDecoration: "none", color:"black"}}>
    64         <Container className="py-3 px-1 my-4"
    65         style={{
    66           border: "4px solid #159895",
    67           borderRadius: "1em",
    68           boxShadow: "0 3px 5px #159895",
    69           maxWidth: "90%",
    70         }}>
    71             <Row>
    72                 <Col className="d-flex justify-content-center">
    73                     <Image
    74                     src="https://www.imgacademy.com/sites/default/files/legacyhotel.jpg"
    75                     style={{
    76                         height: "8em",
    77                         borderRadius: "1em",
    78                         boxShadow: "0 4px 20px lightblue",
    79                         maxWidth: "100%",
    80                     }}
    81                     ></Image>
    82                 </Col>
    83                 <Col >
    84                     <h2 style={{textAlign: "left"}}>{name}</h2>
    85                     {props.type === "hotel" && (<>
    86                       <h5 style={{textAlign: "left"}}>{props.data.hotelLocation}</h5>
    87                       <h5 style={{textAlign: "left"}}>{props.data.hotelEmail}</h5>
    88                     </>)}
    89                     {props.type === "restaurant" && (<>
    90                       <h5 style={{textAlign: "left"}}>{props.data.restaurantLocation}</h5>
    91                       <h5 style={{textAlign: "left"}}>{props.data.cousineType} кујна</h5>
    92                     </>)}
    93                     {props.type === "transport" && (<>
    94                       <h5 style={{textAlign: "left"}}>{props.data.carBrand}</h5>
    95                       <h5 style={{textAlign: "left"}}>{props.data.carPlate}</h5>
    96                     </>)}
    97                 </Col>
    98                 <Col className="d-flex justify-content-center align-content-center" >
    99 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
    10056                  <span
    10157                      style={{
  • frontend/src/Components/Resources/ResourcesTab.js

    r5528b99 r07f4e8b  
    1010
    1111function ResourcesTab(props) {
    12 <<<<<<< HEAD
    1312    const [activeTab, setActiveTab] = useState(props.tab);
    1413    const userId = JSON.parse(localStorage.getItem("user")).userId;
     
    3635                    <Nav.Item className="tab_item rounded-5">
    3736                        <Nav.Link href="/resources/hotel" className="text-left rounded-5">
    38 =======
    39   const [activeTab, setActiveTab] = useState(props.tab);
    40   // const [changed, setChanged] = useState(0);
    41   const userId = localStorage.getItem("userId");
    42   const { data, setData, isLoading, getData, setChanged } = useGet(`${props.tab}/user/${userId}`);
    43 
    44   const handleSelect = (eventKey) => {
    45     setActiveTab(eventKey);
    46     console.log(props.refresh);
    47     props.refresh(eventKey);
    48     console.log("refresh" + eventKey);
    49   };
    50 
    51   !isLoading && console.log(data);
    52   console.log(props.tab);
    53 
    54   return (
    55     <Container className="rounded-5">
    56       <Tab.Container
    57         activeKey={activeTab}
    58         onSelect={handleSelect}
    59         className="bg-dark rounded-5"
    60       >
    61         <Nav
    62           fill
    63           variant="tabs"
    64           className="bg-body rounded-top-5"
    65           activeKey="/hotel"
    66           id="tab_item"
    67         >
    68           <Nav.Item className="tab_item rounded-5">
    69             <Nav.Link href="/resources/hotel" className="text-left rounded-5">
    70 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
    7137              <span className="ikona">
    7238                <FaHotel
     
    10167                </Nav>
    10268
    103 <<<<<<< HEAD
    10469                <Tab.Content className="py-5 px-3 border rounded-bottom-5 bg-light">
    10570                    <Tab.Pane eventKey="/hotel" key="hotelPane">
     
    150115        </Container>
    151116    );
    152 =======
    153         <Tab.Content className="py-5 px-3 border rounded-bottom-5 bg-light">
    154           <Tab.Pane eventKey="/hotel" key="hotelPane">
    155             {props.tab == "/hotel" && !isLoading && data != null &&
    156               data.map((hotel) => {
    157                 return (
    158                   <Link key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>
    159                     <ResourceListing
    160                       key={hotel.hotelId}
    161                       id={hotel.hotelId}
    162                       type="hotel"
    163                       data={hotel}
    164                     />
    165                   </Link>
    166                 );
    167               })}
    168             <AddNew type="hotel" refresh={setChanged} />
    169           </Tab.Pane>
    170           <Tab.Pane eventKey="/restaurant" key="restaurantPane">
    171             {props.tab == "/restaurant" && !isLoading && data != null &&
    172               data.map((restaurant) => {
    173                 console.log("mapiranje " + restaurant)
    174                 return (
    175                   <Link key={restaurant.restaurantId} to={"/resources/restaurant/" + restaurant.restaurantID}>
    176                     <ResourceListing
    177                       key={restaurant.restaurantId}
    178                       type="restaurant"
    179                       data={restaurant}
    180                     />
    181                   </Link>
    182                 );
    183               })}
    184             <AddNew type="restaurant" refresh={setChanged}/>
    185           </Tab.Pane>
    186           <Tab.Pane eventKey="/transport" key="transportPane">
    187             {props.tab == "/transport" && !isLoading && data.length > 0 &&
    188               data.map((transport) => {
    189                 return (
    190                   <ResourceListing
    191                     key={transport.transportId}
    192                     id={transport.transportId}
    193                     type="transport"
    194                     data={transport}
    195                   />
    196                 );
    197               })}
    198             <AddNew type="transport" refresh={setChanged}/>
    199           </Tab.Pane>
    200         </Tab.Content>
    201       </Tab.Container>
    202     </Container>
    203   );
    204 >>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
    205117}
    206118
Note: See TracChangeset for help on using the changeset viewer.