diff --git a/lib/osf-components/addon/components/file-browser/file-item/styles.scss b/lib/osf-components/addon/components/file-browser/file-item/styles.scss index 6d6012752f1..538af8b707d 100644 --- a/lib/osf-components/addon/components/file-browser/file-item/styles.scss +++ b/lib/osf-components/addon/components/file-browser/file-item/styles.scss @@ -68,7 +68,7 @@ .FileList__item__options { display: flex; align-items: center; - flex: 1; + padding-right: 2vw; } .FileList__item__name { diff --git a/lib/osf-components/addon/components/file-browser/file-item/template.hbs b/lib/osf-components/addon/components/file-browser/file-item/template.hbs index 6aa6214dc83..714d7e55094 100644 --- a/lib/osf-components/addon/components/file-browser/file-item/template.hbs +++ b/lib/osf-components/addon/components/file-browser/file-item/template.hbs @@ -57,7 +57,9 @@ data-test-file-list-download-count local-class='FileList__item__download_count' > - {{t 'osf-components.file-browser.download_count' count=@item.fileModel.extra.downloads}} + {{#if (has-key @item.fileModel.extra 'downloads')}} + {{t 'osf-components.file-browser.download_count' count=@item.fileModel.extra.downloads}} + {{/if}}
{{/if}} -
+
{{#unless @manager.selectedFiles}} {{/unless}} diff --git a/lib/osf-components/addon/components/file-browser/folder-item/styles.scss b/lib/osf-components/addon/components/file-browser/folder-item/styles.scss index c88c1830489..a0b453ef02c 100644 --- a/lib/osf-components/addon/components/file-browser/folder-item/styles.scss +++ b/lib/osf-components/addon/components/file-browser/folder-item/styles.scss @@ -62,7 +62,7 @@ .FileList__item__options { display: flex; align-items: center; - flex: 1; + padding-right: 2vw; } .MobileDropdownTrigger { diff --git a/lib/osf-components/addon/components/file-browser/folder-item/template.hbs b/lib/osf-components/addon/components/file-browser/folder-item/template.hbs index a335e61935a..95094b49aa0 100644 --- a/lib/osf-components/addon/components/file-browser/folder-item/template.hbs +++ b/lib/osf-components/addon/components/file-browser/folder-item/template.hbs @@ -40,7 +40,11 @@ {{#if this.showActionsDropdown}}
{ + test('returns correct boolean value', assert => { + const object = { itzy: 'hey' }; + const absentKey = 'twice'; + const existingKey = 'itzy'; + assert.equal(hasKey([object, absentKey]), false); + assert.equal(hasKey([object, existingKey]), true); + }); + + test('returns false when object is null or undefined', assert => { + // eslint-disable-next-line no-undef-init + const object = undefined; + assert.equal(hasKey([null, 'a']), false); + assert.equal(hasKey([object, 'b']), false); + }); +});