Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
868176b
Community settings WIP.
dessalines Dec 2, 2025
291ebe5
Merge branch 'main' into community-settings
dessalines Dec 2, 2025
3a59a05
Merge branch 'main' into community-settings
dessalines Dec 5, 2025
32a32e2
Merge branch 'main' into community-settings
dessalines Dec 9, 2025
4e9eac6
Merge branch 'main' into community-settings
dessalines Jan 8, 2026
57b2bc2
Adding more to community settings.
dessalines Jan 8, 2026
4183a65
Translations (tmp)
dessalines Jan 12, 2026
96dc708
Merge branch 'main' into community-settings
dessalines Jan 13, 2026
c7bff75
Update express methods.
dessalines Jan 13, 2026
b62b296
Fix community loading
dessalines Jan 13, 2026
a1ad3f1
Adding community settings link
dessalines Jan 13, 2026
26d5ed9
Fixing dropdown menu offset
dessalines Jan 14, 2026
2f04bbb
Adding proper community remove and purge dialogs
dessalines Jan 14, 2026
3007440
Adding ability to add and remove mods from community settings
dessalines Jan 15, 2026
2ed4c90
Adding transferring community to community settings.
dessalines Jan 15, 2026
acfdc85
Fixing remove and transfer dialogs
dessalines Jan 15, 2026
2c79032
Merge branch 'main' into community-settings
dessalines Jan 16, 2026
967d92a
Remove leaveModTeam from community sidebar
dessalines Jan 16, 2026
42e558c
Fixing lint.
dessalines Jan 16, 2026
79fc2c9
Merge branch 'main' into remove-bind-2
dessalines Jan 17, 2026
cb89de5
Removing bind from search
dessalines Jan 17, 2026
6b835c8
Removing bind from comment-report
dessalines Jan 17, 2026
83dd03f
Removing bind from community-create
dessalines Jan 17, 2026
444ee80
Removing bind from pending-follows
dessalines Jan 17, 2026
4a44458
Removing bind from private message and form
dessalines Jan 17, 2026
3778e09
Removing bind from create private message.
dessalines Jan 17, 2026
3a1e80e
Removing bind from view votes modal
dessalines Jan 17, 2026
3329aab
Removing bind from emoji mart
dessalines Jan 17, 2026
75a5014
Removing bind from language-select
dessalines Jan 17, 2026
6308912
Removing bind from oauth provider modal
dessalines Jan 17, 2026
77bf4bd
fix
dessalines Jan 17, 2026
755cd76
Revert "Removing bind from view votes modal"
dessalines Jan 17, 2026
b50a957
Fixing view votes modal
dessalines Jan 17, 2026
d2ec9be
Removing bind from registration application
dessalines Jan 17, 2026
b1f1ff4
Removing binds from content-action-dropdown.
dessalines Jan 17, 2026
00cdc57
Remove bind for emoji-picker
dessalines Jan 17, 2026
41297b0
Removing bind from modlog
dessalines Jan 17, 2026
3e59da8
Removing binds for admin-settings.
dessalines Jan 17, 2026
f0f0aa1
Removing bind from markdown textarea
dessalines Jan 17, 2026
23d9327
Removing bind from navbar
dessalines Jan 17, 2026
a864963
Removing binds from signup
dessalines Jan 17, 2026
86816a7
Removing binds from home
dessalines Jan 17, 2026
57d2cf8
Removing binds for site form
dessalines Jan 17, 2026
79ac405
Removing binds from setup
dessalines Jan 17, 2026
6e1ceb5
Removing binds from hide donation dialog
dessalines Jan 17, 2026
edeccb2
Removing binds from instances
dessalines Jan 17, 2026
8856fcc
Removing binds from login
dessalines Jan 17, 2026
0bedcc9
Removing binds from oauthproviderstab
dessalines Jan 18, 2026
6eb2434
Removing binds for multi-community-form
dessalines Jan 18, 2026
1cd98d5
Removing binds for create-multi-community
dessalines Jan 18, 2026
e22d346
Removing binds for post-report
dessalines Jan 18, 2026
deb3174
Removing binds for post-form
dessalines Jan 18, 2026
6db525c
Fixing signup
dessalines Jan 18, 2026
9800141
Removing binds for post
dessalines Jan 18, 2026
b7be61b
Removing binds for create-post
dessalines Jan 18, 2026
f482757
Removing binds for profile
dessalines Jan 18, 2026
54b9dff
Removing binds from notifications
dessalines Jan 18, 2026
f8d3223
Removing binds from reports
dessalines Jan 18, 2026
2042516
Removing binds for registration applications
dessalines Jan 18, 2026
8d31645
Removing binds from settings
dessalines Jan 18, 2026
a8f8081
Make community settings only accessible by mod or admin with local co…
dessalines Jan 19, 2026
86bc9af
Merge branch 'main' into community-settings
dessalines Jan 19, 2026
707aea4
Merge branch 'main' into community-settings
dessalines Jan 19, 2026
9067a5d
Merge branch 'community-settings' into remove-bind-2
dessalines Jan 19, 2026
d53575c
Fixing markdown-textarea
dessalines Jan 19, 2026
aa356e6
Fixing markdown-textarea form submit
dessalines Jan 20, 2026
e43d0fb
Fix 2
dessalines Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions src/shared/components/app/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ interface NavbarState {
unreadPendingFollowsCount: number;
}

