Skip to content

Commit f20f738

Browse files
committed
Move Manage to Control section and put back Explorer
1 parent c4899f7 commit f20f738

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

src/i18n/locales/en/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"search": "Search..."
2121
},
2222
"PROJECT": "Project",
23+
"PROJECTS": "Projects",
2324
"SAVE": "Save",
2425
"DEPLOY": "Deploy",
2526
"MANAGE": "Manage",

src/i18n/locales/es/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"example_opmode": "Por ejemplo: AutoEstacionarYDisparar",
1818
"example_project": "Por ejemplo: RobotRuedasLocas",
1919
"PROJECT": "Proyecto",
20+
"PROJECTS": "Proyectos",
2021
"SAVE": "Guardar",
2122
"DEPLOY": "Desplegar",
2223
"MANAGE": "Gestionar",

src/i18n/locales/he/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"search": "חיפוש..."
2121
},
2222
"PROJECT": "פרויקט",
23+
"PROJECTS": "פרויקטים",
2324
"SAVE": "שמור",
2425
"DEPLOY": "העלה לרובוט",
2526
"MANAGE": "ניהול",

src/reactComponents/Menu.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
CheckOutlined,
4444
DownloadOutlined,
4545
UploadOutlined,
46+
ControlOutlined
4647
} from '@ant-design/icons';
4748
import FileManageModal from './FileManageModal';
4849
import ProjectManageModal from './ProjectManageModal';
@@ -102,19 +103,42 @@ function getDivider(): MenuItem {
102103
* Generates menu items for a given project.
103104
*/
104105
function getMenuItems(t: (key: string) => string, project: storageProject.Project, currentLanguage: string): MenuItem[] {
105-
106+
const mechanisms: MenuItem[] = [];
107+
const opmodes: MenuItem[] = [];
108+
109+
// Build mechanisms menu items
110+
project.mechanisms.forEach((mechanism) => {
111+
mechanisms.push(getItem(
112+
mechanism.className,
113+
mechanism.modulePath,
114+
<BlockOutlined />
115+
));
116+
});
117+
118+
// Build opmodes menu items
119+
project.opModes.forEach((opmode) => {
120+
opmodes.push(getItem(
121+
opmode.className,
122+
opmode.modulePath,
123+
<CodeOutlined />
124+
));
125+
});
126+
106127
return [
107128
getItem(t('PROJECT'), 'project', <FolderOutlined />, [
108129
getItem(t('SAVE'), 'save', <SaveOutlined />),
109130
getItem(t('DEPLOY'), 'deploy'),
110-
getDivider(),
111-
getItem(t('MANAGE') + '...', 'manageProjects'),
112131
]),
113-
getItem(t('EXPLORER'), 'explorer', <FileOutlined />, [
114-
getItem(t('ROBOT'), project.robot.modulePath, <RobotOutlined />),
132+
getItem(t('MANAGE'), 'manage', <ControlOutlined />, [
133+
getItem(t('PROJECTS') + '...', 'manageProjects', <FolderOutlined />),
115134
getItem(t('MECHANISMS') + '...', 'manageMechanisms', <BlockOutlined />),
116135
getItem(t('OPMODES') + '...', 'manageOpmodes', <CodeOutlined />),
117136
]),
137+
getItem(t('EXPLORER'), 'explorer', <FileOutlined />, [
138+
getItem(t('ROBOT'), project.robot.modulePath, <RobotOutlined />),
139+
getItem(t('MECHANISMS'), 'mechanisms', <BlockOutlined />, mechanisms),
140+
getItem(t('OPMODES'), 'opmodes', <CodeOutlined />, opmodes),
141+
]),
118142
getItem(t('SETTINGS'), 'settings', <SettingOutlined />, [
119143
getItem(t('WPI_TOOLBOX'), 'wpi_toolbox'),
120144
getItem(t('THEME') + '...', 'theme', <BgColorsOutlined />),

0 commit comments

Comments
 (0)