Skip to content

Commit fa37edd

Browse files
committed
Merge branch 'develop' into alpha
2 parents 98b0307 + c6102b0 commit fa37edd

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"mime-types": "^2.1.28",
112112
"monaco-editor": "^0.21.3",
113113
"node-fetch": "^2.6.1",
114+
"semver": "^5.7.1",
114115
"uuid": "^8.3.2",
115116
"winston": "^3.3.3"
116117
},

src/app/scripts/arc/AdvancedRestClientApplication.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ document.adoptedStyleSheets = document.adoptedStyleSheets.concat(ContextMenuStyl
7676
/** @typedef {import('@advanced-rest-client/arc-events').ARCMenuPopupEvent} ARCMenuPopupEvent */
7777
/** @typedef {import('@advanced-rest-client/arc-events').ARCNavigationEvent} ARCNavigationEvent */
7878
/** @typedef {import('@advanced-rest-client/arc-events').ARCExternalNavigationEvent} ARCExternalNavigationEvent */
79+
/** @typedef {import('@advanced-rest-client/arc-events').ARCHelpTopicEvent} ARCHelpTopicEvent */
7980
/** @typedef {import('@advanced-rest-client/arc-events').ConfigStateUpdateEvent} ConfigStateUpdateEvent */
8081
/** @typedef {import('@advanced-rest-client/arc-events').ArcImportInspectEvent} ArcImportInspectEvent */
8182
/** @typedef {import('@advanced-rest-client/arc-events').WorkspaceAppendRequestEvent} WorkspaceAppendRequestEvent */
@@ -139,6 +140,7 @@ const sheetClosedHandler = Symbol('sheetClosedHandler');
139140
const metaRequestHandler = Symbol('metaRequestHandler');
140141
const requestMetaCloseHandler = Symbol('requestMetaCloseHandler');
141142
const externalNavigationHandler = Symbol('externalNavigationHandler');
143+
const helpNavigationHandler = Symbol('helpNavigationHandler');
142144
const contextCommandHandler = Symbol('contextCommandHandler');
143145
const hostRulesTemplate = Symbol('hostRulesTemplate');
144146
const processApplicationState = Symbol('processApplicationState');
@@ -595,6 +597,7 @@ export class AdvancedRestClientApplication extends ApplicationPage {
595597
window.addEventListener(ArcNavigationEventTypes.navigateRestApi, this[navigateRestApiHandler].bind(this));
596598
window.addEventListener(ArcNavigationEventTypes.popupMenu, this[popupMenuHandler].bind(this));
597599
window.addEventListener(ArcNavigationEventTypes.navigateExternal, this[externalNavigationHandler].bind(this));
600+
window.addEventListener(ArcNavigationEventTypes.helpTopic, this[helpNavigationHandler].bind(this));
598601
window.addEventListener(WorkspaceEventTypes.appendRequest, this[workspaceAppendRequestHandler].bind(this));
599602
window.addEventListener(WorkspaceEventTypes.appendExport, this[workspaceAppendExportHandler].bind(this));
600603
window.addEventListener(ConfigEventTypes.State.update, this[configStateChangeHandler].bind(this));
@@ -837,6 +840,14 @@ export class AdvancedRestClientApplication extends ApplicationPage {
837840
ipc.send('open-web-url', url, purpose);
838841
}
839842

843+
/**
844+
* @param {ARCHelpTopicEvent} e
845+
*/
846+
[helpNavigationHandler](e) {
847+
const { topic } = e;
848+
ipc.send('help-topic', topic);
849+
}
850+
840851
/**
841852
* A handler for the main toolbar arrow back click.
842853
* Always navigates to the workspace.

src/io/ExternalResourcesManager.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ const ARC_REPO_URI = 'https://github.com/advanced-rest-client/arc-electron/';
55
const ARC_DOCS_URI = 'https://docs.advancedrestclient.com/';
66

77
const openExternalHandler = Symbol('openExternalHandler');
8+
const openHelpTopicHandler = Symbol('openHelpTopicHandler');
89

910
export class ExternalResourcesManager {
1011
listen() {
1112
ipcMain.on('open-external-url', this[openExternalHandler].bind(this));
13+
ipcMain.on('help-topic', this[openHelpTopicHandler].bind(this));
1214
}
1315

1416
[openExternalHandler](e, url) {
@@ -125,4 +127,34 @@ export class ExternalResourcesManager {
125127
const url = `${ARC_DOCS_URI}using-arc/cookies-and-session-management`;
126128
shell.openExternal(url);
127129
}
130+
131+
/**
132+
* @param {Electron.IpcMainEvent} e
133+
* @param {string} topic
134+
*/
135+
[openHelpTopicHandler](e, topic) {
136+
let url;
137+
switch (topic) {
138+
case 'history':
139+
url = `${ARC_DOCS_URI}using-arc/history`;
140+
break;
141+
case 'saved':
142+
url = `${ARC_DOCS_URI}using-arc/saved`;
143+
break;
144+
case 'projects':
145+
url = `${ARC_DOCS_URI}using-arc/legacy-projects`;
146+
break;
147+
case 'rest-api-docs':
148+
url = `${ARC_DOCS_URI}using-arc/api-console`;
149+
break;
150+
case 'search-docs':
151+
url = `${ARC_DOCS_URI}using-arc/search`;
152+
break;
153+
default:
154+
logger.error(`Unknown help topic to open: ${topic}`);
155+
return;
156+
}
157+
logger.debug(`Opening help topic at ${url}.`);
158+
shell.openExternal(url);
159+
}
128160
}

0 commit comments

Comments
 (0)