From 9fa523a0d37d9394eb973614c79aaf1f0a93212e Mon Sep 17 00:00:00 2001 From: ayusharma Date: Wed, 20 Jun 2018 21:07:32 +0200 Subject: [PATCH] fix: license field alignment on web ui (#761) --- src/webui/src/components/Package/index.js | 6 +----- .../webui/components/__snapshots__/packagelist.spec.js.snap | 2 +- test/webui/components/packagelist.spec.js | 2 ++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/webui/src/components/Package/index.js b/src/webui/src/components/Package/index.js index 630695058..7e4c33d1e 100644 --- a/src/webui/src/components/Package/index.js +++ b/src/webui/src/components/Package/index.js @@ -35,13 +35,9 @@ export default class Package extends React.Component { } renderPublished(pkg) { - if (pkg.time) { return (
- {`Published ${formatDateDistance(pkg.time)} ago`} + {pkg.time ? `Published ${formatDateDistance(pkg.time)} ago`: ''}
); - } - - return null; } renderLicense(pkg) { diff --git a/test/webui/components/__snapshots__/packagelist.spec.js.snap b/test/webui/components/__snapshots__/packagelist.spec.js.snap index 739a622bc..0683c8723 100644 --- a/test/webui/components/__snapshots__/packagelist.spec.js.snap +++ b/test/webui/components/__snapshots__/packagelist.spec.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` component should load the component with packages 1`] = `""`; +exports[` component should load the component with packages 1`] = `""`; diff --git a/test/webui/components/packagelist.spec.js b/test/webui/components/packagelist.spec.js index 5d50baae5..f53c61ed5 100644 --- a/test/webui/components/packagelist.spec.js +++ b/test/webui/components/packagelist.spec.js @@ -32,12 +32,14 @@ describe(' component', () => { { name: 'verdaccio', version: '1.0.0', + time: new Date(), description: 'Private NPM repository', author: { name: 'Sam' } }, { name: 'abc', version: '1.0.1', + time: new Date(), description: 'abc description', author: { name: 'Rose' } },