From 669270441b4ca966a633b13bdc2b5fe937075e94 Mon Sep 17 00:00:00 2001 From: swve Date: Wed, 13 Dec 2023 22:04:16 +0100 Subject: [PATCH] chore: remove depreceated settings code --- .../settings/account/passwords/page.tsx | 30 ---- .../settings/account/passwords/passwords.tsx | 77 --------- .../settings/account/profile/page.tsx | 26 --- .../settings/account/profile/profile.tsx | 81 --------- apps/web/app/orgs/[orgslug]/settings/head.tsx | 15 -- .../app/orgs/[orgslug]/settings/layout.tsx | 128 -------------- .../organization/general/organization.tsx | 156 ------------------ .../settings/organization/general/page.tsx | 33 ---- .../settings/organization/roles/page.tsx | 9 - apps/web/app/orgs/[orgslug]/settings/page.tsx | 28 ---- 10 files changed, 583 deletions(-) delete mode 100644 apps/web/app/orgs/[orgslug]/settings/account/passwords/page.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/account/passwords/passwords.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/account/profile/page.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/account/profile/profile.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/head.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/layout.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/organization/general/organization.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/organization/general/page.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/organization/roles/page.tsx delete mode 100644 apps/web/app/orgs/[orgslug]/settings/page.tsx diff --git a/apps/web/app/orgs/[orgslug]/settings/account/passwords/page.tsx b/apps/web/app/orgs/[orgslug]/settings/account/passwords/page.tsx deleted file mode 100644 index af13c2b2..00000000 --- a/apps/web/app/orgs/[orgslug]/settings/account/passwords/page.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { getOrganizationContextInfo } from "@services/organizations/orgs"; -import { Metadata } from "next"; -import PasswordsClient from "./passwords"; - -type MetadataProps = { - params: { orgslug: string }; - searchParams: { [key: string]: string | string[] | undefined }; -}; - -export async function generateMetadata( - { params }: MetadataProps, -): Promise { - - // Get Org context information - const org = await getOrganizationContextInfo(params.orgslug, { revalidate: 1800, tags: ['organizations'] }); - return { - title: `Settings: Passwords — ${org.name}`, - description: org.description, - }; -} - -function SettingsProfilePasswordsPage() { - return ( - <> - - - ) -} - -export default SettingsProfilePasswordsPage \ No newline at end of file diff --git a/apps/web/app/orgs/[orgslug]/settings/account/passwords/passwords.tsx b/apps/web/app/orgs/[orgslug]/settings/account/passwords/passwords.tsx deleted file mode 100644 index 7f1d2028..00000000 --- a/apps/web/app/orgs/[orgslug]/settings/account/passwords/passwords.tsx +++ /dev/null @@ -1,77 +0,0 @@ -"use client"; -import { AuthContext } from '@components/Security/AuthProviderDepreceated'; -import React, { useEffect } from 'react' -import { Formik, Form, Field, ErrorMessage } from 'formik'; -import { updatePassword } from '@services/settings/password'; - - -function PasswordsClient() { - const auth: any = React.useContext(AuthContext); - - - - const updatePasswordUI = async (values: any) => { - let user_id = auth.userInfo.user_object.user_id; - await updatePassword(user_id, values) - } - - - return ( -
- - {auth.isAuthenticated && ( -
-

Account Password

-

- - { - setTimeout(() => { - alert(JSON.stringify(values, null, 2)); - setSubmitting(false); - updatePasswordUI(values) - }, 400); - }} - > - {({ isSubmitting }) => ( -
- - - - - - - - - - )} -
-
- )} - - -
- - ) -} - -export default PasswordsClient \ No newline at end of file diff --git a/apps/web/app/orgs/[orgslug]/settings/account/profile/page.tsx b/apps/web/app/orgs/[orgslug]/settings/account/profile/page.tsx deleted file mode 100644 index 31139edc..00000000 --- a/apps/web/app/orgs/[orgslug]/settings/account/profile/page.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { getOrganizationContextInfo } from "@services/organizations/orgs"; -import { Metadata } from "next"; -import ProfileClient from "./profile"; - -type MetadataProps = { - params: { orgslug: string }; - searchParams: { [key: string]: string | string[] | undefined }; -}; - -export async function generateMetadata( - { params }: MetadataProps, -): Promise { - - // Get Org context information - const org = await getOrganizationContextInfo(params.orgslug, { revalidate: 1800, tags: ['organizations'] }); - return { - title: `Settings: Profile — ${org.name}`, - description: org.description, - }; -} - -function SettingsProfilePage() { - return -} - -export default SettingsProfilePage \ No newline at end of file diff --git a/apps/web/app/orgs/[orgslug]/settings/account/profile/profile.tsx b/apps/web/app/orgs/[orgslug]/settings/account/profile/profile.tsx deleted file mode 100644 index 3e454f06..00000000 --- a/apps/web/app/orgs/[orgslug]/settings/account/profile/profile.tsx +++ /dev/null @@ -1,81 +0,0 @@ -"use client"; -import { AuthContext } from '@components/Security/AuthProviderDepreceated'; -import React, { useEffect } from 'react' -import { Formik, Form, Field, ErrorMessage } from 'formik'; -import { updateProfile } from '@services/settings/profile'; - -function ProfileClient() { - const auth: any = React.useContext(AuthContext); - - - - return ( -
- - {auth.isAuthenticated && ( -
-

Profile Settings

-

- - { - setTimeout(() => { - alert(JSON.stringify(values, null, 2)); - setSubmitting(false); - updateProfile(values) - }, 400); - }} - > - {({ isSubmitting }) => ( -
- - - - - - - - - - - - - )} -
-
- )} - - -
- - ) -} - -export default ProfileClient \ No newline at end of file diff --git a/apps/web/app/orgs/[orgslug]/settings/head.tsx b/apps/web/app/orgs/[orgslug]/settings/head.tsx deleted file mode 100644 index 2cc1698e..00000000 --- a/apps/web/app/orgs/[orgslug]/settings/head.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { createStitches } from '@stitches/react'; - -export const { getCssText } = createStitches(); - -export default function Head() { - return ( - <> - Settings - - -