Merge branch 'main' into fix_comment_tree_replacing

This commit is contained in:
Dessalines 2023-08-07 12:53:13 -04:00 committed by GitHub
commit 7333cde814
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 39 additions and 6 deletions

View file

@ -67,7 +67,7 @@
"inferno-router": "^8.2.2", "inferno-router": "^8.2.2",
"inferno-server": "^8.2.2", "inferno-server": "^8.2.2",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"lemmy-js-client": "0.18.1", "lemmy-js-client": "0.19.0-rc.1",
"lodash.isequal": "^4.5.0", "lodash.isequal": "^4.5.0",
"markdown-it": "^13.0.1", "markdown-it": "^13.0.1",
"markdown-it-container": "^3.0.0", "markdown-it-container": "^3.0.0",

View file

@ -48,6 +48,9 @@ export class CommentSortSelect extends Component<
{I18NextService.i18n.t("sort_type")} {I18NextService.i18n.t("sort_type")}
</option> </option>
<option value={"Hot"}>{I18NextService.i18n.t("hot")}</option>, <option value={"Hot"}>{I18NextService.i18n.t("hot")}</option>,
<option value={"Controversial"}>
{I18NextService.i18n.t("controversial")}
</option>
<option value={"Top"}>{I18NextService.i18n.t("top")}</option>, <option value={"Top"}>{I18NextService.i18n.t("top")}</option>,
<option value={"New"}>{I18NextService.i18n.t("new")}</option> <option value={"New"}>{I18NextService.i18n.t("new")}</option>
<option value={"Old"}>{I18NextService.i18n.t("old")}</option> <option value={"Old"}>{I18NextService.i18n.t("old")}</option>

View file

