Skip to content

Commit 041688b

Browse files
author
Akos Kitta
committed
fix: added profile URL, fixed menu label
From now on, the customized bottom widget hides the default setting menu Signed-off-by: Akos Kitta <[email protected]>
1 parent 5f8d864 commit 041688b

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {
1010
MenuContribution,
1111
MenuModelRegistry,
1212
} from '@theia/core';
13-
import {
14-
FrontendApplication,
15-
FrontendApplicationContribution,
16-
} from '@theia/core/lib/browser';
13+
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
1714
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
1815
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
1916
import { CommonMenus } from '@theia/core/lib/browser/common-frontend-contribution';
@@ -77,7 +74,7 @@ export class ArduinoFrontendContribution
7774
}
7875
}
7976

80-
onStart(app: FrontendApplication): void {
77+
onStart(): void {
8178
this.electronWindowPreferences.onPreferenceChanged((event) => {
8279
if (event.newValue !== event.oldValue) {
8380
switch (event.preferenceName) {
@@ -98,8 +95,6 @@ export class ArduinoFrontendContribution
9895
webContents.setZoomLevel(zoomLevel);
9996
})
10097
);
101-
// Removes the _Settings_ (cog) icon from the left sidebar
102-
app.shell.leftPanelHandler.removeBottomMenu('settings-menu');
10398
}
10499

105100
registerToolbarItems(registry: TabBarToolbarRegistry): void {

arduino-ide-extension/src/browser/contributions/account.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Account extends Contribution {
5555
isEnabled: () => !Boolean(this.createFeatures.session),
5656
});
5757
registry.registerCommand(Account.Commands.GO_TO_PROFILE, {
58-
execute: () => {},
58+
execute: () => openExternal('https://id.arduino.cc/'),
5959
isEnabled: () => Boolean(this.createFeatures.session),
6060
});
6161
registry.registerCommand(Account.Commands.GO_TO_CLOUD_EDITOR, {
@@ -85,8 +85,7 @@ export class Account extends Contribution {
8585

8686
register(ArduinoMenus.ARDUINO_ACCOUNT__CONTEXT__SIGN_IN_GROUP, [
8787
CloudUserCommands.LOGIN,
88-
// TODO: why not 'Sign in to Arduino Cloud' like the current message in the cloud sketchbook tree?
89-
nls.localize('arduino/account/signIn', 'Sign in with Arduino Cloud'),
88+
nls.localize('arduino/cloud/signInToCloud', 'Sign in to Arduino Cloud'),
9089
]);
9190
register(ArduinoMenus.ARDUINO_ACCOUNT__CONTEXT__LEARN_MORE_GROUP, [
9291
Account.Commands.LEARN_MORE,
@@ -139,9 +138,8 @@ export namespace Account {
139138
export const GO_TO_IOT_CLOUD: Command = {
140139
id: 'arduino-go-to-iot-cloud',
141140
};
142-
export const LEARN_MORE: Command & { label: string } = {
141+
export const LEARN_MORE: Command = {
143142
id: 'arduino-learn-more',
144-
label: nls.localize('arduino/cloud/learnMore', 'Learn more'),
145143
};
146144
}
147145
}

arduino-ide-extension/src/browser/theia/core/sidebar-bottom-menu-widget.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ export class SidebarBottomMenuWidget extends TheiaSidebarBottomMenuWidget {
4848
);
4949
}
5050

51-
private renderMenu(menu: SidebarMenu): JSX.Element {
51+
private renderMenu(menu: SidebarMenu): React.ReactNode {
52+
// Removes the _Settings_ (cog) icon from the left sidebar
53+
if (menu.id === 'settings-menu') {
54+
return undefined;
55+
}
5256
const arduinoAccount = menu.id === accountMenu.id;
5357
const picture =
5458
arduinoAccount && this.createFeatures.session?.account.picture;

i18n/en.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"goToCloudEditor": "Go to Cloud Editor",
99
"goToIoTCloud": "Go to IoT Cloud",
1010
"goToProfile": "Go to Profile",
11-
"menuTitle": "Arduino Cloud",
12-
"signIn": "Sign in with Arduino Cloud"
11+
"menuTitle": "Arduino Cloud"
1312
},
1413
"board": {
1514
"board": "Board{0}",

0 commit comments

Comments
 (0)