SwellRT / jetpad

Collaboration tool based on real-time text editing
10 stars 3 forks source link

Pad friendly URL #1

Open pablojan opened 6 years ago

pablojan commented 6 years ago

We want to have friendly URLs for the pads. A pad URL must be aligned with the pad title. If a pad title changes, a new URL for that title must be accepted as well as previous URLs It is ok to store the current title as a pad's object property.

SwellRT provides utility methods for handling this, check out. https://github.com/P2Pvalue/swellrt/blob/develop/wave/doc/swellrt/Reference.md#friendly-names-for-collaborative-objects

Ana06 commented 6 years ago

until https://github.com/SwellRT/jetpad/issues/2 is implemented the pad title can not change, right? :thinking: although it is supported anyway....

pablojan commented 6 years ago

Right ;) you can also implement #2 :)

El 12 jul. 2018 7:52 p. m., Ana María Martínez Gómez notifications@github.com escribió:

until #2 is implemented the pad title can not change, right? 🤔

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

Ana06 commented 6 years ago

@pablojan I have some questions:

pablojan commented 6 years ago

Swell assigns an auto generated id to objects if no custom id is provided, for example local.net/s+34cs5z2 , and I think that it must be the canonical id for the object.

Secondly, to make things easier for the users, we can set a first object name, using the title. Regarding your idea of different names by user <user-name>/<pad-title> I can't say now if it is a useful approach.

I am pretty sure that getObjectNames() returns the object id together with all names for that id. Maybe doc is not clear enough. :dancer:

Ana06 commented 6 years ago

@pablojan

I am pretty sure that getObjectNames() returns the object id together with all names for that id. Maybe doc is not clear enough.

I see... the WaveNaming is converted to JSON so the id is there, just missed in the documentation... :thinking: I'll update the documentation :wink:

Ana06 commented 6 years ago

ok... it is there... but it is still not really nice... It returns something like:

{ "waveId": { "domain": "local.net", "id": "hola" }, "names": [ { "name": "hola", "created": 1531492853419 } ] }

what would mean that to get the id you would have to do something like in the frontend:

names_json['waveId']['domain'].concat('/').concat(names_json['waveId']['id'])

or is there a better way to do this? :thinking: because if not, it would be nicer to just return { id: "local.net/hola", names: ["hola"] }. So, parsing it manually instead of using toJson of a WaveNaming

pablojan commented 6 years ago

hehe sure, the response will be nicer returning the id in one single string. I did open an issue in swellrt for it https://github.com/P2Pvalue/swellrt/issues/242