-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): support diff for application list
Signed-off-by: vivian.zhang <[email protected]>
- Loading branch information
Showing
5 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...plications/components/application-resource-diff-panel/application-resource-diff-panel.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,25 @@ | ||
import {DataLoader, SlidingPanel} from 'argo-ui'; | ||
import * as React from 'react'; | ||
import * as models from '../../../shared/models'; | ||
import {services} from '../../../shared/services'; | ||
import {ApplicationResourcesDiff} from '../application-resources-diff/application-resources-diff'; | ||
|
||
export const ApplicationResourceDiffPanel = ({application, hide}: {application: models.Application; hide: () => any}) => { | ||
const isVisible = !!application; | ||
const header = application?.metadata.name || 'diff'; | ||
return ( | ||
<SlidingPanel header={header} isShown={isVisible} onClose={() => hide()}> | ||
{isVisible && ( | ||
<DataLoader | ||
key='diff' | ||
load={async () => | ||
await services.applications.managedResources(application.metadata.name, application.metadata.namespace, { | ||
fields: ['items.normalizedLiveState', 'items.predictedLiveState', 'items.group', 'items.kind', 'items.namespace', 'items.name'] | ||
}) | ||
}> | ||
{managedResources => <ApplicationResourcesDiff states={managedResources} />} | ||
</DataLoader> | ||
)} | ||
</SlidingPanel> | ||
); | ||
}; |
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