unfoldingWord / gateway-translate

A tool for editing and translating text in USFM markup
MIT License
2 stars 3 forks source link

Default to read-only files except for user's default repo #80

Closed birchamp closed 1 year ago

birchamp commented 1 year ago

When a card is opened, the text can be viewed read-only (R/O) or read-write (R/W).

DoD:

When the file meets the above criteria it is opened as editable. Otherwise, it is opened as read-only.

mandolyte commented 1 year ago

@larsgson @abelpz

Is there a flag in the editor component to specify "read only" (at least as a default - the user should be able to change it).

Which reminds me, the README for the editor needs some work. For example, it would be nice if questions like the above could be found in the README.

abelpz commented 1 year ago

@mandolyte there is one button in the toolbar that sets a prop from xelah I beleive, it is the pencil icon in the toolbar, but it seems like even in read-only mode it allows the user to edit the title, unless you also activate the preview button.

abelpz commented 1 year ago

As I can see from the source code, you are able to pass the props: {editable: false, preview:true} to the editor components, so no need to modify anything in uw-editor I think, apart from the documentation for it.

superdav42 commented 1 year ago

I just approved and merged #91 but then looked at this issue and realized it does not follow:

Text comes from local machine - open RW

Uploaded text is now being opened RO by default.

abelpz commented 1 year ago

@mandolyte ^^^

mandolyte commented 1 year ago

This does not seem to be working at all now. Every method is making an editable card. Nothing is read only.

Not sure what happened here.

Note: tested using current deployment https://gateway-translate.netlify.app/ (since it should be merged)

superdav42 commented 1 year ago

It is working now. Pleas check again.

elsylambert commented 1 year ago

Cards default to Read only/ Read write on the following conditions: Text comes from user's current Org/lang - open R/W- Works as expected Text comes from local machine - open RW- works as expected Text comes from anywhere else - open RO. Opens in Read only. Users are able to edit by clicking on the Pencil icon and Save the edits if they have permission for the Org/Repo.

danielklapp commented 1 year ago

Tested with v0.9.0-rc.2 build 29a2450 QA. Looks good