fix https://gitee.com/openkylin/kylin-code/issues/I7O0TT 帮助菜单和必读中添加跳转到用户帮助文档的菜单和链接

This commit is contained in:
chriswang521 2023-07-26 10:27:11 +08:00
parent abcaa88976
commit 7e56b8e90a
5 changed files with 52 additions and 2 deletions

View File

@ -2777,7 +2777,9 @@
"openUserVoiceUrl": "搜索功能请求",
"openVideoTutorialsUrl": "视频教程",
"miOpenExtensionDependency": "打开插件依赖管理器",
"miOpenOfflineExtensionsManager": "打开离线插件管理器"
"miOpenOfflineExtensionsManager": "打开离线插件管理器",
"openHelpDocUrl":"用户帮助文档(链接)",
"miHelpDocs":"用户帮助文档(链接)"
},
"vs/workbench/browser/actions/layoutActions": {
"active": "活动",

View File

@ -86,5 +86,6 @@
},
"linkProtectionTrustedDomains": [
"https://open-vsx.org"
]
],
"helpDocUrl":"https://gitee.com/openkylin/extensions-repo/blob/master/user-guide/%E7%9B%AE%E5%BD%95.md"
}

View File

@ -124,6 +124,8 @@ export interface IProductConfiguration {
readonly privacyStatementUrl?: string;
readonly showTelemetryOptOut?: boolean;
readonly helpDocUrl?: string;
readonly serverGreeting?: string[];
readonly serverLicense?: string[];
readonly serverLicensePrompt?: string;

View File

@ -317,6 +317,39 @@ class OpenPrivacyStatementUrlAction extends Action2 {
}
}
class OpenHelpDocUrlAction extends Action2 {
static readonly ID = 'workbench.action.openHelpDocUrl';
static readonly AVAILABLE = !!product.helpDocUrl;
constructor() {
super({
id: OpenHelpDocUrlAction.ID,
title: {
value: localize('openHelpDocUrl', "User Guides(URL)"),
mnemonicTitle: localize({ key: 'miHelpDocs', comment: ['&& denotes a mnemonic'] }, "User Guides(URL)"),
original: 'User Guides(URL)'
},
category: CATEGORIES.Help,
f1: true,
menu: {
id: MenuId.MenubarHelpMenu,
group: '2_reference',
order: 4
}
});
}
run(accessor: ServicesAccessor): void {
const productService = accessor.get(IProductService);
const openerService = accessor.get(IOpenerService);
if (productService.helpDocUrl) {
openerService.open(URI.parse(productService.helpDocUrl));
}
}
}
// --- Actions Registration
if (KeybindingsReferenceAction.AVAILABLE) {
@ -355,6 +388,9 @@ if (OpenPrivacyStatementUrlAction.AVAILABE) {
registerAction2(OpenPrivacyStatementUrlAction);
}
if (OpenHelpDocUrlAction.AVAILABLE) {
registerAction2(OpenHelpDocUrlAction);
}
// --- Menu Registration

View File

@ -362,6 +362,12 @@ export class GettingStartedPage extends EditorPane {
this.makeCategoryVisibleWhenAvailable('requiredReading', 'getExtensions');
break;
}
case 'openUserGuides': {
if (this.productService.helpDocUrl) {
this.openerService.open(URI.parse(this.productService.helpDocUrl));
}
break;
}
case 'installDependency': {
// this.makeCategoryVisibleWhenAvailable('Setup', 'findLanguageExtensions');
this.commandService.executeCommand('workbench.action.openWalkthrough', { category: 'requiredReading', step: 'installDependency' }, true);
@ -982,6 +988,9 @@ export class GettingStartedPage extends EditorPane {
klass: 'required-container',
limit: 10,//Meaningless code
empty: $('.empty-required', {},
$('p', {}, localize('tipsMsg0', "查看更多Kylin-IDE的使用请参见"),
$('button.button-link', { 'x-dispatch': 'openUserGuides' }, localize('openUserGuides', "用户帮助文档。"))
),
$('p', {}, localize('tipsMsg1', "如何检索到KylinIDETeam开发适配的插件Kylin-Code默认接入OpenVSX插件商店在Kylin-Code中可以使用插件检索列表找到KylinIDETeam开发、适配、上传到openVSX中的插件也可以在插件详情页面找到openKylin社区插件仓库的链接。"),
$('button.button-link', { 'x-dispatch': 'openDetails' }, localize('openDetails', "详情."))
),