-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i18n support in devconsole Gitops and Guided tour components
- Loading branch information
1 parent
dae0335
commit 22ec7cb
Showing
13 changed files
with
153 additions
and
77 deletions.
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
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
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
50 changes: 29 additions & 21 deletions
50
frontend/packages/dev-console/src/components/gitops/list/GitOpsList.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 |
---|---|---|
@@ -1,36 +1,44 @@ | ||
import * as React from 'react'; | ||
import * as _ from 'lodash'; | ||
import { useTranslation } from 'react-i18next'; | ||
import GitOpsListItem from './GitOpsListItem'; | ||
import { Stack, StackItem, Split, SplitItem } from '@patternfly/react-core'; | ||
import { GitOpsAppGroupData } from '../utils/gitops-types'; | ||
import './GitOpsList.scss'; | ||
import GitOpsEmptyState from '../GitOpsEmptyState'; | ||
import './GitOpsList.scss'; | ||
|
||
interface GitOpsListProps { | ||
appGroups: GitOpsAppGroupData[]; | ||
emptyStateMsg: string; | ||
} | ||
|
||
const GitOpsList: React.FC<GitOpsListProps> = ({ appGroups, emptyStateMsg }) => ( | ||
<div className="odc-gitops-list"> | ||
{!emptyStateMsg ? ( | ||
<Stack hasGutter> | ||
<StackItem> | ||
<Split> | ||
<SplitItem isFilled /> | ||
<SplitItem>{`${_.size(appGroups)} items`}</SplitItem> | ||
</Split> | ||
</StackItem> | ||
{_.map(appGroups, (appGroup) => ( | ||
<StackItem key={`${appGroup.name}-${appGroup.repo_url}`}> | ||
<GitOpsListItem appGroup={appGroup} /> | ||
const GitOpsList: React.FC<GitOpsListProps> = ({ appGroups, emptyStateMsg }) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<div className="odc-gitops-list"> | ||
{!emptyStateMsg ? ( | ||
<Stack hasGutter> | ||
<StackItem> | ||
<Split> | ||
<SplitItem isFilled /> | ||
<SplitItem> | ||
{t('devconsole~{{count, number}} item', { | ||
count: _.size(appGroups), | ||
})} | ||
</SplitItem> | ||
</Split> | ||
</StackItem> | ||
))} | ||
</Stack> | ||
) : ( | ||
<GitOpsEmptyState emptyStateMsg={emptyStateMsg} /> | ||
)} | ||
</div> | ||
); | ||
{_.map(appGroups, (appGroup) => ( | ||
<StackItem key={`${appGroup.name}-${appGroup.repo_url}`}> | ||
<GitOpsListItem appGroup={appGroup} /> | ||
</StackItem> | ||
))} | ||
</Stack> | ||
) : ( | ||
<GitOpsEmptyState emptyStateMsg={emptyStateMsg} /> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default GitOpsList; |
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
Oops, something went wrong.