tests & image-request on google & inspirobot & front

This commit is contained in:
Simon CATANESE 2024-05-11 22:37:32 +02:00
parent 6602bfd408
commit 3f0db3f976
24 changed files with 1421 additions and 454 deletions

Binary file not shown.

View File

@ -3,56 +3,44 @@
"WorkspaceRootPath": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\", "WorkspaceRootPath": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\",
"Documents": [ "Documents": [
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\Source\\Repos\\2024-DEV-BUT3\\src\\api\\image-request.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\home.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\api\\image-request.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\pages\\home.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\RoomItemsList.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\inspirobot.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\item\\RoomItemsList.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\api\\inspirobot.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemBox.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\item\\ItemBox.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemPage.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\item\\ItemPage.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\index.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\api\\index.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\app-layout.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\app-layout.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\main.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\main.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\App.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\App.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\nav\\Navbar.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\main.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\nav\\Navbar.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\main.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\room.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\item.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\api\\room.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\api\\item.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\test.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\app-layout.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\pages\\test.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\app-layout.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemBox.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\item\\ItemBox.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}, },
{ {
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\Source\\Repos\\2024-DEV-BUT3\\src\\hooks\\page-title-context.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}", "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\form\\formUpdateItem.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\hooks\\page-title-context.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}" "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\form\\formUpdateItem.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\router.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\router.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\form\\formCreateItem.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\form\\formCreateItem.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
} }
], ],
"DocumentGroupContainers": [ "DocumentGroupContainers": [
@ -61,50 +49,59 @@
"VerticalTabListWidth": 256, "VerticalTabListWidth": 256,
"DocumentGroups": [ "DocumentGroups": [
{ {
"DockedWidth": 200, "DockedWidth": 109,
"SelectedChildIndex": 3, "SelectedChildIndex": 6,
"Children": [ "Children": [
{ {
"$type": "Bookmark", "$type": "Document",
"Name": "ST:1:0:{d212f56b-c48a-434c-a121-1c5d80b59b9f}" "DocumentIndex": 4,
"Title": "item.js",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\item.js",
"RelativeDocumentMoniker": "src\\api\\item.js",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\item.js",
"RelativeToolTip": "src\\api\\item.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAdAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-09T22:23:19.906Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "App.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx",
"RelativeDocumentMoniker": "src\\App.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx",
"RelativeToolTip": "src\\App.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABoAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-09T22:10:26.286Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "main.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\main.jsx",
"RelativeDocumentMoniker": "src\\main.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\main.jsx",
"RelativeToolTip": "src\\main.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAANAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-09T22:08:08.294Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 1, "DocumentIndex": 1,
"Title": "RoomItemsList.jsx", "Title": "inspirobot.js",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\RoomItemsList.jsx", "DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\inspirobot.js",
"RelativeDocumentMoniker": "src\\components\\item\\RoomItemsList.jsx", "RelativeDocumentMoniker": "src\\api\\inspirobot.js",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\RoomItemsList.jsx", "ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\inspirobot.js",
"RelativeToolTip": "src\\components\\item\\RoomItemsList.jsx", "RelativeToolTip": "src\\api\\inspirobot.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABwAAABiAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAIAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-09T12:04:41.785Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "index.js",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\index.js",
"RelativeDocumentMoniker": "src\\api\\index.js",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\index.js",
"RelativeToolTip": "src\\api\\index.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAIAAAAeAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-09T12:03:27.48Z", "WhenOpened": "2024-05-09T21:22:04.631Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "image-request.js",
"DocumentMoniker": "C:\\Users\\Admin\\Source\\Repos\\2024-DEV-BUT3\\src\\api\\image-request.js",
"RelativeDocumentMoniker": "src\\api\\image-request.js",
"ToolTip": "C:\\Users\\Admin\\Source\\Repos\\2024-DEV-BUT3\\src\\api\\image-request.js",
"RelativeToolTip": "src\\api\\image-request.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-09T11:59:29.915Z",
"EditorCaption": "" "EditorCaption": ""
}, },
{ {
@ -115,125 +112,78 @@
"RelativeDocumentMoniker": "src\\components\\app-layout.jsx", "RelativeDocumentMoniker": "src\\components\\app-layout.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\app-layout.jsx", "ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\app-layout.jsx",
"RelativeToolTip": "src\\components\\app-layout.jsx", "RelativeToolTip": "src\\components\\app-layout.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAACYAAAAcAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAABUAAABCAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-07T10:59:39.423Z", "WhenOpened": "2024-05-09T21:08:36.748Z",
"EditorCaption": "" "EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 8, "DocumentIndex": 8,
"Title": "Navbar.jsx", "Title": "router.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\nav\\Navbar.jsx", "DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\router.jsx",
"RelativeDocumentMoniker": "src\\components\\nav\\Navbar.jsx", "RelativeDocumentMoniker": "src\\router.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\nav\\Navbar.jsx", "ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\router.jsx",
"RelativeToolTip": "src\\components\\nav\\Navbar.jsx", "RelativeToolTip": "src\\router.jsx",
"ViewState": "AQIAADUAAAAAAAAAAAAQwFAAAAAVAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAwAAAAIAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-07T10:56:14.054Z" "WhenOpened": "2024-05-09T21:07:37.931Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "home.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\home.jsx",
"RelativeDocumentMoniker": "src\\pages\\home.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\home.jsx",
"RelativeToolTip": "src\\pages\\home.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAB0AAABSAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-09T21:06:29.035Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:1:0:{d212f56b-c48a-434c-a121-1c5d80b59b9f}"
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "formUpdateItem.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\form\\formUpdateItem.jsx",
"RelativeDocumentMoniker": "src\\components\\form\\formUpdateItem.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\form\\formUpdateItem.jsx",
"RelativeToolTip": "src\\components\\form\\formUpdateItem.jsx",
"ViewState": "AQIAADIAAAAAAAAAAAAQwFAAAAA+AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-09T17:17:12.338Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 9, "DocumentIndex": 9,
"Title": "room.js", "Title": "formCreateItem.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\room.js", "DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\form\\formCreateItem.jsx",
"RelativeDocumentMoniker": "src\\api\\room.js", "RelativeDocumentMoniker": "src\\components\\form\\formCreateItem.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\room.js", "ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\form\\formCreateItem.jsx",
"RelativeToolTip": "src\\api\\room.js", "RelativeToolTip": "src\\components\\form\\formCreateItem.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAASAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-06T22:06:47.739Z"
},
{
"$type": "Document",
"DocumentIndex": 10,
"Title": "test.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\test.jsx",
"RelativeDocumentMoniker": "src\\pages\\test.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\test.jsx",
"RelativeToolTip": "src\\pages\\test.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABMAAAACAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T18:36:04.359Z" "WhenOpened": "2024-05-09T17:10:45.808Z",
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "ItemPage.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemPage.jsx",
"RelativeDocumentMoniker": "src\\components\\item\\ItemPage.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemPage.jsx",
"RelativeToolTip": "src\\components\\item\\ItemPage.jsx",
"ViewState": "AQIAABIAAAAAAAAAAAAAACkAAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T18:36:16.712Z",
"EditorCaption": "" "EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 6, "DocumentIndex": 6,
"Title": "main.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\main.jsx",
"RelativeDocumentMoniker": "src\\main.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\main.jsx",
"RelativeToolTip": "src\\main.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAwAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-07T11:03:34.632Z"
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "App.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx",
"RelativeDocumentMoniker": "src\\App.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx",
"RelativeToolTip": "src\\App.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA4AAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T16:40:31.952Z"
},
{
"$type": "Document",
"DocumentIndex": 11,
"Title": "package.json",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\package.json",
"RelativeDocumentMoniker": "package.json",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\package.json",
"RelativeToolTip": "package.json",
"ViewState": "AQIAAAYAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
"WhenOpened": "2024-05-06T23:20:16.656Z"
},
{
"$type": "Document",
"DocumentIndex": 12,
"Title": "page-title-context.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\hooks\\page-title-context.jsx",
"RelativeDocumentMoniker": "src\\hooks\\page-title-context.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\hooks\\page-title-context.jsx",
"RelativeToolTip": "src\\hooks\\page-title-context.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAMAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T19:10:02.382Z"
}
]
},
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "ItemBox.jsx", "Title": "ItemBox.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemBox.jsx", "DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemBox.jsx",
"RelativeDocumentMoniker": "src\\components\\item\\ItemBox.jsx", "RelativeDocumentMoniker": "src\\components\\item\\ItemBox.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemBox.jsx", "ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemBox.jsx",
"RelativeToolTip": "src\\components\\item\\ItemBox.jsx", "RelativeToolTip": "src\\components\\item\\ItemBox.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABwAAAA7AAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAACAAAAB6AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-09T12:03:58.04Z", "WhenOpened": "2024-05-09T16:47:58.998Z",
"EditorCaption": "" "EditorCaption": ""
} }
] ]

View File

@ -2,15 +2,15 @@
"ExpandedNodes": [ "ExpandedNodes": [
"", "",
"\\src", "\\src",
"\\src\\api", "\\src\\assets",
"\\src\\assets\\styles",
"\\src\\components", "\\src\\components",
"\\src\\components\\form", "\\src\\components\\form",
"\\src\\components\\item", "\\src\\components\\item",
"\\src\\components\\nav", "\\src\\components\\nav",
"\\src\\contexts", "\\src\\hooks",
"\\src\\pages", "\\src\\pages"
"\\src\\pages\\authenticated"
], ],
"SelectedNode": "\\src\\main.jsx", "SelectedNode": "\\src\\api\\item.js",
"PreviewInSolutionExplorer": false "PreviewInSolutionExplorer": false
} }

Binary file not shown.

View File

@ -0,0 +1,25 @@
import { describe, it, expect } from "vitest";
import { searchAndResizeImage } from "../../src/api/image-request"
describe("Image request API", () => {
it("return a string", async () => {
let query = 'cat';
let imageUrl = await searchAndResizeImage(query);
let isString = typeof imageUrl == 'string'
expect(isString).toBe(true);
});
it("returns a valid image URL when results are found", async () => {
let query = 'cat';
let imageUrl = await searchAndResizeImage(query);
expect(imageUrl).toMatch(/^https?:\/\/.*\.(?:png|jpg|jpeg|gif|webp)$/i);
});
it("returns an empty string when no image is found", async () => {
const query = '[][][][][][][][][][][][][][]'; //cette requête ne renvoie aucune image
const imageUrl = await searchAndResizeImage(query);
expect(imageUrl).toEqual('');
});
});

View File

@ -0,0 +1,18 @@
import { describe, it, expect } from "vitest";
import { findInspiration } from "../../src/api/inspirobot"
describe("Inspirobot API", () => {
it("return a string", async () => {
let imageUrl = await findInspiration();
let isString = typeof imageUrl == 'string'
expect(isString).toBe(true);
});
it("returns a valid image URL or an empty string", async () => {
let query = 'cat';
let imageUrl = await findInspiration(query);
let okResult = imageUrl.endsWith('.jpg') || imageUrl == ""
expect(okResult).toBe(true)
});
});

973
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,14 +10,12 @@ export async function searchAndResizeImage(query) {
const imageUrl = data.items[0].link; const imageUrl = data.items[0].link;
console.log('Image URL:', imageUrl); console.log('Image URL:', imageUrl);
return imageUrl; return imageUrl;
} else {
console.error('No image found.');
return "";
} }
} catch (error) { } catch (error) {
console.error('Error fetching image:', error); console.error('Error fetching image:', error);
return "";
} }
console.error('No image found.');
return "";
} }