@ -14,6 +14,7 @@ interface PasswordInputProps {
showStrength?: boolean; showStrength?: boolean;
label?: string | null; label?: string | null;
showForgotLink?: boolean; showForgotLink?: boolean;
isNew?: boolean;
} }
interface PasswordInputState { interface PasswordInputState {
@ -73,6 +74,7 @@ class PasswordInput extends Component<PasswordInputProps, PasswordInputState> {
showStrength, showStrength,
label, label,
showForgotLink, showForgotLink,
isNew,
}, },
state: { show }, state: { show },
} = this; } = this;
@ -91,7 +93,7 @@ class PasswordInput extends Component<PasswordInputProps, PasswordInputState> {
type={show ? "text" : "password"} type={show ? "text" : "password"}
className="form-control" className="form-control"
aria-describedby={id} aria-describedby={id}
autoComplete="on" autoComplete={isNew ? "new-password" : "current-password"}
onInput={onInput} onInput={onInput}
value={value} value={value}
required required

View file

@ -54,6 +54,9 @@ export class SortSelect extends Component<SortSelectProps, SortSelectState> {
{I18NextService.i18n.t("active")} {I18NextService.i18n.t("active")}
</option>, </option>,
]} ]}
<option value={"Controversial"}>
{I18NextService.i18n.t("controversial")}
</option>
<option value={"New"}>{I18NextService.i18n.t("new")}</option> <option value={"New"}>{I18NextService.i18n.t("new")}</option>
<option value={"Old"}>{I18NextService.i18n.t("old")}</option> <option value={"Old"}>{I18NextService.i18n.t("old")}</option>
{!this.props.hideMostComments && [ {!this.props.hideMostComments && [

View file

@ -128,6 +128,7 @@ export class Setup extends Component<any, State> {
value={this.state.form.password} value={this.state.form.password}
onInput={linkEvent(this, this.handleRegisterPasswordChange)} onInput={linkEvent(this, this.handleRegisterPasswordChange)}
label={I18NextService.i18n.t("password")} label={I18NextService.i18n.t("password")}
isNew
/> />
</div> </div>
<div className="mb-3"> <div className="mb-3">
@ -136,6 +137,7 @@ export class Setup extends Component<any, State> {
value={this.state.form.password_verify} value={this.state.form.password_verify}
onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)} onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)}
label={I18NextService.i18n.t("verify_password")} label={I18NextService.i18n.t("verify_password")}
isNew
/> />
</div> </div>
<div className="mb-3 row"> <div className="mb-3 row">

View file

@ -189,6 +189,7 @@ export class Signup extends Component<any, State> {
onInput={linkEvent(this, this.handleRegisterPasswordChange)} onInput={linkEvent(this, this.handleRegisterPasswordChange)}
showStrength showStrength
label={I18NextService.i18n.t("password")} label={I18NextService.i18n.t("password")}
isNew
/> />
</div> </div>
@ -198,6 +199,7 @@ export class Signup extends Component<any, State> {
value={this.state.form.password_verify} value={this.state.form.password_verify}
onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)} onInput={linkEvent(this, this.handleRegisterPasswordVerifyChange)}
label={I18NextService.i18n.t("verify_password")} label={I18NextService.i18n.t("verify_password")}
isNew
/> />
</div> </div>

View file

@ -68,6 +68,7 @@ export class PasswordChange extends Component<any, State> {
onInput={linkEvent(this, this.handlePasswordChange)} onInput={linkEvent(this, this.handlePasswordChange)}
showStrength showStrength
label={I18NextService.i18n.t("new_password")} label={I18NextService.i18n.t("new_password")}
isNew
/> />
</div> </div>
<div className="mb-3"> <div className="mb-3">

View file

@ -264,7 +264,7 @@ export class Settings extends Component<any, SettingsState> {
); );
} }
userSettings(isSelected) { userSettings(isSelected: boolean) {
return ( return (
<div <div
className={classNames("tab-pane show", { className={classNames("tab-pane show", {
@ -289,7 +289,7 @@ export class Settings extends Component<any, SettingsState> {
); );
} }
blockCards(isSelected) { blockCards(isSelected: boolean) {
return ( return (
<div <div
className={classNames("tab-pane", { className={classNames("tab-pane", {
@ -326,6 +326,7 @@ export class Settings extends Component<any, SettingsState> {
onInput={linkEvent(this, this.handleNewPasswordChange)} onInput={linkEvent(this, this.handleNewPasswordChange)}
showStrength showStrength
label={I18NextService.i18n.t("new_password")} label={I18NextService.i18n.t("new_password")}
isNew
/> />
</div> </div>
<div className="mb-3"> <div className="mb-3">
@ -334,6 +335,7 @@ export class Settings extends Component<any, SettingsState> {
value={this.state.changePasswordForm.new_password_verify} value={this.state.changePasswordForm.new_password_verify}
onInput={linkEvent(this, this.handleNewPasswordVerifyChange)} onInput={linkEvent(this, this.handleNewPasswordVerifyChange)}
label={I18NextService.i18n.t("verify_password")} label={I18NextService.i18n.t("verify_password")}
isNew
/> />
</div> </div>
<div className="mb-3"> <div className="mb-3">

View file

@ -582,8 +582,10 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
case "loading": case "loading":
return <Spinner />; return <Spinner />;
case "success": { case "success": {
const suggestedTitle = this.state.metadataRes.data.metadata.title; // Clean up the title of any extra whitespace and replace &nbsp; with a space
const suggestedTitle = this.state.metadataRes.data.metadata.title
?.trim()
.replace(/\s+/g, " ");
return ( return (
suggestedTitle && ( suggestedTitle && (
<button <button

View file

@ -482,6 +482,22 @@ export class Post extends Component<any, PostState> {
> >
{I18NextService.i18n.t("top")} {I18NextService.i18n.t("top")}
</label> </label>
<input
id={`${radioId}-controversial`}
type="radio"
className="btn-check"
value={"Controversial"}
checked={this.state.commentSort === "Controversial"}
onChange={linkEvent(this, this.handleCommentSortChange)}
/>
<label
htmlFor={`${radioId}-controversial`}
className={classNames("btn btn-outline-secondary pointer", {
active: this.state.commentSort === "Controversial",
})}
>
{I18NextService.i18n.t("controversial")}
</label>
<input <input
id={`${radioId}-new`} id={`${radioId}-new`}
type="radio" type="radio"