X Tutup
Skip to content

Allow multiple link shares#27337

Merged
PVince81 merged 41 commits intomasterfrom
allow-multiple-link-shares
Mar 23, 2017
Merged

Allow multiple link shares#27337
PVince81 merged 41 commits intomasterfrom
allow-multiple-link-shares

Conversation

@PVince81
Copy link
Contributor

@PVince81 PVince81 commented Mar 8, 2017

Description

Removes the artifical restriction in the code that limited link shares to a single entry.

Please note that the limit was put in place because the UI wasn't ready for multiple link shares.
Before merging this, make sure the UI is adjusted first.

Related Issue

Motivation and Context

We want multiple link shares!

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@fheidecke here you go, please use this branch when testing the frontend changes.
Multiple link shares can simply be created by using POST when creating the share and PUT when changing it. Each will get a different id. It's similar to regular user shares.

@PVince81 PVince81 added this to the 10.0 milestone Mar 8, 2017
@mention-bot
Copy link

@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mjobst-necls and @DeepDiver1975 to be potential reviewers.

@lordelix
Copy link
Contributor

Does this support all features shown in this clickdummy?
https://felixheidecke.github.io/owc_clickdummys/pages/sharing.html

@PVince81
Copy link
Contributor Author

Does this support all features shown in this clickdummy?

very likely

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 14, 2017

Tasks:

  • create SharesCollection class for shares and use it only for link shares for now

  • create ShareModel class for shares but only use for link shares for now

    • fetch must get it
    • save must create or update it
  • make ShareItemModel's getLinkShare method return a collection instead of an array => getLinkShareCollection()

  • create a ShareLinkCollectionView representing the link shares list

    • based / wired with a SharesCollection (any event rerenders the whole list)
    • put it in a separate sub-tab "Public links" as per click-dummy
    • action for opening popup
      • set a newly created ShareModel
      • add it to collection if popup was closed with OK
    • action for deletion (collection.get(shareId).destroy())
    • action for edition: get the ShareModel from the collection and pass it to the popup
  • repurpose ShareDialogLinkShareView for the popup

    • remove all saving logic and move it to the model if needed (we only save on OK, not for every field change)
    • triggers events for OK and Cancel/close
    • based on a ShareModel
    • merge expiration subview into this one => did not merge it but used it
    • put it into a popup dialog
    • clicking OK calls shareModel.save() and closes

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • TODO: make sure that when resharing is not allowed the UI appear properly accordingly

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • TODO: the share link social view must only appear / be created when clicking the share/anchor icon (only a single view might be needed and append it within the row)

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • TODO: double check expire data inconsistency
  • TODO: test server side errors handling in link dialog (ex: password policy)

@PVince81
Copy link
Contributor Author

@felixheidecke please have a look at my changes, let me know if something is unclear.

We still need the subtab for "Public links".

Regarding the merging of the expiration view I'd recommend against it to save some time. If needed I can simply rewire it for now. Let me know what you think.

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • TODO: email field

Should the email field rather be part of the anchor feature ? (share with social, share with email, copy to clipboard). It feels weird to have an email field in the popup and need to click "Edit" to access it.

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • TODO: adjust unit tests (once the structure is set in stone)

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • only show email field in popup on create

  • test if email field actually works

  • investigate how to pass / add a new "label" field for link naming

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • TEST: reshares and reshare info display

@lordelix
Copy link
Contributor

lordelix commented Mar 15, 2017

It feels weird to have an email field in the pop-up and need to click "Edit" to access it.

As we discussed just now, we need this in the modal to be able to access the password for further usage with E-Mail and Text-Messages (SMS)

@PVince81 PVince81 mentioned this pull request Mar 15, 2017
9 tasks
@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

Then once we have this we can use another migration to add the new column.

@PVince81
Copy link
Contributor Author

I've already added the migration commit + the new name column + passing it through the APIs on this PR.
There's now a name field now in the popup which value is saved/edited properly.

Now if we want the name to be prepopulated to be the token, then it means we need to pre-create the share before opening the popup for editing. If we really want that, then once the share model reaches the popup it isn't a new share any more. So we'll need to pass a flag to the dialog as it cannot rely on isNew() any more.

@felixheidecke can you confirm that this is the flow we want ?

@PVince81
Copy link
Contributor Author

  • creation date in tooltip ? (it's the "stime" attribute)

@lordelix
Copy link
Contributor

lordelix commented Mar 15, 2017

@PVince81 My suggestion is the following (in code terms): echo (name) ? name : token
There is no need to populate the name field if the name input is null. Agree?

@PVince81
Copy link
Contributor Author

My suggestion is the following (in code terms): echo (name) ? name : token
There is no need to populate the name field if the name is null. Agree?

Yes, agree.

@lordelix
Copy link
Contributor

creation date in tooltip?

Depends on where the tooltip lives. Go ahead and implement it. I can take care of it whenever I bügel glatt the UI.

@PVince81
Copy link
Contributor Author

I'll let you do the share time stuff.

In the last push a7db599:

  • added mail view to the popup (only for new shares)
  • email is sent when clicking ok, right after share creation
  • removed the link share text field and replaced it with the name (with the logic name || token)

@felixheidecke I think you can take over from here. Let me know when the structures are stable enough so I can update most unit tests.

@PVince81
Copy link
Contributor Author

I've just added a few more tweaks:

  • link view is now rendered lazily
  • link view and subtabs properly disappear when link sharing is globally forbidden
  • properly display "resharing is not allowed" on the main view
  • prevent sidebar tab switching to affect subtabs (it was a bug in the sidebar code)

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 15, 2017

  • TODO: server-side unit tests for the newly added "name" column...

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 16, 2017

  • TODO: reimplement password enforcement logic (visual clue about required field + validation on save)

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 16, 2017

  • BUG: clipboard button doesn't seem to work for hidden fields. Maybe need to hide it offscreen instead

@PVince81
Copy link
Contributor Author

  • little clear button to clear fields, unless the field value is required

@PVince81 PVince81 force-pushed the allow-multiple-link-shares branch from 6220dea to e05713d Compare March 20, 2017 10:40
@PVince81
Copy link
Contributor Author

PVince81 commented Mar 20, 2017

We can't merge this yet as there is no proper way for copying the link.
Minimum would be to make the clipboard thing work to avoid losing this in a major way.

  • BUG: no way to copy link

In general I'd also like to have the icon order sorted out already before merging, if possible. Trash is still too close to the share button.

@PVince81 PVince81 force-pushed the allow-multiple-link-shares branch from d0ef748 to 012208f Compare March 23, 2017 11:19
@PVince81
Copy link
Contributor Author

Merged all blockers, rebased.

👍 for @felixheidecke's code

Let's get this merged, unless you have objections @felixheidecke. Date picker format stuff to be handled separately as it's a different topic.

@PVince81 PVince81 merged commit 6100a3d into master Mar 23, 2017
@PVince81 PVince81 deleted the allow-multiple-link-shares branch March 23, 2017 14:23
@PVince81 PVince81 restored the allow-multiple-link-shares branch March 23, 2017 14:23
@PVince81 PVince81 deleted the allow-multiple-link-shares branch March 23, 2017 14:23
@PVince81
Copy link
Contributor Author

Cannot unset password when editing, raised here #27481

@lock
Copy link

lock bot commented Aug 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup