Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: datasource homepage ui redesign and search functionality for the datasources #38360

Merged
merged 32 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
edecabd
fix: premium ds fixes
AmanAgarwal041 Dec 23, 2024
19d07d8
fix: added calendly link
AmanAgarwal041 Dec 23, 2024
97b2197
feat: display integration in updated ui with search
AmanAgarwal041 Dec 25, 2024
a880be6
feat: resolved conflicts
AmanAgarwal041 Dec 25, 2024
d9defc9
feat: fix errors
AmanAgarwal041 Dec 25, 2024
e5ed096
fix: data test ids
AmanAgarwal041 Dec 26, 2024
aeaeec2
fix: rightsibling flex spacing
AmanAgarwal041 Dec 26, 2024
35f1347
fix: test fixes
AmanAgarwal041 Dec 27, 2024
7c0f440
fix: conflict fixes
AmanAgarwal041 Dec 27, 2024
f652ddd
fix: test fixes
AmanAgarwal041 Dec 27, 2024
fdb2f41
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Dec 27, 2024
8e3f1e2
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 2, 2025
7801328
fix: onboarding flow ui, cypress test cases
AmanAgarwal041 Jan 2, 2025
bff9896
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 2, 2025
307be87
fix: updated the suggestions
AmanAgarwal041 Jan 3, 2025
d1c8430
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 3, 2025
fdb8873
fix: moved the divider at correct place
AmanAgarwal041 Jan 3, 2025
df2bd3c
fix: updated the test party bug fixes
AmanAgarwal041 Jan 3, 2025
3ec726c
fix: updated any types
AmanAgarwal041 Jan 3, 2025
17ed083
fix: moved to contact and helpers moved to specific directories
AmanAgarwal041 Jan 6, 2025
5e1877f
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 6, 2025
832c305
fix: build error
AmanAgarwal041 Jan 7, 2025
9622d18
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 7, 2025
e95fb60
fix: conflict resolve
AmanAgarwal041 Jan 7, 2025
58919a9
fix: deleted the already deleted file
AmanAgarwal041 Jan 7, 2025
4f4ab22
fix: client unit tests
AmanAgarwal041 Jan 7, 2025
e6494bd
fix: ui fixes
AmanAgarwal041 Jan 7, 2025
a06b3fb
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 7, 2025
9c34a59
fix: ui fixes
AmanAgarwal041 Jan 8, 2025
028d7f3
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 8, 2025
23a91a2
fix: ui fixes banner, spec file
AmanAgarwal041 Jan 8, 2025
aa2489b
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,19 @@ export const CREATE_NEW_DATASOURCE_REST_API = () => "REST API";
export const SAMPLE_DATASOURCES = () => "Sample datasources";
export const EDIT_DS_CONFIG = () => "Edit datasource configuration";
export const NOT_FOUND = () => "Not found";
export const CREATE_NEW_DATASOURCE_AUTHENTICATED_REST_API = () =>
"Authenticated API";
export const CREATE_NEW_DATASOURCE_GRAPHQL_API = () => "GraphQL API";
export const CREATE_NEW_API_SECTION_HEADER = () => "APIs";
export const CREATE_NEW_SAAS_SECTION_HEADER = () => "SaaS integrations";
export const CREATE_NEW_AI_SECTION_HEADER = () => "AI integrations";
export const CONNECT_A_DATASOURCE_HEADING = () => "Connect a datasource";
export const CONNECT_A_DATASOURCE_SUBHEADING = () =>
"Select a sample datasource or connect your own";
export const SEARCH_FOR_DATASOURCES = () => "Search for datasources";
export const EMPTY_SEARCH_DATASOURCES_TITLE = () => "No results found";
export const EMPTY_SEARCH_DATASOURCES_DESCRIPTION = () =>
"Please try again with a different search";

export const ERROR_EVAL_ERROR_GENERIC = () =>
`Unexpected error occurred while evaluating the application`;
Expand Down Expand Up @@ -2379,8 +2392,6 @@ export const PARTIAL_IMPORT_EXPORT = {
},
};

export const DATASOURCE_SECURELY_TITLE = () => "Secure & fast connection";

