Skip to content
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

feat: log list is searchable + filterable #554

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Log list returned by `Log: Retrieve Apex Log And Show Analysis command` is filterable ([#523][#523])

## [1.16.1] - 2024-12-03

### Fixed
Expand Down Expand Up @@ -361,6 +367,10 @@ Skipped due to adopting odd numbering for pre releases and even number for relea

<!-- Unreleased -->

[#523]: https://github.com/certinia/debug-log-analyzer/issues/523

<!-- v1.16.1 -->

[#537]: https://github.com/certinia/debug-log-analyzer/issues/537
[#526]: https://github.com/certinia/debug-log-analyzer/issues/526
[#536]: https://github.com/certinia/debug-log-analyzer/issues/536
Expand Down
11 changes: 9 additions & 2 deletions lana/src/commands/RetrieveLogFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DebugLogItem extends Item {
desc: string,
details: string,
logId: string,
sticky = true,
sticky = false,
selected = false,
) {
super(name, desc, details, sticky, selected);
Expand Down Expand Up @@ -87,7 +87,14 @@ export class RetrieveLogFile {
return new DebugLogItem(name, description, detail, r.Id);
});

const [selectedLog] = await QuickPick.pick(items, new Options('Select a logfile'));
const [selectedLog] = await QuickPick.pick(
items,
new Options({
placeholder: 'Select a workspace:',
matchOnDescription: true,
matchOnDetail: true,
}),
);
return selectedLog?.logId || null;
}

Expand Down
6 changes: 5 additions & 1 deletion lana/src/display/OpenFileInPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export class OpenFileInPackage {
matchingWs.length > 1
? await QuickPick.pick(
matchingWs.map((p) => new Item(p.name(), p.path(), '')),
new Options('Select a workspace:'),
new Options({
placeholder: 'Select a workspace:',
matchOnDescription: true,
matchOnDetail: true,
}),
)
: [new Item(matchingWs[0]?.name() || '', matchingWs[0]?.path() || '', '')];

Expand Down
18 changes: 17 additions & 1 deletion lana/src/display/QuickPick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,27 @@ export class Options implements QuickPickOptions {
canPickMany: boolean;
ignoreFocusOut: boolean;
placeHolder: string;
matchOnDescription: boolean;
matchOnDetail: boolean;

constructor(placeholder: string, ignoreDefocus = false, multiSelect = false) {
constructor({
placeholder,
ignoreDefocus = false,
multiSelect = false,
matchOnDescription = false,
matchOnDetail = false,
}: {
placeholder: string;
ignoreDefocus?: boolean;
multiSelect?: boolean;
matchOnDescription?: boolean;
matchOnDetail?: boolean;
}) {
this.placeHolder = placeholder;
this.ignoreFocusOut = ignoreDefocus;
this.canPickMany = multiSelect;
this.matchOnDescription = matchOnDescription;
this.matchOnDetail = matchOnDetail;
}
}

Expand Down
6 changes: 5 additions & 1 deletion lana/src/display/QuickPickWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export class QuickPickWorkspace {
if (context.workspaces.length > 1) {
const [workspace] = await QuickPick.pick(
context.workspaces.map((ws) => new Item(ws.name(), ws.path(), '')),
new Options('Select a workspace:'),
new Options({
placeholder: 'Select a workspace:',
matchOnDescription: true,
matchOnDetail: true,
}),
);

if (workspace) {
Expand Down
Loading