-
Notifications
You must be signed in to change notification settings - Fork 7
feat: app clone flow #731
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
Merged
Merged
feat: app clone flow #731
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9f46a7e
chore: generic empty list updated
shivani170 7387fac
chore: import enabled
shivani170 2d10966
chore: export GenericInfoCardListingProps
shivani170 3537fa1
chore: version bump
shivani170 d93f01c
Merge branch 'develop' into feat/app-clone-flow
shivani170 d1e0f4e
chore: separate out loading state component
shivani170 b511695
Merge branch 'develop' into feat/app-clone-flow
shivani170 730ab48
chore: Added app icon with background
shivani170 0170291
chore: code feedback fixes
shivani170 50b9305
Merge branch 'develop' into feat/app-clone-flow
shivani170 765eb00
fix: icon background fill change from 500 to 400
shivani170 ee0a5c5
chore: generic info card fixes
shivani170 96a5bb2
chore: suggestion fixes
shivani170 9541eb3
Merge branch 'develop' into feat/app-clone-flow
shivani170 530c0de
chore: version bump
shivani170 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions
65
src/Shared/Components/GenericInfoCard/GenericInfoCardListing.tsx
This file contains hidden or 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,65 @@ | ||
| /* | ||
| * Copyright (c) 2024. Devtron Inc. | ||
| */ | ||
|
|
||
| import { useMemo } from 'react' | ||
|
|
||
| import emptyList from '@Images/empty-create.png' | ||
| import ErrorScreenManager from '@Common/ErrorScreenManager' | ||
| import { GenericEmptyState, GenericFilterEmptyState } from '@Common/index' | ||
|
|
||
| import GenericInfoCard from './GenericInfoCard.component' | ||
| import { GenericInfoListSkeleton } from './GenericInfoListSkeleton' | ||
| import { GenericInfoCardListingProps } from './types' | ||
|
|
||
| export const GenericInfoCardListing = ({ | ||
| isLoading, | ||
| error, | ||
| list, | ||
| searchKey, | ||
| reloadList, | ||
| borderVariant, | ||
| handleClearFilters, | ||
| emptyStateConfig, | ||
| }: GenericInfoCardListingProps) => { | ||
| const filteredList = useMemo(() => { | ||
| if (!searchKey || error) { | ||
| return list | ||
| } | ||
|
|
||
| const loweredSearchKey = searchKey.toLowerCase() | ||
| return list.filter(({ title }) => title.toLowerCase().includes(loweredSearchKey)) | ||
|
shivani170 marked this conversation as resolved.
Outdated
|
||
| }, [searchKey, list, error]) | ||
|
|
||
| if (isLoading) { | ||
| return <GenericInfoListSkeleton borderVariant={borderVariant} /> | ||
| } | ||
|
|
||
| if (error) { | ||
| return <ErrorScreenManager code={error?.code as number} reload={reloadList} /> | ||
| } | ||
|
|
||
| if (filteredList.length === 0) { | ||
| if (searchKey) { | ||
| return <GenericFilterEmptyState handleClearFilters={handleClearFilters} /> | ||
| } | ||
|
|
||
| return <GenericEmptyState image={emptyStateConfig.image ?? emptyList} {...emptyStateConfig} /> | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| {filteredList.map(({ id, title, description, author, Icon, onClick, linkProps }) => ( | ||
| <GenericInfoCard | ||
| key={id} | ||
| title={title} | ||
| description={description} | ||
| author={author} | ||
| borderVariant={borderVariant} | ||
| Icon={Icon} | ||
| {...(onClick ? { onClick } : { linkProps })} | ||
| /> | ||
| ))} | ||
| </> | ||
| ) | ||
| } | ||
9 changes: 9 additions & 0 deletions
9
src/Shared/Components/GenericInfoCard/GenericInfoListSkeleton.tsx
This file contains hidden or 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,9 @@ | ||
| import GenericInfoCard from './GenericInfoCard.component' | ||
|
|
||
| export const GenericInfoListSkeleton = (borderVariant) => ( | ||
|
AbhishekA1509 marked this conversation as resolved.
Outdated
|
||
| <> | ||
| <GenericInfoCard isLoading borderVariant={borderVariant} /> | ||
| <GenericInfoCard isLoading borderVariant={borderVariant} /> | ||
| <GenericInfoCard isLoading borderVariant={borderVariant} /> | ||
| </> | ||
| ) | ||
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.