@geode/opengeodeweb-front 12.2.0-rc.1 → 12.2.0-rc.3

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.
Files changed (62) hide show
  1. package/.build/server/utils/microservices_process.js +1 -1
  2. package/.build/tests/browser/helpers/crs.js +136 -0
  3. package/.build/tests/browser/helpers/crs_flows.js +60 -0
  4. package/.build/tests/browser/helpers/crs_shortlist.js +13 -0
  5. package/.build/tests/browser/helpers/crs_test_data.js +40 -0
  6. package/.build/tests/browser/helpers/image.js +25 -0
  7. package/.build/tests/browser/suites/crs.js +142 -0
  8. package/.build/tests/browser/suites/crs_harmonize.js +63 -0
  9. package/.build/tests/browser/suites/crs_shortlist.js +31 -0
  10. package/.build/tests/browser/suites/image/raster_image.js +33 -0
  11. package/.build/tests/browser/suites/index.js +8 -0
  12. package/app/app.config.ts +4 -0
  13. package/app/components/CrsAlign.vue +207 -0
  14. package/app/components/CrsDialog.vue +400 -0
  15. package/app/components/CrsDialogHost.vue +66 -0
  16. package/app/components/CrsSelector.vue +100 -3
  17. package/app/components/PickButton.vue +43 -0
  18. package/app/components/ProjectCrsDialog.vue +109 -0
  19. package/app/components/ToolPanel.vue +5 -2
  20. package/app/components/Viewer/CrsOverlays.vue +29 -0
  21. package/app/components/Viewer/Image/ImageOptions.vue +67 -0
  22. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +3 -2
  23. package/app/components/Viewer/Ui.vue +3 -2
  24. package/app/composables/crs.ts +197 -0
  25. package/app/composables/crs_align.ts +206 -0
  26. package/app/composables/crs_assign.ts +102 -0
  27. package/app/composables/crs_link.ts +22 -0
  28. package/app/composables/crs_shortlist.ts +63 -0
  29. package/app/composables/hover_highlight.ts +6 -5
  30. package/app/composables/project_crs.ts +197 -0
  31. package/app/composables/use_overlapping_picker.ts +6 -1
  32. package/app/composables/user_setting.ts +140 -0
  33. package/app/stores/basemap.ts +19 -2
  34. package/app/stores/crs.ts +11 -106
  35. package/app/stores/crs_helpers/geographic_list.ts +44 -0
  36. package/app/stores/crs_helpers/project_crs.ts +60 -0
  37. package/app/stores/crs_helpers/requests.ts +60 -0
  38. package/app/stores/data_style.ts +12 -1
  39. package/app/stores/menu_helpers/image.ts +11 -0
  40. package/app/stores/menu_helpers/menus_data.ts +2 -0
  41. package/app/types/identifiers.ts +8 -0
  42. package/app/utils/crs.ts +17 -1
  43. package/app/utils/default_styles/images.ts +16 -0
  44. package/app/utils/default_styles/index.ts +3 -2
  45. package/app/utils/import_item.ts +87 -0
  46. package/app/utils/import_workflow.ts +36 -94
  47. package/app/utils/reload_object.ts +26 -0
  48. package/app/utils/threshold_sources.ts +5 -1
  49. package/internal/stores/data_style/image/index.ts +107 -0
  50. package/package.json +1 -1
  51. package/server/utils/microservices_process.ts +4 -1
  52. package/tests/browser/data/test_lambert93_no_crs.og_pts3d +0 -0
  53. package/tests/browser/data/test_utm31n.og_pts3d +0 -0
  54. package/tests/browser/helpers/crs.ts +250 -0
  55. package/tests/browser/helpers/crs_flows.ts +115 -0
  56. package/tests/browser/helpers/crs_shortlist.ts +27 -0
  57. package/tests/browser/helpers/crs_test_data.ts +34 -0
  58. package/tests/browser/helpers/image.ts +33 -0
  59. package/tests/browser/suites/crs.ts +228 -0
  60. package/tests/browser/suites/crs_harmonize.ts +96 -0
  61. package/tests/browser/suites/crs_shortlist.ts +37 -0
  62. package/tests/browser/suites/image/raster_image.ts +40 -0
@@ -37,7 +37,7 @@ async function runScript(execPath, execName, args, expectedResponse, timeoutSeco
37
37
  }
38
38
  }
39
39
  function isPortInUseError(error) {
40
- return /EADDRINUSE|address already in use|port already in use/iu.test(String(error));
40
+ return /EADDRINUSE|address already in use|port already in use|only one usage of each socket address/iu.test(String(error));
41
41
  }
