-
Notifications
You must be signed in to change notification settings - Fork 149
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
[MNT-24575] Added dialog to display folder information #4282
base: develop
Are you sure you want to change the base?
Conversation
modifiedAt: new Date(2024, 2, 2, 22, 22) | ||
}; | ||
|
||
const getValueFromElement = (id: string) => fixture.debugElement.query(By.css(`[data-automation-id="${id}"]`)).nativeElement.textContent; |
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.
const getValueFromElement = (id: string) => fixture.debugElement.query(By.css(`[data-automation-id="${id}"]`)).nativeElement.textContent; | |
const getValueFromElement = (id: string): string => fixture.debugElement.query(By.css(`[data-automation-id="${id}"]`)).nativeElement.textContent; |
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.
Added return type
private readonly destroyRef = inject(DestroyRef); | ||
|
||
data: Node = inject(DIALOG_COMPONENT_DATA); | ||
name: string; |
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.
Do we need separate variables for name
,size
, location
, created
and modified
?
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.
Consolidated all properties into a single FolderInformation type, defined in folder-information.component.ts
this.nodesService | ||
.getFolderSizeInfo(this.data.id, jobIdEntry.entry.jobId) | ||
.pipe( | ||
expand((result: any) => |
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.
Please use proper type instead of any
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.
Changed instance of any to SizeDetailsEntry
…perties into a single type
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.html
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.html
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.html
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.spec.ts
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.spec.ts
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Outdated
Show resolved
Hide resolved
projects/aca-content/src/lib/dialogs/folder-details/folder-information.component.ts
Show resolved
Hide resolved
this.folderDetails.icon = this.contentService.getNodeIcon(this.data); | ||
this.folderDetails.size = this.translateService.instant('APP.FOLDER_INFO.CALCULATING'); | ||
|
||
this.nodesService |
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.
Could you please add some error handling (for example you can display some error content inside dialog when loading is failed)?
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.
@swapnil-verma-gl I guess this one is not addressed because I can't see changes for that one?
@swapnil-verma-gl I'm getting some issue. When I'm opening dialog then many errors are inside console and dialog's look is broken: |
Quality Gate passedIssues Measures |
.initiateFolderSizeCalculation(this.data.id) | ||
.pipe( | ||
first(), | ||
switchMap((jobIdEntry: JobIdBodyEntry) => { |
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.
? timer(5000).pipe(concatMap(() => this.nodesService.getFolderSizeInfo(this.data.id, jobIdEntry.entry.jobId))) | ||
: EMPTY | ||
), | ||
takeUntilDestroyed(this.destroyRef) |
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.
takeUntilDestroyed(this.destroyRef) is added for pipe for result of getFolderSizeInfo function. I guess we should add takeUntilDestroyed for pipe for result of initiateFolderSizeCalculation instead as we call subscribe for result of that function?
|
||
describe('folderInformation$', () => { | ||
it('should call folder information dialog', () => { | ||
const node: any = { entry: { isFile: true } }; |
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.
No need to use any. You can use 'as NodeEntry' and correct type will be set
|
||
store.dispatch(new FolderInformationAction(node)); | ||
|
||
expect(contentService.showFolderInformation).toHaveBeenCalled(); |
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 use toHaveBeenCalledWith to test also parameters passed to showFolderInformation function?
private readonly destroyRef = inject(DestroyRef); | ||
|
||
data: Node = inject(DIALOG_COMPONENT_DATA); | ||
folderDetails: FolderDetails = new FolderDetails(); |
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.
no need to set type at left side when you do inline initialization because ts knows then that type is FolderDetails
@swapnil-verma-gl I see 2 issues, see video: Screen.Recording.2024-12-19.at.12.51.55.mov
NOTE: After some time, when you wait a bit, it seems working correctly. |
@swapnil-verma-gl there is some accessibility issue: |
JIRA ticket link or changeset's description
https://hyland.atlassian.net/browse/MNT-24575
Added new dialog accessible via context menu to display folder information such as folder location, size, file count etc