From af6af451bf92aa1dac127b6305644ae13a0e21fe Mon Sep 17 00:00:00 2001 From: "Lucian I. Last" Date: Wed, 14 Feb 2024 10:19:09 +0100 Subject: [PATCH] Remove route privacy from frontend - needs to be added to app instead --- frontend/public/locales/en/translation.json | 9 +-- frontend/src/api/chain.ts | 2 - frontend/src/api/login.ts | 1 - frontend/src/components/ChainDetailsForm.tsx | 58 -------------------- frontend/src/pages/ChainEdit.tsx | 3 +- frontend/src/pages/ChainMemberList.tsx | 16 ------ 6 files changed, 2 insertions(+), 87 deletions(-) diff --git a/frontend/public/locales/en/translation.json b/frontend/public/locales/en/translation.json index aefc1c3eb..cd4914ec4 100644 --- a/frontend/public/locales/en/translation.json +++ b/frontend/public/locales/en/translation.json @@ -318,12 +318,5 @@ "clickHereToRegister": "<1>Click here to register", "clickHereToLogin": "<1>Click here to login", "mustBeRegistered": "You must be registered to create an event", - "userExists": "User already exists", - "routePrivacy-1": "No privacy", - "routePrivacy0": "Full privacy", - "routePrivacy": "Route Privacy", - "routePrivacyInfo": "Defines the visibility of participants within a loop. Set to 'no privacy' to make all participants visible to each other", - "routePrivacyAllVisible": "All participants in the route are visible to one another.", - "routePrivacyNoneVisible": "Participants are not visible to each other in the route.", - "routePrivacyWithCount": "{{ count }} participants above and {{ count }} participants below are visible." + "userExists": "User already exists" } diff --git a/frontend/src/api/chain.ts b/frontend/src/api/chain.ts index 719e9b933..0395afef5 100644 --- a/frontend/src/api/chain.ts +++ b/frontend/src/api/chain.ts @@ -6,7 +6,6 @@ export function chainGet( o: { addTotals?: boolean; addIsAppDisabled?: boolean; - addRoutePrivacy?: boolean; } = {} ) { return window.axios.get("/v2/chain", { @@ -14,7 +13,6 @@ export function chainGet( chain_uid: chainUID, add_totals: o.addTotals || false, add_is_app_disabled: o.addIsAppDisabled || false, - add_route_privacy: o.addRoutePrivacy || false, }, }); } diff --git a/frontend/src/api/login.ts b/frontend/src/api/login.ts index 9c920baa2..d2546a5cb 100644 --- a/frontend/src/api/login.ts +++ b/frontend/src/api/login.ts @@ -23,7 +23,6 @@ export interface RequestRegisterChain { open_to_new_members: boolean; sizes: Array | null; genders: Array | null; - route_privacy?: number; allow_toh: boolean; } diff --git a/frontend/src/components/ChainDetailsForm.tsx b/frontend/src/components/ChainDetailsForm.tsx index 73b0af265..3462ef6c1 100644 --- a/frontend/src/components/ChainDetailsForm.tsx +++ b/frontend/src/components/ChainDetailsForm.tsx @@ -22,7 +22,6 @@ interface Props { onSubmit: (values: RegisterChainForm) => void; initialValues?: RegisterChainForm; showBack?: boolean; - showRoutePrivacyField?: boolean; showAllowedTOH: boolean; } @@ -71,7 +70,6 @@ export default function ChainDetailsForm({ onSubmit, initialValues, showBack, - showRoutePrivacyField, showAllowedTOH, }: Props) { const { t } = useTranslation(); @@ -90,7 +88,6 @@ export default function ChainDetailsForm({ sizes: [], longitude: 0, latitude: 0, - route_privacy: 2, ...initialValues, }); @@ -263,61 +260,6 @@ export default function ChainDetailsForm({ info={t("decideOnTheAreaYourLoopWillBeActiveIn")} /> - {showRoutePrivacyField && ( -
- - setValue("route_privacy", e.target.valueAsNumber) - } - step="1" - min={-1} - info={t("routePrivacyInfo")} - /> - -
- - -
-
- )} -
{ (async () => { try { - let chain = (await chainGet(chainUID, { addRoutePrivacy: true })).data; + let chain = (await chainGet(chainUID)).data; setChain(chain); } catch (err: any) { @@ -70,7 +70,6 @@ export default function ChainEdit() {

{t("clickToChangeLoopLocation")}

{t("peopleWithCount", { count: users.length })} - - {isUserAdmin || authUser?.is_root_admin ? ( - <> -
{t("routePrivacy")}
-
- {chain.route_privacy === 0 - ? t("routePrivacyNoneVisible") - : chain.route_privacy !== -1 - ? t("routePrivacyWithCount", { - count: chain.route_privacy, - }) - : t("routePrivacyAllVisible")} -
- - ) : null} {isUserAdmin || authUser?.is_root_admin ? (