maziggy 2 hafta önce
ebeveyn
işleme
3f78ce8119

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
CHANGELOG.md


+ 19 - 8
frontend/src/__tests__/pages/ArchivesPage.test.tsx

@@ -346,6 +346,14 @@ describe('ArchivesPage', () => {
   });
 
   describe('timelapse management', () => {
+    // A card reaches print-video downloads through its context menu; only the
+    // list row keeps an action-bar button for it (#2853).
+    const openCardPrintVideos = async (cardIndex = 0) => {
+      const triggers = await screen.findAllByTitle('Right-click for more options');
+      fireEvent.click(triggers[cardIndex]);
+      return screen.findByRole('button', { name: 'Download print videos' });
+    };
+
     it('keeps an attached timelapse available without printer-file permission', async () => {
       setAuthToken('archive-only-token', 'session');
       server.use(
@@ -377,12 +385,16 @@ describe('ArchivesPage', () => {
 
       render(<ArchivesPage />);
 
-      const mediaButton = (await screen.findAllByTitle('Download print videos'))[0];
-      expect(mediaButton).toBeEnabled();
-      const deniedButtons = screen.getAllByTitle('You do not have permission to access printer files');
-      expect(deniedButtons.every(button => button.hasAttribute('disabled'))).toBe(true);
+      // One of the two archives has no attached copy, so without printer-file
+      // permission there is nothing left for the action to offer.
+      const deniedItem = await openCardPrintVideos(0);
+      expect(deniedItem).toBeDisabled();
+      expect(deniedItem).toHaveAttribute('title', 'You do not have permission to access printer files');
+      fireEvent.keyDown(document, { key: 'Escape' });
 
-      fireEvent.click(mediaButton);
+      const mediaItem = await openCardPrintVideos(1);
+      expect(mediaItem).toBeEnabled();
+      fireEvent.click(mediaItem);
       expect(await screen.findByText('attached.mp4')).toBeInTheDocument();
       expect(screen.getByText('You do not have permission to access printer files')).toBeInTheDocument();
     });
@@ -409,8 +421,7 @@ describe('ArchivesPage', () => {
       );
 
       render(<ArchivesPage />);
-      const mediaButtons = await screen.findAllByTitle('Download print videos');
-      fireEvent.click(mediaButtons[0]);
+      fireEvent.click(await openCardPrintVideos());
 
       expect(await screen.findByText('Print videos')).toBeInTheDocument();
       expect(await screen.findByText('ipcam-record.2024-01-01_10-05-00.1.mp4')).toBeInTheDocument();
@@ -443,7 +454,7 @@ describe('ArchivesPage', () => {
       );
 
       render(<ArchivesPage />);
-      fireEvent.click((await screen.findAllByTitle('Download print videos'))[0]);
+      fireEvent.click(await openCardPrintVideos());
       fireEvent.click(await screen.findByRole('button', { name: /Download selected \(1\)/i }));
 
       expect(await screen.findByText('Download failed: Not enough app data volume space')).toBeInTheDocument();

+ 12 - 14
frontend/src/pages/ArchivesPage.tsx

@@ -33,6 +33,7 @@ import {
   AlertCircle,
   Copy,
   Film,
+  FileVideo,
   ScanSearch,
   QrCode,
   Camera,
@@ -619,6 +620,17 @@ function ArchiveCard({
       onClick: () => setShowTimelapse(true),
       disabled: !archive.timelapse_path,
     },
+    {
+      label: t('archives.media.download'),
+      icon: <FileVideo className="w-4 h-4" />,
+      onClick: () => setShowPrinterMedia(true),
+      disabled: !archive.timelapse_path && (
+        !hasPermission('printers:files') || !archive.printer_id || !archive.started_at
+      ),
+      title: !archive.timelapse_path && !hasPermission('printers:files')
+        ? t('printers.permission.noFiles')
+        : undefined,
+    },
     {
       label: t('archives.menu.scanForTimelapse'),
       icon: <ScanSearch className="w-4 h-4" />,
@@ -1383,20 +1395,6 @@ function ArchiveCard({
           >
             <Globe className={`w-3 h-3 sm:w-4 sm:h-4 ${!archive.external_url && !archive.makerworld_url ? 'opacity-20' : ''}`} />
           </Button>
-          <Button
-            variant="secondary"
-            size="sm"
-            className="min-w-0 p-1 sm:p-1.5"
-            onClick={() => setShowPrinterMedia(true)}
-            disabled={!archive.timelapse_path && (
-              !hasPermission('printers:files') || !archive.printer_id || !archive.started_at
-            )}
-            title={!archive.timelapse_path && !hasPermission('printers:files')
-              ? t('printers.permission.noFiles')
-              : t('archives.media.download')}
-          >
-            <Film className="w-3 h-3 sm:w-4 sm:h-4" />
-          </Button>
           <Button
             variant="secondary"
             size="sm"

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/assets/index-e8_8xCtK.js


+ 1 - 1
static/index.html

@@ -26,7 +26,7 @@
 
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-DoAzVOXb.js"></script>
+    <script type="module" crossorigin src="/assets/index-e8_8xCtK.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-DjndScv6.css">
   </head>
   <body>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor