@@ -62,12 +62,12 @@ async function openDialog(sdk, _currentValue, _config) {
6262
6363function prepareAEMAssetsHTML ( ) {
6464 return `
65- <dialog id='content-advisor-dialog' style='width:100%;height:100%;'>
66- <div id='content-advisor-error' class='content-advisor-error' role='alert' hidden></div>
65+ <dialog id='content-advisor-dialog'>
6766 <div class='content-advisor-toolbar'>
6867 <div id='content-advisor-logout-container'></div>
68+ <div id='content-advisor-error' role='alert' hidden></div>
6969 </div>
70- <div id='content-advisor' style='overflow-x:auto; width:100%;height:100 %;'></div>
70+ <div id='content-advisor' style='width:100%;height:95 %;'></div>
7171 </dialog>
7272 ` ;
7373}
@@ -226,10 +226,11 @@ async function renderDialog(sdk) {
226226 onLogout = { async ( ) => {
227227 if ( ! imsInstance ) return ;
228228 try {
229- await imsInstance . signOut ( ) ;
230- showAuthError (
231- 'You have been logged out of Adobe. Close this dialog and reopen the asset selector to sign in again.'
232- ) ;
229+ await imsInstance . signOut ( ) . then ( ( ) => {
230+ showAuthError (
231+ 'You have been logged out of Adobe. Close this dialog and reopen the asset selector to sign in again.'
232+ ) ;
233+ } ) ;
233234 } catch ( error ) {
234235 showAuthError ( `Failed to log out of Adobe: ${ error ?. message || error } ` ) ;
235236 }
@@ -240,6 +241,7 @@ async function renderDialog(sdk) {
240241
241242 const imsAuthProps = {
242243 imsClientId : imsClientId ,
244+ imsOrg : imsOrg ,
243245 imsScope : IMS_SCOPE ,
244246 redirectUrl : window . location . href ,
245247 modalMode : true ,
@@ -253,15 +255,21 @@ async function renderDialog(sdk) {
253255 'Your Adobe session has expired. Close this dialog and try selecting assets again.'
254256 ) ;
255257 } ,
256- onAccessTokenReceived : ( ) => {
257- hideAuthError ( ) ;
258+ onAccessTokenReceived : ( imsToken ) => {
259+ if ( imsToken ) {
260+ hideAuthError ( ) ;
261+ } else {
262+ // Close the modal if we don't have a valid IMS token. The IMS login modal should open.
263+ // After signing in, the user can re-open the asset selector by clicking the select assets button.
264+ sdk . close ( ) ;
265+ }
258266 } ,
259267 } ;
260268
261269 const contentAdvisorProps = {
262270 imsOrg,
263271 repositoryId,
264- aemTierType : aemTierType ? aemTierType . split ( ',' ) : [ 'delivery' , 'author' ] ,
272+ aemTierType : aemTierType && aemTierType !== 'both' ? [ aemTierType ] : [ 'delivery' , 'author' ] ,
265273 env : env === 'stage' ? 'stage' : undefined ,
266274 hideTreeNav,
267275 selectedAssets :
@@ -272,7 +280,7 @@ async function renderDialog(sdk) {
272280 uploadConfig : {
273281 hideUploadButton : hideUploadButton === 'Yes' ? true : false ,
274282 } ,
275- alwaysUseDMDelivery : true ,
283+ alwaysUseDMDelivery : aemTierType !== 'author' ,
276284 // handleAssetSelection, // only enabled for testing
277285 handleSelection,
278286 onClose,
@@ -333,10 +341,13 @@ function isDisabled() {
333341 return false ;
334342}
335343
336- function validateParameters ( { imsClientId } ) {
344+ function validateParameters ( { imsClientId, imsOrg } ) {
337345 if ( ! imsClientId ) {
338346 return 'Please add your IMS Client ID' ;
339347 }
348+ if ( ! imsOrg ) {
349+ return 'Please add your IMS Organization' ;
350+ }
340351 return null ;
341352}
342353
@@ -352,32 +363,32 @@ setup({
352363 id : 'imsClientId' ,
353364 type : 'Symbol' ,
354365 name : 'IMS Client ID' ,
355- description : 'Your Client ID from Adobe IMS.' ,
366+ description :
367+ 'The Adobe Identity Management System (IMS) Client ID provided by Adobe for your Adobe AEM CS organization.' ,
356368 required : true ,
357369 } ,
358370 {
359371 id : 'imsOrg' ,
360372 name : 'IMS Organization' ,
361373 type : 'Symbol' ,
362374 description :
363- 'Adobe Identity Management System (IMS) ID that is assigned while provisioning Adobe Experience Manager as a Cloud Service for your organization' ,
375+ 'The Adobe Identity Management System (IMS) ID provided by Adobe when provisioning Adobe AEM CS for your organization. ' ,
364376 required : true ,
365377 } ,
366378 {
367379 id : 'repositoryId' ,
368- name : 'Repository ID ' ,
380+ name : 'Repository' ,
369381 type : 'Symbol' ,
370- description : 'Restricts access to a single repository' ,
382+ description : 'Restricts the asset selector to a single repository. ' ,
371383 required : false ,
372384 } ,
373385 {
374386 id : 'aemTierType' ,
375387 name : 'AEM Tier' ,
376388 type : 'List' ,
377- value : 'delivery,author' ,
378- default : '' ,
379- description :
380- 'Specifies the tier type for the app (defaults to delivery and author if no selection made)' ,
389+ value : 'delivery,author,both' ,
390+ default : 'both' ,
391+ description : 'Restricts the asset selector to repositories in the selected tier(s).' ,
381392 required : false ,
382393 } ,
383394 {
@@ -386,25 +397,23 @@ setup({
386397 type : 'List' ,
387398 value : 'prod,stage' ,
388399 default : 'prod' ,
389- description :
390- 'Specifies the AEM repository environment for the app (defaults to prod if no selection made)' ,
400+ description : 'Restricts the asset selector to repositories in the selected environment.' ,
391401 } ,
392402 {
393403 id : 'prefillSelectedAssets' ,
394404 name : 'Prefill Selected Assets' ,
395405 type : 'List' ,
396406 value : 'No,Yes' ,
397407 default : 'Yes' ,
398- description :
399- 'Determines whether the selected assets will be prefilled when opening the asset picker.' ,
408+ description : 'Specifies if selected assets are pre-selected in the asset picker.' ,
400409 } ,
401410 {
402411 id : 'hideUploadButton' ,
403412 name : 'Hide Asset Upload Button' ,
404413 type : 'List' ,
405414 value : 'Yes, No' ,
406415 default : 'Yes' ,
407- description : 'Specifies whether to show or hide the upload button ' ,
416+ description : 'Specifies if the upload button is displayed in the asset picker. ' ,
408417 } ,
409418 ] ,
410419 customUpdateStateValue,
0 commit comments