Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

refactor hide / delete actions #2390

Closed
wants to merge 8 commits into from

Conversation

der-john
Copy link

@der-john der-john commented Jun 8, 2016

Strongly related to #2374 (follow-up: introduce DELETE), and thus to #2336 (physical deletion).

The original aim of this was:

  • translate the popup saying 'Do you really want to delete this?' when you hit 'delete' on an IdeaCollection proposal.

While doing this, I noticed that hide/delete functions were wrapped in extremely similar ways (including the aforementioned question) in the following five places:

  • IdeaCollection
  • Alexanderplatz
  • Blog
  • Comment
  • Mercator2015

@xi and I discussed the possibility to factor out this functionality. I suggested adding a 'resourceAction' - eventually this action should replace adhDeleteAction, since HIDE should be used where 'mark-as-deleted' used to be used.

In this PR,

  • a resourceAction called adhHideAction is implemented;

the following use cases are replaced with adhHideAction:

  • IdeaCollection
  • Alexanderplatz
  • Blog (physical deletion #2365 replaced 'mark-as-deleted' with physical deletion. The
    use case for this was deleting badge assignments, not blog contents.
    Therefore @2e2a and I suggest to replace the delete action in Blog.ts with hide, even though I couldn't test it right now.)

The following use cases are left untouched:

  • Comment - because the template of the hide action is different (it's an icon).
  • Mercator2015 - because the functionality is part of a ResourceWidget.

TODO:

  • check for remaining use cases of 'mark-as-deleted' (-> none),
  • check for remaining use cases of DELETE (-> none),
  • check for remaining use cases of adhDeleteAction (-> only Mercator2015).
  • check whether Mercator2015 can be changed affordably.

John added 8 commits June 8, 2016 11:48
permission check was improved
use case for this was deleting badge assignments, not blog contents.
Therefore I suggest to replace the delete action in Blog.ts with hide.
since it uses adhHttp.hide
@der-john der-john self-assigned this Jun 8, 2016
@der-john der-john changed the title refactor hide actions refactor hide / delete actions Jun 8, 2016
@der-john
Copy link
Author

der-john commented Jun 9, 2016

rebased.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant