Skip to content

Commit

Permalink
Fixes Prettier issues
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn committed Nov 20, 2024
1 parent c036045 commit c823a81
Show file tree
Hide file tree
Showing 8 changed files with 520 additions and 487 deletions.
8 changes: 7 additions & 1 deletion container/src/api/container-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ export class ContainerAPIFunctions {
* @param iframeHandle a reference to the iframe to be affected
* @param data data to be sent alongside the custom message
*/
sendCustomMessage = (id: string, mainComponent: ContainerElement, isWebcomponent: boolean, iframeHandle: IframeHandle, data?: object) => {
sendCustomMessage = (
id: string,
mainComponent: ContainerElement,
isWebcomponent: boolean,
iframeHandle: IframeHandle,
data?: object
) => {
if (isWebcomponent && mainComponent._luigi_mfe_webcomponent) {
containerService.dispatch(id, mainComponent._luigi_mfe_webcomponent, data);
} else {
Expand Down
8 changes: 7 additions & 1 deletion container/src/services/container.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ export class ContainerService {
* @param {Function} callback
* @param {string} callbackName
*/
dispatch(msg: string, targetCnt: ContainerElement, data: object, callback?: (arg?) => void, callbackName?: string): void {
dispatch(
msg: string,
targetCnt: ContainerElement,
data: object,
callback?: (arg?) => void,
callbackName?: string
): void {
const customEvent = new CustomEvent(msg, { detail: data });

if (callback && GenericHelperFunctions.isFunction(callback) && callbackName) {
Expand Down
12 changes: 10 additions & 2 deletions container/src/services/web-component-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ export class CustomCompoundRenderer extends DefaultCompoundRenderer {

createCompoundItemContainer(layoutConfig): HTMLDivElement {
if ((this.rendererObject.use as RendererUseProps).createCompoundItemContainer) {
return (this.rendererObject.use as RendererUseProps).createCompoundItemContainer(layoutConfig, this.config, this.superRenderer);
return (this.rendererObject.use as RendererUseProps).createCompoundItemContainer(
layoutConfig,
this.config,
this.superRenderer
);
} else if (this.superRenderer) {
return this.superRenderer.createCompoundItemContainer(layoutConfig);
}
Expand All @@ -71,7 +75,11 @@ export class CustomCompoundRenderer extends DefaultCompoundRenderer {

attachCompoundItem(compoundCnt, compoundItemCnt): void {
if ((this.rendererObject.use as RendererUseProps).attachCompoundItem) {
(this.rendererObject.use as RendererUseProps).attachCompoundItem(compoundCnt, compoundItemCnt, this.superRenderer);
(this.rendererObject.use as RendererUseProps).attachCompoundItem(
compoundCnt,
compoundItemCnt,
this.superRenderer
);
} else if (this.superRenderer) {
this.superRenderer.attachCompoundItem(compoundCnt, compoundItemCnt);
} else {
Expand Down
20 changes: 17 additions & 3 deletions container/src/services/webcomponents.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ export class WebComponentService {
* @param isCompoundChild defines if rendered mf is a compound child or not
* @returns an object with the Luigi Client API
*/
createClientAPI(eventBusElement: ContainerElement, nodeId: string, wc_id: string, component: HTMLElement, isCompoundChild?: boolean) {
createClientAPI(
eventBusElement: ContainerElement,
nodeId: string,
wc_id: string,
component: HTMLElement,
isCompoundChild?: boolean
) {
return {
linkManager: () => {
let fromContext = null;
Expand Down Expand Up @@ -574,7 +580,11 @@ export class WebComponentService {
*
* @param {DefaultCompoundRenderer} renderer
*/
createCompoundContainerAsync(renderer: WebComponentRenderer, ctx: object, navNode: WebComponentNode): Promise<HTMLElement> {
createCompoundContainerAsync(
renderer: WebComponentRenderer,
ctx: object,
navNode: WebComponentNode
): Promise<HTMLElement> {
return new Promise((resolve, reject) => {
if (renderer.viewUrl) {
try {
Expand Down Expand Up @@ -617,7 +627,11 @@ export class WebComponentService {
* @param {ContainerElement} wc_container the web component container dom element
* @param {*} context the luigi node context
*/
renderWebComponentCompound(navNode: WebComponentNode, wc_container: ContainerElement, context: object): Promise<ContainerElement> {
renderWebComponentCompound(
navNode: WebComponentNode,
wc_container: ContainerElement,
context: object
): Promise<ContainerElement> {
let renderer;
if (navNode.webcomponent && navNode.viewUrl) {
renderer = new DefaultCompoundRenderer();
Expand Down
Loading

0 comments on commit c823a81

Please sign in to comment.