chore: Remove Algolia, we don't use it anymore (#37664)

## Automation

/test sanity

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11987511676>
> Commit: 22f0a6fc7c916a948cdd1ec98183f0113d485d90
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11987511676&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Sat, 23 Nov 2024 14:45:28 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

- **Chores**
- Removed Algolia Search configuration from various files, including
environment variables and configuration scripts.
  
- **Refactor**
- Simplified search-related components and utility functions by removing
Algolia dependencies, enhancing clarity and usability.
  
- **Bug Fixes**
- Adjusted search item type handling to improve type safety and reduce
complexity.

These updates streamline the application by eliminating unnecessary
dependencies and refining existing functionalities.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Shrikant Sharat Kandula 2024-11-23 21:38:04 +05:30 committed by GitHub
parent 5c1501717b
commit 7c66c07805
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 1 additions and 215 deletions

View File

@ -21,11 +21,6 @@ APPSMITH_SIGNUP_DISABLED=
# Segment # Segment
APPSMITH_SEGMENT_KEY= APPSMITH_SEGMENT_KEY=
# Algolia Search (Docs)
APPSMITH_ALGOLIA_API_ID=
APPSMITH_ALGOLIA_API_KEY=
APPSMITH_ALGOLIA_SEARCH_INDEX_NAME=
#Client log level (debug | error) #Client log level (debug | error)
APPSMITH_CLIENT_LOG_LEVEL= APPSMITH_CLIENT_LOG_LEVEL=

View File

@ -30,9 +30,6 @@ server {
sub_filter __APPSMITH_SENTRY_DSN__ '${APPSMITH_SENTRY_DSN}'; sub_filter __APPSMITH_SENTRY_DSN__ '${APPSMITH_SENTRY_DSN}';
sub_filter __APPSMITH_SMART_LOOK_ID__ '${APPSMITH_SMART_LOOK_ID}'; sub_filter __APPSMITH_SMART_LOOK_ID__ '${APPSMITH_SMART_LOOK_ID}';
sub_filter __APPSMITH_SEGMENT_KEY__ '${APPSMITH_SEGMENT_KEY}'; sub_filter __APPSMITH_SEGMENT_KEY__ '${APPSMITH_SEGMENT_KEY}';
sub_filter __APPSMITH_ALGOLIA_API_ID__ '${APPSMITH_ALGOLIA_API_ID}';
sub_filter __APPSMITH_ALGOLIA_SEARCH_INDEX_NAME__ '${APPSMITH_ALGOLIA_SEARCH_INDEX_NAME}';
sub_filter __APPSMITH_ALGOLIA_API_KEY__ '${APPSMITH_ALGOLIA_API_KEY}';
sub_filter __APPSMITH_CLIENT_LOG_LEVEL__ '${APPSMITH_CLIENT_LOG_LEVEL}'; sub_filter __APPSMITH_CLIENT_LOG_LEVEL__ '${APPSMITH_CLIENT_LOG_LEVEL}';
sub_filter __APPSMITH_SENTRY_RELEASE__ '${APPSMITH_SENTRY_RELEASE}'; sub_filter __APPSMITH_SENTRY_RELEASE__ '${APPSMITH_SENTRY_RELEASE}';
sub_filter __APPSMITH_SENTRY_ENVIRONMENT__ '${APPSMITH_SENTRY_ENVIRONMENT}'; sub_filter __APPSMITH_SENTRY_ENVIRONMENT__ '${APPSMITH_SENTRY_ENVIRONMENT}';

View File

@ -114,11 +114,6 @@ module.exports = {
enabled: parseConfig("__APPSMITH_SEGMENT_KEY__"), enabled: parseConfig("__APPSMITH_SEGMENT_KEY__"),
apiKey: parseConfig("__APPSMITH_MIXPANEL_KEY__"), apiKey: parseConfig("__APPSMITH_MIXPANEL_KEY__"),
}, },
algolia: {
apiId: parseConfig("__APPSMITH_ALGOLIA_API_ID__"),
apiKey: parseConfig("__APPSMITH_ALGOLIA_API_KEY__"),
indexName: parseConfig("__APPSMITH_ALGOLIA_SEARCH_INDEX_NAME__"),
},
logLevel: logLevel:
CONFIG_LOG_LEVEL_INDEX > -1 CONFIG_LOG_LEVEL_INDEX > -1
? LOG_LEVELS[CONFIG_LOG_LEVEL_INDEX] ? LOG_LEVELS[CONFIG_LOG_LEVEL_INDEX]

View File

@ -277,7 +277,6 @@
"@types/react-dom": "^17.0.2", "@types/react-dom": "^17.0.2",
"@types/react-google-recaptcha": "^2.1.1", "@types/react-google-recaptcha": "^2.1.1",
"@types/react-helmet": "^5.0.14", "@types/react-helmet": "^5.0.14",
"@types/react-instantsearch-core": "^6.26.10",
"@types/react-modal": "^3.13.1", "@types/react-modal": "^3.13.1",
"@types/react-redux": "^7.0.1", "@types/react-redux": "^7.0.1",
"@types/react-router-dom": "^5.1.2", "@types/react-router-dom": "^5.1.2",

View File

@ -251,11 +251,6 @@
enabled: parseConfig('{{env "APPSMITH_SEGMENT_KEY"}}'), enabled: parseConfig('{{env "APPSMITH_SEGMENT_KEY"}}'),
apiKey: parseConfig('{{env "APPSMITH_MIXPANEL_KEY"}}'), apiKey: parseConfig('{{env "APPSMITH_MIXPANEL_KEY"}}'),
}, },
algolia: {
apiId: parseConfig('{{env "APPSMITH_ALGOLIA_API_ID"}}'),
apiKey: parseConfig('{{env "APPSMITH_ALGOLIA_API_KEY"}}'),
indexName: parseConfig('{{env "APPSMITH_ALGOLIA_SEARCH_INDEX_NAME"}}'),
},
logLevel: logLevel:
CONFIG_LOG_LEVEL_INDEX > -1 CONFIG_LOG_LEVEL_INDEX > -1
? LOG_LEVELS[CONFIG_LOG_LEVEL_INDEX] ? LOG_LEVELS[CONFIG_LOG_LEVEL_INDEX]

View File

