-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for Inlinedashboard page #79
Conversation
@@ -0,0 +1,26 @@ | |||
<div *ngFor="let kid of children"> | |||
<div *ngIf="kid.type === 'DateTime'" [formGroup]="rangeFormGroup"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using two formGroups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the rangeFormGroup and using the existing one.
<component-mapper [name]="kid.c11nEnv.getPConnect().getComponentName()" [props]="{ | ||
pConn$: kid.c11nEnv.getPConnect(), | ||
formGroup$: formGroup$ | ||
}" | ||
errorMsg="Promoted filters wants component not yet available: {{ kid.c11nEnv.getPConnect().getComponentName() }}"> | ||
</component-mapper> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like formatting is missing here, are you using prettier to format the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, might be not used prettier to format for this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatted the file with prettier
import { Component, OnInit, Input, forwardRef, SimpleChanges, OnChanges } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms'; | ||
import { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have library imports at top and local imports at the bottom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
...angular-sdk-library/src/lib/_components/infra/dashboard-filter/dashboard-filter.component.ts
Show resolved
Hide resolved
...ibrary/src/lib/_components/template/inline-dashboard-page/inline-dashboard-page.component.ts
Show resolved
Hide resolved
</div> | ||
</div> | ||
<div class="psdk-inline-list"> | ||
<app-region [pConn$]="children[0].getPConnect()"></app-region> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use component mapper to load Region component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
let payload = {}; | ||
if (this.payload) { | ||
payload = this.payload; | ||
} else if (this.filterPayload) { | ||
payload = this.filterPayload; | ||
} else { | ||
payload = {}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let payload = {}; | |
if (this.payload) { | |
payload = this.payload; | |
} else if (this.filterPayload) { | |
payload = this.filterPayload; | |
} else { | |
payload = {}; | |
} | |
const payload = this.payload || this.filterPayload || {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: remove extra line break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
export function getLayoutDataFromRegion(regionData) { | ||
const defaultLayoutConfig = { | ||
width: 'full', | ||
fillAvailable: true, | ||
minWidth: [300, 'px'] | ||
}; | ||
|
||
return regionData.props | ||
?.getPConnect() | ||
?.getChildren() | ||
?.map((item, index) => { | ||
const itemPConnect = item?.getPConnect(); | ||
|
||
return { | ||
id: itemPConnect?.getComponentName() | ||
? `${itemPConnect.getComponentName()}--${index}` | ||
: `item--${index}`, | ||
content: itemPConnect?.getComponent(), | ||
layoutConfig: { | ||
...defaultLayoutConfig, | ||
...itemPConnect?.getConfigProps().layoutConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is not getting used anywhere in the code, please remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
return filterComponents; | ||
}; | ||
|
||
export const convertDateToGMT = value => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is not used anywhere, please remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
...ibrary/src/lib/_components/template/inline-dashboard-page/inline-dashboard-page.component.ts
Show resolved
Hide resolved
@@ -0,0 +1,29 @@ | |||
<div *ngFor="let kid of children"> | |||
<div *ngIf="kid.type === 'DateTime'" [formGroup]="formGroup$"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change the name of formGroup$ to filtersFormGroup$ which differentiates with case form formGroup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
<app-dashboard-filter [children]="children[1]" [formGroup$]="formGroup$" [ngClass]="{ | ||
'psdk-block-style': inlineProps.filterPosition === 'block-start' | ||
}"></app-dashboard-filter> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue in the Work Status filter, as @4manasa mentioned it was not related to Inline Dashboard, approving this PR
No description provided.