fix: fixes repositoryId issue and adds selection type of single or multiple [] - #11261
Conversation
Lisa White (whitelisab)
left a comment
There was a problem hiding this comment.
The repositoryId fix looks good, I just had a few small questions on this PR
| env, | ||
| env: env === 'stage' ? 'stage' : undefined, | ||
| hideTreeNav, | ||
| selectionType: 'multiple', |
There was a problem hiding this comment.
It looks like selectionType was previously hardcoded to multiple, but now we are accessing it from invocation parameters, however I don't see selectionType as a defined parameter. Where is the value for this being set now?
There was a problem hiding this comment.
Lisa White (@whitelisab) The selectionType is an instance parameter that needs to be set on the fields on which the connector is being used.
| 'Specifies the AEM repository environment for the app (defaults to prod if no selection made)', | ||
| }, | ||
| { | ||
| id: 'prefillSelectedAssets', |
There was a problem hiding this comment.
It might be helpful to add this to the configuration section of the README where the other configuration parameters are mentioned.
There was a problem hiding this comment.
Lisa White (@whitelisab) I will add to the README and submit a separate PR.
| name: 'AEM Tier', | ||
| type: 'Symbol', | ||
| description: 'Specifies the tier type [delivery, author] for the app (defaults to both)', | ||
| type: 'List', |
There was a problem hiding this comment.
It looks like this changes the behavior of this field from being able to define both delivery,author to being a single select, but the description says that it still defaults to delivery and author. Can you confirm that this change matches the behavior you are seeking?
There was a problem hiding this comment.
Lisa White (@whitelisab) I will update this with the README update.
efeece8
into
master
Purpose
This update adds following capabilities:
repositoryIdproperty was missing from the Adobe Content Advisor config properties and has been added so it can be used for restricting user access to a single repositoryselectedAssetsproperty has been added to the Content Advisor config properties to persist previously selected assets and uses the asset ids from the current field value if theprefillSelectedAssetsconfig value is 'Yes'CustomUpdateStateValueFnhas been added to modify the save functionality so the app replaces the existing field values with the new selections if theprefillSelectedAssetsconfig value is 'Yes' and adds the new selections to the previously selected assets if the value is 'No'prefillSelectedAssetsconfig has been added to support theselectedAssetsproperty in the Content Advisor props and theCustomUpdateStateValueFnselectionTypeproperty has been added to the Content Advisor props to support the creation of asset fields that contain a 'single' asset or 'multiple' assets (the selectionType property is populated from the value of a new instance config property of the same name with the following options: single, multipleaemTierTypeconfig property has been changed from text to a dropdown to prevent invalid values and contains the following options: delivery, authorenvconfig property has been changed from text to a dropdown to prevent invalid values and contains the following options: prod, stageApproach
The changes were made in accordance with the capabilities provided by the
contentful/dam-app-basepackage, the Adobe Content Advisor front-end-as-a-service app, and best practices for installation and instance config properties.Testing steps
The following tests should be passed:
repositoryIdin the application's installation config restricts users to the identified repository and no othersrepositoryIdin the application's installation config allows users to see all repositories available to them based on their AEM Assets permissionsprefillSelectedAssetsto 'Yes' selects all previously selected assets when opening the Adobe Content Advisor modalprefillSelectedAssetsto 'Yes' causes the previously selected assets to be replaced with the assets selected in the Adobe Content Advisor modalprefillSelectedAssetsto 'No' leaves the previously selected assets unselected when opening the Adobe Content Advisor modalprefillSelectedAssetsto 'No' cause the assets selected in the Adobe Content Advisor modal to be added to the previously selected assetsselectionTypeto 'single' restricts the user to the selection of a single asset in the Adobe Content Advisor modalselectionTypeto 'multiple' allows the user to select multiple assets in the Adobe Content Advisor modalaemTierTypeto 'delivery' or 'stage' restricts the user to repositories of the selected typeenvto 'prod' or 'stage' restricts the user to repositories in the selected environmentBreaking Changes
None
Dependencies and/or References
All changes are based on information collected in zoom calls, email or slack
Deployment
None that I am aware of