Procházet zdrojové kódy

adding side menu for download option (#33307)

* adding side menu for download option

* fixing the E2E tests to adapt the new behaviour

GitOrigin-RevId: d96df4906a40006d36ac0ea525d74a1644ec4085
Davinder Singh před 3 měsíci
rodič
revize
30e0e6adaf

+ 2 - 0
server-ce/test/editor.spec.ts

@@ -140,6 +140,7 @@ describe('editor', function () {
   describe('file menu', function () {
     it('can download project sources', function () {
       cy.findByRole('button', { name: 'File' }).click()
+      cy.findByRole('link', { name: 'Download' }).click()
       cy.findByRole('menuitem', { name: 'Download as source (.zip)' }).click()
       const zipName = projectName.replaceAll('-', '_')
       cy.task('readFileInZip', {
@@ -156,6 +157,7 @@ describe('editor', function () {
       )
 
       cy.findByRole('button', { name: 'File' }).click()
+      cy.findByRole('link', { name: 'Download' }).click()
       cy.findByRole('menuitem', { name: 'Download as PDF' }).click()
       const pdfName = projectName.replaceAll('-', '_')
       cy.task('readPdf', `cypress/downloads/${pdfName}.pdf`).should(

+ 12 - 2
services/web/frontend/js/features/ide-react/components/toolbar/menu-bar.tsx

@@ -87,14 +87,24 @@ export const ToolbarMenuBar = () => {
       { id: 'submit', children: ['submit-project', 'manage-template'] },
       {
         id: 'file-download',
-        children: ['download-as-source-zip', 'download-pdf', 'export-as-docx'],
+        children: [
+          {
+            id: 'file-download-group',
+            title: t('download'),
+            children: [
+              'download-as-source-zip',
+              'download-pdf',
+              'export-as-docx',
+            ],
+          },
+        ],
       },
       {
         id: 'settings',
         children: ['open-settings'],
       },
     ],
-    []
+    [t]
   )
 
   const editMenuStructure: MenuStructure = useMemo(