-
Notifications
You must be signed in to change notification settings - Fork 32
feat: Public sharing via link #2236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: enh/noid/link-share-biz
Are you sure you want to change the base?
Conversation
- modifies oc_tables_share structure with two columns, token and password - adds ShareOCSController with a route to create link shares - adds a PageController front route to display the link share - adds a ApiPublicColumnsController to retrieve columns for public links. It was not added to the existing ApiColumnsController, as it requires the userId of the logged-in user and I did not want to weaken this detail. - adds an abstract controller for columns with shared functionality and make ApiColumnsController extend it. - adds a PublicRowOCSController for retrieving rows through link shares - adds a ShareToken value object - adds a ShareControlMiddleware for share token and existance validation. It comes with the AssertShareToken attribute. - extends Share entity with ShareToken and Password properties - extends ShareMapper to find a share by the share token - extends ShareService with a method to easily create link shares - extends ResponseDefinitions with TablesPublicRow and TablesPublicColumn specs. Essentially tableIDs are not exposed and also user ids in lastEditBy and createdBy are not disclosed. - extends RowService and ColumnService with methods to return such ^ formatted result arrays. - extends OpenAPI spec Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for displaying both views and tables, despite the name. I should probably rename view to element
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com>
9f86cfc to
6cc82e6
Compare
| ); | ||
| } | ||
|
|
||
| Util::addScript(Application::APP_ID, 'tables-main'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try using addStyle here to have custom styles, instead of the inline styles in error.php
| return !!this.shareToken | ||
| }, | ||
| shareToken() { | ||
| return loadState('tables', 'shareToken', false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadState is not reactive so this does not need to be a computed property but can just go to data
To prepare for more advanced navigation on public pages, we could also use the token from the vue-router route, but may be a step to far already
| <div v-if="usePassword" class="sharing-entry-link__form-row"> | ||
| <NcActionInput | ||
| :value.sync="password" | ||
| type="text" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be rather a type password? I think even in the files app that is not shown in plain text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went over the code and generally seems good, a few things to address still:
- We should probably not allow creating a share with a password when the password field is empty
- Design needs a bit of polishing so that the rows span the full width

- Editing should be blocked, you can currently inline edit, and requests are sent but they fail as expected
- Set password should probably be not checked by default (aligned with how it works in files)
| Util::addStyle(Application::APP_ID, 'grid'); | ||
| Util::addStyle(Application::APP_ID, 'modal'); | ||
| Util::addStyle(Application::APP_ID, 'tiptap'); | ||
| Util::addStyle(Application::APP_ID, 'tables-style'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this change but I think "tables-style" is not existent anymore. We can remove this and save a 404 request for a styles file that does not exist anymore. Can be seen in the browser development console
part of #67
TODO