42
42
  function resolveUploadFolderPath(projectFolderPath, uploadFolderPath) {
43
43
  if (uploadFolderPath !== void 0 && uploadFolderPath !== "") return uploadFolderPath;
@@ -0,0 +1,136 @@
1
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
2
+ import { closeFeedbackSnackbar, moveMouseOutOfTheWay } from "./app_interaction.js";
3
+ import { expandGeodeObjectTypeInTree, getTreeRowByTextAndParent } from "./object_trees/common.js";
4
+ import { getMainObjectTree } from "./object_trees/main_object_tree.js";
5
+ import { expect } from "@playwright/test";
6
+ //#region tests/browser/helpers/crs.ts
7
+ const TOOLTIP_TIMEOUT_MS = 2e3;
8
+ const TOOLTIP_HOVER_ATTEMPTS = 3;
9
+ async function getDataTreeRow(window, geodeObjectType, dataName) {
10
+ const tree = getMainObjectTree(window);
11
+ await expandGeodeObjectTypeInTree(window, geodeObjectType, tree);
12
+ return getTreeRowByTextAndParent(window, geodeObjectType, dataName, tree);
13
+ }
14
+ async function hoverTreeRowTooltip(window, row, target) {
15
+ for (let attempt = 1; attempt <= TOOLTIP_HOVER_ATTEMPTS; attempt += 1) {
16
+ await moveMouseOutOfTheWay(window);
17
+ await row.getByTestId("treeItemLabel").first().hover();
18
+ if (await target.waitFor({
19
+ state: "visible",
20
+ timeout: TOOLTIP_TIMEOUT_MS
21
+ }).then(() => true).catch(() => false)) return;
22
+ }
23
+ throw new Error(`The tree tooltip did not open after ${TOOLTIP_HOVER_ATTEMPTS} hovers`);
24
+ }
25
+ async function openCrsFromTree(window, geodeObjectType, dataName) {
26
+ const row = await getDataTreeRow(window, geodeObjectType, dataName);
27
+ const editButton = window.locator(".v-overlay--active").getByTestId("editCrsBtn");
28
+ await hoverTreeRowTooltip(window, row, editButton);
29
+ await editButton.click();
30
+ await waitForActionSettled(window);
31
+ }
32
+ async function expectTreeCrs(window, geodeObjectType, dataName, expected) {
33
+ const row = await getDataTreeRow(window, geodeObjectType, dataName);
34
+ const crsValue = window.locator(".v-overlay--active").getByTestId("tooltipCrsValue");
35
+ await hoverTreeRowTooltip(window, row, crsValue);
36
+ await expect(crsValue).toContainText(expected);
37
+ }
38
+ async function openCrsFromInfoCard(window, geodeObjectType, dataName) {
39
+ await (await getDataTreeRow(window, geodeObjectType, dataName)).click({ button: "right" });
40
+ await waitForActionSettled(window);
41
+ await window.getByTestId("circularMenuCenterButton").click();
42
+ await window.getByTestId("infoEditCrsBtn").click();
43
+ await waitForActionSettled(window);
44
+ }
45
+ async function openCrsFromWarning(window, geodeObjectType, dataName) {
46
+ await (await getDataTreeRow(window, geodeObjectType, dataName)).getByTestId("crsMismatchIcon").click();
47
+ await waitForActionSettled(window);
48
+ }
49
+ async function openCrsFromFeedback(window, text) {
50
+ const snackbar = window.getByTestId("feedbackSnackbar").filter({ hasText: text });
51
+ await expect(snackbar).toBeVisible();
52
+ await snackbar.getByTestId("feedbackActionBtn").click();
53
+ await waitForActionSettled(window);
54
+ }
55
+ async function selectCrs(window, crsName) {
56
+ await window.getByTestId("crsSearchInput").locator("input").fill(crsName);
57
+ await window.locator("tbody tr").filter({ hasText: crsName }).first().click();
58
+ await waitForActionSettled(window);
59
+ }
60
+ async function confirmAssign(window) {
61
+ await window.getByTestId("crsAssignButton").click();
62
+ await waitForActionSettled(window);
63
+ await closeFeedbackSnackbar(window);
64
+ }
65
+ async function expectCurrentCrs(window, expected) {
66
+ await expect(window.getByTestId("crsCurrentValue")).toContainText(expected);
67
+ }
68
+ async function selectAssignMode(window) {
69
+ await window.getByTestId("crsModeAssign").click();
70
+ await waitForActionSettled(window);
71
+ }
72
+ async function clickAssign(window) {
73
+ await window.getByTestId("crsAssignButton").click();
74
+ await waitForActionSettled(window);
75
+ }
76
+ const FEEDBACK_TIMEOUT_MS = 6e4;
77
+ async function expectFeedback(window, text, action) {
78
+ const shown = window.getByTestId("feedbackSnackbar").filter({ hasText: text }).first().waitFor({
79
+ state: "visible",
80
+ timeout: FEEDBACK_TIMEOUT_MS
81
+ });
82
+ await Promise.all([shown, action()]);
83
+ await closeFeedbackSnackbar(window);
84
+ }
85
+ async function selectConvertMode(window) {
86
+ await window.getByTestId("crsModeConvert").click();
87
+ await waitForActionSettled(window);
88
+ }
89
+ async function confirmConvert(window) {
90
+ await window.getByTestId("crsConvertButton").click();
91
+ await waitForActionSettled(window);
92
+ await closeFeedbackSnackbar(window);
93
+ }
94
+ async function startAlignment(window) {
95
+ await window.getByTestId("crsModeAlign").click();
96
+ await window.getByTestId("crsStartAlignButton").click();
97
+ await waitForActionSettled(window);
98
+ await moveMouseOutOfTheWay(window);
99
+ }
100
+ async function fillAlignPoints(window, prefix, points) {
101
+ for (const [index, { x, y }] of points.entries()) {
102
+ const inputs = window.getByTestId(`${prefix}-${index}`).locator("input");
103
+ await inputs.nth(0).fill(String(x));
104
+ await inputs.nth(1).fill(String(y));
105
+ }
106
+ }
107
+ async function selectAlignmentCrs(window, crsName) {
108
+ const panel = window.getByTestId("crsAlignPanel");
109
+ await panel.getByTestId("crsSearchInput").locator("input").fill(crsName);
110
+ await panel.locator("tbody tr").filter({ hasText: crsName }).first().click();
111
+ await waitForActionSettled(window);
112
+ }
113
+ async function selectScope(window, scope, testId = "crsScope") {
114
+ await window.getByTestId(`${testId}-${scope}`).locator("input").check();
115
+ await waitForActionSettled(window);
116
+ }
117
+ async function expectCrsMismatch(window, geodeObjectType, dataName, expected) {
118
+ const row = await getDataTreeRow(window, geodeObjectType, dataName);
119
+ await expect(row.getByTestId("crsMismatchIcon")).toHaveCount(expected ? 1 : 0);
120
+ }
121
+ async function openProjectCrs(window) {
122
+ await window.getByTestId("projectCrs").click();
123
+ await waitForActionSettled(window);
124
+ }
125
+ async function confirmProjectCrs(window) {
126
+ await window.getByTestId("projectCrsApply").click();
127
+ await waitForActionSettled(window);
128
+ await closeFeedbackSnackbar(window);
129
+ }
130
+ async function applyAlignment(window) {
131
+ await window.getByTestId("crsAlignApplyButton").click();
132
+ await waitForActionSettled(window);
133
+ await closeFeedbackSnackbar(window);
134
+ }
135
+ //#endregion
136
+ export { applyAlignment, clickAssign, confirmAssign, confirmConvert, confirmProjectCrs, expectCrsMismatch, expectCurrentCrs, expectFeedback, expectTreeCrs, fillAlignPoints, openCrsFromFeedback, openCrsFromInfoCard, openCrsFromTree, openCrsFromWarning, openProjectCrs, selectAlignmentCrs, selectAssignMode, selectConvertMode, selectCrs, selectScope, startAlignment };
@@ -0,0 +1,60 @@
1
+ import { brepGeodeObjectType, edgedCurveGeodeObjectType, pointSetGeodeObjectType } from "./constants.js";
2
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
3
+ import { closeFeedbackSnackbar, moveMouseOutOfTheWay } from "./app_interaction.js";
4
+ import { getMainObjectTree } from "./object_trees/main_object_tree.js";
5
+ import { applyAlignment, clickAssign, confirmConvert, expectFeedback, expectTreeCrs, fillAlignPoints, openCrsFromTree, selectAlignmentCrs, selectAssignMode, selectConvertMode, selectCrs, selectScope } from "./crs.js";
6
+ import { BREP_NAME, CURVE_NAME, POINTSET_NAME } from "./crs_test_data.js";
7
+ import { expect } from "@playwright/test";
8
+ //#region tests/browser/helpers/crs_flows.ts
9
+ async function closeCrsDialog(window) {
10
+ await window.keyboard.press("Escape");
11
+ await moveMouseOutOfTheWay(window);
12
+ }
13
+ async function expectEveryRowCrs(window, expected) {
14
+ await expectTreeCrs(window, pointSetGeodeObjectType, POINTSET_NAME, expected);
15
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, expected);
16
+ await expectTreeCrs(window, edgedCurveGeodeObjectType, CURVE_NAME, expected);
17
+ }
18
+ async function fillAlignment(window, source, target, crsName) {
19
+ await fillAlignPoints(window, "crsAlignSource", source);
20
+ await fillAlignPoints(window, "crsAlignTarget", target);
21
+ await selectAlignmentCrs(window, crsName);
22
+ await moveMouseOutOfTheWay(window);
23
+ }
24
+ async function convertAloneTo(window, geodeObjectType, dataName, crsName) {
25
+ await openCrsFromTree(window, geodeObjectType, dataName);
26
+ await selectConvertMode(window);
27
+ await selectScope(window, "one");
28
+ await selectCrs(window, crsName);
29
+ await confirmConvert(window);
30
+ await moveMouseOutOfTheWay(window);
31
+ }
32
+ async function startMisfitAssign(window, geodeObjectType, dataName, crsName) {
33
+ await openCrsFromTree(window, geodeObjectType, dataName);
34
+ await selectAssignMode(window);
35
+ await selectCrs(window, crsName);
36
+ await clickAssign(window);
37
+ }
38
+ async function assignAnywayToAll(window, crsName) {
39
+ await selectAssignMode(window);
40
+ await selectScope(window, "all");
41
+ await selectCrs(window, crsName);
42
+ await clickAssign(window);
43
+ await window.getByTestId("crsAssignAnyway").click();
44
+ await waitForActionSettled(window);
45
+ await closeFeedbackSnackbar(window);
46
+ await moveMouseOutOfTheWay(window);
47
+ }
48
+ async function applyAlignmentOffTheMap(window) {
49
+ const basemapRow = getMainObjectTree(window).getByTestId("treeRowWrapper").filter({ hasText: "Basemap" });
50
+ if (await basemapRow.count() === 0) {
51
+ await applyAlignment(window);
52
+ return;
53
+ }
54
+ await expectFeedback(window, "Area outside the map projection limits", async () => {
55
+ await applyAlignment(window);
56
+ });
57
+ await expect(basemapRow.getByTestId("hiddenObjectEyeButton")).toBeVisible();
58
+ }
59
+ //#endregion
60
+ export { applyAlignmentOffTheMap, assignAnywayToAll, closeCrsDialog, convertAloneTo, expectEveryRowCrs, fillAlignment, startMisfitAssign };
@@ -0,0 +1,13 @@
1
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
2
+ import { expect } from "@playwright/test";
3
+ //#region tests/browser/helpers/crs_shortlist.ts
4
+ async function toggleFavoriteCrs(window, crsName) {
5
+ await window.getByTestId("crsSearchInput").locator("input").fill(crsName);
6
+ await window.locator("tbody tr").filter({ hasText: crsName }).first().getByTestId("crsFavoriteToggle").click();
7
+ await waitForActionSettled(window);
8
+ }
9
+ async function expectCrsChip(window, kind, code) {
10
+ await expect(window.getByTestId(kind).filter({ hasText: code })).toBeVisible();
11
+ }
12
+ //#endregion
13
+ export { expectCrsChip, toggleFavoriteCrs };
@@ -0,0 +1,40 @@
1
+ //#region tests/browser/helpers/crs_test_data.ts
2
+ const BREP_FILE = "test.og_brep";
3
+ const POINTSET_FILE = "test.og_pts3d";
4
+ const CURVE_FILE = "test.og_edc3d";
5
+ const POINTSET_NAME = "test";
6
+ const BREP_NAME = "test";
7
+ const CURVE_NAME = "test";
8
+ const LAMBERT_93 = "RGF93 v1 / Lambert-93";
9
+ const UTM_31N = "WGS 84 / UTM zone 31N";
10
+ const CC42 = "RGF93 v1 / CC42";
11
+ const ALIGN_SOURCE = [
12
+ {
13
+ x: 0,
14
+ y: 0
15
+ },
16
+ {
17
+ x: 1,
18
+ y: 0
19
+ },
20
+ {
21
+ x: 0,
22
+ y: 1
23
+ }
24
+ ];
25
+ const ALIGN_TARGET = [
26
+ {
27
+ x: 7e5,
28
+ y: 66e5
29
+ },
30
+ {
31
+ x: 700010,
32
+ y: 66e5
33
+ },
34
+ {
35
+ x: 7e5,
36
+ y: 6600010
37
+ }
38
+ ];
39
+ //#endregion
40
+ export { ALIGN_SOURCE, ALIGN_TARGET, BREP_FILE, BREP_NAME, CC42, CURVE_FILE, CURVE_NAME, LAMBERT_93, POINTSET_FILE, POINTSET_NAME, UTM_31N };
@@ -0,0 +1,25 @@
1
+ import { waitForActionSettled } from "./wait_for_action_settled.js";
2
+ import { moveMouseOutOfTheWay } from "./app_interaction.js";
3
+ import { openDataContextMenu } from "./object_trees/main_object_tree.js";
4
+ import { ensureMenuOpen } from "./viewer_menu.js";
5
+ import "./viewer_interaction.js";
6
+ //#region tests/browser/helpers/image.ts
7
+ const IMAGE_MENU_TEST_ID = "imageMenu";
8
+ async function openImageMenu(window, geodeObjectType, dataName) {
9
+ await openDataContextMenu(window, geodeObjectType, dataName);
10
+ await ensureMenuOpen(window, IMAGE_MENU_TEST_ID);
11
+ }
12
+ async function setImageOpacity(window, opacity) {
13
+ await ensureMenuOpen(window, IMAGE_MENU_TEST_ID);
14
+ const track = window.getByTestId("imageOpacitySlider").locator(".v-slider").first();
15
+ const box = await track.boundingBox();
16
+ if (!box) throw new Error("Could not get bounding box of the image opacity slider");
17
+ await track.click({ position: {
18
+ x: box.width * opacity,
19
+ y: box.height / 2
20
+ } });
21
+ await moveMouseOutOfTheWay(window);
22
+ await waitForActionSettled(window);
23
+ }
24
+ //#endregion
25
+ export { IMAGE_MENU_TEST_ID, openImageMenu, setImageOpacity };
@@ -0,0 +1,142 @@
1
+ import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { brepGeodeObjectType, edgedCurveGeodeObjectType, pointSetGeodeObjectType } from "../helpers/constants.js";
3
+ import { waitForActionSettled } from "../helpers/wait_for_action_settled.js";
4
+ import { closeFeedbackSnackbar, moveMouseOutOfTheWay } from "../helpers/app_interaction.js";
5
+ import { applyAlignment, confirmAssign, confirmConvert, confirmProjectCrs, expectCrsMismatch, expectCurrentCrs, expectFeedback, expectTreeCrs, openCrsFromInfoCard, openCrsFromTree, openCrsFromWarning, openProjectCrs, selectConvertMode, selectCrs, startAlignment } from "../helpers/crs.js";
6
+ import { ALIGN_SOURCE, ALIGN_TARGET, BREP_FILE, BREP_NAME, CC42, CURVE_FILE, CURVE_NAME, LAMBERT_93, POINTSET_FILE, POINTSET_NAME, UTM_31N } from "../helpers/crs_test_data.js";
7
+ import { applyAlignmentOffTheMap, assignAnywayToAll, closeCrsDialog, convertAloneTo, expectEveryRowCrs, fillAlignment, startMisfitAssign } from "../helpers/crs_flows.js";
8
+ import { expect } from "@playwright/test";
9
+ //#region tests/browser/suites/crs.ts
10
+ var crs_exports = /* @__PURE__ */ __exportAll({ registerTests: () => registerTests });
11
+ function registerTests({ test, loadTestDatas }) {
12
+ test.describe.configure({ mode: "serial" });
13
+ test("load objects", async ({ window }) => {
14
+ await loadTestDatas(window, [BREP_FILE]);
15
+ await loadTestDatas(window, [POINTSET_FILE]);
16
+ });
17
+ test("open the crs dialog of the point set", async ({ window }) => {
18
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
19
+ await expectCurrentCrs(window, "None (local coordinates)");
20
+ });
21
+ test("select a crs to assign", async ({ window }) => {
22
+ await selectCrs(window, LAMBERT_93);
23
+ });
24
+ test("assign the selected crs", async ({ window }) => {
25
+ await confirmAssign(window);
26
+ await expectTreeCrs(window, pointSetGeodeObjectType, POINTSET_NAME, "EPSG:2154");
27
+ await moveMouseOutOfTheWay(window);
28
+ });
29
+ test("current crs is the assigned one", async ({ window }) => {
30
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
31
+ await expectCurrentCrs(window, "EPSG:2154");
32
+ });
33
+ test("open the convert mode", async ({ window }) => {
34
+ await selectConvertMode(window);
35
+ });
36
+ test("select a crs to convert to", async ({ window }) => {
37
+ await selectCrs(window, UTM_31N);
38
+ });
39
+ test("convert to the selected crs", async ({ window }) => {
40
+ await confirmConvert(window);
41
+ await expectTreeCrs(window, pointSetGeodeObjectType, POINTSET_NAME, "EPSG:32631");
42
+ await moveMouseOutOfTheWay(window);
43
+ });
44
+ test("load a curve sharing the model frame", async ({ window }) => {
45
+ await expectFeedback(window, "these coordinates do not match EPSG:32631", async () => {
46
+ await loadTestDatas(window, [CURVE_FILE]);
47
+ });
48
+ await moveMouseOutOfTheWay(window);
49
+ });
50
+ test("open the alignment panel", async ({ window }) => {
51
+ await openCrsFromTree(window, brepGeodeObjectType, BREP_NAME);
52
+ await startAlignment(window);
53
+ await expect(window.getByTestId("crsAlignPanel")).toBeVisible();
54
+ });
55
+ test("fill the affine alignment points and target crs", async ({ window }) => {
56
+ await fillAlignment(window, ALIGN_SOURCE, ALIGN_TARGET, LAMBERT_93);
57
+ });
58
+ test("apply the alignment", async ({ window }) => {
59
+ test.slow();
60
+ await applyAlignmentOffTheMap(window);
61
+ await closeFeedbackSnackbar(window);
62
+ await moveMouseOutOfTheWay(window);
63
+ });
64
+ test("current crs is the project one", async ({ window }) => {
65
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:32631");
66
+ await expectTreeCrs(window, edgedCurveGeodeObjectType, CURVE_NAME, "EPSG:32631");
67
+ await moveMouseOutOfTheWay(window);
68
+ });
69
+ test("re-align this data only", async ({ window }) => {
70
+ await openCrsFromTree(window, brepGeodeObjectType, BREP_NAME);
71
+ await startAlignment(window);
72
+ await expect(window.getByTestId("crsAlignScope-one").locator("input")).toBeChecked();
73
+ await fillAlignment(window, ALIGN_SOURCE, ALIGN_TARGET, LAMBERT_93);
74
+ await applyAlignment(window);
75
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:32631");
76
+ await moveMouseOutOfTheWay(window);
77
+ });
78
+ test("no data is flagged once every data follows the project", async ({ window }) => {
79
+ await expectCrsMismatch(window, brepGeodeObjectType, BREP_NAME, false);
80
+ await expectCrsMismatch(window, pointSetGeodeObjectType, POINTSET_NAME, false);
81
+ await moveMouseOutOfTheWay(window);
82
+ });
83
+ test("open the crs dialog from the object tree", async ({ window }) => {
84
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
85
+ await expectCurrentCrs(window, "EPSG:32631");
86
+ });
87
+ test("close the crs dialog opened from the object tree", async ({ window }) => {
88
+ await closeCrsDialog(window);
89
+ });
90
+ test("open the crs dialog from the info card", async ({ window }) => {
91
+ await openCrsFromInfoCard(window, pointSetGeodeObjectType, POINTSET_NAME);
92
+ await expectCurrentCrs(window, "EPSG:32631");
93
+ });
94
+ test("close the crs dialog opened from the info card", async ({ window }) => {
95
+ await closeCrsDialog(window);
96
+ });
97
+ test("convert the model alone", async ({ window }) => {
98
+ await convertAloneTo(window, brepGeodeObjectType, BREP_NAME, LAMBERT_93);
99
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:2154");
100
+ await expectTreeCrs(window, edgedCurveGeodeObjectType, CURVE_NAME, "EPSG:32631");
101
+ await moveMouseOutOfTheWay(window);
102
+ });
103
+ test("the model out of the project crs is flagged in the tree", async ({ window }) => {
104
+ await expectCrsMismatch(window, brepGeodeObjectType, BREP_NAME, true);
105
+ await moveMouseOutOfTheWay(window);
106
+ });
107
+ test("the warning opens the crs dialog of the model", async ({ window }) => {
108
+ await openCrsFromWarning(window, brepGeodeObjectType, BREP_NAME);
109
+ await expectCurrentCrs(window, "EPSG:2154");
110
+ await closeCrsDialog(window);
111
+ });
112
+ test("open the project crs from the scene", async ({ window }) => {
113
+ await openProjectCrs(window);
114
+ await moveMouseOutOfTheWay(window);
115
+ });
116
+ test("change the project crs", async ({ window }) => {
117
+ await selectCrs(window, LAMBERT_93);
118
+ await confirmProjectCrs(window);
119
+ await moveMouseOutOfTheWay(window);
120
+ await expectCrsMismatch(window, pointSetGeodeObjectType, POINTSET_NAME, false);
121
+ });
122
+ test("every data is in the project crs", async ({ window }) => {
123
+ await expectEveryRowCrs(window, "EPSG:2154");
124
+ await moveMouseOutOfTheWay(window);
125
+ });
126
+ test("relabeling a georeferenced data with a misfit crs asks first", async ({ window }) => {
127
+ await startMisfitAssign(window, brepGeodeObjectType, BREP_NAME, CC42);
128
+ await expect(window.getByTestId("crsAssignMismatch")).toContainText("Did you mean Convert?");
129
+ });
130
+ test("convert instead switches to convert", async ({ window }) => {
131
+ await window.getByTestId("crsConvertInstead").click();
132
+ await waitForActionSettled(window);
133
+ await expect(window.getByTestId("crsConvertButton")).toBeVisible();
134
+ });
135
+ test("assign anyway to all data", async ({ window }) => {
136
+ await assignAnywayToAll(window, CC42);
137
+ await expectEveryRowCrs(window, "EPSG:3942");
138
+ await moveMouseOutOfTheWay(window);
139
+ });
140
+ }
141
+ //#endregion
142
+ export { crs_exports, registerTests };
@@ -0,0 +1,63 @@
1
+ import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { brepGeodeObjectType, pointSetGeodeObjectType } from "../helpers/constants.js";
3
+ import { moveMouseOutOfTheWay } from "../helpers/app_interaction.js";
4
+ import { clickAssign, confirmAssign, expectCrsMismatch, expectCurrentCrs, expectFeedback, expectTreeCrs, openCrsFromTree, openCrsFromWarning, selectCrs } from "../helpers/crs.js";
5
+ import { BREP_FILE, BREP_NAME, LAMBERT_93 } from "../helpers/crs_test_data.js";
6
+ //#region tests/browser/suites/crs_harmonize.ts
7
+ var crs_harmonize_exports = /* @__PURE__ */ __exportAll({ registerTests: () => registerTests });
8
+ const LAMBERT_FILE = "test_lambert93_no_crs.og_pts3d";
9
+ const LAMBERT_NAME = "test_lambert93_no_crs";
10
+ const UTM_FILE = "test_utm31n.og_pts3d";
11
+ const UTM_NAME = "test_utm31n";
12
+ const LOCAL_FILE = "test.og_pts3d";
13
+ const LOCAL_NAME = "test";
14
+ function registerTests({ test, loadTestDatas }) {
15
+ test.describe.configure({ mode: "serial" });
16
+ test("load a model", async ({ window }) => {
17
+ await loadTestDatas(window, [BREP_FILE]);
18
+ });
19
+ test("assign a crs to the model", async ({ window }) => {
20
+ await openCrsFromTree(window, brepGeodeObjectType, BREP_NAME);
21
+ await selectCrs(window, LAMBERT_93);
22
+ await confirmAssign(window);
23
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:2154");
24
+ await moveMouseOutOfTheWay(window);
25
+ });
26
+ test("imported data without crs take the project crs", async ({ window }) => {
27
+ await expectFeedback(window, `EPSG:2154 assigned: ${LAMBERT_NAME}`, async () => {
28
+ await loadTestDatas(window, [LAMBERT_FILE]);
29
+ });
30
+ await expectTreeCrs(window, pointSetGeodeObjectType, LAMBERT_NAME, "EPSG:2154");
31
+ await moveMouseOutOfTheWay(window);
32
+ });
33
+ test("imported data in another crs are converted to the project crs", async ({ window }) => {
34
+ await expectFeedback(window, `Converted to EPSG:2154: ${UTM_NAME}`, async () => {
35
+ await loadTestDatas(window, [UTM_FILE]);
36
+ });
37
+ await expectTreeCrs(window, pointSetGeodeObjectType, UTM_NAME, "EPSG:2154");
38
+ await moveMouseOutOfTheWay(window);
39
+ });
40
+ test("imported data that fit no crs are flagged in the tree", async ({ window }) => {
41
+ await expectFeedback(window, `${LOCAL_NAME}: these coordinates do not match EPSG:2154`, async () => {
42
+ await loadTestDatas(window, [LOCAL_FILE]);
43
+ });
44
+ await expectCrsMismatch(window, pointSetGeodeObjectType, LOCAL_NAME, true);
45
+ await moveMouseOutOfTheWay(window);
46
+ });
47
+ test("open the crs dialog from the warning", async ({ window }) => {
48
+ await openCrsFromWarning(window, pointSetGeodeObjectType, LOCAL_NAME);
49
+ await expectCurrentCrs(window, "None (local coordinates)");
50
+ });
51
+ test("select the project crs", async ({ window }) => {
52
+ await selectCrs(window, LAMBERT_93);
53
+ });
54
+ test("assign the project crs to the data", async ({ window }) => {
55
+ await expectFeedback(window, "Georeference the data?", async () => {
56
+ await clickAssign(window);
57
+ });
58
+ await expectCrsMismatch(window, pointSetGeodeObjectType, LOCAL_NAME, false);
59
+ await moveMouseOutOfTheWay(window);
60
+ });
61
+ }
62
+ //#endregion
63
+ export { crs_harmonize_exports, registerTests };
@@ -0,0 +1,31 @@
1
+ import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { pointSetGeodeObjectType } from "../helpers/constants.js";
3
+ import { confirmAssign, openCrsFromTree, selectCrs } from "../helpers/crs.js";
4
+ import { LAMBERT_93, POINTSET_FILE, POINTSET_NAME, UTM_31N } from "../helpers/crs_test_data.js";
5
+ import { closeCrsDialog } from "../helpers/crs_flows.js";
6
+ import { expectCrsChip, toggleFavoriteCrs } from "../helpers/crs_shortlist.js";
7
+ //#region tests/browser/suites/crs_shortlist.ts
8
+ var crs_shortlist_exports = /* @__PURE__ */ __exportAll({ registerTests: () => registerTests });
9
+ function registerTests({ test, loadTestDatas }) {
10
+ test.describe.configure({ mode: "serial" });
11
+ test("load a point set", async ({ window }) => {
12
+ await loadTestDatas(window, [POINTSET_FILE]);
13
+ });
14
+ test("a starred crs becomes a favorite chip", async ({ window }) => {
15
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
16
+ await toggleFavoriteCrs(window, UTM_31N);
17
+ await expectCrsChip(window, "crsFavoriteChip", "EPSG:32631");
18
+ });
19
+ test("assign a crs", async ({ window }) => {
20
+ await selectCrs(window, LAMBERT_93);
21
+ await confirmAssign(window);
22
+ });
23
+ test("the favorite and the assigned crs come back as chips", async ({ window }) => {
24
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
25
+ await expectCrsChip(window, "crsFavoriteChip", "EPSG:32631");
26
+ await expectCrsChip(window, "crsRecentChip", "EPSG:2154");
27
+ await closeCrsDialog(window);
28
+ });
29
+ }
30
+ //#endregion
31
+ export { crs_shortlist_exports, registerTests };
@@ -0,0 +1,33 @@
1
+ import { __exportAll } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { closeAllMenus } from "../../helpers/app_interaction.js";
3
+ import { expandMainObjectTree } from "../../helpers/object_trees/main_object_tree.js";
4
+ import { setVisibilityGeneric } from "../../helpers/viewer_menu.js";
5
+ import "../../helpers/viewer_interaction.js";
6
+ import { IMAGE_MENU_TEST_ID, openImageMenu, setImageOpacity } from "../../helpers/image.js";
7
+ //#region tests/browser/suites/image/raster_image.ts
8
+ var raster_image_exports = /* @__PURE__ */ __exportAll({ registerTests: () => registerTests });
9
+ const inputFilename = "test_texture.png";
10
+ const dataName = "test_texture";
11
+ const geodeObjectType = "RasterImage2D";
12
+ const halfOpacity = .5;
13
+ function registerTests({ test, loadTestDatas }) {
14
+ test.describe.configure({ mode: "serial" });
15
+ test("load shows the image colors", async ({ window }) => {
16
+ await loadTestDatas(window, [inputFilename]);
17
+ await expandMainObjectTree(window);
18
+ });
19
+ test("image menu", async ({ window }) => {
20
+ await openImageMenu(window, geodeObjectType, dataName);
21
+ });
22
+ test("image opacity", async ({ window }) => {
23
+ await setImageOpacity(window, halfOpacity);
24
+ });
25
+ test("image hidden", async ({ window }) => {
26
+ await setVisibilityGeneric(window, IMAGE_MENU_TEST_ID, "imageVisibilitySwitch", false);
27
+ });
28
+ test("close image menu", async ({ window }) => {
29
+ await closeAllMenus(window);
30
+ });
31
+ }
32
+ //#endregion
33
+ export { raster_image_exports, registerTests };
@@ -1,4 +1,8 @@
1
+ import { crs_exports } from "./crs.js";
2
+ import { crs_harmonize_exports } from "./crs_harmonize.js";
3
+ import { crs_shortlist_exports } from "./crs_shortlist.js";
1
4
  import { grid_scale_exports } from "./grid_scale.js";
