Open anaqreon opened 5 years ago
I would like to share not only the favorites but also a selection of my pictures/contacts/devices/...
@escoand: for the pictures and contacts, just share it via the files/contact app and they will popup on the map of the other user. Let's discuss device sharing in an own Issue, as it is more complicated than favorite share. (most of the time you do not want to share a device (i.e. your phone) forever, but just for a limited time, like a live location in whatsapp).
Yup, let’s focus on sharing sets of Favorites here. First version could be to just get a read-only link to a map view with the favorite places marked on the map.
@tacruc but I would also be interested in sharing to non-users by URL. Maybe as live holiday tracking or so. Sharing images, tracks and favourites separately would not help in this case.
@anaqreon see my comment above. ;)
First version could be to just get a read-only link to a map view with the favorite places marked on the map.
And we will see from there. Step by step.
I'd be happy to have a go at a basic version to share favorites with other users on the same server. Is anyone already working on this?
@paulschwoerer very cool! As far as I can see, no one is working on this.
Best would be to just have a "Share" icon left of the 3-dot menu of a favorite row, just like it is in the Files app.
Then there’s 2 ways:
This is also why I would start the sharing not with people on the same server but rather only getting a share link you can send out to anyone. It’s very simple, doesn’t need a list and it works with anyone directly. :) (As mentioned above at https://github.com/nextcloud/maps/issues/70#issuecomment-527174169 )
What do you think?
I agree that introducing the right side at an early stage like this is overkill. Might make sense in the future though, once the sharing functionality is further ahead. I'll familiarize myself with the code and see what I can come up with.
On a sidenote: Are there plans on adding in VueJS, like the core project and other nextcloud apps are doing? Maybe this question is off-topic and could be answered in a pm.
I'll familiarize myself with the code and see what I can come up with.
Cool! Feel free to open up a pull request early so we can communicate about the direction and design. :)
Are there plans on adding in VueJS, like the core project and other nextcloud apps are doing?
I don’t know how familiar @eneiluj and @tacruc are with Vue.js, but yes, ideally we would use that too especially now that we have more and more in the compontent library. They will have to comment on that. :)
@jancborchardt I'm fairly experienced with VueJS, I'd be happy to help with the transition.
@paulschwoerer very cool! We have our components at https://github.com/nextcloud/nextcloud-vue If you have time, you are invited to our next Contributor Week in Berlin, November 4–8. All info at https://nextcloud.com/blog/join-us-in-berlin-for-the-next-nextcloud-hackweek/ :)
(Also cc'ing some of our Vue experts @skjnldsv @juliushaertl)
Just to let anyone reading this ticket know of my progress so far: Basic public link sharing works in an early stage, public editing is still to be implemented. Due to the arguably tight coupling of the frontend controllers, it seemed like a lot of work to extract the necessary parts of the favorite controller without breaking everything. This is why I went a step further and used Vue for the public facing part of the app, because
I might be able to open a pull request sometime next week, depending on how much time I can dedicate towards this project on the weekend. In the meantime, anyone interested in the changes so far can have a look at my fork of the maps app.
Cheers!
@paulschwoerer very cool! Sent you an invite to the Nextcloud org, including the Maps and Vuejs teams (you can opt out if you like). You can then directly work in a branch off this main repo instead of in a fork which makes collaboration easier. Also you can open pull requests in Draft mode so we can directly discuss on that. :)
@jancborchardt Cool, sounds good. Thanks!
PS: I'd also be happy to join a hackweek, this time however won't work out.
@paulschwoerer I'm not sure which of your fork's branches to use. The latest commit is on the vue-rewrite
branch, so I tried that one. I am unable to enable the Maps app on a fresh installation. It fails with the following error:
PHP Fatal error: Cannot declare class InstallScan, because the name is already in use in /var/www/html/apps/maps/lib/Migration/InstallScan.php on line 45
If you have a working Docker environment, you should be able to reproduce this by executing
git clone --recursive --branch issue-70 https://github.com/anaqreon/nextcloud-maps-dev.git
cd nextcloud-maps-dev
./maps/init.sh
See the https://github.com/anaqreon/nextcloud-maps-dev Readme for details.
@anaqreon Yeah I see. For whatever reason (I guess by accident) I commented out the namespace line in file /var/www/html/apps/maps/lib/Migration/InstallScan.php
. Undoing that got it working again. If you do a git submodule update --remote
in your repository, it should install correctly.
However if you want to run the app in its current state you need to manually add a table to your database, as I did not create a migration, yet. This should help you:
CREATE TABLE `oc_maps_favorite_shares` (
`id` int(11) NOT NULL,
`owner` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`category` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`token` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `oc_maps_favorite_shares`
ADD PRIMARY KEY (`id`);
Also you need to manually add the share to the database, like so:
INSERT INTO `oc_maps_favorite_shares` (`id`, `owner`, `category`, `token`) VALUES
(1, 'YOUR_USER_NAME', 'Personal', 'TOKEN');
You can then access the shared favorites on:
NEXTCLOUD_URL/apps/maps/s/favorites/TOKEN
This process is a bit tedious right now, but will be fixed soon(ish).
Upon clicking the three dots and Share link
I see the following error in a notification in the top right corner of the map Failed to share favorites category
However, the checkbox stays selected past a refresh.
A similar error shows when unchecking the share box as well. No errors in JS console besides something seems unrelated in https://eotl.cloud/js/activity/activity-sidebar.js?v=64336246-8:603
@basebuilder I'll have a look at that tomorrow.
@basebuilder Unfortunately, I cannot reproduce this behaviour in NC20, can you check if there are entries in the nexcloud.log, that could be related to the error?
I had the same issue as @basebuilder and see this in the request logs:
POST | https://<domain>/apps/maps/favorites-category/<Some-Category>/share
400 bad request
Response: "Unknown category"
For me it happens when there are spaces in the category name.
@basebuilder are you trying to share the default category? Then I think it is solved in #510.
@louwers Thank you so much. Removing spaces and special characters fixed the issue for me.
My understanding is that currently the only way to share static locations stored in a user's "favorites" is by exporting them to a GPX-formatted file, either exporting all favorites or favorites in a selected category. This GPX file may then be shared in the standard ways file sharing is supported in Nextcloud.
It would be very useful to have the ability to share a favorite group "directly" with either (1) Nextcloud account holders (the same way files can be shared with access control based on authenticated Nextcloud accounts) or (2) via public link, where the practically-impossible-to-guess shared link opens the Maps app in a public view-only mode that displays the shared favorites group on the map. In the case of shares with local Nextcloud account holders, the shared favorites would appear alongside the user's own favorites, perhaps under a collapsible/toggleable "Locations shared with you" navigation section.