function handleCollapseClick(i: Navbar) {
if (
i.collapseButtonRef.current?.attributes &&
i.collapseButtonRef.current?.attributes.getNamedItem("aria-expanded")
?.value === "true"
) {
i.collapseButtonRef.current?.click();
}
}

function handleLogOut(i: Navbar) {
UserService.Instance.logout();
handleCollapseClick(i);
}

@tippyMixin
export class Navbar extends Component<NavbarProps, NavbarState> {
collapseButtonRef = createRef<HTMLButtonElement>();
Expand All @@ -67,8 +52,6 @@ export class Navbar extends Component<NavbarProps, NavbarState> {

constructor(props: any, context: any) {
super(props, context);

this.handleOutsideMenuClick = this.handleOutsideMenuClick.bind(this);
}

async componentWillMount() {
Expand Down Expand Up @@ -101,12 +84,16 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
);
}

document.addEventListener("mouseup", this.handleOutsideMenuClick);
document.addEventListener("mouseup", e =>
handleOutsideMenuClick(this, e),
);
}
}

componentWillUnmount() {
document.removeEventListener("mouseup", this.handleOutsideMenuClick);
document.removeEventListener("mouseup", e =>
handleOutsideMenuClick(this, e),
);
this.unreadNotifsCountSubscription.unsubscribe();
this.unreadReportCountSubscription.unsubscribe();
if (moderatesSomething(this.props.myUserInfo)) {
Expand Down Expand Up @@ -508,12 +495,6 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
);
}

handleOutsideMenuClick(event: MouseEvent) {
if (!this.mobileMenuRef.current?.contains(event.target as Node | null)) {
handleCollapseClick(this);
}
}

get currentLocation() {
return this.context.router.history.location.pathname;
}
Expand All @@ -532,3 +513,24 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
}
}
}

function handleCollapseClick(i: Navbar) {
if (
i.collapseButtonRef.current?.attributes &&
i.collapseButtonRef.current?.attributes.getNamedItem("aria-expanded")
?.value === "true"
) {
i.collapseButtonRef.current?.click();
}
}

function handleLogOut(i: Navbar) {
UserService.Instance.logout();
handleCollapseClick(i);
}

function handleOutsideMenuClick(i: Navbar, event: MouseEvent) {
if (!i.mobileMenuRef.current?.contains(event.target as Node | null)) {
handleCollapseClick(i);
}
}
74 changes: 36 additions & 38 deletions src/shared/components/comment/comment-report.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, InfernoNode, linkEvent } from "inferno";
import { Component, InfernoNode } from "inferno";
import { T } from "inferno-i18next-dess";
import {
CommentReportView,
Expand Down Expand Up @@ -48,11 +48,9 @@ export class CommentReport extends Component<
loading: false,
showRemoveCommentDialog: false,
};