View File

@ -1,3 +1,6 @@
export * from './authentication' export * from './authentication'
export * from './user' export * from './user'
export * from './image-request' export * from './image-request'
export * from './room'
export * from './item'
export * from './inspirobot'

15
src/api/inspirobot.js Normal file
View File

@ -0,0 +1,15 @@
export const findInspiration = async () => {
try {
const url = 'https://corsproxy.io/?https://inspirobot.me/api?generate=true'
const response = await fetch(url);
const pictureUrl = await response.text();
console.log(pictureUrl);
return pictureUrl
} catch (error) {
console.error(error);
}
return "";
}

25
src/api/item.js Normal file
View File

@ -0,0 +1,25 @@
import axios from "axios";
export const getItem = async (_id) => {
try {
const response = await axios.get("/item", {_id});
console.log(response.data)
return response.data;
} catch (error) {
console.log("ERROR", error.response.data)
return error.response.data;
}
};
export const getItems = async () => {
try {
const response = await axios.get("/item", {});
console.log(response.data)
return response.data;
} catch (error) {
console.log("ERROR", error.response.data)
return error.response.data;
}
};

View File

@ -2,7 +2,19 @@ import axios from "axios";
export const getRoom = async () => {
export const getRoom = async (_id) => {
try {
const response = await axios.get("/room", {_id});
console.log(response.data)
return response.data;
} catch (error) {
console.log("ERROR", error.response.data)
return error.response.data;
}
};
export const getRooms = async () => {
try { try {
const response = await axios.get("/room", {}); const response = await axios.get("/room", {});
console.log(response.data) console.log(response.data)

View File

@ -0,0 +1,102 @@
.item-container {
display: flex;
flex-direction: column;
align-items: center;
}
.filters {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 15px;
background-color: #f5f5f5;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.filter-group {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.filter-group label {
margin-right: 15px;
font-weight: bold;
color: #333;
}
.filter-group .ant-picker,
.filter-group .ant-input-number,
.filter-group .ant-input,
.filter-group .ant-select {
margin-right: 15px;
width: 180px;
}
.filter-group .ant-select {
max-width: 180px;
}
.filter-group .ant-picker {
width: 100%;
}
.filter-group .ant-input-number {
width: 100%;
}
.filter-group .ant-input {
width: 100%;
}
@media screen and (max-width: 768px) {
.filters {
flex-direction: column;
align-items: stretch;
padding: 10px;
}
.filter-group {
margin-bottom: 15px;
}
.filter-group label {
margin-bottom: 5px;
}
.filter-group .ant-picker,
.filter-group .ant-input-number,
.filter-group .ant-input,
.filter-group .ant-select {
margin-right: 0;
margin-bottom: 5px;
width: auto;
max-width: 100%;
}
}
.item-list {
width: 100%;
}
.pagination {
margin-top: 20px;
}
/* Style pour les boutons de pagination */
.pagination button {
margin: 0 5px;
}
/* Style pour les ItemBox */
.item-container .item-list .ant-col {
display: flex;
justify-content: center;
}
.item-container .item-list .ant-col .gutter-row {
margin-bottom: 20px;
}

View File

@ -0,0 +1,59 @@
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.product-details {
border: 1px solid #ccc;
border-radius: 8px;
padding: 15px;
margin-bottom: 20px;
width: 250px; /* Largeur ajustable en fonction de votre mise en page */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.product-details img {
display: block;
margin: 0 auto;
width: 150px;
height: 150px;
object-fit: fill;
border-radius: 5px;
}
.product-details h2 {
font-size: 16px;
margin-top: 10px;
margin-bottom: 5px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: bold;
color: #333;
}
.characteristic {
margin-top: 10px;
font-size: 14px;
color: #555;
}
.product-details button {
display: block;
width: 100%;
margin-top: 15px;
padding: 10px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
font-weight: bold;
transition: background-color 0.3s ease;
}
.product-details button:hover {
background-color: #0056b3;
}

View File

@ -0,0 +1,36 @@
/* CSS pour la fenêtre modale */
.modal {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
z-index: 999;
}
.modal-content {
background-color: white;
margin: 20% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}

View File

@ -19,19 +19,19 @@ const AppLayout = ({ footer }) => {
return ( return (
<Layout style={{ height:'100vh' }}> <Layout style={{ minHeight: '100vh', margin: '-8px -8px 0' }}>
<Sider breakpoint="lg" collapsible collapsed={collapsed}> <Sider breakpoint="lg">
<div className="demo-logo-vertical" /> <div className="demo-logo-vertical" />
<Navbar/> <Navbar />
</Sider> </Sider>
<Layout> <Layout style={{ flexGrow: 1 }}>
<Header style={{ padding: 0, background: colorBgContainer }}> <Header style={{ padding: 0, background: colorBgContainer }}>
<Button type="text" icon={collapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />} onClick={() => setCollapsed(!collapsed)} style={{fontSize: '16px', width: 64, height: 64}}/> <Button type="text" icon={collapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />} onClick={() => setCollapsed(!collapsed)} style={{ fontSize: '16px', width: 64, height: 64 }} />
{pageTitle} {pageTitle}
</Header> </Header>
<Content style={{ margin: '24px 16px 0'}}> <Content style={{ margin: '24px 16px 0', overflowY: 'auto', overflowX: 'hidden' }}>
<div style={{ padding: 24, minHeight: 360, background: colorBgContainer, borderRadius: borderRadiusLG }}> <div style={{ padding: 24, background: colorBgContainer, borderRadius: borderRadiusLG, minHeight: '100%' }}>
<Router /> <Router />
</div> </div>
</Content> </Content>

View File

@ -0,0 +1,93 @@
import React, { useState, useEffect } from "react";
import { Form, Input, InputNumber, Button, Select } from "antd";
import axios from "axios";
import { getRooms } from "../../api/room";
import { getItem } from "../../api/item";
const { TextArea } = Input;
const { Option } = Select;
function formatItem(_id, brand, model, room, price, purchaseDate, description, categories, createdAt, updatedAt, __v) {
let item = {
_id,
brand,
model,
room,
price,
purchaseDate,
description,
categories,
createdAt,
updatedAt,
__v
}
return item;
}
export const FormUpdateItem = ({ itemId }) => {
const [form] = Form.useForm();
const [rooms, setRooms] = useState([]);
const [item, setItem] = useState(formatItem({ _id: itemId }))
useEffect(() => {
setRooms(getRooms())
setItem(getItem(item._id))
}, []);
const onFinish = async (values) => {
try {
const response = await axios.put(
`${import.meta.env.VITE_API_URL}/item/${item._id}`,
values,
);
console.log(response.data);
} catch (error) {
console.error(error);
}
};
return (
<Form
form={form}
onFinish={onFinish}
initialValues={item} // Initialise le formulaire avec les valeurs de l'élément
>
<h1>Update Item</h1>
<Form.Item label="Brand" name="brand">
<Input />
</Form.Item>
<Form.Item label="Model" name="model">
<Input />
</Form.Item>
<Form.Item label="Room" name="room">
<Select placeholder="Select a room">
{rooms.map((room) => (
<Option key={room._id} value={room._id}>
{room.name}
</Option>
))}
</Select>
</Form.Item>
<Form.Item label="Price" name="price">
<InputNumber />
</Form.Item>
<Form.Item label="Purchase Date" name="purchaseDate">
<Input />
</Form.Item>
<Form.Item label="Description" name="description">
<Input.TextArea rows={4} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
);
};
export default FormUpdateItem;

View File

@ -1,5 +1,8 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { searchAndResizeImage } from '../../api/image-request' import { searchAndResizeImage } from '../../api/image-request'
import '../../assets/styles/modal.css'
import '../../assets/styles/itembox.css'
import FormUpdateItem from '../form/formUpdateItem';
// Composant Image // Composant Image
@ -35,12 +38,9 @@ const Image = ({ src, alt, request, _id }) => {
// Composant Description // Composant Description
const Description = ({ title, children }) => { const Description = ({ title, children }) => {
if (title.length >= 30) {
title = title.slice(0, 22 - 3) + '...';
}
return ( return (
<div className="description"> <div className="description">
<h2>{title}</h2> <h2 className="text-ellipsis">{title}</h2>
{children} {children}
</div> </div>
); );
@ -56,15 +56,32 @@ const Characteristic = ({ label, value }) => {
); );
}; };
// Composant Détails du Produit // Composant Détails du Produit
export const ItemBox = ({ model, brand, purchaseDate, price, onEdit, _id }) => { export const ItemBox = ({ model, brand, purchaseDate, price, _id }) => {
const [isModalOpen, setIsModalOpen] = useState(false);
// Fonction pour ouvrir la fenêtre modale
const openModal = () => {
setIsModalOpen(true);
};
// Fonction pour fermer la fenêtre modale
const closeModal = () => {
setIsModalOpen(false);
};
let productname = brand + " " + model; let productname = brand + " " + model;
let formatedPrice = price + "€"; let formatedPrice = price + "€";
let formatedDate = new Date(purchaseDate).toLocaleDateString('fr-FR'); let formatedDate = new Date(purchaseDate).toLocaleDateString('fr-FR');
let request = brand + " " + model let request = brand + " " + model
return ( return (
<div className="product-details" > <div className="product-details" >
<Description title={productname} > <Description title={productname} >
@ -73,8 +90,18 @@ export const ItemBox = ({ model, brand, purchaseDate, price, onEdit, _id }) => {
<Characteristic label="Brand" value={brand} /> <Characteristic label="Brand" value={brand} />
<Characteristic label="Purchase Date" value={formatedDate} /> <Characteristic label="Purchase Date" value={formatedDate} />
<Characteristic label="Price" value={formatedPrice} /> <Characteristic label="Price" value={formatedPrice} />
{/* Bouton d'édition pour ouvrir la fenêtre modale */}
<button onClick={openModal}>Edit</button>
</Description> </Description>
<button onClick={onEdit}>Edit</button> {/* Fenêtre modale */}
{isModalOpen && (
<div className="modal">
<div className="modal-content">
<span className="close" onClick={closeModal}>&times;</span>
<FormUpdateItem itemId={_id}></FormUpdateItem>
</div>
</div>
)}
</div> </div>
); );
}; };

View File

@ -2,6 +2,8 @@ import React, { useState, useEffect } from "react";
import axios from 'axios'; // Assurez-vous que le chemin d'importation soit correct import axios from 'axios'; // Assurez-vous que le chemin d'importation soit correct
import { ItemBox } from './ItemBox'; import { ItemBox } from './ItemBox';
import { Space, DatePicker, Row, Col, Select, Input, InputNumber } from 'antd'; import { Space, DatePicker, Row, Col, Select, Input, InputNumber } from 'antd';
import '../../assets/styles/item-page.css'
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
@ -111,33 +113,33 @@ export const ItemPage = () => {
const rowsToDisplay = chunkedItems.slice(startIndex, endIndex); const rowsToDisplay = chunkedItems.slice(startIndex, endIndex);
return ( return (
<div> <div className="item-container">
{/* Ajouter des éléments d'interface utilisateur pour les filtres */} <div className="filters">
<Select defaultValue="all" style={{ width: 120 }} onChange={handleRoomChange}> <div className="filter-group">
<label htmlFor="roomSelect">Chambre :</label>
<Select id="roomSelect" defaultValue="all" style={{ width: 120 }} onChange={handleRoomChange}>
<Option value="all">Toutes</Option> <Option value="all">Toutes</Option>
{rooms.map(room => ( {rooms.map(room => (
<Option key={room._id} value={room._id}>{room.name}</Option> <Option key={room._id} value={room._id}>{room.name}</Option>
))} ))}
</Select> </Select>
<Row> </div>
<Col span={5}> <div className="filter-group">
<Input placeholder="Recherche par nom" value={filterName} onChange={e => setFilterName(e.target.value)} /> <label htmlFor="nameInput">Recherche par nom :</label>
</Col> <Input id="nameInput" placeholder="Recherche par nom" value={filterName} onChange={e => setFilterName(e.target.value)} />
</Row> </div>
<Space direction="vertical" size={12}> <div className="filter-group">
<div> <label>Prix :</label>
<InputNumber placeholder="Prix min" value={filterPriceMin} onChange={value => setFilterPriceMin(value)} /> <InputNumber placeholder="Prix min" value={filterPriceMin} onChange={value => setFilterPriceMin(value)} />
<span> - </span> <span> - </span>
<InputNumber placeholder="Prix max" value={filterPriceMax} onChange={value => setFilterPriceMax(value)} /> <InputNumber placeholder="Prix max" value={filterPriceMax} onChange={value => setFilterPriceMax(value)} />
</div> </div>
<RangePicker <div className="filter-group">
format="YYYY-MM-DD" <label>Date d'achat :</label>
onChange={dates => setFilterDateRange(dates)} <RangePicker format="YYYY-MM-DD" onChange={dates => setFilterDateRange(dates)} value={filterDateRange} />
value={filterDateRange} </div>
/> </div>
</Space> <div className="item-list">
{/* Utiliser Row et Col pour afficher les éléments */}
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}> <Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}>
{rowsToDisplay.map((row, rowIndex) => ( {rowsToDisplay.map((row, rowIndex) => (
<React.Fragment key={rowIndex}> <React.Fragment key={rowIndex}>
@ -149,6 +151,7 @@ export const ItemPage = () => {
</React.Fragment> </React.Fragment>
))} ))}
</Row> </Row>
</div>
<div className="pagination"> <div className="pagination">
<button onClick={handlePrevPage} disabled={currentPage === 1}>Précédente</button> <button onClick={handlePrevPage} disabled={currentPage === 1}>Précédente</button>
<span>Page {currentPage}</span> <span>Page {currentPage}</span>

View File

@ -2,9 +2,9 @@ import React, { useState, useEffect } from "react";
import { Menu } from "antd"; import { Menu } from "antd";
import { HomeOutlined } from "@ant-design/icons" import { HomeOutlined } from "@ant-design/icons"
import { Home } from "../../pages"; import { Home } from "../../pages";
import { getRoom } from "../../api/room"; import { getRooms } from "../../api/room";
import { isLoggedIn } from "../../api/authentication" import { isLoggedIn } from "../../api/authentication"
import { Test } from "../../pages/test"; import { Items } from "../../pages/items";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
function getItem(key, label) { function getItem(key, label) {
@ -32,7 +32,7 @@ const Navbar = () => {
console.log("NAVBAR EFFECT") console.log("NAVBAR EFFECT")
isLoggedIn().then((user) => { isLoggedIn().then((user) => {
if (user !== "Unauthorized") { if (user !== "Unauthorized") {
getRoom().then((result) => { getRooms().then((result) => {
setRooms(result); setRooms(result);
}) })
} }
@ -56,7 +56,7 @@ const Navbar = () => {
<Link to="/home">Home</Link> <Link to="/home">Home</Link>
</Menu.Item>, </Menu.Item>,
<Menu.Item key="2" > <Menu.Item key="2" >
<Link to="/test">Test</Link> <Link to="/items">Tous les articles</Link>
</Menu.Item>, </Menu.Item>,
<SubMenu key="3" title="Chambres"> <SubMenu key="3" title="Chambres">
{roomItems} {roomItems}

View File

@ -1,20 +1,35 @@
import React from "react"; import React, { useEffect, useState } from "react";
import { usePageTitle } from '../hooks/page-title-context';
import { findInspiration } from '../api/inspirobot';
import { useAuth } from "../hooks"; import { useAuth } from "../hooks";
import { FormCreateItem } from "../components/form/formCreateItem";
import { FormCreateRoom } from "../components/form/formCreateRoom";
import { RoomItemsList } from "../components/item/RoomItemsList";
export const Home = () => { export const Home = () => {
const { setPageTitle } = usePageTitle();
const [inspirationUrl, setInspirationUrl] = useState("");
// Mettre à jour le titre de la page dans le contexte
useEffect(() => {
setPageTitle("Page d'accueil");
}, [setPageTitle]);
useEffect(() => {
findInspiration().then(result => {
console.log("AAAAAAAAA" + result)
setInspirationUrl(result)
})
}, []);
const { user } = useAuth(); const { user } = useAuth();
return ( return (
<div> <div style={{ display: 'block', margin: '5%, 50%, 0' }}>
<h1>Home page</h1> {user && <h2>BONJOUR {user.user.username}</h2>}
{user && <h2>Hello {user.user.username}</h2>} <p>C'est un plaisir de te voir aujourd'hui.</p>
<p>Nous allons te générer un message inspirationnel rien que pour toi :)</p>
<FormCreateRoom></FormCreateRoom> {inspirationUrl && <img src={inspirationUrl + '?' + new Date().getTime()} alt="inspirobot" style={{ display: 'block', margin: 'auto' }} width='auto' />}
<FormCreateItem></FormCreateItem> <p>Credits : https://inspirobot.me/</p>
<RoomItemsList></RoomItemsList>
</div> </div>
); );
}; };

View File

@ -4,13 +4,13 @@ import { useAuth } from "../hooks";
import { ItemPage } from "../components/item/ItemPage"; import { ItemPage } from "../components/item/ItemPage";
import { usePageTitle } from '../hooks/page-title-context'; import { usePageTitle } from '../hooks/page-title-context';
export const Test = () => { export const Items = () => {
const { user } = useAuth(); const { user } = useAuth();
const { setPageTitle } = usePageTitle(); const { setPageTitle } = usePageTitle();
// Mettre à jour le titre de la page dans le contexte // Mettre à jour le titre de la page dans le contexte
useEffect(() => { useEffect(() => {
setPageTitle("Vive la macronie à bat montjoie saint dennis"); setPageTitle("Liste des articles");
}, [setPageTitle]); }, [setPageTitle]);
return ( return (
<div> <div>

View File

@ -2,13 +2,14 @@ import React from "react";
import { Route, Routes } from "react-router-dom"; import { Route, Routes } from "react-router-dom";
import { Home, Login, Register } from "./pages"; import { Home, Login, Register } from "./pages";
import { Test } from "./pages/test"; import { Items } from "./pages/items";
export const Router = () => ( export const Router = () => (
<Routes> <Routes>
<Route index element={<Home />} /> <Route index element={<Home />} />
<Route path="home" element={<Home />} />
<Route path="login" element={<Login />} /> <Route path="login" element={<Login />} />
<Route path="register" element={<Register />} /> <Route path="register" element={<Register />} />
<Route path="test" element={<Test />} /> <Route path="items" element={<Items />} />
</Routes> </Routes>
); );

View File

@ -4,7 +4,7 @@ import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
server: { server: {
port: 3000, port: 3001,
}, },
test: { test: {
// Use happy-dom for a more lightweight browser environment // Use happy-dom for a more lightweight browser environment