@uxland/primary-shell 7.39.0 → 7.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.39.0",
3
+ "version": "7.40.1",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -49,10 +49,30 @@
49
49
  box-sizing: border-box;
50
50
  }
51
51
 
52
+ /* Right column: stacks plugin cards and scrolls as a whole. */
52
53
  .content > primaria-region[name="import-data-region"] > div {
53
54
  overflow-y: auto;
54
55
  }
55
56
 
57
+ /* Left column: vertical stack of multiple views with a gap. The last view
58
+ takes the remaining space and handles its own scroll; preceding views
59
+ keep their natural height. */
60
+ .content > primaria-region[name="import-data-activity-history-region"] > div {
61
+ display: flex;
62
+ flex-direction: column;
63
+ gap: 16px;
64
+ overflow: hidden;
65
+ }
66
+
67
+ .content > primaria-region[name="import-data-activity-history-region"] > div > * {
68
+ flex-shrink: 0;
69
+ }
70
+
71
+ .content > primaria-region[name="import-data-activity-history-region"] > div > *:last-child {
72
+ flex: 1;
73
+ min-height: 0;
74
+ }
75
+
56
76
  .footer {
57
77
  display: flex;
58
78
  flex-direction: row;
@@ -2,7 +2,6 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
2
2
  import { createPdfViewerManager } from "./pdf-viewer-manager";
3
3
  import { pdfViwerEvents } from "./events";
4
4
  import { registerPdfViewerNavItem } from "./handle-views";
5
- import { showNavItemTooltip } from "../../UI/components/navigation-tooltip";
6
5
 
7
6
  vi.mock("@primaria/plugins-core", () => ({
8
7
  generateId: () => "generated-id",
@@ -16,10 +15,6 @@ vi.mock("../../locales", () => ({
16
15
  translate: (key: string) => key,
17
16
  }));
18
17
 
19
- vi.mock("../../UI/components/navigation-tooltip", () => ({
20
- showNavItemTooltip: vi.fn(),
21
- }));
22
-
23
18
  describe("PdfViewerManager", () => {
24
19
  let manager: ReturnType<typeof createPdfViewerManager>;
25
20
  let broker: any;
@@ -64,20 +59,10 @@ describe("PdfViewerManager", () => {
64
59
  });
65
60
  });
66
61
 
67
- it("should show tooltip when adding a valid pdf", async () => {
68
- vi.useFakeTimers();
69
-
62
+ it("should show success notification when adding a valid pdf", () => {
70
63
  manager.add({ id: "doc-1", name: "Doc1", date: "2024-01-15 - 10:00", url: "https://test.com/doc1.pdf" });
71
64
 
72
- // Fast-forward the setTimeout(100ms)
73
- vi.advanceTimersByTime(100);
74
-
75
- expect(showNavItemTooltip).toHaveBeenCalledWith(
76
- "primaria-shell::pdf-viewer",
77
- "pdfManager.tooltipMessage"
78
- );
79
-
80
- vi.useRealTimers();
65
+ expect(notificationService.success).toHaveBeenCalledWith("pdfManager.tooltipMessage");
81
66
  });
82
67
 
83
68
  it("should warn if pdf with same name already exists", () => {
@@ -88,36 +73,21 @@ describe("PdfViewerManager", () => {
88
73
  expect(manager.getPdfs()).toHaveLength(1); // solo el primero
89
74
  });
90
75
 
91
- it("should not show tooltip when pdf with same name already exists", () => {
92
- vi.useFakeTimers();
93
-
94
- // First add succeeds and shows tooltip
76
+ it("should not show success notification when pdf with same name already exists", () => {
95
77
  manager.add({ id: "doc-1", name: "Doc1", date: "2024-01-15 - 10:00", b64: "xxx" });
96
- vi.advanceTimersByTime(100);
97
-
98
- // Clear mocks after first add
99
78
  vi.clearAllMocks();
100
79
 
101
- // Second add with same name should show warning but NOT tooltip
102
80
  manager.add({ id: "doc-1", name: "Doc1", date: "2024-01-15 - 10:00", b64: "xxx" });
103
- vi.advanceTimersByTime(100);
104
81
 
105
82
  expect(notificationService.warning).toHaveBeenCalledWith("pdfManager.alreadyUploaded");
106
- expect(showNavItemTooltip).not.toHaveBeenCalled();
107
-
108
- vi.useRealTimers();
83
+ expect(notificationService.success).not.toHaveBeenCalled();
109
84
  });
110
85
 
111
- it("should not show tooltip when pdf data is invalid", () => {
112
- vi.useFakeTimers();
113
-
86
+ it("should not show success notification when pdf data is invalid", () => {
114
87
  manager.add({ id: "doc-1", name: "Doc1", date: "2024-01-15 - 10:00" });
115
- vi.advanceTimersByTime(100);
116
88
 
117
89
  expect(notificationService.error).toHaveBeenCalledWith("pdfManager.missingData");
118
- expect(showNavItemTooltip).not.toHaveBeenCalled();
119
-
120
- vi.useRealTimers();
90
+ expect(notificationService.success).not.toHaveBeenCalled();
121
91
  });
122
92
 
123
93
  it("should not call registerNavButton when adding PDFs", () => {
@@ -5,9 +5,7 @@ import { PrimariaNotificationService } from "../notification-service/notificatio
5
5
  import { pdfViwerEvents } from "./events";
6
6
  import { PdfSelector } from "./pdf-visor/pdf-selector/pdf-selector";
7
7
  import { PdfVisor } from "./pdf-visor/pdf-visor";
8
- import { showNavItemTooltip } from "../../UI/components/navigation-tooltip";
9
8
  import { pdfViewerId } from "./constants";
10
- import { primariaShellId } from "../../constants";
11
9
 
12
10
  export interface PdfData {
13
11
  id: string;
@@ -72,11 +70,7 @@ export class PdfViewerManager {
72
70
  });
73
71
  }, 150);
74
72
  } else {
75
- // Show tooltip to guide user to the PDF viewer
76
- setTimeout(() => {
77
- const navItemKey = `${primariaShellId}::${pdfViewerId}`;
78
- showNavItemTooltip(navItemKey, translate("pdfManager.tooltipMessage"));
79
- }, 100);
73
+ this.notificationService.success(translate("pdfManager.tooltipMessage"));
80
74
  }
81
75
  }
82
76