@@ -66,7 +66,11 @@ const propTypes = {
6666 } ) . isRequired ,
6767 isSearchPending : PropTypes . bool ,
6868 listType : PropTypes . string ,
69- ownBlobCsid : PropTypes . string ,
69+ ownFields : PropTypes . shape ( {
70+ ownBlobCsid : PropTypes . string ,
71+ ownAltText : PropTypes . string ,
72+ ownIdentificationNumber : PropTypes . string ,
73+ } ) ,
7074 searchResult : PropTypes . instanceOf ( Immutable . Map ) ,
7175 readRecord : PropTypes . func ,
7276} ;
@@ -113,7 +117,7 @@ export default class MediaViewer extends Component {
113117 . then ( ( blobData ) => getContentPath ( config , 'blob' , undefined , blobCsid , popupSubresource , blobData ) ) ;
114118 }
115119
116- createGalleryImage ( blobCsid ) {
120+ createGalleryImage ( blobCsid , altText , identificationNumber ) {
117121 const {
118122 config,
119123 } = this . props ;
@@ -128,7 +132,11 @@ export default class MediaViewer extends Component {
128132 // move from snapshot to original here to keep similar semantics
129133 original : getContentPath ( config , 'blob' , undefined , blobCsid , snapshotSubresource ) ,
130134 snapshot : getContentPath ( config , 'blob' , undefined , blobCsid , snapshotSubresource ) ,
135+ snapshotAlt : altText ?? identificationNumber ,
136+ snapshotTitle : identificationNumber ,
131137 thumbnail : getContentPath ( config , 'blob' , undefined , blobCsid , thumbnailSubresource ) ,
138+ thumbnailAlt : altText ?? identificationNumber ,
139+ thumbnailTitle : identificationNumber ,
132140 } ;
133141 }
134142
@@ -137,14 +145,15 @@ export default class MediaViewer extends Component {
137145 config,
138146 isSearchPending,
139147 listType,
140- ownBlobCsid ,
148+ ownFields ,
141149 searchResult,
142150 } = this . props ;
143151
144152 const images = [ ] ;
145153
146- if ( ownBlobCsid ) {
147- images . push ( this . createGalleryImage ( ownBlobCsid ) ) ;
154+ if ( ownFields ) {
155+ const { ownBlobCsid, ownAltText, ownIdentificationNumber } = ownFields ;
156+ images . push ( this . createGalleryImage ( ownBlobCsid , ownAltText , ownIdentificationNumber ) ) ;
148157 }
149158
150159 if ( searchResult ) {
@@ -168,9 +177,11 @@ export default class MediaViewer extends Component {
168177
169178 items . forEach ( ( item ) => {
170179 const blobCsid = item . get ( 'blobCsid' ) ;
180+ const altText = item . get ( 'altText' ) ;
181+ const identificationNumber = item . get ( 'identificationNumber' ) ;
171182
172183 if ( blobCsid ) {
173- images . push ( this . createGalleryImage ( blobCsid ) ) ;
184+ images . push ( this . createGalleryImage ( blobCsid , altText , identificationNumber ) ) ;
174185 }
175186 } ) ;
176187 }
0 commit comments