Skip to content

Commit ea87cd5

Browse files
authored
Merge pull request #15 from OpenForgeProject/feat-collapsed-reports
Feat collapsed reports
2 parents ed82115 + 819917a commit ea87cd5

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,30 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
66

77
## [Unreleased]
88

9+
## [1.8.0] - 2024-12-25
10+
11+
### Added
12+
13+
- Added collapsed reports added if error titles are identical
14+
15+
### Removed
16+
17+
- Removed not used "Hello World" command
18+
19+
### Changed
20+
21+
- Change Logo for Marketplace
22+
923
## [1.7.1] - 2024-12-09
1024

1125
### Added
26+
1227
- Added a message when there are no report files.
1328
- Support for Node.js 18.x in GitHub Actions
1429
- Automated tests for releases using GitHub Workflows
1530

1631
### Fixed
32+
1733
- Fixed an issue where the status bar item was being created multiple times.
1834

1935
## [1.7.0] - 2024-12-08

package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento-log-viewer",
33
"displayName": "Magento Log Viewer",
44
"description": "A Visual Studio Code extension to view and manage Magento log files.",
5-
"version": "1.7.1",
5+
"version": "1.8.0",
66
"publisher": "MathiasElle",
77
"icon": "resources/logo.png",
88
"repository": {
@@ -21,10 +21,6 @@
2121
"main": "./dist/extension.js",
2222
"contributes": {
2323
"commands": [
24-
{
25-
"command": "magento-log-viewer.helloWorld",
26-
"title": "Hello World"
27-
},
2824
{
2925
"command": "magento-log-viewer.clearAllLogFiles",
3026
"title": "Delete Logfiles",

resources/logo.png

-855 KB
Loading

src/extension.ts

-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ export function activate(context: vscode.ExtensionContext): void {
2929
}
3030
}
3131

32-
// This method is called when your extension is deactivated
3332
export function deactivate(): void {}

src/logViewer.ts

+23-1
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,32 @@ export class ReportViewerProvider implements vscode.TreeDataProvider<LogItem>, v
240240
}
241241

242242
private getLogItems(dir: string, label: string): LogItem[] {
243-
return getLogItems(dir, parseReportTitle, getIconForReport).map(item => {
243+
const items = getLogItems(dir, parseReportTitle, getIconForReport).map(item => {
244244
item.contextValue = 'reportItem';
245245
return item;
246246
});
247+
248+
const groupedItems = this.groupReportItems(items);
249+
return groupedItems;
250+
}
251+
252+
private groupReportItems(items: LogItem[]): LogItem[] {
253+
const groupedByTitle = new Map<string, LogItem[]>();
254+
255+
items.forEach(item => {
256+
const title = item.label;
257+
const group = groupedByTitle.get(title) || [];
258+
group.push(item);
259+
groupedByTitle.set(title, group);
260+
});
261+
262+
return Array.from(groupedByTitle.entries()).map(([title, group]) => {
263+
if (group.length > 1) {
264+
return new LogItem(`${title} (${group.length})`, vscode.TreeItemCollapsibleState.Collapsed, undefined, group);
265+
} else {
266+
return group[0];
267+
}
268+
});
247269
}
248270

249271
getLogFilesWithoutUpdatingBadge(dir: string): LogItem[] {

0 commit comments

Comments
 (0)