@ -34,12 +34,6 @@ export interface INJECTED_CONFIGS {
apiKey: string; apiKey: string;
}; };
cloudHosting: boolean; cloudHosting: boolean;
algolia: {
apiId: string;
apiKey: string;
indexName: string;
snippetIndex: string;
};
logLevel: "debug" | "error"; logLevel: "debug" | "error";
appVersion: { appVersion: {
id: string; id: string;
@ -89,12 +83,6 @@ export const getConfigsFromEnvVars = (): INJECTED_CONFIGS => {
: false, : false,
apiKey: process.env.REACT_APP_MIXPANEL_KEY || "", apiKey: process.env.REACT_APP_MIXPANEL_KEY || "",
}, },
algolia: {
apiId: process.env.REACT_APP_ALGOLIA_API_ID || "",
apiKey: process.env.REACT_APP_ALGOLIA_API_KEY || "",
indexName: process.env.REACT_APP_ALGOLIA_SEARCH_INDEX_NAME || "",
snippetIndex: process.env.REACT_APP_ALGOLIA_SNIPPET_INDEX_NAME || "",
},
observability: { observability: {
deploymentName: process.env.APPSMITH_DEPLOYMENT_NAME || "self-hosted", deploymentName: process.env.APPSMITH_DEPLOYMENT_NAME || "self-hosted",
serviceInstanceId: process.env.HOSTNAME || "appsmith-0", serviceInstanceId: process.env.HOSTNAME || "appsmith-0",
@ -225,23 +213,6 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => {
APPSMITH_FEATURE_CONFIGS?.smartLook.id, APPSMITH_FEATURE_CONFIGS?.smartLook.id,
); );
const algoliaAPIID = getConfig(
ENV_CONFIG.algolia.apiId,
APPSMITH_FEATURE_CONFIGS?.algolia.apiId,
);
const algoliaAPIKey = getConfig(
ENV_CONFIG.algolia.apiKey,
APPSMITH_FEATURE_CONFIGS?.algolia.apiKey,
);
const algoliaIndex = getConfig(
ENV_CONFIG.algolia.indexName,
APPSMITH_FEATURE_CONFIGS?.algolia.indexName,
);
const algoliaSnippetIndex = getConfig(
ENV_CONFIG.algolia.indexName,
APPSMITH_FEATURE_CONFIGS?.algolia.snippetIndex,
);
const segmentCEKey = getConfig( const segmentCEKey = getConfig(
ENV_CONFIG.segment.ceKey, ENV_CONFIG.segment.ceKey,
APPSMITH_FEATURE_CONFIGS?.segment.ceKey, APPSMITH_FEATURE_CONFIGS?.segment.ceKey,
@ -289,13 +260,6 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => {
enabled: fusioncharts.enabled, enabled: fusioncharts.enabled,
licenseKey: fusioncharts.value, licenseKey: fusioncharts.value,
}, },
algolia: {
enabled: true,
apiId: algoliaAPIID.value || "AZ2Z9CJSJ0",
apiKey: algoliaAPIKey.value || "dfde934d9bdc2e0b14830f1dd3cb240f",
indexName: algoliaIndex.value || "omnibar_docusaurus_index",
snippetIndex: algoliaSnippetIndex.value || "snippet",
},
googleRecaptchaSiteKey: { googleRecaptchaSiteKey: {
enabled: googleRecaptchaSiteKey.enabled, enabled: googleRecaptchaSiteKey.enabled,
apiKey: googleRecaptchaSiteKey.value, apiKey: googleRecaptchaSiteKey.value,

View File

@ -43,13 +43,6 @@ export interface AppsmithUIConfigs {
enabled: boolean; enabled: boolean;
licenseKey: string; licenseKey: string;
}; };
algolia: {
enabled: boolean;
apiId: string;
apiKey: string;
indexName: string;
snippetIndex: string;
};
mixpanel: { mixpanel: {
enabled: boolean; enabled: boolean;

View File

@ -1,6 +1,5 @@
import React, { useEffect, useRef, useContext, useMemo } from "react"; import React, { useEffect, useRef, useContext, useMemo } from "react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import type { Hit as IHit } from "react-instantsearch-core";
import styled, { css } from "styled-components"; import styled, { css } from "styled-components";
import { getTypographyByKey } from "@appsmith/ads-old"; import { getTypographyByKey } from "@appsmith/ads-old";
import Highlight from "./Highlight"; import Highlight from "./Highlight";
@ -402,7 +401,7 @@ const SearchItemByType = {
}; };
interface ItemProps { interface ItemProps {
item: IHit | SearchItem; item: SearchItem;
index: number; index: number;
query: string; query: string;
} }

View File

@ -25,7 +25,6 @@ import {
} from "actions/globalSearchActions"; } from "actions/globalSearchActions";
import type { SearchCategory, SearchItem, SelectEvent } from "./utils"; import type { SearchCategory, SearchItem, SelectEvent } from "./utils";
import { import {
algoliaHighlightTag,
filterCategories, filterCategories,
getEntityId, getEntityId,
getFilterCategoryList, getFilterCategoryList,
@ -101,8 +100,6 @@ const StyledContainer = styled.div<{ category: SearchCategory; query: string }>`
} }
} }
${algoliaHighlightTag},
& .ais-Highlight-highlighted,
& .search-highlighted { & .search-highlighted {
background-color: transparent; background-color: transparent;
font-style: normal; font-style: normal;

View File

@ -230,8 +230,6 @@ export const getItemPage = (item: SearchItem): string => {
} }
}; };
export const algoliaHighlightTag = "ais-highlight-0000000000";
// TODO: Fix this the next time the file is edited // TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export const attachKind = (source: any[], kind: string) => { export const attachKind = (source: any[], kind: string) => {

View File

@ -12,107 +12,6 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@algolia/client-abtesting@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/client-abtesting@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
"@algolia/requester-browser-xhr": 5.6.1
"@algolia/requester-fetch": 5.6.1
"@algolia/requester-node-http": 5.6.1
checksum: 516f2b91388c98eb309f28b81f9b6467e69e82dc7150be16b88ffdcf1cee9d29e5bef9add3397e8e951626fbd586d38b6e66cd43b298ff47c5cf02fb561176a8
languageName: node
linkType: hard
"@algolia/client-analytics@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/client-analytics@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
"@algolia/requester-browser-xhr": 5.6.1
"@algolia/requester-fetch": 5.6.1
"@algolia/requester-node-http": 5.6.1
checksum: fae1b496065a77e33a99cde28982d9b077ce56b84caf2707323f7d180047f8118ee04fb2297f0c2221d4a23b974407ce981fcd41704f2ccfb6e68f867ce4d17e
languageName: node
linkType: hard
"@algolia/client-common@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/client-common@npm:5.6.1"
checksum: 9d46de033377c90a9f42edeb65a5d68d27610332e92fdddcf489c9c2aa3f0e0ddbe6570239dbc7b163b6914aa4e5e497b6a3f547b4b41fe26766cc126ab4ef49
languageName: node
linkType: hard
"@algolia/client-personalization@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/client-personalization@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
"@algolia/requester-browser-xhr": 5.6.1
"@algolia/requester-fetch": 5.6.1
"@algolia/requester-node-http": 5.6.1
checksum: 4a6486a43d82875291d572f1fdec3fcd9306a2872f320972ad44a8a5c3ff1bbca6dd99b399302b3c17ab55a1eed96e05e8ef357867ac4a0fdc6d783f9ee3c5b6
languageName: node
linkType: hard
"@algolia/client-search@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/client-search@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
"@algolia/requester-browser-xhr": 5.6.1
"@algolia/requester-fetch": 5.6.1
"@algolia/requester-node-http": 5.6.1
checksum: 540645d05cc05b5e800ba27ad7c4bd3e726de7bd672a7fc79d489dfd0249fae1cdc56218da7c7db9d4ea937d3293edf77964c3d153841df00c2f6d78d8816694
languageName: node
linkType: hard
"@algolia/events@npm:^4.0.1":
version: 4.0.1
resolution: "@algolia/events@npm:4.0.1"
checksum: 4f63943f4554cfcfed91d8b8c009a49dca192b81056d8c75e532796f64828cd69899852013e81ff3fff07030df8782b9b95c19a3da0845786bdfe22af42442c2
languageName: node
linkType: hard
"@algolia/recommend@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/recommend@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
"@algolia/requester-browser-xhr": 5.6.1
"@algolia/requester-fetch": 5.6.1
"@algolia/requester-node-http": 5.6.1
checksum: 70e362935a17967fc1ad58e8f168d07e47919526e2ed468dd8eb55fee77e2b2f5b499014ef680a5a83cf575f6b5fa691b2648b47642db9419b767bc8a55f68cb
languageName: node
linkType: hard
"@algolia/requester-browser-xhr@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/requester-browser-xhr@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
checksum: 4196a0bb16133b47aaebfa407c375967c7df661f9df19909d02f669b884d7137269010f53191642ce0c525abca4b38cf58695d986a98f3e4a0d541fcad3a54c5
languageName: node
linkType: hard
"@algolia/requester-fetch@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/requester-fetch@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
checksum: 240eb4d3028f98c271014fcbe3ab245cc8dfdb87f91aaff7dc66eff41182f70fcf0f891f03a8050183c2f5ce4f5e2410b2ec47263c9b715eee6ecb880fb5a45a
languageName: node
linkType: hard
"@algolia/requester-node-http@npm:5.6.1":
version: 5.6.1
resolution: "@algolia/requester-node-http@npm:5.6.1"
dependencies:
"@algolia/client-common": 5.6.1
checksum: d27a69b14b1a1fabeeb23e41cffced8e2edd2e52d93fbdadd2fbadfd775b21fa484a20bb63ea0373d8c2a339069c7e0681588d94d775b8a168dcc4cad96b684a
languageName: node
linkType: hard
"@alloc/quick-lru@npm:^5.2.0": "@alloc/quick-lru@npm:^5.2.0":
version: 5.2.0 version: 5.2.0
resolution: "@alloc/quick-lru@npm:5.2.0" resolution: "@alloc/quick-lru@npm:5.2.0"
@ -10985,17 +10884,6 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/react-instantsearch-core@npm:^6.26.10":
version: 6.26.10
resolution: "@types/react-instantsearch-core@npm:6.26.10"
dependencies:
"@types/react": "*"
algoliasearch: ">=4"
algoliasearch-helper: ">=3"
checksum: 7f5ce45ffceec268fc6697b59ed137804f8256c7cd94ec00e8a69f7070e6d4b201c1c57bd38a0afe9ecca4161a853823cea5aeeae9532b28169aa48a2501e24e
languageName: node
linkType: hard
"@types/react-modal@npm:^3.13.1": "@types/react-modal@npm:^3.13.1":
version: 3.13.1 version: 3.13.1
resolution: "@types/react-modal@npm:3.13.1" resolution: "@types/react-modal@npm:3.13.1"
@ -12627,34 +12515,6 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"algoliasearch-helper@npm:>=3":
version: 3.22.5
resolution: "algoliasearch-helper@npm:3.22.5"
dependencies:
"@algolia/events": ^4.0.1
peerDependencies:
algoliasearch: ">= 3.1 < 6"
checksum: bf1f0573778a5d4398efbc723558eaa7efd81a0c906c8c6339d6ab243e065c8dabea656c5bb914cda8dfa57e7af3c16e5370b0399f265a2a3dc49fed0dceedac
languageName: node
linkType: hard
"algoliasearch@npm:>=4":
version: 5.6.1
resolution: "algoliasearch@npm:5.6.1"
dependencies:
"@algolia/client-abtesting": 5.6.1
"@algolia/client-analytics": 5.6.1
"@algolia/client-common": 5.6.1
"@algolia/client-personalization": 5.6.1
"@algolia/client-search": 5.6.1
"@algolia/recommend": 5.6.1
"@algolia/requester-browser-xhr": 5.6.1
"@algolia/requester-fetch": 5.6.1
"@algolia/requester-node-http": 5.6.1
checksum: 32ed2e9aba9953171546f3a9b3270e18943884d2debad3f7c680883d3fb93380a98ba4e0cec0e9faa71f5978df6e9163338317e44039423808bc1d23777a935b
languageName: node
linkType: hard
"ally.js@npm:^1.4.1": "ally.js@npm:^1.4.1":
version: 1.4.1 version: 1.4.1
resolution: "ally.js@npm:1.4.1" resolution: "ally.js@npm:1.4.1"
@ -12923,7 +12783,6 @@ __metadata:
"@types/react-dom": ^17.0.2 "@types/react-dom": ^17.0.2
"@types/react-google-recaptcha": ^2.1.1 "@types/react-google-recaptcha": ^2.1.1
"@types/react-helmet": ^5.0.14 "@types/react-helmet": ^5.0.14
"@types/react-instantsearch-core": ^6.26.10
"@types/react-modal": ^3.13.1 "@types/react-modal": ^3.13.1
"@types/react-page-visibility": ^6.4.1 "@types/react-page-visibility": ^6.4.1
"@types/react-redux": ^7.0.1 "@types/react-redux": ^7.0.1

View File

@ -29,11 +29,6 @@ APPSMITH_SIGNUP_DISABLED=
# Segment # Segment
APPSMITH_SEGMENT_KEY= APPSMITH_SEGMENT_KEY=
# Algolia Search (Docs)
APPSMITH_ALGOLIA_API_ID=
APPSMITH_ALGOLIA_API_KEY=
APPSMITH_ALGOLIA_SEARCH_INDEX_NAME=
#Client log level (debug | error) #Client log level (debug | error)
APPSMITH_CLIENT_LOG_LEVEL= APPSMITH_CLIENT_LOG_LEVEL=