This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app/controllers
Isaac Janzen 292d3677e9
FEATURE: Allow admins to permanently delete revisions (#19913)
# Context
This PR introduces the ability to permanently delete revisions from a post while maintaining the changes implemented by the revisions.
Additional Context: /t/90301

# Functionality
In the case a staff member wants to _remove the visual cue_ that a post has been edited eg.

<img width="86" alt="Screenshot 2023-01-18 at 2 59 12 PM" src="https://user-images.githubusercontent.com/50783505/213293333-9c881229-ab18-4591-b39b-e3419a67907d.png">

while maintaining the changes made in the edits, they can enable the (hidden) site setting of `can_permanently_delete`.
When this is enabled, after _hiding_ the revisions

<img width="149" alt="Screenshot 2023-01-19 at 1 53 35 PM" src="https://user-images.githubusercontent.com/50783505/213546080-2a9e9c55-b3ef-428e-a93d-1b6ba287dfae.png">

there will be an additional button in the history modal to <kbd>Delete revisions</kbd> on a post.

<img width="997" alt="Screenshot 2023-01-19 at 1 49 51 PM" src="https://user-images.githubusercontent.com/50783505/213546333-49042558-50ab-4724-9da7-08bacc68d38d.png">

Since this action is permanent, we display a confirmation dialog prior to triggering the destroy call

<img width="722" alt="Screenshot 2023-01-19 at 1 55 59 PM" src="https://user-images.githubusercontent.com/50783505/213546487-96ea6e89-ac49-4892-b4b0-28996e3c867f.png">

Once confirmed the history modal will close and the post will `rebake` to display an _unedited_ post.

<img width="868" alt="Screenshot 2023-01-19 at 1 56 35 PM" src="https://user-images.githubusercontent.com/50783505/213546608-d6436717-8484-4132-a1a8-b7a348d92728.png">
 
see that there is not a visual que for _revision have been made on this post_ for a post that **HAS** been edited. In addition to this, a user history log for `purge_post_revisions` will be added for each action completed.

# Limits
- Admins are rate limited to 20 posts per minute
2023-01-19 15:09:01 -06:00
..
badges FIX: Don't try to load badges if there none left (#13695) 2021-07-14 14:42:31 +10:00
discovery DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
navigation FIX: Regression with Categories nav item (#17885) 2022-08-12 11:30:39 -04:00
preferences A11Y: more descriptive user page titles (#19819) 2023-01-19 12:45:45 -05:00
about.js DEV: Fix various typos (#17485) 2022-07-14 08:56:25 +08:00
account-created-edit-email.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
account-created-index.js UX: better account-created page (#17452) 2022-07-14 20:43:00 +05:30
activation-edit.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
application.js DEV: Migrate sidebar site settings (#19336) 2022-12-08 09:44:29 +08:00
associate-account-confirm.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
auth-token.js A11Y: Trap focus on auth security modal (#18573) 2022-10-13 16:16:22 -04:00
avatar-selector.js DEV: Centralise user preferences account route tests into single file (#19118) 2022-11-21 13:09:33 +08:00
basic-modal-body.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
bookmark.js FEATURE: Promote polymorphic bookmarks to default and migrate (#16729) 2022-05-23 10:07:15 +10:00
bulk-notification-level.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
change-owner.js FIX: Call _clearFlash() when displaying a modal (#14848) 2021-11-09 17:51:50 -05:00
change-post-notice.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
change-timestamp.js FIX: Call _clearFlash() when displaying a modal (#14848) 2021-11-09 17:51:50 -05:00
composer.js DEV: Remove enable_whispers site setting (#19196) 2022-12-16 18:42:51 +02:00
convert-to-public-topic.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
create-account.js FEATURE: add user toggle to mask/unmask passwords (#19306) 2022-12-19 18:56:51 -05:00
create-invite-bulk.js FEATURE: Various improvements to invite system (#12023) 2021-03-03 11:45:29 +02:00
create-invite.js DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
delete-topic-confirm.js FIX: Call _clearFlash() when displaying a modal (#14848) 2021-11-09 17:51:50 -05:00
discard-draft.js DEV: Asyncify most of Composer controller (#17974) 2022-08-18 13:58:08 +02:00
discovery-sortable.js FIX: Ensure all public topic-query options can be used via Ember (#17706) 2022-07-29 09:03:53 +10:00
discovery.js UX: Change placement of welcome cta (#18806) 2022-11-01 14:07:40 -05:00
dismiss-notification-confirmation.js Refine dismiss notification confirmation (#15017) 2021-11-22 09:11:24 +08:00
do-not-disturb.js FEATURE: Create notification schedule to automatically set do not disturb time (#11665) 2021-01-20 10:31:52 -06:00
download-calendar.js DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
edit-category-tabs.js DEV: update yes/no confirmation dialogs (#18181) 2022-09-14 11:06:56 -04:00
edit-slow-mode.js DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
edit-topic-timer.js FEATURE: Allow category moderators to set auto deletion topic timers (#19383) 2022-12-08 17:14:43 -03:00
edit-user-directory-columns.js DEV: Plugin API to add directory columns (#13440) 2021-06-22 13:00:04 -05:00
email-login.js FEATURE: Add safe-mode toggle to /u/admin-login (#17930) 2022-08-15 15:30:07 +01:00
exception.js FEATURE: Improvement to history stack handling on server errors 2021-06-21 11:09:23 -07:00
explain-reviewable.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
feature-topic-on-profile.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
feature-topic.js DEV: update yes/no confirmation dialogs (#18181) 2022-09-14 11:06:56 -04:00
flag.js REFACTOR: Improve reusability by Decoupling flag modal from flag target. (#18251) 2022-09-29 11:57:36 -03:00
forgot-password.js DEV: Extensively use includes() (#17541) 2022-07-17 20:48:36 +02:00
full-page-search.js FIX: Reset search controller state (#19402) 2022-12-13 09:50:44 -05:00
fullscreen-code.js FEATURE: Add fullscreen button for code blocks (#16044) 2022-03-01 08:37:24 +10:00
grant-badge.js DEV: Extensively use startsWith() (#17540) 2022-07-17 20:16:39 +02:00
group-activity-posts.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-activity-topics.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
group-activity.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-add-members.js FIX: Reintroduce add group user by email (#13581) 2021-06-30 17:59:22 +03:00
group-default-notifications.js FEATURE: update existing users when group default notifications changed. (#13434) 2021-07-15 19:53:57 +05:30
group-index.js FEATURE: Allow group owners promote more owners (#19768) 2023-01-11 16:43:18 +08:00
group-manage-categories.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-manage-logs.js DEV: enforces eslint’s curly rule to the codebase (#10720) 2020-09-22 16:28:28 +02:00
group-manage-profile.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
group-manage-tags.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-manage.js FIX: Show group Email settings if just SMTP enabled (#13362) 2021-06-15 10:09:25 +10:00
group-messages.js FIX: Allow mobile-nav to work without loading transitions (#12184) 2021-02-23 11:16:40 +00:00
group-permissions.js FEATURE: Group category permissions tab (#10388) 2020-08-10 09:49:05 -05:00
group-requests.js FIX: Correctly debounce various functions (#18673) 2022-10-20 13:28:09 +02:00
group.js UX: Improve UI of group delete dialog (#19292) 2022-12-02 12:01:25 +08:00
groups-index.js Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509) 2020-12-18 10:18:52 -03:00
groups-new.js DEV: refactor bootbox alerts (#18292) 2022-09-27 14:47:13 -04:00
history.js FEATURE: Allow admins to permanently delete revisions (#19913) 2023-01-19 15:09:01 -06:00
ignore-duration-with-username.js DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
ignore-duration.js DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
insert-hyperlink.js A11Y: Keep composer as focused element when dismissing Link modal via keyboard (#17893) 2022-08-15 09:37:19 +08:00
invites-show.js FEATURE: add user toggle to mask/unmask passwords (#19306) 2022-12-19 18:56:51 -05:00
json-schema-editor.js DEV: Add experimental json_scheme site setting type (#12226) 2021-03-01 09:15:17 -05:00
jump-to-post.js DEV: minor refactoring or jump-to-post (#15312) 2021-12-15 12:09:26 +01:00
keyboard-shortcuts-help.js FIX: Clientside checks for personal_message_enabled_groups (#18691) 2022-10-21 14:38:33 +10:00
login.js FEATURE: add user toggle to mask/unmask passwords (#19306) 2022-12-19 18:56:51 -05:00
modal.js DEV: Add the missing app subdirectory (#9499) 2020-04-23 10:07:54 -03:00
move-to-topic.js FIX: post mover validation color and message (#15688) 2022-02-02 16:22:52 +11:00
not-activated.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
password-reset.js FEATURE: add user toggle to mask/unmask passwords (#19306) 2022-12-19 18:56:51 -05:00
preferences.js FIX: don't allow category and tag tracking settings on staged users (#13688) 2021-07-16 14:50:40 -04:00
publish-page.js UX: publishes page, on public change, only when page is published (#12123) 2021-02-18 17:34:50 +01:00
raw-email.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
reject-reason-reviewable.js FEATURE: reason to reject user signup (#11700) 2021-01-15 09:43:26 +11:00
reorder-categories.js UX: Improvements for reordering categories (#13013) 2021-06-09 13:01:06 +03:00
request-group-membership-form.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
review-index.js DEV: Extensively use includes() (#17541) 2022-07-17 20:48:36 +02:00
review-settings.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
second-factor-add-security-key.js FIX: Clarify security key copy (#18636) 2022-10-18 16:30:48 +10:00
second-factor-add-totp.js DEV: Remove usage of {{action}} modifiers - Take 2 (#18476) 2022-10-05 13:08:54 +01:00
second-factor-auth.js DEV: Remove usage of {{action}} modifiers - Take 2 (#18476) 2022-10-05 13:08:54 +01:00
second-factor-backup-edit.js FEATURE: better UI to manage 2fa (#19338) 2022-12-08 09:41:22 +11:00
second-factor-edit-security-key.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
second-factor-edit.js FEATURE: better UI to manage 2fa (#19338) 2022-12-08 09:41:22 +11:00
share-and-invite.js DEV: Add the missing app subdirectory (#9499) 2020-04-23 10:07:54 -03:00
share-topic.js SECURITY: Category group permissions leaked to normal users. 2022-04-08 13:46:20 +08:00
static.js UX: fix button alignment on log-in required page (#11965) 2021-02-04 14:38:58 +11:00
tag-groups-edit.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
tag-groups-new.js UX: Adjustments to tag groups layout (#13269) 2021-06-03 13:58:28 -04:00
tag-groups.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
tag-show.js DEV: Refactor the last few bootbox dialogs (#18416) 2022-10-07 11:38:27 -04:00
tags-index.js DEV: Refactor the last few bootbox dialogs (#18416) 2022-10-07 11:38:27 -04:00
topic-bulk-actions.js DEV: Remove user options from current user serializer (#19089) 2022-12-05 18:25:30 +02:00
topic.js FIX: Bookmark auto delete preference usage and default value (#19707) 2023-01-05 08:43:58 +10:00
user-activity-bookmarks.js FIX: Return next bookmarks page only if it exists (#18139) 2022-09-01 13:04:00 +03:00
user-activity.js DEV: Add A11Y-friendly dialog addon (#18028) 2022-08-29 13:59:57 -04:00
user-badges.js FEATURE: Make max number of favorite configurable (#13480) 2021-06-22 18:58:03 +03:00
user-card.js FEATURE: Optional filtered replies view (#11387) 2020-12-10 12:02:07 -05:00
user-invited-show.js FIX: Correctly debounce various functions (#18673) 2022-10-20 13:28:09 +02:00
user-invited.js UX: Improve route hierarchy in for user-invites (#14583) 2021-10-12 17:39:47 +01:00
user-notifications.js DEV: Add bookmarks tab to the new user menu (#17814) 2022-08-08 17:24:04 +03:00
user-posts.js DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
user-private-messages-group.js DEV: Group and nest routes in userPrivateMessages into child routes (#19190) 2022-12-01 09:21:12 +08:00
user-private-messages-tags-index.js DEV: Group and nest routes in userPrivateMessages into child routes (#19190) 2022-12-01 09:21:12 +08:00
user-private-messages-tags.js DEV: Group and nest routes in userPrivateMessages into child routes (#19190) 2022-12-01 09:21:12 +08:00
user-private-messages-user.js DEV: Group and nest routes in userPrivateMessages into child routes (#19190) 2022-12-01 09:21:12 +08:00
user-private-messages.js FEATURE: Add experimental plugin API to register messages nav dropdown (#19294) 2022-12-05 12:31:09 +08:00
user-status.js FEATURE: integrate DnD with user status (#19410) 2022-12-16 16:35:39 +04:00
user-summary.js UX: Add title to read time stats from user page (#16501) 2022-04-19 20:48:08 +03:00
user-topics-list.js DEV: Remove usage of {{action}} modifiers - Take 2 (#18476) 2022-10-05 13:08:54 +01:00
user.js FIX: Clientside checks for personal_message_enabled_groups (#18691) 2022-10-21 14:38:33 +10:00
users.js FIX: show group in filter only if user can see the members list. (#16580) 2022-04-28 18:27:47 +05:30