owncloud / guests

:family: Share with externals easily via email address
https://marketplace.owncloud.com/apps/guests
GNU General Public License v2.0
6 stars 13 forks source link

Client interaction upcoming troubles #180

Open PVince81 opened 6 years ago

PVince81 commented 6 years ago

A lot of the guest app code is in JS form: the autocomplete dropdown extension that decides whether to add "Add guest" in the dropdown depending on some criteria:

With this current state, all clients (desktop, mobile, etc) would need to reimplement the same logic. The more complex the logic becomes, the more logic needs to be replicated on clients.

At some point we need to think of moving said logic to the server side. This comes with its own complications as there is currently no good way to plug it in into the autocomplete results without affecting other apps (ex: custom groups also uses share autocomplete, to be confirmed).

There is a way to provide share providers (like federated shares one), maybe the guest app could implement one. The difference is that it would only display an entry and upon share creation, instead of creating a share it would create a guest instead of creating a share of type "guest".

@pmaier1 FYI

michaelstingl commented 6 years ago

With this current state, all clients (desktop, mobile, etc) would need to reimplement the same logic. The more complex the logic becomes, the more logic needs to be replicated on clients.

Guest User creation was designed, to enter only the mail. No other Ui needed. It should be fully transparent for the clients. Display … (guest) after the mail? Maybe server can put it in the shareWithAdditionalInfo field? (owncloud/client#6749, owncloud/android#2284, owncloud/ios-app#83)

PVince81 commented 6 years ago

displaying "(guest)" can be done as part of the label like we do for federated shares

michaelstingl commented 6 years ago

Just checked federated shares in the web UI, and label isn't used there. More JS magic?

com_bjango_istatmenus_network_und_applevolumeextra_und_item-0

{
  "ocs": {
    "meta": {
      "status": "ok",
      "statuscode": 100,
      "message": "OK",
      "totalitems": "",
      "itemsperpage": ""
    },
    "data": {
      "exact": {
        "users": [],
        "groups": [],
        "remotes": [
          {
            "label": "user@exampl",
            "value": {
              "shareType": 6,
              "shareWith": "user@exampl"
            }
          }
        ]
      },
      "users": [],
      "groups": [],
      "remotes": []
    }
  }
}

(ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=user%40exampl&perPage=200&itemType=folder)

Why do clients need to care about the shareType and need to adapt the UI? Only link share and user share (could be user, group, federated, guest …) should be differentiated.

PVince81 commented 6 years ago

This is all legacy stuff... I agree with you. We could introduce another label "fullDisplayName" that contains everything to be displayed, not only the user's display name.