Skip to content

Commit

Permalink
Fix Angular errors (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
tumms2021389 committed Oct 3, 2023
1 parent ccad23d commit b1271bb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import { CommonModule } from '@angular/common';
import { SdkComponentMap } from '../helpers/sdk_component_map';
import { ErrorBoundaryComponent } from '../../_components/infra/error-boundary/error-boundary.component';

const componentsRequireDisplayOnlyFAProp: Array<string> = [
'HybridViewContainer',
'ModalViewContainer',
'ViewContainer',
'RootContainer',
'View',
'CaseView'
];

@Component({
selector: 'component-mapper',
templateUrl: './component-mapper.component.html',
Expand Down Expand Up @@ -84,6 +93,13 @@ export class ComponentMapperComponent implements OnInit, OnChanges {
try {
for (const propName in this.props) {
if (this.props[propName] !== undefined) {
// We'll set 'displayOnlyFA$' prop only to the components which really need it
// Eventual plan is to get rid of this particular prop
if (propName === 'displayOnlyFA$' && !componentsRequireDisplayOnlyFAProp.includes(this.name)) {
// eslint-disable-next-line no-continue
continue;
}

this.componentRef.setInput(propName, this.props[propName]);
}
}
Expand All @@ -110,4 +126,4 @@ export class ComponentMapperComponent implements OnInit, OnChanges {
this.componentRef.destroy();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Component, OnInit, Input } from '@angular/core';
})
export class ReferenceComponent implements OnInit {
@Input() pConn$: any;
@Input() displayOnlyFA$: boolean;

configProps$: Object;
referencedComponent: any = null;
Expand Down Expand Up @@ -43,9 +42,7 @@ export class ReferenceComponent implements OnInit {
if (inPConn.getComponentName() !== 'reference') {
// debugger;

console.error(
`Reference component: createFullReferencedViewFromRef inPConn is NOT a reference! ${inPConn.getComponentName()}`
);
console.error(`Reference component: createFullReferencedViewFromRef inPConn is NOT a reference! ${inPConn.getComponentName()}`);
}

const theResolvedConfigProps = inPConn.resolveConfigProps(inPConn.getConfigProps());
Expand Down Expand Up @@ -79,9 +76,7 @@ export class ReferenceComponent implements OnInit {
};

if (ReferenceComponent.bLogging) {
console.log(
`Reference: about to call createComponent with pageReference: context: ${theResolvedConfigProps['context']}`
);
console.log(`Reference: about to call createComponent with pageReference: context: ${theResolvedConfigProps['context']}`);
}

const viewComponent = inPConn.createComponent(viewObject, null, null, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { ComponentMapperComponent } from '../../../_bridge/component-mapper/comp
export class WideNarrowPageComponent implements OnInit {
@Input() pConn$: any;
@Input() formGroup$: FormGroup;
@Input() displayOnlyFA$;

thePConnType: string = '';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
</div>

<div *ngIf="sComponentName$ == 'RootContainer'">
<component-mapper name="RootContainer" [props]="{ pConn$, PCore$, props$, displayOnlyFA: false }"></component-mapper>
<component-mapper name="RootContainer" [props]="{ pConn$, PCore$, props$, displayOnlyFA$: false }"></component-mapper>
</div>

0 comments on commit b1271bb

Please sign in to comment.