Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/Stepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const { steps, current_step_index } = toRefs(stepper_tree);
@update:model-value="current_step_index = $event - 1"
flat
non-linear
class="pa-0 ma-0 bg-transparent rounded-xl overflow-hidden custom-stepper flex-grow-1"
class="pa-0 ma-0 bg-transparent rounded-xl overflow-y-auto custom-stepper flex-grow-1"
>
<Step
v-for="(step, index) in steps"
Expand Down
2 changes: 1 addition & 1 deletion app/composables/project_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import fileDownload from "js-file-download";
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";

import { importWorkflowFromSnapshot } from "@ogw_front/utils/file_import_workflow";
import { importWorkflowFromSnapshot } from "@ogw_front/utils/import_workflow";

import { useAppStore } from "@ogw_front/stores/app";
import { useDataStore } from "@ogw_front/stores/data";
Expand All @@ -10,11 +10,11 @@
import { useGeodeStore } from "@ogw_front/stores/geode";
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
import { useTreeviewStore } from "@ogw_front/stores/treeview";
import { useViewerStore } from "@ogw_front/stores/viewer";

Check warning on line 13 in app/composables/project_manager.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-import(max-dependencies)

File has too many dependencies (11). Maximum allowed is 10.

export function useProjectManager() {
async function exportProject() {
console.log("[export triggered]");

Check warning on line 17 in app/composables/project_manager.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
const appStore = useAppStore();
const geodeStore = useGeodeStore();
const snapshot = await appStore.exportStores();
Expand All @@ -30,71 +30,71 @@
return { result };
}

async function importProjectFile(file) {
const geodeStore = useGeodeStore();
const dataStyleStore = useDataStyleStore();
const viewerStore = useViewerStore();
const dataStore = useDataStore();
const treeviewStore = useTreeviewStore();
const hybridViewerStore = useHybridViewerStore();

await viewerStore.ws_connect();

const { client } = viewerStore;
if (client && client.getConnection && client.getConnection().getSession) {
await client.getConnection().getSession().call("opengeodeweb_viewer.release_database", [{}]);
}

await viewerStore.request(
viewer_schemas.opengeodeweb_viewer.viewer.reset_visualization,
{},
undefined,
);

treeviewStore.clear();
dataStore.clear();
hybridViewerStore.clear();

const schemaImport = back_schemas.opengeodeweb_back.import_project;
const form = new FormData();
const originalFileName = file && file.name ? file.name : "project.vease";
if (!originalFileName.toLowerCase().endsWith(".vease")) {
throw new Error("Uploaded file must be a .vease");
}
form.append("file", file, originalFileName);

const result = await $fetch(schemaImport.$id, {
baseURL: geodeStore.base_url,
method: "POST",
body: form,
});
const snapshot = result && result.snapshot ? result.snapshot : {};

treeviewStore.isImporting = true;

const { client: client2 } = viewerStore;
if (client2 && client2.getConnection && client2.getConnection().getSession) {
await client2.getConnection().getSession().call("opengeodeweb_viewer.import_project", [{}]);
}

await treeviewStore.importStores(snapshot.treeview || {});
await hybridViewerStore.initHybridViewer();
await hybridViewerStore.importStores(snapshot.hybridViewer || {});

const items = snapshot?.data?.items || [];

await importWorkflowFromSnapshot(items);
await hybridViewerStore.importStores(snapshot.hybridViewer || {});
{
await dataStyleStore.importStores(snapshot.dataStyle || {});
}
{
await dataStyleStore.applyAllStylesFromState();
}

treeviewStore.finalizeImportSelection();
treeviewStore.isImporting = false;
}

Check warning on line 97 in app/composables/project_manager.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(max-statements)

function `importProjectFile` has too many statements (38). Maximum allowed is 20.

Check warning on line 97 in app/composables/project_manager.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(max-lines-per-function)

The async function `importProjectFile` has too many lines (53). Maximum allowed is 50.

return { exportProject, importProjectFile };
}

Check warning on line 100 in app/composables/project_manager.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(max-lines-per-function)

The function `useProjectManager` has too many lines (71). Maximum allowed is 50.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/integration/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import { createPath, generateProjectFolderPath } from "@ogw_front/utils/local/path";
import { Status } from "@ogw_front/utils/status";
import { appMode } from "@ogw_front/utils/local/app_mode";
import { importFile } from "@ogw_front/utils/file_import_workflow";
import { importFile } from "@ogw_front/utils/import_workflow";
import { setupActivePinia } from "@ogw_tests/utils";
import { useGeodeStore } from "@ogw_front/stores/geode";
import { useInfraStore } from "@ogw_front/stores/infra";

Check warning on line 16 in tests/integration/setup.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-import(max-dependencies)

File has too many dependencies (12). Maximum allowed is 10.
import { useViewerStore } from "@ogw_front/stores/viewer";

// Local constants
Expand All @@ -36,8 +36,8 @@
runViewer(COMMAND_VIEWER, NUXT_ROOT_PATH, { projectFolderPath }),
]);

console.log("back_port", back_port);

Check warning on line 39 in tests/integration/setup.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
console.log("viewer_port", viewer_port);

Check warning on line 40 in tests/integration/setup.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.

await addMicroserviceMetadatas(projectFolderPath, {
type: "back",
Expand Down Expand Up @@ -65,7 +65,7 @@
await viewerStore.ws_connect();
const id = await importFile(file_name, geode_object);
expect(viewerStore.status).toBe(Status.CONNECTED);
console.log("end of setupIntegrationTests", { id, projectFolderPath });

Check warning on line 68 in tests/integration/setup.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
return { id, projectFolderPath };
}

Expand Down
Loading