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: show app age in application list view (#11209) #11502

Merged
merged 4 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {DataLoader, DropDownMenu, Tooltip} from 'argo-ui';
import * as React from 'react';
import Moment from 'react-moment';
import {Key, KeybindingContext, useNav} from 'argo-ui/v2';
import {Cluster} from '../../../shared/components';
import {Consumer, Context} from '../../../shared/context';
Expand Down Expand Up @@ -118,22 +119,32 @@ export const ApplicationsTable = (props: {
</div>
</div>
</div>

<div className='columns small-2'>
<AppUtils.HealthStatusIcon state={app.status.health} /> <span>{app.status.health.status}</span> <br />
<AppUtils.ComparisonStatusIcon status={app.status.sync.status} />
<span>{app.status.sync.status}</span> <OperationState app={app} quiet={true} />
<DropDownMenu
anchor={() => (
<button className='argo-button argo-button--light argo-button--lg argo-button--short'>
<i className='fa fa-ellipsis-v' />
</button>
)}
items={[
{title: 'Sync', action: () => props.syncApplication(app.metadata.name, app.metadata.namespace)},
{title: 'Refresh', action: () => props.refreshApplication(app.metadata.name, app.metadata.namespace)},
{title: 'Delete', action: () => props.deleteApplication(app.metadata.name, app.metadata.namespace)}
]}
/>
<div className='row'>
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel the table has too many columns to display and it's slightly cramped, I would prefer to have created time in the tooltip
Screen Shot 2022-11-30 at 12 23 54 PM

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with you, but where exactly in the tooltip? or you mean as a tooltip of one table row?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the tooltip on the table row with additional metadata would be better however if you just want to display age then I would prefer tooltip on the application name

<div className='columns small-4'>
<Moment style={{marginLeft: 'auto'}} fromNow={true} ago={true}>
{app.metadata.creationTimestamp}
</Moment>
</div>
<div className='columns small-8'>
<AppUtils.HealthStatusIcon state={app.status.health} /> <span>{app.status.health.status}</span> <br />
<AppUtils.ComparisonStatusIcon status={app.status.sync.status} />
<span>{app.status.sync.status}</span> <OperationState app={app} quiet={true} />
<DropDownMenu
anchor={() => (
<button className='argo-button argo-button--light argo-button--lg argo-button--short'>
<i className='fa fa-ellipsis-v' />
</button>
)}
items={[
{title: 'Sync', action: () => props.syncApplication(app.metadata.name, app.metadata.namespace)},
{title: 'Refresh', action: () => props.refreshApplication(app.metadata.name, app.metadata.namespace)},
{title: 'Delete', action: () => props.deleteApplication(app.metadata.name, app.metadata.namespace)}
]}
/>
</div>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {DataLoader, Tooltip} from 'argo-ui';
import * as classNames from 'classnames';
import * as React from 'react';
import Moment from 'react-moment';
import {Key, KeybindingContext, NumKey, NumKeyToNumber, NumPadKey, useNav} from 'argo-ui/v2';
import {Cluster} from '../../../shared/components';
import {Consumer, Context, AuthSettingsCtx} from '../../../shared/context';
Expand Down Expand Up @@ -256,6 +257,16 @@ export const ApplicationTiles = ({applications, syncApplication, refreshApplicat
</div>
<div className='columns small-9'>{app.spec.destination.namespace}</div>
</div>
<div className='row'>
<div className='columns small-3' title='Age:'>
Age:
</div>
alexef marked this conversation as resolved.
Show resolved Hide resolved
<div className='columns small-9'>
<Moment fromNow={true} ago={true}>
{app.metadata.creationTimestamp}
</Moment>
</div>
</div>
<div className='row'>
<div className='columns applications-list__entry--actions'>
<a
Expand Down