export const CUSTOM_WIDGET_FEATURE = {
addEvent: {
addCTA: () => "Add",
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/constants/PremiumDatasourcesConstants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAssetUrl } from "ee/utils/airgapHelpers";
import { ASSETS_CDN_URL } from "./ThirdPartyConstants";

interface PremiumIntegration {
export interface PremiumIntegration {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmanAgarwal041 Instead of creating this const file inside the common constants folder, can we create a constants folder inside IntegrationEditor and keep it there. I believe these constants are not being used outside of IntegrationEditor, that way we will have a better organisation of files, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets keep it here only, as if we keep the constants inside the IntegrationEditor then we should ideally keep the utils PremiumDatasourcesHelpers also inside IntegrationEditor. But that would not be a good option here. Keeping these things segregated is good.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should even keep utils inside IntegrationEditor, that way we would have all things needed for IntegrationEditor inside IntegrationEditor folder, following modularisation framework.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have anything adopted yet ? If not then we should leave it for now, otherwise we would be in a state where we follow two architecture mechanism at once, which becomes a little confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name: string;
icon: string;
}
Expand Down
184 changes: 0 additions & 184 deletions app/client/src/pages/Editor/IntegrationEditor/AIDataSources.tsx

This file was deleted.

112 changes: 112 additions & 0 deletions app/client/src/pages/Editor/IntegrationEditor/AIPlugins.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import React from "react";
import { connect } from "react-redux";
import { createTempDatasourceFromForm } from "actions/datasourceActions";
import type { AppState } from "ee/reducers";
import type { Plugin } from "api/PluginApi";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { PluginType } from "entities/Action";
import { getAssetUrl, isAirgapped } from "ee/utils/airgapHelpers";
import {
DatasourceContainer,
DatasourceSection,
DatasourceSectionHeading,
StyledDivider,
} from "./IntegrationStyledComponents";
import DatasourceItem from "./DatasourceItem";
import {
CREATE_NEW_AI_SECTION_HEADER,
createMessage,
} from "ee/constants/messages";
import { pluginSearchSelector } from "./CreateNewDatasourceHeader";
import { getPlugins } from "ee/selectors/entitiesSelector";

interface CreateAIPluginsProps {
pageId: string;
isCreating?: boolean;
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
showUnsupportedPluginDialog: (callback: any) => void;

plugins: Plugin[];
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
createTempDatasourceFromForm: (data: any) => void;
}

function AIDataSources(props: CreateAIPluginsProps) {
const { plugins } = props;

const handleOnClick = (plugin: Plugin) => {
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", {
pluginName: plugin.name,
pluginPackageName: plugin.packageName,
});

props.createTempDatasourceFromForm({
pluginId: plugin.id,
type: plugin.type,
});
};

return (
<DatasourceContainer data-testid="newai-datasource-card-container">
{plugins.map((plugin) => (
<DatasourceItem
className={`t--createBlankApi-${plugin.packageName}`}
handleOnClick={() => {
handleOnClick(plugin);
}}
icon={getAssetUrl(plugin.iconLocation)}
key={plugin.id}
name={plugin.name}
/>
))}
</DatasourceContainer>
);
}

function CreateAIPlugins(props: CreateAIPluginsProps) {
const isAirgappedInstance = isAirgapped();

if (isAirgappedInstance || props.plugins.length === 0) return null;

return (
<>
<StyledDivider />
<DatasourceSection id="new-ai-query">
<DatasourceSectionHeading kind="heading-m">
{createMessage(CREATE_NEW_AI_SECTION_HEADER)}
</DatasourceSectionHeading>
<AIDataSources {...props} />
</DatasourceSection>
</>
);
}

const mapStateToProps = (state: AppState) => {
const searchedPlugin = pluginSearchSelector(state, "search") || "";

let plugins = getPlugins(state);

// AI Plugins
plugins = plugins
.sort((a, b) => {
// Sort the AI plugins alphabetically
return a.name.localeCompare(b.name);
})
.filter(
(p) =>
p.type === PluginType.AI &&
p.name.toLocaleLowerCase().includes(searchedPlugin),
);

return {
plugins,
};
};

const mapDispatchToProps = {
createTempDatasourceFromForm,
};

export default connect(mapStateToProps, mapDispatchToProps)(CreateAIPlugins);
Loading
Loading