* [ACS-12451] Add missing ADF upgrade guides * [ACS-12451] CR fix * [ACS-12451] CR fixes
14 KiB
Title
| Title |
|---|
| Upgrading from ADF v6.6.0 to v6.7.1 |
Upgrading from ADF v6.6.0 to v6.7.1
This guide provides instructions on how to upgrade your v6.6.0 ADF projects to v6.7.1 (covering the 6.7.0 and 6.7.1 releases).
Before you begin
Always perform upgrades on a "clean" project state, back up your changes or make a project backup.
Do not skip this task if you want your application to be updated to the most recent version of ADF. Upgrades of multiple versions of ADF cannot be done in one step only, but should follow the chain of sequential updates.
After the upgrade, check the other sections below to see if there are any changes affecting your project.
Contents
- Library updates
- Breaking changes
- Angular Material CSS classes
- Tags and categories config keys renamed
- Content metadata property panel API
- Card view methods are now getters
- REGEX card-view validator inverted
- Version list infinite scroll
- Authentication changes
- Data table sorting and resizing
- Viewer extension projection
- Task list service
- Other breaking changes
- New components and features
- Behavioural changes
- Theme changes
Library updates
Update the package.json file with the latest library versions:
{
"dependencies": {
"@alfresco/adf-core": "6.7.1",
"@alfresco/adf-content-services": "6.7.1",
"@alfresco/adf-process-services": "6.7.1",
"@alfresco/adf-process-services-cloud": "6.7.1",
"@alfresco/adf-insights": "6.7.1",
"@alfresco/adf-extensions": "6.7.1",
"@alfresco/js-api": ">=7.5.0"
}
}
Clean your old distribution and dependencies by deleting node_modules and package-lock.json, then reinstall:
npm install
Breaking changes
Angular Material CSS classes
A large refactor (~130 files) removed all references to Angular Material internal CSS classes (.mat-*,
.cdk-*) from ADF component styles, in preparation for the Material MDC migration. ADF SCSS now styles its own
adf-* host classes instead. A stylelint rule was added to forbid mat-/material-/cdk- selector prefixes.
Consumer impact: because ADF components use ViewEncapsulation.None, their old .mat-* overrides leaked
globally. If your app relied on those leaked overrides, or targeted .mat-* inside ADF components, restyle
against the new adf-* host classes. Concrete removals to be aware of:
CategoriesManagementComponent.addCategoryToAssign()signature changed from(change: MatSelectionListChange)to(category: Category)— the only hard TypeScript break in this commit.content-user-infodropped its environmentmat-tab-group(#tab-group-env,.adf-userinfo-tab,.adf-hide-tab).content-node-selectorremoved its "headless tabs" mode (.adf-content-node-selector-headless-tabs).sites-dropdown.component.scsswas deleted.
Tags and categories config keys renamed
The app.config.json keys that enable/disable the tags and categories features (introduced in 6.6.0) were
renamed:
| Before (6.6.0) | After (6.7.x) |
|---|---|
plugins.tags |
plugins.tagsEnabled |
plugins.categories |
plugins.categoriesEnabled |
Update your app.config.json, or the flags silently fall back to their true default. The methods
TagService.areTagsEnabled() and CategoryService.areCategoriesEnabled() are unchanged.
Content metadata property panel API
ContentMetadataComponent was refactored so only one panel edits at a time, replacing the per-panel
(General Info / Tags / Categories / group) state introduced in 6.6.0. Many public members were removed:
- Removed methods include
canExpandTheCard,onToggleGeneralInfoEdit,onToggleTagsEdit,onToggleCategoriesEdit,onToggleGroupEdit,onSaveGeneralInfoChanges,onSaveTagsChanges,onSaveCategoriesChanges,onSaveGroupChanges,isEditingPanel, and theonCancel*Editmethods. - Removed fields/getters include
isGeneralPanelExpanded,isTagPanelExpanded,isCategoriesPanelExpanded,currentGroup,isEditingModeGeneralInfo/Tags/Categories,canEditGeneralInfo,isEditingGeneralInfo,canEditTags,isEditingTags,canEditCategories,isEditingCategories,hasGroupToggleEdit,isGroupToggleEditing,tagNameControlVisible,categoryControlVisible. - They are replaced by a unified API: fields
editing,editedPanelTitle,currentPanel, an exposedDefaultPanelsenum, and methodsisPanelEditing(),saveChanges(),toggleGroupEditing(),cancelGroupEditing(),expandPanel(),closePanel(),resetEditing(). - A new
ContentMetadataPanel { panelTitle: string; expanded?: boolean }interface was added, andContentMetadataCustomPanelnow extends it. CardViewGroup.editablebecame a required property (was optional) — constructingCardViewGroupliterals now requireseditable.
The @Input/@Output/selector of ContentMetadataComponent are unchanged.
Card view methods are now getters
To remove redundant function calls from templates, several card-view members changed from methods to getters. Drop the parentheses in any custom code/templates calling them:
CardViewArrayItemComponent:showClickableIcon,displayCount,isClickable.CardViewDateItemComponent:showProperty,showClearAction.CardViewMapItemComponent:showProperty,isClickable.
REGEX card-view validator inverted
CardViewItemMatchValidator (the REGEX card-view constraint) gained a requiresMatch? parameter, and its
default semantics inverted: with requiresMatch falsy, a value that matches the pattern is now treated
as invalid (used to express forbidden-character patterns for e.g. folder names). Existing REGEX constraints
that expected "match means valid" must now set requiresMatch: true. The validator's flags are now forwarded
from config as well.
Version list infinite scroll
VersionListComponent now loads versions lazily in batches via CDK virtual scroll:
- The public
versions: VersionEntry[]property was removed. UselatestVersion: VersionEntry(or the newversionsDataSource) instead — e.g.versionList.versions[0].entrybecomesversionList.latestVersion?.entry. - A new abstract
InfiniteScrollDatasource<T>andVersionListDataSourceare exported from@alfresco/adf-content-services;VersionManagerModulenow imports@angular/cdk/scrolling.
Authentication changes
- Code-flow infinite loop fix — the OIDC login callback is now driven by
OidcAuthGuard(root-provided) on theview/authentication-confirmationroute rather than byAuthenticationConfirmationComponent. As a result:AuthService.loginCallback()signature changed tologinCallback(loginOptions?: LoginOptions).OidcAuthGuardconstructor gainedRouter; itscanActivate/canActivateChildno longer take route/state args.AuthModuleConfiggainedpreventClearHashAfterLogin?: boolean(defaults totrue).
requireAlfTicketauto-wiring moved to content-services — the automatic ECM ticket fetch after OAuth login was moved out of@alfresco/adf-coreinto a newContentAuthLoaderServiceAPP_INITIALIZERin@alfresco/adf-content-services.BasicAlfrescoAuthService.requireAlfTicket()still exists in core, but apps that import only@alfresco/adf-core(notContentModule) no longer get the automatic fetch — importContentModule.forRoot()or callrequireAlfTicket()yourself onauthService.onLogin.nonceStateSeparatoris now set to'~'in the OIDCAuthConfig(fixes login with IdPs sensitive to the state/nonce separator).
Data table sorting and resizing
- Sorting default changed —
ObjectDataTableAdapter.sort()andDataSortingnow useString.localeComparewithIntl.CollatorOptionsand{ numeric: true }by default (both gained an optionaloptions?: Intl.CollatorOptionsparameter). Numeric and date columns may sort differently than in 6.6.0. - Columns are resizable by default —
DataColumn/DataColumnComponentgained aresizableflag that defaults totrue(DocumentListPresetRef.resizable?too). Setresizable="false"per column to opt out. DataTableComponent.isResizingis now a read-only getter (was a mutable field).
Viewer extension projection
Custom viewer extension templates are now projected explicitly instead of via the old externalExtensions push:
ViewerComponent/AlfrescoViewerComponentaccept the extensions through a#viewerExtensionstemplate ref (@ContentChild) /@Input() viewerExtensions: TemplateRef<any>.ViewerExtensionDirectivenow populatesextensionsSupportedByTemplatesrather thanexternalExtensions.ViewerRenderComponentconstructor gained anInjectorparameter (affects manual instantiation).
Task list service
TaskListService (@alfresco/adf-process-services):
- The public method
findAllTasksWithoutState()was removed. findAllTaskByState()was renamed tofindAllTasksByState()(note the extra "s").
The all state is now handled by findTasksByState (it applies to both open and completed tasks).
Other breaking changes
FormCloudComponentconstructor gained aDisplayModeServicedependency (see Full-screen task forms);FormRepresentationModel.displayModewas added.FormFieldModel'svaluesetter no longer callsupdateForm()when the value is unchanged.WidgetVisibilityModel.leftType/rightTypereturn type widened tostring | null.
New components and features
- Decimal form widget — a new
DecimalWidgetComponent(selectoradf-decimal) rendersbigdecimalfields (newFormFieldTypes.DECIMAL = 'bigdecimal'), backed by aDecimalFieldValidatorand a newFormFieldModel.precisionproperty. Registered automatically by the form rendering service. - Full-screen user task forms —
FormCloudComponentandTaskFormCloudComponentgained@Input() displayModeConfigurationsand@Output() displayModeOn/displayModeOff, backed by a newDisplayModeServiceandFormCloudDisplayMode { inline, fullScreen }— forms can switch between inline and full-screen. - Dynamic chip list — a new standalone
DynamicChipListComponent(adf-dynamic-chip-list, with aChipinterface) is exported from@alfresco/adf-core;TagNodeListComponentnow delegates its chip rendering to it. - Unsaved-changes dialog / guard — new
UnsavedChangesDialogComponentandUnsavedChangesGuard(CanDeactivate) exported from@alfresco/adf-core. - Group service —
GroupServicegainedgetGroup()andupdateGroup()(the js-apiGroup/GroupBodyUpdatemodels gained an optionaldescription). - Resizable columns by default and per-column
resizableconfig (see Data table sorting and resizing). - Storage prefix factory — a new
STORAGE_PREFIX_FACTORY_SERVICEinjection token andStoragePrefixFactorylet apps supply a dynamicStorageServiceprefix (theapplication.storagePrefixapp-config value still takes precedence). - Header design tokens — new themeable
--adf-header-icon-button-*CSS custom properties (see Theme changes).
Behavioural changes
| Area | Change |
|---|---|
| Card view dates | date-type card-view values are now displayed timezone-agnostically (stored at UTC midnight), fixing off-by-one-day display; new DateFnsUtils.forceLocal / forceUtc helpers. Custom d:date aspect strings no longer crash the app. |
| Card view text item | Non-editable text items render as readonly (not disabled) with a corrected clickable area; update() is a no-op when not editable. |
| Aspect list | The aspect dialog no longer overwrites node aspects it doesn't display; hidden aspects are preserved and included in valueChanged. |
| Document list | Size / Modified-by columns re-render correctly after editing properties; nodes are deleted sequentially; declared records hide the "Edit Offline" / "Upload New Version" actions. |
| Search | The search filter panel no longer shows duplicated Clear/Apply buttons for the date-time widget; tab content re-displays correctly after switching tabs. |
| Tags | Creating a tag validates against illegal characters; a to-be-created tag can be removed without clearing the "already exists" error. |
| Forms | Required people/groups widgets keep the submit button disabled while empty; integer "greater than" visibility conditions work. |
Theme changes
HeaderLayoutComponent gained themeable CSS custom properties for its icon buttons:
--adf-header-icon-button-default-color--adf-header-icon-button-default-border-radius--adf-header-icon-button-hover-color--adf-header-icon-button-pressed-color--adf-header-icon-button-disabled-color
More broadly, the Material-CSS-class removal (see Angular Material CSS classes)
means ADF no longer ships overrides of Material internals — theme ADF components through their adf-* classes
and documented CSS custom properties.