@uxland/primary-shell 7.40.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/dist/{component-t8PFluu3.js → component-IklL-P_z.js} +3 -3
- package/dist/{component-t8PFluu3.js.map → component-IklL-P_z.js.map} +1 -1
- package/dist/{index-RXjJQygZ.js → index-Dnyofefj.js} +1487 -1133
- package/dist/index-Dnyofefj.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +224 -127
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/api/import-data-manager/component/styles.css +1 -8
- package/src/api/pdf-viewer-manager/pdf-viewer-manager.test.ts +6 -36
- package/src/api/pdf-viewer-manager/pdf-viewer-manager.ts +1 -7
- package/dist/index-RXjJQygZ.js.map +0 -1
- package/dist/primary/shell/src/UI/components/navigation-tooltip/index.d.ts +0 -2
- package/dist/primary/shell/src/UI/components/navigation-tooltip/navigation-tooltip.d.ts +0 -8
- package/dist/primary/shell/src/UI/components/navigation-tooltip/tooltip-manager.d.ts +0 -1
- package/src/UI/components/navigation-tooltip/index.ts +0 -2
- package/src/UI/components/navigation-tooltip/navigation-tooltip.ts +0 -50
- package/src/UI/components/navigation-tooltip/styles.css +0 -67
- package/src/UI/components/navigation-tooltip/tooltip-manager.ts +0 -31
package/package.json
CHANGED
|
@@ -29,18 +29,11 @@
|
|
|
29
29
|
display: grid;
|
|
30
30
|
flex: 1;
|
|
31
31
|
min-height: 0;
|
|
32
|
-
|
|
33
|
-
que el client validi la nova UX. Per reactivar, tornar a
|
|
34
|
-
`grid-template-columns: 1fr 1fr;` i treure el `display: none` de sota. */
|
|
35
|
-
grid-template-columns: 1fr;
|
|
32
|
+
grid-template-columns: 1fr 1fr;
|
|
36
33
|
gap: 16px;
|
|
37
34
|
padding: 16px;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
|
-
.content > primaria-region[name="import-data-activity-history-region"] {
|
|
41
|
-
display: none;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
37
|
.content > primaria-region {
|
|
45
38
|
width: 100%;
|
|
46
39
|
height: 100%;
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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(
|
|
107
|
-
|
|
108
|
-
vi.useRealTimers();
|
|
83
|
+
expect(notificationService.success).not.toHaveBeenCalled();
|
|
109
84
|
});
|
|
110
85
|
|
|
111
|
-
it("should not show
|
|
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(
|
|
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
|
-
|
|
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
|
|