-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Reintroduce make public (#167)
* Re-introduce option to remove recipients and make the private discussion public * Apply fixes from StyleCI * format * Use transformPublic, remove debug code * Select tag when making public * Present tag modal in promise * Add translations Co-authored-by: Ian Morland <[email protected]>
- Loading branch information
Showing
23 changed files
with
500 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import app from 'flarum/forum/app'; | ||
import EventPost from 'flarum/forum/components/EventPost'; | ||
|
||
export default class MadePublic extends EventPost { | ||
static initAttrs(attrs: any) { | ||
super.initAttrs(attrs); | ||
} | ||
|
||
icon() { | ||
return app.forum.attribute('byobu.icon-postAction'); | ||
} | ||
|
||
descriptionKey() { | ||
return 'fof-byobu.forum.post.recipients_modified.made_public'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import app from 'flarum/forum/app'; | ||
import MadePublic from './MadePublic'; | ||
import RecipientLeft from './RecipientLeft'; | ||
import RecipientsModified from './RecipientsModified'; | ||
|
||
export default () => { | ||
app.postComponents.recipientsModified = RecipientsModified; | ||
app.postComponents.recipientLeft = RecipientLeft; | ||
app.postComponents.madePublic = MadePublic; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import app from 'flarum/forum/app'; | ||
import TagDiscussionModal from 'flarum/tags/components/TagDiscussionModal'; | ||
|
||
export default class ByobuTagDiscussionModal extends TagDiscussionModal { | ||
static isDismissible = false; | ||
|
||
onsubmit(e) { | ||
e.preventDefault(); | ||
|
||
const tags = this.selected; | ||
|
||
if (this.attrs.resolve) this.attrs.resolve(tags); | ||
|
||
this.hide(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
js/src/forum/notifications/PrivateDiscussionMadePublicNotification.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import app from 'flarum/forum/app'; | ||
import Notification from 'flarum/components/Notification'; | ||
|
||
export default class PrivateDiscussionMadePublicNotification extends Notification { | ||
icon() { | ||
return app.forum.attribute('byobu.icon-badge'); | ||
} | ||
|
||
href() { | ||
const notification = this.props.notification; | ||
const discussion = notification.subject(); | ||
|
||
return app.route.discussion(discussion); | ||
} | ||
|
||
content() { | ||
const user = this.props.notification.fromUser(); | ||
return app.translator.trans('fof-byobu.forum.notifications.pd_made_public_text', { | ||
user: user, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
.ByobuSettingsPage { | ||
margin-top: 25px; | ||
} | ||
margin-top: 15px; | ||
|
||
@media @desktop-up { | ||
.container { | ||
max-width: 600px; | ||
margin: 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{!! $translator->trans('fof-byobu.email.body.made_public', [ | ||
'{recipient_display_name}' => $user->display_name, | ||
'{actor_display_name}' => $blueprint->actor->display_name, | ||
'{discussion_title}' => $blueprint->discussion->title, | ||
'{discussion_url}' => $url->to('forum')->route('discussion', ['id' => $blueprint->discussion->id]), | ||
]) !!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.