Johani
(Joe)
15. Dezember 2021 um 00:55
9
Ich habe ein paar Änderungen vorgenommen.
main ← hnb-ku:wiki-post-improvments
opened 12:31AM - 15 Dec 21 UTC
Context: https://meta.discourse.org/t/discourse-shared-edits/167583/41?u=johani
…
This PR does six things:
1. Adds a CSS class to `shared-edit` posts for customizability.
2. Improves the way the default edit button is removed. It now uses the `api.removePostMenuButton` plugin API method.
3. Improves the way the `wiki-edit` is removed. It was previously done by setting the post attribute `wiki` to false. This
caused issues in the post-admin menu, making it always think the post is not a wiki. The toggle worked, but it always showed the label "make-wiki" since it believed that the post was not a wiki.
4. Improves the interaction between shared-edit posts and the revision history modal. The modal shows a button to edit the post (if the user can). That button used to ignore the fact that it can be a shared-edit post causing it to open the default editor instead of the shared-edits composer. This PR fixes that. If the post is a shared-edit, the button will open the shared-edit composer.
5. If the post is a shared-edit, replace the "reply" button with a "small-reply" button. This prevents a case where we show two buttons with labels next to each other. Core does this already if the post is a wiki, so this PR makes the same change for shared-edit posts.
6. In the revision modal, the edit button label is changed from "edit-post" to "edit-wiki" if the post is a wiki. Currently, setting the post to be a shared-edit + wiki is done to extend the post's edit permission to allow more users to edit the post as a shared edit. This PR overrides that behavior for shared-edit + wiki posts. The button will always show "edit post," just like default. The use case for wiki's here is a workaround and the label change adds more confusion than needed.
Ralf_Stockmann:
Wenn ich Shared Edits aktiviere, habe ich auch die Möglichkeit, es zu einem Wiki zu machen. Aber wenn ich dies über die Option Make Wiki tue, steht dort immer noch „Make Wiki“. Es wird zwar in den Wiki-Modus wechseln. Aber es gibt keine Möglichkeit, das Wiki zu widerrufen.
Dies ist behoben. Das Umschalten von Wiki auf einem Shared Edits-Beitrag zeigt nun die richtige Beschriftung an.
Ralf_Stockmann:
Ich denke, der beste Weg, dies zu lösen, wäre, den Button Edit Post zum neuen Shared Edits-Composer umzuleiten?
Dies ist ebenfalls behoben. Wenn Sie auf den Button aus dem Revisionsverlauf-Modal klicken UND der Beitrag auf shared-edit gesetzt ist, wird der Shared Edits-Composer anstelle des Standard-Composers geöffnet.
Ich habe die Klasse im Plugin hinzugefügt. Sie können den von Ihnen hinzugefügten Snippet also entfernen. Das Plugin fügt diese Klasse nun hinzu, ohne dass Änderungen erforderlich sind.
Ich vermute, Sie wollten das, weil der Button früher den Standard-Composer geöffnet hat? Das ist jetzt behoben, sodass Sie ihn nicht mehr ausblenden müssen.
6 „Gefällt mir“