${soqlSkeleton}
@@ -161,6 +181,14 @@ export class SOQLView extends LitElement {
`;
}
+ _copyToClipboard() {
+ this.soqlTable?.copyToClipboard('all');
+ }
+
+ _exportToCSV() {
+ this.soqlTable?.download('csv', 'soql.csv', { bom: true, delimiter: ',' });
+ }
+
_findEvt = ((event: FindEvt) => this._find(event)) as EventListener;
_soqlGroupBy(event: Event) {
diff --git a/log-viewer/modules/components/datagrid/datagrid-filter-bar.ts b/log-viewer/modules/components/datagrid/datagrid-filter-bar.ts
new file mode 100644
index 00000000..c4524006
--- /dev/null
+++ b/log-viewer/modules/components/datagrid/datagrid-filter-bar.ts
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2021 Certinia Inc. All rights reserved.
+ */
+import { provideVSCodeDesignSystem } from '@vscode/webview-ui-toolkit';
+import { LitElement, css, html } from 'lit';
+import { customElement } from 'lit/decorators.js';
+
+import { globalStyles } from '../../styles/global.styles.js';
+
+provideVSCodeDesignSystem().register();
+
+@customElement('datagrid-filter-bar')
+export class DatagridFilterBar extends LitElement {
+ static styles = [
+ globalStyles,
+ css`
+ :host {
+ height: 100%;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ }
+
+ .filter-bar {
+ display: flex;
+ }
+
+ .filter-bar .filter-bar__actions--right {
+ align-items: center;
+ display: flex;
+ flex: 1 1 auto;
+ justify-content: flex-end;
+ }
+ `,
+ ];
+
+ render() {
+ return html`
`;
+ }
+}
From 3a90eda304698a249ce16a0952ca4224ed35b574 Mon Sep 17 00:00:00 2001
From: Luke Cotter <4013877+lukecotter@users.noreply.github.com>
Date: Mon, 7 Apr 2025 14:43:20 +0100
Subject: [PATCH 4/8] refactor: re order imports
---
.../components/analysis-view/AnalysisView.ts | 37 +++++++++----------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/log-viewer/modules/components/analysis-view/AnalysisView.ts b/log-viewer/modules/components/analysis-view/AnalysisView.ts
index 04596533..2039399b 100644
--- a/log-viewer/modules/components/analysis-view/AnalysisView.ts
+++ b/log-viewer/modules/components/analysis-view/AnalysisView.ts
@@ -10,25 +10,24 @@ import {
} from '@vscode/webview-ui-toolkit';
import { LitElement, css, html, unsafeCSS, type PropertyValues } from 'lit';
import { customElement, property } from 'lit/decorators.js';
-import { Tabulator, type ColumnComponent, type RowComponent } from 'tabulator-tables';
-import * as CommonModules from '../../datagrid/module/CommonModules.js';
-import codiconStyles from '../../styles/codicon.css';
-
-import NumberAccessor from '../../datagrid/dataaccessor/Number.js';
-import { progressFormatter } from '../../datagrid/format/Progress.js';
-import { RowKeyboardNavigation } from '../../datagrid/module/RowKeyboardNavigation.js';
-import dataGridStyles from '../../datagrid/style/DataGrid.scss';
import { ApexLog, LogLine } from '../../parsers/ApexLogParser.js';
import { vscodeMessenger } from '../../services/VSCodeExtensionMessenger.js';
import { globalStyles } from '../../styles/global.styles.js';
-import { isVisible } from '../../Util.js';
+// Tabulator custom modules, imports + styles
+import { Tabulator, type ColumnComponent, type RowComponent } from 'tabulator-tables';
+import { isVisible } from '../../Util.js';
+import NumberAccessor from '../../datagrid/dataaccessor/Number.js';
+import { progressFormatter } from '../../datagrid/format/Progress.js';
+import { GroupCalcs } from '../../datagrid/group-calcs/GroupCalcs.js';
+import * as CommonModules from '../../datagrid/module/CommonModules.js';
+import { RowKeyboardNavigation } from '../../datagrid/module/RowKeyboardNavigation.js';
import { RowNavigation } from '../../datagrid/module/RowNavigation.js';
+import dataGridStyles from '../../datagrid/style/DataGrid.scss';
+import codiconStyles from '../../styles/codicon.css';
import { Find, formatter } from '../calltree-view/module/Find.js';
import { callStackSum } from './column-calcs/CallStackSum.js';
-import { GroupCalcs } from '../../datagrid/group-calcs/GroupCalcs.js';
-
// Components
import '../datagrid/datagrid-filter-bar.js';
import '../skeleton/GridSkeleton.js';
@@ -67,15 +66,15 @@ export class AnalysisView extends LitElement {
flex-flow: column nowrap;
align-items: flex-start;
justify-content: flex-start;
- }
- .dropdown-container label {
- display: block;
- color: var(--vscode-foreground);
- cursor: pointer;
- font-size: var(--vscode-font-size);
- line-height: normal;
- margin-bottom: 2px;
+ label {
+ display: block;
+ color: var(--vscode-foreground);
+ cursor: pointer;
+ font-size: var(--vscode-font-size);
+ line-height: normal;
+ margin-bottom: 2px;
+ }
}
`,
];
From 0de90222f9ea1b6fb1e65e71a7db290f4dd01a5c Mon Sep 17 00:00:00 2001
From: Luke Cotter <4013877+lukecotter@users.noreply.github.com>
Date: Mon, 7 Apr 2025 14:45:53 +0100
Subject: [PATCH 5/8] refactor: remove header menus
---
.../components/analysis-view/AnalysisView.ts | 12 +-----------
.../components/database-view/DMLView.ts | 19 +------------------
.../components/database-view/SOQLView.ts | 12 ------------
3 files changed, 2 insertions(+), 41 deletions(-)
diff --git a/log-viewer/modules/components/analysis-view/AnalysisView.ts b/log-viewer/modules/components/analysis-view/AnalysisView.ts
index 2039399b..343cb693 100644
--- a/log-viewer/modules/components/analysis-view/AnalysisView.ts
+++ b/log-viewer/modules/components/analysis-view/AnalysisView.ts
@@ -15,7 +15,7 @@ import { vscodeMessenger } from '../../services/VSCodeExtensionMessenger.js';
import { globalStyles } from '../../styles/global.styles.js';
// Tabulator custom modules, imports + styles
-import { Tabulator, type ColumnComponent, type RowComponent } from 'tabulator-tables';
+import { Tabulator, type RowComponent } from 'tabulator-tables';
import { isVisible } from '../../Util.js';
import NumberAccessor from '../../datagrid/dataaccessor/Number.js';
import { progressFormatter } from '../../datagrid/format/Progress.js';
@@ -233,15 +233,6 @@ export class AnalysisView extends LitElement {
}
const metricList = groupMetrics(rootMethod);
- const headerMenu = [
- {
- label: 'Export to CSV',
- action: function (_e: PointerEvent, column: ColumnComponent) {
- column.getTable().download('csv', 'analysis.csv', { bom: true, delimiter: ',' });
- },
- },
- ];
-
Tabulator.registerModule(Object.values(CommonModules));
Tabulator.registerModule([RowKeyboardNavigation, RowNavigation, Find, GroupCalcs]);
this.analysisTable = new Tabulator(this._tableWrapper, {
@@ -290,7 +281,6 @@ export class AnalysisView extends LitElement {
resizable: true,
headerSortStartingDir: 'desc',
headerTooltip: true,
- headerMenu: headerMenu,
headerWordWrap: true,
},
initialSort: [{ column: 'selfTime', dir: 'desc' }],
diff --git a/log-viewer/modules/components/database-view/DMLView.ts b/log-viewer/modules/components/database-view/DMLView.ts
index 8a5798f2..fc18a495 100644
--- a/log-viewer/modules/components/database-view/DMLView.ts
+++ b/log-viewer/modules/components/database-view/DMLView.ts
@@ -8,12 +8,7 @@ import {
} from '@vscode/webview-ui-toolkit';
import { LitElement, css, html, render, unsafeCSS, type PropertyValues } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
-import {
- Tabulator,
- type ColumnComponent,
- type GroupComponent,
- type RowComponent,
-} from 'tabulator-tables';
+import { Tabulator, type GroupComponent, type RowComponent } from 'tabulator-tables';
// tabulator custom modules
import * as CommonModules from '../../datagrid/module/CommonModules.js';
@@ -298,7 +293,6 @@ export class DMLView extends LitElement {
resizable: true,
headerSortStartingDir: 'desc',
headerTooltip: true,
- headerMenu: this.csvheaderMenu('dml.csv'),
headerWordWrap: true,
},
initialSort: [{ column: 'rowCount', dir: 'desc' }],
@@ -473,17 +467,6 @@ export class DMLView extends LitElement {
return [...newMap.keys()];
}
- csvheaderMenu(csvFileName: string) {
- return [
- {
- label: 'Export to CSV',
- action: function (_e: PointerEvent, column: ColumnComponent) {
- column.getTable().download('csv', csvFileName, { bom: true, delimiter: ',' });
- },
- },
- ];
- }
-
downlodEncoder(defaultFileName: string) {
return function (fileContents: string, mimeType: string) {
const vscode = vscodeMessenger.getVsCodeAPI();
diff --git a/log-viewer/modules/components/database-view/SOQLView.ts b/log-viewer/modules/components/database-view/SOQLView.ts
index 9455f084..e9d3882e 100644
--- a/log-viewer/modules/components/database-view/SOQLView.ts
+++ b/log-viewer/modules/components/database-view/SOQLView.ts
@@ -341,7 +341,6 @@ export class SOQLView extends LitElement {
resizable: true,
headerSortStartingDir: 'desc',
headerTooltip: true,
- headerMenu: this.csvheaderMenu('soql.csv'),
headerWordWrap: true,
},
initialSort: [{ column: 'rowCount', dir: 'desc' }],
@@ -611,17 +610,6 @@ export class SOQLView extends LitElement {
return [...newMap.keys()];
}
- csvheaderMenu(csvFileName: string) {
- return [
- {
- label: 'Export to CSV',
- action: function (_e: PointerEvent, column: ColumnComponent) {
- column.getTable().download('csv', csvFileName, { bom: true, delimiter: ',' });
- },
- },
- ];
- }
-
downlodEncoder(defaultFileName: string) {
return function (fileContents: string, mimeType: string) {
const vscode = vscodeMessenger.getVsCodeAPI();
From 066f9bfde3561709dc1118049cea87e0d2badd28 Mon Sep 17 00:00:00 2001
From: Luke Cotter <4013877+lukecotter@users.noreply.github.com>
Date: Mon, 7 Apr 2025 14:49:37 +0100
Subject: [PATCH 6/8] docs: update readme
---
README.md | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index ab53ab08..515f27b6 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,8 @@
Apex Log Analyzer makes performance analysis of Salesforce debug logs much easier and quicker. Visualize code execution via a Flame chart and Call Tree, identify and resolve performance and SOQL/DML problems via Method and Database Analysis.
+Visualize code execution via a Flame chart and identify performance and SOQL/DML problems via Method and Database analysis
+

## WARNING
@@ -163,8 +165,8 @@ The rows can be grouped by Type or Namespace
#### Export to CSV + copy to clipboard
-Click the header menu,`⋮`, and use `Export to CSV` to save the table content to a file.
-Focus the Analysis table and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
+Use `Export to CSV` above the table to save the table content to a file or `Copy to Clipboard`.
+You can also focus the Analysis table and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
### Database
@@ -202,8 +204,8 @@ For SOQL rows, to the right of the Call Stack is SOQL Analysis which shows infor
#### Export to CSV + copy to clipboard
-Click the header menu,`⋮`, and use `Export to CSV` to save the table content to a file.
-Focus the Analysis table and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
+Use `Export to CSV` above the table to save the table content to a file or `Copy to Clipboard`.
+You can also focus the DML/ SOQL tables and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
### Find
From 5ba8716eb731438cf9c38753c586e883ddbe39a7 Mon Sep 17 00:00:00 2001
From: Luke Cotter <4013877+lukecotter@users.noreply.github.com>
Date: Mon, 7 Apr 2025 14:49:58 +0100
Subject: [PATCH 7/8] docs: update copy + export in doc site
---
lana-docs-site/docs/docs/features.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lana-docs-site/docs/docs/features.md b/lana-docs-site/docs/docs/features.md
index 4383fdd5..3c886ed2 100644
--- a/lana-docs-site/docs/docs/features.md
+++ b/lana-docs-site/docs/docs/features.md
@@ -91,8 +91,8 @@ The rows can be grouped by Type or Namespace
### Export to CSV + copy to clipboard
-Click the header menu,`⋮`, and use `Export to CSV` to save the table content to a file.
-Focus the Analysis table and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
+Use `Export to CSV` above the table to save the table content to a file or `Copy to Clipboard`.
+You can also focus the Analysis tables and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
## 💾 Database
@@ -130,8 +130,8 @@ For SOQL rows, to the right of the Call Stack is SOQL Analysis which shows infor
### Export to CSV + copy to clipboard
-Click the header menu,`⋮`, and use `Export to CSV` to save the table content to a file.
-Focus the Analysis table and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
+Use `Export to CSV` above the table to save the table content to a file or `Copy to Clipboard`.
+You can also focus the DML/ SOQL tables and use `CMD / CTRL + c` to copy the table content to clipboard. This can then be pasted into a spreadsheet or other file.
## 🔍 Find
From 2e82b96216f5f68c9958a6bb8da69abad3160b06 Mon Sep 17 00:00:00 2001
From: Luke Cotter <4013877+lukecotter@users.noreply.github.com>
Date: Mon, 7 Apr 2025 14:54:28 +0100
Subject: [PATCH 8/8] docs: update changelog
---
CHANGELOG.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 453a36ee..436f9c1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Column totals for Grouped rows will now be shown inside the groups instead of on a seperate row ([#583][#583]).
-- Table actions: copy to clipboard and export to CSV
+- Table actions: Copy to clipboard and Export to CSV directly from the button above the Analysis and Database table ([#589]).
### Changed
@@ -385,6 +385,7 @@ Skipped due to adopting odd numbering for pre releases and even number for relea
[#582]: https://github.com/certinia/debug-log-analyzer/issues/582
[#588]: https://github.com/certinia/debug-log-analyzer/issues/588
[#583]: https://github.com/certinia/debug-log-analyzer/issues/583
+[#589]: https://github.com/certinia/debug-log-analyzer/issues/589