5
+ import { raster_image_exports } from "./image/raster_image.js";
2
6
  import { edged_curve_exports } from "./mesh/edged_curve.js";
3
7
  import { grid2d_exports } from "./mesh/grid2d.js";
4
8
  import { grid3d_exports } from "./mesh/grid3d.js";
@@ -24,7 +28,11 @@ import { time_series_exports } from "./time_series.js";
24
28
  //#region tests/browser/suites/index.ts
25
29
  const SUITE_PATH_REGEX = /^\.\/(?<name>.+)\.ts$/u;
26
30
  const suites = Object.fromEntries(Object.entries(/* @__PURE__ */ Object.assign({
31
+ "./crs.ts": crs_exports,
32
+ "./crs_harmonize.ts": crs_harmonize_exports,
33
+ "./crs_shortlist.ts": crs_shortlist_exports,
27
34
  "./grid_scale.ts": grid_scale_exports,
35
+ "./image/raster_image.ts": raster_image_exports,
28
36
  "./mesh/edged_curve.ts": edged_curve_exports,
29
37
  "./mesh/grid2d.ts": grid2d_exports,
30
38
  "./mesh/grid3d.ts": grid3d_exports,
package/app/app.config.ts CHANGED
@@ -6,6 +6,8 @@ declare module "nuxt/schema" {
6
6
  ogwFront?: {
7
7
  chromeTheme?: ChromeTheme;
8
8
  orientationOverlay?: boolean;
9
+ // Map or satellite view under the georeferenced data, see stores/basemap.ts
10
+ basemap?: boolean;
9
11
  // Colors ({ red, green, blue, alpha }) of a new or reset scene, see plugins/scene_colors.ts
10
12
  sceneColors?: SceneColors;
11
13
  };
@@ -22,6 +24,8 @@ export default defineAppConfig({
22
24
  // Draw the orientation marker (axes or compass) as a front overlay instead of the viewer's VTK
23
25
  // Marker, which is then hidden (see composables/orientation_overlay.ts).
24
26
  orientationOverlay: false,
27
+ // Offer the basemap (a map or satellite view under the data in the project CRS)
28
+ basemap: false,
25
29
  // Colors of a new or reset scene, the OpenGeodeWeb ones when not set (see utils/default_styles)
26
30
  sceneColors: {},
27
31
  },