Skip to content

Commit

Permalink
Merge branch 'LemmyNet:main' into lazy_translation
Browse files Browse the repository at this point in the history
  • Loading branch information
matc-pub committed Mar 10, 2024
2 parents 49d5dd5 + 9d10cfe commit 0f2b6a1
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 2 deletions.
86 changes: 86 additions & 0 deletions cliff.toml
@@ -0,0 +1,86 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

[remote.github]
owner = "LemmyNet"
repo = "lemmy-ui"
# token = ""

[changelog]
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
{% if commit.github.pr_title -%}
{%- set commit_message = commit.github.pr_title -%}
{%- else -%}
{%- set commit_message = commit.message -%}
{%- endif -%}
* {{ commit_message | split(pat="\n") | first | trim }}\
{% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%}
{% if commit.github.pr_number %} in \
[#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# postprocessors
postprocessors = []

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = false
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# remove issue numbers from commits
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# regex for matching git tags
tag_pattern = "v[0-9].*"
# regex for skipping tags
skip_tags = "beta|alpha"
# regex for ignoring tags
ignore_tags = "rc"
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"
29 changes: 27 additions & 2 deletions src/shared/components/person/settings.tsx
Expand Up @@ -112,6 +112,7 @@ interface SettingsState {
old_password?: string;
};
deleteAccountForm: {
delete_content?: boolean;
password?: string;
};
personBlocks: PersonBlockView[];
Expand Down Expand Up @@ -1103,6 +1104,25 @@ export class Settings extends Component<any, SettingsState> {
)}
className="my-2"
/>
<div className="input-group mb-3">
<div className="form-check">
<input
id="delete-account-content"
type="checkbox"
className="form-check-input"
onInput={linkEvent(
this,
this.handleDeleteAccountContentChange,
)}
/>
<label
className="form-check-label"
htmlFor="delete-account-content"
>
{I18NextService.i18n.t("delete_account_content")}
</label>
</div>
</div>
<button
type="submit"
className="btn btn-danger me-4"
Expand Down Expand Up @@ -1692,6 +1712,12 @@ export class Settings extends Component<any, SettingsState> {
i.setState({ deleteAccountShowConfirm: !i.state.deleteAccountShowConfirm });
}

handleDeleteAccountContentChange(i: Settings, event: any) {
i.setState(
s => ((s.deleteAccountForm.delete_content = event.target.checked), s),
);
}

handleDeleteAccountPasswordChange(i: Settings, event: any) {
i.setState(s => ((s.deleteAccountForm.password = event.target.value), s));
}
Expand All @@ -1703,8 +1729,7 @@ export class Settings extends Component<any, SettingsState> {
i.setState({ deleteAccountRes: LOADING_REQUEST });
const deleteAccountRes = await HttpService.client.deleteAccount({
password,
// TODO: promt user weather he wants the content to be deleted
delete_content: false,
delete_content: i.state.deleteAccountForm.delete_content || false,
});
if (deleteAccountRes.state === "success") {
UserService.Instance.logout();
Expand Down

0 comments on commit 0f2b6a1

Please sign in to comment.