Remove federation strict_allowlist and retry_count.

This commit is contained in:
Dessalines 2022-11-21 11:52:54 -05:00
parent e2a29a5bad
commit 3c856cf036
3 changed files with 65 additions and 130 deletions

View file

@ -47,7 +47,7 @@
"inferno-server": "^8.0.3", "inferno-server": "^8.0.3",
"isomorphic-cookie": "^1.2.4", "isomorphic-cookie": "^1.2.4",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"lemmy-js-client": "0.17.0-rc.53", "lemmy-js-client": "0.17.0-rc.54",
"markdown-it": "^13.0.1", "markdown-it": "^13.0.1",
"markdown-it-container": "^3.0.0", "markdown-it-container": "^3.0.0",
"markdown-it-footnote": "^3.0.3", "markdown-it-footnote": "^3.0.3",

View file

@ -72,8 +72,6 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
federation_enabled: None, federation_enabled: None,
federation_debug: None, federation_debug: None,
federation_worker_count: None, federation_worker_count: None,
federation_strict_allowlist: None,
federation_http_fetch_retry_limit: None,
captcha_enabled: None, captcha_enabled: None,
captcha_difficulty: None, captcha_difficulty: None,
allowed_instances: None, allowed_instances: None,
@ -148,10 +146,6 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
federation_enabled: Some(ls.federation_enabled), federation_enabled: Some(ls.federation_enabled),
federation_debug: Some(ls.federation_debug), federation_debug: Some(ls.federation_debug),
federation_worker_count: Some(ls.federation_worker_count), federation_worker_count: Some(ls.federation_worker_count),
federation_strict_allowlist: Some(ls.federation_strict_allowlist),
federation_http_fetch_retry_limit: Some(
ls.federation_http_fetch_retry_limit
),
captcha_enabled: Some(ls.captcha_enabled), captcha_enabled: Some(ls.captcha_enabled),
captcha_difficulty: Some(ls.captcha_difficulty), captcha_difficulty: Some(ls.captcha_difficulty),
allowed_instances: this.props.siteRes.federated_instances.andThen( allowed_instances: this.props.siteRes.federated_instances.andThen(
@ -678,53 +672,6 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
</div> </div>
</div> </div>
</div> </div>
<div className="form-group row">
<div className="col-12">
<div className="form-check">
<input
className="form-check-input"
id="create-site-federation-strict-allowlist"
type="checkbox"
checked={toUndefined(
this.state.siteForm.federation_strict_allowlist
)}
onChange={linkEvent(
this,
this.handleSiteFederationStrictAllowList
)}
/>
<label
className="form-check-label"
htmlFor="create-site-federation-strict-allowlist"
>
{i18n.t("federation_strict_allowlist")}
</label>
</div>
</div>
</div>
<div className="form-group row">
<label
className="col-12 col-form-label"
htmlFor="create-site-federation-http-fetch-retry-limit"
>
{i18n.t("federation_http_fetch_retry_limit")}
</label>
<div className="col-12">
<input
type="number"
id="create-site-federation-http-fetch-retry-limit"
className="form-control"
min={0}
value={toUndefined(
this.state.siteForm.federation_http_fetch_retry_limit
)}
onInput={linkEvent(
this,
this.handleSiteFederationHttpFetchRetryLimit
)}
/>
</div>
</div>
<div className="form-group row"> <div className="form-group row">
<label <label
className="col-12 col-form-label" className="col-12 col-form-label"
@ -1034,10 +981,14 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
/> />
</div> </div>
</div> </div>
{siteSetup && <div className="form-group row"> {siteSetup && (
<div className="form-group row">
<h5 className="col-12">{i18n.t("taglines")}</h5> <h5 className="col-12">{i18n.t("taglines")}</h5>
<div className="table-responsive col-12"> <div className="table-responsive col-12">
<table id="taglines_table" className="table table-sm table-hover"> <table
id="taglines_table"
className="table table-sm table-hover"
>
<thead className="pointer"></thead> <thead className="pointer"></thead>
<tbody> <tbody>
{this.state.siteForm.taglines {this.state.siteForm.taglines
@ -1084,7 +1035,8 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
{i18n.t("add_tagline")} {i18n.t("add_tagline")}
</button> </button>
</div> </div>
</div>} </div>
)}
<div className="form-group row"> <div className="form-group row">
<div className="col-12"> <div className="col-12">
<button <button
@ -1152,9 +1104,6 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
federation_enabled: sForm.federation_enabled, federation_enabled: sForm.federation_enabled,
federation_debug: sForm.federation_debug, federation_debug: sForm.federation_debug,
federation_worker_count: sForm.federation_worker_count, federation_worker_count: sForm.federation_worker_count,
federation_strict_allowlist: sForm.federation_strict_allowlist,
federation_http_fetch_retry_limit:
sForm.federation_http_fetch_retry_limit,
captcha_enabled: sForm.captcha_enabled, captcha_enabled: sForm.captcha_enabled,
captcha_difficulty: sForm.captcha_difficulty, captcha_difficulty: sForm.captcha_difficulty,
allowed_instances: sForm.allowed_instances, allowed_instances: sForm.allowed_instances,
@ -1195,8 +1144,10 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
handleTaglineChange(i: SiteForm, index: number, val: string) { handleTaglineChange(i: SiteForm, index: number, val: string) {
i.state.siteForm.taglines.match({ i.state.siteForm.taglines.match({
some: tls => { tls[index] = val; }, some: tls => {
none: void 0 tls[index] = val;
},
none: void 0,
}); });
i.setState(i.state); i.setState(i.state);
} }
@ -1207,7 +1158,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
event: InfernoMouseEvent<HTMLButtonElement> event: InfernoMouseEvent<HTMLButtonElement>
) { ) {
event.preventDefault(); event.preventDefault();
if (i.state.siteForm.taglines.isSome()){ if (i.state.siteForm.taglines.isSome()) {
let taglines = i.state.siteForm.taglines.unwrap(); let taglines = i.state.siteForm.taglines.unwrap();
taglines.splice(index, 1); taglines.splice(index, 1);
i.state.siteForm.taglines = None; // force rerender of table rows i.state.siteForm.taglines = None; // force rerender of table rows
@ -1222,7 +1173,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
event: InfernoMouseEvent<HTMLButtonElement> event: InfernoMouseEvent<HTMLButtonElement>
) { ) {
event.preventDefault(); event.preventDefault();
if (i.state.siteForm.taglines.isNone()){ if (i.state.siteForm.taglines.isNone()) {
i.state.siteForm.taglines = Some([]); i.state.siteForm.taglines = Some([]);
} }
i.state.siteForm.taglines.unwrap().push(""); i.state.siteForm.taglines.unwrap().push("");
@ -1438,11 +1389,6 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
i.setState(i.state); i.setState(i.state);
} }
handleSiteFederationStrictAllowList(i: SiteForm, event: any) {
i.state.siteForm.federation_strict_allowlist = Some(event.target.checked);
i.setState(i.state);
}
handleSiteFederationWorkerCount(i: SiteForm, event: any) { handleSiteFederationWorkerCount(i: SiteForm, event: any) {
i.setState( i.setState(
s => ( s => (
@ -1452,17 +1398,6 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
); );
} }
handleSiteFederationHttpFetchRetryLimit(i: SiteForm, event: any) {
i.setState(
s => (
(s.siteForm.federation_http_fetch_retry_limit = Some(
Number(event.target.value)
)),
s
)
);
}
handleSiteCaptchaEnabled(i: SiteForm, event: any) { handleSiteCaptchaEnabled(i: SiteForm, event: any) {
i.state.siteForm.captcha_enabled = Some(event.target.checked); i.state.siteForm.captcha_enabled = Some(event.target.checked);
i.setState(i.state); i.setState(i.state);

View file

@ -4909,10 +4909,10 @@ lcid@^1.0.0:
dependencies: dependencies:
invert-kv "^1.0.0" invert-kv "^1.0.0"
lemmy-js-client@0.17.0-rc.51: lemmy-js-client@0.17.0-rc.54:
version "0.17.0-rc.51" version "0.17.0-rc.54"
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.51.tgz#adf554b8837741bc9bb419df090744fc2ef8a1fa" resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.54.tgz#cda3aae8149699f944da354b76710b148cf441dc"
integrity sha512-AGXzQptVrdYim/5YrpAnlqAElZl5aTwqZcwffTrzXs4tL91b/APkdoPLUKASGt/5lRng2CP4cQTbykldZyjQRA== integrity sha512-7EhwjfAoq1jmwj6CAFOBNiNQOMOZk/yAsW4kwVRsNGD3pZexW3NrjEoAQx3kFC7mDEUuVbkkRMkl3ND8vUY+Uw==
levn@^0.4.1: levn@^0.4.1:
version "0.4.1" version "0.4.1"