File tree Expand file tree Collapse file tree 7 files changed +44
-5
lines changed Expand file tree Collapse file tree 7 files changed +44
-5
lines changed Original file line number Diff line number Diff line change 6868.FileList__item__options {
6969 display : flex ;
7070 align-items : center ;
71- flex : 1 ;
71+ padding-right : 2 vw ;
7272}
7373
7474.FileList__item__name {
Original file line number Diff line number Diff line change 5757 data-test-file-list-download-count
5858 local-class =' FileList__item__download_count'
5959 >
60- {{ t ' osf-components.file-browser.download_count' count = @item.fileModel.extra.downloads }}
60+ {{ #if (has-key @item.fileModel.extra ' downloads' )}}
61+ {{ t ' osf-components.file-browser.download_count' count = @item.fileModel.extra.downloads }}
62+ {{ /if }}
6163 </div >
6264 <div
6365 data-test-file-list-size
7880 {{ /if }}
7981 </div >
8082 {{ /if }}
81- <div data-test-file-list-options local-class =' FileList__item__options' >
83+ <div
84+ data-test-file-list-options
85+ local-class =' FileList__item__options'
86+ >
8287 {{ #unless @manager.selectedFiles }}
8388 <FileActionsMenu @item ={{ @item }} @onDelete ={{ @manager.reload }} @manager ={{ @manager }} @allowRename ={{ true }} />
8489 {{ /unless }}
Original file line number Diff line number Diff line change 6262.FileList__item__options {
6363 display : flex ;
6464 align-items : center ;
65- flex : 1 ;
65+ padding-right : 2 vw ;
6666}
6767
6868.MobileDropdownTrigger {
Original file line number Diff line number Diff line change 4040 {{ #if this.showActionsDropdown }}
4141 <div
4242 data-test-file-list-date
43- local-class =' FileList__item__options NoShrink {{ if (or this.media.isTablet this.media.isMobile ) ' MobileDropdownTrigger' }} '
43+ local-class ='
44+ FileList__item__options
45+ NoShrink
46+ {{ if (or this.media.isTablet this.media.isMobile ) ' MobileDropdownTrigger' }}
47+ '
4448 >
4549 <ResponsiveDropdown
4650 local-class =' DownloadShareDropdown'
Original file line number Diff line number Diff line change 1+ import { helper } from '@ember/component/helper' ;
2+
3+ export function hasKey ( [ object , key ] : [ any , any ] ) : any {
4+ if ( object ) {
5+ return ( key in object ) ;
6+ }
7+ return false ;
8+ }
9+
10+ export default helper ( hasKey ) ;
Original file line number Diff line number Diff line change 1+ export { default } from 'osf-components/helpers/has-key' ;
Original file line number Diff line number Diff line change 1+ import { hasKey } from 'osf-components/helpers/has-key' ;
2+ import { module , test } from 'qunit' ;
3+
4+ module ( 'Unit | Helper | has-key' , ( ) => {
5+ test ( 'returns correct boolean value' , assert => {
6+ const object = { itzy : 'hey' } ;
7+ const absentKey = 'twice' ;
8+ const existingKey = 'itzy' ;
9+ assert . equal ( hasKey ( [ object , absentKey ] ) , false ) ;
10+ assert . equal ( hasKey ( [ object , existingKey ] ) , true ) ;
11+ } ) ;
12+
13+ test ( 'returns false when object is null or undefined' , assert => {
14+ // eslint-disable-next-line no-undef-init
15+ const object = undefined ;
16+ assert . equal ( hasKey ( [ null , 'a' ] ) , false ) ;
17+ assert . equal ( hasKey ( [ object , 'b' ] ) , false ) ;
18+ } ) ;
19+ } ) ;
You can’t perform that action at this time.
0 commit comments