Page MenuHomePhabricator

D3823.diff
No OneTemporary

D3823.diff

diff --git a/web/modals/threads/thread-settings-modal.react.js b/web/modals/threads/thread-settings-modal.react.js
--- a/web/modals/threads/thread-settings-modal.react.js
+++ b/web/modals/threads/thread-settings-modal.react.js
@@ -105,6 +105,7 @@
+onDelete: (event: SyntheticEvent<HTMLElement>) => void,
+changeThreadSettingsAction: () => Promise<ChangeThreadSettingsPayload>,
+onSubmit: (event: SyntheticEvent<HTMLElement>) => void,
+ +buttons: ?React.Node,
};
class ThreadSettingsModal extends React.PureComponent<Props> {
constructor(props: Props) {
@@ -159,30 +160,6 @@
);
}
- let buttons = null;
- if (this.props.currentTabType === 'delete') {
- buttons = (
- <Button
- onClick={this.props.onDelete}
- variant="danger"
- disabled={inputDisabled}
- >
- Delete
- </Button>
- );
- } else {
- buttons = (
- <Button
- type="submit"
- onClick={this.props.onSubmit}
- disabled={inputDisabled || !this.props.changeQueued}
- className={css.save_button}
- >
- Save
- </Button>
- );
- }
-
const tabs = [
<Tab
name="General"
@@ -237,7 +214,7 @@
<form method="POST">
{mainContent}
<div className={css.form_footer}>
- {buttons}
+ {this.props.buttons}
<div className={css.modal_form_error}>
{this.props.errorMessage}
</div>
@@ -464,6 +441,29 @@
);
}
+ const inputDisabled =
+ changeInProgress || !hasPermissionForTab(threadInfo, currentTabType);
+
+ let buttons;
+ if (currentTabType === 'delete') {
+ buttons = (
+ <Button onClick={onDelete} variant="danger" disabled={inputDisabled}>
+ Delete
+ </Button>
+ );
+ } else {
+ buttons = (
+ <Button
+ type="submit"
+ onClick={onSubmit}
+ disabled={inputDisabled || !changeQueued}
+ className={css.save_button}
+ >
+ Save
+ </Button>
+ );
+ }
+
return (
<ThreadSettingsModal
{...props}
@@ -495,6 +495,7 @@
onDelete={onDelete}
changeThreadSettingsAction={changeThreadSettingsAction}
onSubmit={onSubmit}
+ buttons={buttons}
/>
);
},

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 6:30 AM (1 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599946
Default Alt Text
D3823.diff (2 KB)

Event Timeline