mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
ACS-11155: update conditional checks to use optional chaining (#11658)
- Modified several components to use optional chaining for safer property access, enhancing code robustness. - Updated ESLint configuration to enforce stricter rules on the use of optional chaining. - Adjusted tests to reflect changes in property access patterns.
This commit is contained in:
@@ -1905,7 +1905,7 @@ describe('retrieve metadata on submit', () => {
|
||||
});
|
||||
|
||||
it('should handle outcomeId correctly when completing form with confirmation dialog', () => {
|
||||
let matDialog = TestBed.inject(MatDialog);
|
||||
const matDialog = TestBed.inject(MatDialog);
|
||||
spyOn(matDialog, 'open').and.returnValue({ afterClosed: () => of(true) } as any);
|
||||
spyOn(formComponent['formCloudService'], 'completeTaskForm').and.returnValue(of({} as any));
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface OutputData {
|
||||
export class RichTextParserService {
|
||||
private static readonly CUSTOM_PARSER = {
|
||||
header: (block: any): string => {
|
||||
if (!block.data || !block.data.text || !block.data.level) {
|
||||
if (!block.data?.text || !block.data.level) {
|
||||
return '';
|
||||
}
|
||||
const paragraphAlign = block.data.alignment || block.data.align || block.tunes?.anyTuneName?.alignment;
|
||||
@@ -40,7 +40,7 @@ export class RichTextParserService {
|
||||
}
|
||||
},
|
||||
paragraph: (block: any): string => {
|
||||
if (!block.data || !block.data.text) {
|
||||
if (!block.data?.text) {
|
||||
return '';
|
||||
}
|
||||
const paragraphAlign = block.data.alignment || block.data.align || block.tunes?.anyTuneName?.alignment;
|
||||
|
||||
Reference in New Issue
Block a user