@geode/opengeodeweb-front 12.2.0-rc.2 → 12.2.0-rc.4
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/.build/tests/browser/helpers/image.js +25 -0
- package/.build/tests/browser/helpers/object_trees/common.js +3 -1
- package/.build/tests/browser/helpers/object_trees/model_tree_bar.js +41 -0
- package/.build/tests/browser/helpers/wait_for_action_settled.js +2 -2
- package/.build/tests/browser/suites/image/raster_image.js +33 -0
- package/.build/tests/browser/suites/index.js +4 -0
- package/.build/tests/browser/suites/model/collections.js +1 -1
- package/.build/tests/browser/suites/object_tree/controls.js +2 -1
- package/.build/tests/browser/suites/object_tree/model_tree_bar.js +81 -0
- package/app/components/Viewer/Image/ImageOptions.vue +67 -0
- package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +12 -1
- package/app/components/Viewer/ObjectTree/Base/Controls.vue +26 -2
- package/app/components/Viewer/ObjectTree/Box.vue +30 -5
- package/app/components/Viewer/ObjectTree/Layout.vue +183 -54
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +3 -2
- package/app/composables/hover_highlight.ts +6 -5
- package/app/composables/model_tree_drag.ts +56 -0
- package/app/composables/use_adaptive_styles.ts +15 -8
- package/app/composables/use_overlapping_picker.ts +6 -1
- package/app/composables/virtual_tree.ts +7 -1
- package/app/stores/data_style.ts +12 -1
- package/app/stores/menu_helpers/image.ts +11 -0
- package/app/stores/menu_helpers/menus_data.ts +2 -0
- package/app/stores/treeview.ts +29 -1
- package/app/types/identifiers.ts +8 -0
- package/app/utils/default_styles/images.ts +16 -0
- package/app/utils/default_styles/index.ts +3 -2
- package/app/utils/threshold_sources.ts +5 -1
- package/internal/stores/data_style/image/index.ts +107 -0
- package/internal/stores/hybrid_viewer/brightness.ts +36 -19
- package/package.json +1 -1
- package/tests/browser/helpers/image.ts +33 -0
- package/tests/browser/helpers/object_trees/common.ts +4 -0
- package/tests/browser/helpers/object_trees/model_tree_bar.ts +78 -0
- package/tests/browser/helpers/wait_for_action_settled.ts +2 -3
- package/tests/browser/suites/image/raster_image.ts +40 -0
- package/tests/browser/suites/model/collections.ts +2 -1
- package/tests/browser/suites/object_tree/controls.ts +3 -0
- package/tests/browser/suites/object_tree/model_tree_bar.ts +125 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Third party imports
|
|
2
|
+
import { expect } from "@playwright/test";
|
|
3
|
+
|
|
4
|
+
// Local imports
|
|
5
|
+
import {
|
|
6
|
+
brepGeodeObjectType,
|
|
7
|
+
defaultDataName,
|
|
8
|
+
structuralModelGeodeObjectType,
|
|
9
|
+
} from "#browser_helpers/constants";
|
|
10
|
+
import {
|
|
11
|
+
clickModelTreeBarButton,
|
|
12
|
+
dragModelTreeButton,
|
|
13
|
+
getModelTreeButtonColors,
|
|
14
|
+
getModelTreePanelColors,
|
|
15
|
+
getModelTreeRows,
|
|
16
|
+
getModelTreeToggles,
|
|
17
|
+
} from "#browser_helpers/object_trees/model_tree_bar";
|
|
18
|
+
import {
|
|
19
|
+
collapseMainObjectTreeGroup,
|
|
20
|
+
expandMainObjectTree,
|
|
21
|
+
getMainObjectTree,
|
|
22
|
+
} from "#browser_helpers/object_trees/main_object_tree";
|
|
23
|
+
import {
|
|
24
|
+
expandMeshComponentType,
|
|
25
|
+
getModelComponentsObjectTree,
|
|
26
|
+
openModelComponentsTree,
|
|
27
|
+
} from "#browser_helpers/object_trees/model_components_object_tree";
|
|
28
|
+
import { fillSearchQuery } from "#browser_helpers/object_trees/common";
|
|
29
|
+
import { moveMouseOutOfTheWay } from "#browser_helpers/app_interaction";
|
|
30
|
+
|
|
31
|
+
import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
|
|
32
|
+
|
|
33
|
+
// Constants
|
|
34
|
+
const brepFilename = "test.og_brep";
|
|
35
|
+
const structuralModelFilename = "test.og_strm";
|
|
36
|
+
|
|
37
|
+
// Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
|
|
38
|
+
function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
|
|
39
|
+
test.describe.configure({ mode: "serial" });
|
|
40
|
+
|
|
41
|
+
let surfaceRows = 0;
|
|
42
|
+
|
|
43
|
+
test("open a model tree with its surfaces expanded", async ({ window }) => {
|
|
44
|
+
test.slow();
|
|
45
|
+
await loadTestDatas(window, [brepFilename]);
|
|
46
|
+
await loadTestDatas(window, [structuralModelFilename]);
|
|
47
|
+
await expandMainObjectTree(window);
|
|
48
|
+
await openModelComponentsTree(window, brepGeodeObjectType, defaultDataName);
|
|
49
|
+
await expandMeshComponentType(window, "Surfaces");
|
|
50
|
+
await moveMouseOutOfTheWay(window);
|
|
51
|
+
surfaceRows = await getModelTreeRows(window).count();
|
|
52
|
+
await expect(getModelTreeToggles(window)).toHaveCount(1);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test("collapse the model tree from its button", async ({ window }) => {
|
|
56
|
+
await clickModelTreeBarButton(window, window.getByTestId("toggleModelTreeButton"));
|
|
57
|
+
await expect(getModelComponentsObjectTree(window)).toHaveCount(0);
|
|
58
|
+
await expect(getModelTreeToggles(window)).toHaveCount(1);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("show the model tree again with its state", async ({ window }) => {
|
|
62
|
+
await clickModelTreeBarButton(window, window.getByTestId("toggleModelTreeButton"));
|
|
63
|
+
await expect(getModelComponentsObjectTree(window)).toHaveCount(1);
|
|
64
|
+
await expect(getModelTreeRows(window)).toHaveCount(surfaceRows);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test("open a second model tree", async ({ window }) => {
|
|
68
|
+
await openModelComponentsTree(window, structuralModelGeodeObjectType, defaultDataName);
|
|
69
|
+
await expect(getModelComponentsObjectTree(window)).toHaveCount(2);
|
|
70
|
+
await expect(window.getByTestId("toggleAllModelTreesButton")).toBeVisible();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("collapse all the model trees", async ({ window }) => {
|
|
74
|
+
await clickModelTreeBarButton(window, window.getByTestId("toggleAllModelTreesButton"));
|
|
75
|
+
await expect(getModelComponentsObjectTree(window)).toHaveCount(0);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test("show all the model trees", async ({ window }) => {
|
|
79
|
+
await clickModelTreeBarButton(window, window.getByTestId("toggleAllModelTreesButton"));
|
|
80
|
+
await expect(getModelComponentsObjectTree(window)).toHaveCount(2);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test("reorder the model trees from their buttons", async ({ window }) => {
|
|
84
|
+
const before = await getModelTreePanelColors(window);
|
|
85
|
+
await dragModelTreeButton(window, 1, 0);
|
|
86
|
+
await expect
|
|
87
|
+
.poll(async () => {
|
|
88
|
+
const colors = await getModelTreePanelColors(window);
|
|
89
|
+
return colors;
|
|
90
|
+
})
|
|
91
|
+
.toStrictEqual(before.toReversed());
|
|
92
|
+
expect(await getModelTreeButtonColors(window)).toStrictEqual(before.toReversed());
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test("the search takes the keyboard as it opens", async ({ window }) => {
|
|
96
|
+
const mainObjectTree = getMainObjectTree(window);
|
|
97
|
+
await collapseMainObjectTreeGroup(window, brepGeodeObjectType);
|
|
98
|
+
await mainObjectTree.getByTestId("searchObjectsButton").click();
|
|
99
|
+
for (const key of ["t", "e", "s"]) {
|
|
100
|
+
// oxlint-disable-next-line no-await-in-loop -- one key after the other
|
|
101
|
+
await window.keyboard.press(key);
|
|
102
|
+
}
|
|
103
|
+
await expect(mainObjectTree.getByTestId("searchObjectsInput").locator("input")).toHaveValue(
|
|
104
|
+
"tes",
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test("clearing the search folds the groups back", async ({ window }) => {
|
|
109
|
+
const mainObjectTree = getMainObjectTree(window);
|
|
110
|
+
await fillSearchQuery(window, "", mainObjectTree);
|
|
111
|
+
await expect(
|
|
112
|
+
mainObjectTree.getByTestId("treeRowWrapper").filter({ hasText: defaultDataName }),
|
|
113
|
+
).toHaveCount(1);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test("leaving an empty search folds it back", async ({ window }) => {
|
|
117
|
+
const searchInput = getMainObjectTree(window)
|
|
118
|
+
.getByTestId("searchObjectsInput")
|
|
119
|
+
.locator("input");
|
|
120
|
+
await searchInput.blur();
|
|
121
|
+
await expect(searchInput).toBeHidden();
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { registerTests };
|