constructor(props: any, context: any) {
super(props, context);
this.handleModBanFromCommunity = this.handleModBanFromCommunity.bind(this);
this.handleAdminBan = this.handleAdminBan.bind(this);
this.handleRemoveComment = this.handleRemoveComment.bind(this);
}

componentWillReceiveProps(
Expand Down Expand Up @@ -162,7 +160,7 @@ export class CommentReport extends Component<
)}
<button
className="btn btn-link btn-animate text-muted py-0"
onClick={linkEvent(this, this.handleResolveReport)}
onClick={() => handleResolveReport(this)}
data-tippy-content={tippyContent}
aria-label={tippyContent}
>
Expand Down Expand Up @@ -196,7 +194,7 @@ export class CommentReport extends Component<
inlineWithText
icon={comment_view.creator_banned ? "unban" : "ban"}
noLoading
onClick={this.handleModBanFromCommunity}
onClick={() => handleModBanFromCommunity(this)}
iconClass={`text-${comment_view.creator_banned ? "success" : "danger"}`}
/>
{this.props.myUserInfo?.local_user_view.local_user.admin && (
Expand All @@ -207,13 +205,13 @@ export class CommentReport extends Component<
inlineWithText
icon={comment_view.creator_banned ? "unban" : "ban"}
noLoading
onClick={this.handleAdminBan}
onClick={() => handleAdminBan(this)}
iconClass={`text-${comment_view.creator_banned ? "success" : "danger"}`}
/>
)}
{this.state.showRemoveCommentDialog && (
<ModActionFormModal
onSubmit={this.handleRemoveComment}
onSubmit={reason => handleRemoveComment(this, reason)}
modActionType="remove-comment"
isRemoved={comment_view.comment.removed}
onCancel={() => this.setState({ showRemoveCommentDialog: false })}
Expand All @@ -223,38 +221,38 @@ export class CommentReport extends Component<
</div>
);
}
}

handleResolveReport(i: CommentReport) {
i.setState({ loading: true });
i.props.onResolveReport({
report_id: i.props.report.comment_report.id,
resolved: !i.props.report.comment_report.resolved,
});
}
function handleResolveReport(i: CommentReport) {
i.setState({ loading: true });
i.props.onResolveReport({
report_id: i.props.report.comment_report.id,
resolved: !i.props.report.comment_report.resolved,
});
}

async handleRemoveComment(reason: string) {
this.props.onRemoveComment({
comment_id: this.props.report.comment.id,
removed: !this.props.report.comment.removed,
reason,
});
this.setState({ showRemoveCommentDialog: false });
}
function handleRemoveComment(i: CommentReport, reason: string) {
i.props.onRemoveComment({
comment_id: i.props.report.comment.id,
removed: !i.props.report.comment.removed,
reason,
});
i.setState({ showRemoveCommentDialog: false });
}

handleModBanFromCommunity() {
this.setState({ loading: true });
this.props.onModBanFromCommunity({
person: this.props.report.comment_creator,
community: this.props.report.community,
ban: !this.props.report.creator_banned,
});
}
function handleModBanFromCommunity(i: CommentReport) {
i.setState({ loading: true });
i.props.onModBanFromCommunity({
person: i.props.report.comment_creator,
community: i.props.report.community,
ban: !i.props.report.creator_banned,
});
}

handleAdminBan() {
this.setState({ loading: true });
this.props.onAdminBan({
person: this.props.report.comment_creator,
ban: !this.props.report.creator_banned,
});
}
function handleAdminBan(i: CommentReport) {
i.setState({ loading: true });
i.props.onAdminBan({
person: i.props.report.comment_creator,
ban: !i.props.report.creator_banned,
});
}
Loading