Skip to content

Commit

Permalink
feat: Display creation time in application node and summary (#4920)
Browse files Browse the repository at this point in the history
This PR adds the creation time as a bubble to the root node in network view. It also adds CREATED_AT field to the application summary page

Fixes: #4903

Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
  • Loading branch information
chetan-rns committed Dec 1, 2020
1 parent f6a32a9 commit ee28288
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ function renderResourceNode(props: ApplicationResourceTreeProps, id: string, nod
</span>
</div>
<div className='application-resource-tree__node-labels'>
{node.createdAt ? (
{node.createdAt || rootNode ? (
<Moment className='application-resource-tree__node-label' fromNow={true} ago={true}>
{node.createdAt}
{node.createdAt || props.app.metadata.creationTimestamp}
</Moment>
) : null}
{(node.info || []).map((tag, i) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Consumer} from '../../../shared/context';
import * as models from '../../../shared/models';
import {services} from '../../../shared/services';

import * as moment from 'moment';
import {ApplicationSyncOptionsField} from '../application-sync-options';
import {RevisionFormField} from '../revision-form-field/revision-form-field';
import {ComparisonStatusIcon, HealthStatusIcon, syncStatusMessage} from '../utils';
Expand Down Expand Up @@ -127,6 +128,13 @@ export const ApplicationSummary = (props: {app: models.Application; updateApp: (
view: app.spec.destination.namespace,
edit: (formApi: FormApi) => <FormField formApi={formApi} field='spec.destination.namespace' component={Text} />
},
{
title: 'CREATED_AT',
view: moment
.utc(app.metadata.creationTimestamp)
.local()
.format('MM/DD/YYYY HH:mm:ss')
},
{
title: 'REPO URL',
view: <Repo url={app.spec.source.repoURL} />,
Expand Down

0 comments on commit ee28288

Please sign in to comment.