add tooltip for dashboard learn more button (#22744)

This commit is contained in:
Alan Ren
2023-04-17 08:19:59 -07:00
committed by GitHub
parent 2d25c8626f
commit f66d3349b9
2 changed files with 4 additions and 2 deletions

View File

@@ -68,12 +68,14 @@ export class ToolbarAction extends Action {
constructor(
id: string,
label: string,
tooltip: string,
cssClass: string,
private runFn: (id: string) => void,
private context: any, // this
private logService: ILogService
) {
super(id, label, cssClass);
this.tooltip = tooltip;
}
override async run(): Promise<void> {

View File

@@ -209,7 +209,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
content = this.getToolbarContent(tabId);
if (tabId === this.homeTabId) {
const configureDashboardCommand = MenuRegistry.getCommand('configureDashboard');
const configureDashboardAction = new ToolbarAction(configureDashboardCommand.id, configureDashboardCommand.title.toString(), TaskRegistry.getOrCreateTaskIconClassName(configureDashboardCommand), this.runAction, this, this.logService);
const configureDashboardAction = new ToolbarAction(configureDashboardCommand.id, configureDashboardCommand.title.toString(), nls.localize('dashboard.configureDashboardTooltip', "Learn more about how to configure the dashboard"), TaskRegistry.getOrCreateTaskIconClassName(configureDashboardCommand), this.runAction, this, this.logService);
content.push({ action: configureDashboardAction });
}
this.toolbar.setContent(content);
@@ -272,7 +272,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
_tasks.forEach(a => {
const iconClassName = TaskRegistry.getOrCreateTaskIconClassName(a);
const title = typeof a.title === 'string' ? a.title : a.title.value;
toolbarActions.push(new ToolbarAction(a.id, title, iconClassName, this.runAction, this, this.logService));
toolbarActions.push(new ToolbarAction(a.id, title, title, iconClassName, this.runAction, this, this.logService));
});
let content: ITaskbarContent[] = [];