JakovTomasic / RitehMaps

Indoor navigation project for the Faculty of Engineering, Rijeka
Apache License 2.0
3 stars 1 forks source link

feat:sharing #54

Closed lus-terry closed 1 year ago

lus-terry commented 1 year ago

In RoomSearch.ts I added findRoomByNodeId which is used to find one SearchNodeSuggestion by a given nodeId. (somewhat opposite logic than sortedSuggestionsForStart and sortedSuggestionsForDestination).

I also created a private method mapToList so that the code is clearer and there are no duplicate parts.

I transferred the buttons (Go and share) to a new document GoShareButtons.tsx. The user is able to click on these buttons when the destination is entered. If for example user doesn't enter start and than clicks Go-button, startNodeId is by default the main entrance. The same applies to share-button.

When the user clicks on share-button ShareWindow opens. The same window can be closed by clicking on ExitIcon. ShareWindow contains buttons for sharing on different social media and button for copying current URL to the clipboard. I used buttons from here . Sharing on social media is not working (error: Parameter 'href' should represent a valid URL) but I think it is because our URL is still "localhost...". I still want reviewers to check that. Copytoclipboard-button works.

In SearchForm.tsx and Search.tsx I added logic for sharing: URL is updated with parameters: startNodeId and endNodeId. When another user approaches that same URL, the input box for start and the input box for destination are automatically filled.

One bug that I didn't manage to resolve is that the input boxes are filled with nodeId and not with roomName as they should be. Another bug or suggestion would be to add some kind of logic that when the correct roomName is typed in (not selected by dropdown) Go and Share-button turns blue and the user is able to click on them. Any suggestion in which file should I implement this?

Also, what do you think about the design of ShareWindow? Any suggestions would be appreciated.

lus-terry commented 1 year ago

Please check 6d7833d73ffe570afe73b783698d511a33dffbcd

JakovTomasic commented 1 year ago

I did and I fixed your problem in b1d7572.

lus-terry commented 1 year ago

Thank you! Everything works great now!

JakovTomasic commented 1 year ago

All problems resolved. The merge was valid.