Skip to content

Share favorite locations #70

Description

@anaqreon

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.

Activity

  1. escoand commented on Sep 2, 2019

    @escoand

    I would like to share not only the favorites but also a selection of my pictures/contacts/devices/...

  2. tacruc commented on Sep 2, 2019

    @tacruc
    Collaborator

    @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).

  3. jancborchardt commented on Sep 2, 2019

    @jancborchardt
    Member

    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.

  4. escoand commented on Sep 8, 2019

    @escoand

    @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.

  5. jancborchardt commented on Sep 10, 2019

    @jancborchardt
    Member

    @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.

  6. paulschwoerer commented on Oct 3, 2019

    @paulschwoerer
    Contributor

    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?

  7. jancborchardt commented on Oct 4, 2019

    @jancborchardt
    Member

    @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 #70 (comment) )

    What do you think?

  8. paulschwoerer commented on Oct 5, 2019

    @paulschwoerer
    Contributor

    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.

  9. jancborchardt commented on Oct 9, 2019

    @jancborchardt
    Member

    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. :)

  10. paulschwoerer commented on Oct 10, 2019

    @paulschwoerer
    Contributor

    @jancborchardt I'm fairly experienced with VueJS, I'd be happy to help with the transition.

  11. jancborchardt commented on Oct 10, 2019

    @jancborchardt
    Member

    @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)

  12. paulschwoerer commented on Oct 30, 2019

    @paulschwoerer
    Contributor

    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

    1. it serves as a proof of concept of how the transition to Vue could work out if it is decided to go along this path
    2. it seemed to be about the same amount of work as adapting the existing controllers

    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!

  13. jancborchardt commented on Oct 30, 2019

    @jancborchardt
    Member

    @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. :)

  14. paulschwoerer commented on Oct 31, 2019

    @paulschwoerer
    Contributor

    @jancborchardt Cool, sounds good. Thanks!

    PS: I'd also be happy to join a hackweek, this time however won't work out.

  15. anaqreon commented on Nov 13, 2019

    @anaqreon
    MemberAuthor

    @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.

  16. paulschwoerer commented on Nov 13, 2019

    @paulschwoerer
    Contributor

    @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).

  17. paulschwoerer commented on Jan 17, 2021

    @paulschwoerer
    Contributor

    @BaseBuilder I'll have a look at that tomorrow.

  18. paulschwoerer commented on Jan 18, 2021

    @paulschwoerer
    Contributor

    @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?

  19. eyecreate commented on Mar 6, 2021

    @eyecreate

    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"
    
  20. louwers commented on Apr 13, 2022

    @louwers

    For me it happens when there are spaces in the category name.

  21. tacruc commented on Apr 13, 2022

    @tacruc
    Collaborator

    @BaseBuilder are you trying to share the default category?
    Then I think it is solved in #510.

  22. Gruefus commented on May 20, 2022

    @Gruefus

    @louwers Thank you so much. Removing spaces and special characters fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions