-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Changes from 7 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
edecabd
fix: premium ds fixes
AmanAgarwal041 19d07d8
fix: added calendly link
AmanAgarwal041 97b2197
feat: display integration in updated ui with search
AmanAgarwal041 a880be6
feat: resolved conflicts
AmanAgarwal041 d9defc9
feat: fix errors
AmanAgarwal041 e5ed096
fix: data test ids
AmanAgarwal041 aeaeec2
fix: rightsibling flex spacing
AmanAgarwal041 35f1347
fix: test fixes
AmanAgarwal041 7c0f440
fix: conflict fixes
AmanAgarwal041 f652ddd
fix: test fixes
AmanAgarwal041 fdb2f41
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 8e3f1e2
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 7801328
fix: onboarding flow ui, cypress test cases
AmanAgarwal041 bff9896
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 307be87
fix: updated the suggestions
AmanAgarwal041 d1c8430
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 fdb8873
fix: moved the divider at correct place
AmanAgarwal041 df2bd3c
fix: updated the test party bug fixes
AmanAgarwal041 3ec726c
fix: updated any types
AmanAgarwal041 17ed083
fix: moved to contact and helpers moved to specific directories
AmanAgarwal041 5e1877f
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 832c305
fix: build error
AmanAgarwal041 9622d18
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 e95fb60
fix: conflict resolve
AmanAgarwal041 58919a9
fix: deleted the already deleted file
AmanAgarwal041 4f4ab22
fix: client unit tests
AmanAgarwal041 e6494bd
fix: ui fixes
AmanAgarwal041 a06b3fb
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 9c34a59
fix: ui fixes
AmanAgarwal041 028d7f3
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 23a91a2
fix: ui fixes banner, spec file
AmanAgarwal041 aa2489b
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/s…
AmanAgarwal041 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
184 changes: 0 additions & 184 deletions
184
app/client/src/pages/Editor/IntegrationEditor/AIDataSources.tsx
This file was deleted.
Oops, something went wrong.
112 changes: 112 additions & 0 deletions
112
app/client/src/pages/Editor/IntegrationEditor/AIPlugins.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
AmanAgarwal041 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AmanAgarwal041 Can you check this once? https://github.com/appsmithorg/appsmith-ee/tree/release/app/client/src/PluginActionEditor