diff --git a/apps/acf-configs/eslint.config.mjs b/apps/acf-configs/eslint.config.mjs deleted file mode 100644 index cd12ea33..00000000 --- a/apps/acf-configs/eslint.config.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import nx from '@nx/eslint-plugin'; -import baseConfig from '../../eslint.config.mjs'; - -export default [ - ...baseConfig, - ...nx.configs['flat/react'], - { - files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], - // Override or add rules here - rules: {} - } -]; diff --git a/apps/acf-configs/index.html b/apps/acf-configs/index.html deleted file mode 100644 index 15126e20..00000000 --- a/apps/acf-configs/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - ACF Configurations - - - - - - - -
- - - diff --git a/apps/acf-configs/package.json b/apps/acf-configs/package.json deleted file mode 100644 index 0b27989e..00000000 --- a/apps/acf-configs/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@dhruv-techapps/acf-configs", - "version": "0.0.1", - "private": true -} diff --git a/apps/acf-configs/project.json b/apps/acf-configs/project.json deleted file mode 100644 index 024e84c5..00000000 --- a/apps/acf-configs/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "acf-configs", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/acf-configs/src", - "projectType": "application", - "tags": ["scope:apps"], - "// targets": "to see all targets run: nx show project acf-configs --web", - "targets": {} -} diff --git a/apps/acf-configs/public/favicon.ico b/apps/acf-configs/public/favicon.ico deleted file mode 100644 index 8507a9f6..00000000 Binary files a/apps/acf-configs/public/favicon.ico and /dev/null differ diff --git a/apps/acf-configs/src/assets/.gitkeep b/apps/acf-configs/src/assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/acf-configs/src/assets/btn_google_signin_dark_normal_web.png b/apps/acf-configs/src/assets/btn_google_signin_dark_normal_web.png deleted file mode 100644 index b1327b4f..00000000 Binary files a/apps/acf-configs/src/assets/btn_google_signin_dark_normal_web.png and /dev/null differ diff --git a/apps/acf-configs/src/assets/btn_google_signin_light_normal_web.png b/apps/acf-configs/src/assets/btn_google_signin_light_normal_web.png deleted file mode 100644 index 29ab5110..00000000 Binary files a/apps/acf-configs/src/assets/btn_google_signin_light_normal_web.png and /dev/null differ diff --git a/apps/acf-configs/src/components/configurations/configuration-modal.tsx b/apps/acf-configs/src/components/configurations/configuration-modal.tsx deleted file mode 100644 index c7dcb88f..00000000 --- a/apps/acf-configs/src/components/configurations/configuration-modal.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { IConfiguration } from '@dhruv-techapps/acf-common'; -import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; -import { Button, Modal } from 'react-bootstrap'; -import JsonView from 'react18-json-view'; -import { ConfigType, getConfig } from '../../database'; -import { downloadFile } from '../../storage'; - -export const ConfigurationModal = forwardRef<{ show: (configId: string) => void }>((_, ref) => { - const [show, setShow] = useState(false); - const [configId, setConfigId] = useState(); - const [config, setConfig] = useState(); - const [file, setFile] = useState(); - const [loading, setLoading] = useState(true); - - useImperativeHandle(ref, () => ({ - show: (_configId: string) => { - if (_configId !== configId) { - setConfig(undefined); - setFile(undefined); - setLoading(true); - setConfigId(_configId); - } - setShow(true); - } - })); - - useEffect(() => { - // Fetch the configuration - if (configId) { - getConfig(configId).then(async (_config) => { - setConfig(_config); - const configuration = await downloadFile(`users/${_config?.userId}/${configId}.json`); - setFile(configuration); - setLoading(false); - }); - } - }, [configId]); - - return ( - setShow(false)} data-testid='configuration-modal' scrollable> - - - {config?.name || 'Configuration'} - {config?.url} - - - - {loading ? ( -

Loading Configuration...

- ) : ( - config && - configId && - file && ( -
- -
- ) - )} -
- {file && configId && } -
- ); -}); diff --git a/apps/acf-configs/src/components/configurations/configuration.tsx b/apps/acf-configs/src/components/configurations/configuration.tsx deleted file mode 100644 index 8700b78a..00000000 --- a/apps/acf-configs/src/components/configurations/configuration.tsx +++ /dev/null @@ -1,202 +0,0 @@ -import { IConfiguration as ConfigurationType } from '@dhruv-techapps/acf-common'; -import React, { useEffect } from 'react'; -import { Alert, Badge, Button } from 'react-bootstrap'; -import { useParams, useSearchParams } from 'react-router-dom'; -import JsonView from 'react18-json-view'; -import 'react18-json-view/src/style.css'; -import { ConfigType, getConfig } from '../../database'; -import { downloadFile } from '../../storage'; -import { download } from '../../util/common'; -import { EXTENSIONS } from '../../util/constant'; - -export const Configuration: React.FC<{ configId?: string }> = ({ configId }) => { - let { id } = useParams(); - const [searchParams] = useSearchParams(); - const [config, setConfig] = React.useState(); - const [file, setFile] = React.useState(); - const [loading, setLoading] = React.useState(true); - const [error, setError] = React.useState(null); - const [extensionError, setExtensionError] = React.useState(null); - const [extensionMessage, setExtensionMessage] = React.useState(null); - - if (configId) { - id = configId; - } - - useEffect(() => { - // Fetch the configuration - if (id) { - getConfig(id) - .then(async (_config) => { - setConfig(_config); - const configuration = await downloadFile(`users/${_config?.userId}/${id}.json`); - setFile(configuration); - }) - .catch((error) => { - setError('Error while fetching configuration'); - }) - .finally(() => { - setLoading(false); - }); - } - }, [id]); - - const onExtensionClick = (extensionId: string) => { - chrome.runtime - .sendMessage(extensionId, { messenger: 'configs', methodName: 'exists', message: id }) - .then(({ result, error }) => { - if (error) { - setExtensionError('Error while checking configuration'); - return; - } - if (!result) { - chrome.runtime - .sendMessage(extensionId, { messenger: 'configs', methodName: 'install', message: file }) - .then(({ result }) => { - if (result === 'done') { - setExtensionMessage('Configuration installed successfully'); - } - }) - .catch(console.error); - } else { - setExtensionError('Configuration already exists in this extension'); - } - }) - .catch(console.error); - }; - - const onDownloadClick = () => { - if (file && id) { - download(file, id, searchParams.get('queryID')); - } - }; - - if (!id) { - return

Configuration not found

; - } - - return ( -
-
-
- {loading &&

Loading Configuration...

} - {!loading && error &&

{error}

} - {!loading && config && ( -
-

{config.name ?? 'Configuration'}

- - - {file && ( - - - - - - - - - - - - - - - - - - - {file.startType === 'manual' && ( - - - - - )} - - - - - - - - - {file.batch && ( - - - - - )} - {file.actions.filter((action) => action.value?.includes('GoogleSheets')).length > 0 && ( - - - - - )} - {config.created && ( - - - - - )} - {config.updated && ( - - - - - )} - -
URL:{config.url}
User:{config.userName}
Load Type:{file.loadType}
Start Type:{file.startType}
Hot Key: - {file.hotkey?.split('+').map((key, index) => ( - <> - {index !== 0 && +} - {key} - - ))} -
Initial Wait:{file.initWait ?? 0} sec
Actions:{file.actions.length}
Batch:{file.batch?.refresh ? 'on refresh' : `${file.batch?.repeat} repeat with ${file.batch?.repeatInterval} sec interval`}
Google Sheets:Require value from google sheets
Created:{config.created?.toDate().toDateString()}
Updated:{config.updated?.toDate().toDateString()}
- )} - {config.tags && ( -
- Tags: - {config.tags.map((tag) => ( - - {tag} - - ))} -
- )} - {file && ( - <> -
- - {EXTENSIONS.filter((extension) => extension.version).map(({ id, name }) => ( - - ))} -
-
- {extensionError && ( - - {extensionError} - - )} -
-
- {extensionMessage && ( - - {extensionMessage} - - )} -
- - - )} -
- )} - {!loading && !config &&

Configuration not found

} -
-
-
- ); -}; diff --git a/apps/acf-configs/src/components/header/user.tsx b/apps/acf-configs/src/components/header/user.tsx deleted file mode 100644 index 614700be..00000000 --- a/apps/acf-configs/src/components/header/user.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { Nav, NavDropdown } from 'react-bootstrap'; -import { useNavigate } from 'react-router-dom'; -import { auth } from '../../firebase'; - -export const User = () => { - const user = auth.currentUser; - - const navigate = useNavigate(); - const onSignOut = async () => { - await auth.signOut(); - navigate('/', { replace: true }); - }; - - if (!user) return null; - return ( - <> - -
-
-
- - - Logout - - - - ); -}; diff --git a/apps/acf-configs/src/components/home.tsx b/apps/acf-configs/src/components/home.tsx deleted file mode 100644 index 684fd790..00000000 --- a/apps/acf-configs/src/components/home.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { Footer, Header } from '@dhruv-techapps/ui-components'; -import React, { useEffect } from 'react'; -import { Outlet, useNavigate } from 'react-router-dom'; -import aa from 'search-insights'; -import { auth } from '../firebase'; -import { EXTENSIONS } from '../util/constant'; -import { User } from './header/user'; - -const Home: React.FC = () => { - const navigate = useNavigate(); - const onHomeClick = (e: React.MouseEvent) => { - e.preventDefault(); - navigate('/'); - }; - - useEffect(() => { - auth.authStateReady().then(() => { - if (auth.currentUser) { - aa('setUserToken', auth.currentUser.uid); - } - }); - }, []); - - useEffect(() => { - if (chrome.runtime?.sendMessage) { - EXTENSIONS.forEach(({ id }, index) => { - chrome.runtime.sendMessage(id, { messenger: 'manifest', methodName: 'value', message: 'version' }, (response) => { - if (response?.version) { - EXTENSIONS[index].version = response.version; - } - }); - }); - } - }, []); - - return ( - <> -
- -
- -