Skip to content

[OGUI-1620] Update repositories and services to use database #2803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mariscalromeroalejandro
Copy link
Collaborator

@mariscalromeroalejandro mariscalromeroalejandro commented Apr 7, 2025

I have JIRA issue created

  • branch and/or PR name(s) includes JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected
  • FLP integration tests were ran successful

This PR updates the services and repositories to retrieve layout information from the database:

  • Creates one repository per table in the database
  • Creates an adapter to map models to objects that the API needs
  • Removes JSON File Service and the requests to a JSON File
  • Updates the controllers to use the service properly

** This PR includes commits from a branch still under review (will be resolved once it merges to dev). First commit for this PR is: Add typedefs, update migrations and models, enable cascade deletions
** This PR does not include tests yet.

import { ok, throws, doesNotThrow, AssertionError } from 'node:assert';
import { suite, test, beforeEach } from 'node:test';
import { ok, throws, strictEqual } from 'node:assert';
import { suite, test, beforeEach, afterEach } from 'node:test';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import afterEach.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to remove the unused afterEach import from the node:test module. This will clean up the code and eliminate any confusion caused by the presence of an unused import. The change should be made in the QualityControl/test/lib/controllers/LayoutController.test.js file.

Suggested changeset 1
QualityControl/test/lib/controllers/LayoutController.test.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/QualityControl/test/lib/controllers/LayoutController.test.js b/QualityControl/test/lib/controllers/LayoutController.test.js
--- a/QualityControl/test/lib/controllers/LayoutController.test.js
+++ b/QualityControl/test/lib/controllers/LayoutController.test.js
@@ -15,3 +15,3 @@
 import { ok, throws, strictEqual } from 'node:assert';
-import { suite, test, beforeEach, afterEach } from 'node:test';
+import { suite, test, beforeEach } from 'node:test';
 import sinon from 'sinon';
EOF
@@ -15,3 +15,3 @@
import { ok, throws, strictEqual } from 'node:assert';
import { suite, test, beforeEach, afterEach } from 'node:test';
import { suite, test, beforeEach } from 'node:test';
import sinon from 'sinon';
Copilot is powered by AI and may make mistakes. Always verify output.
import { LayoutRepository } from '../../../lib/repositories/LayoutRepository.js';
import { LAYOUT_ADAPTED_MOCK, LAYOUT_INPUT_MOCK } from '../../demoData/layout/layout.mock.js';
import { LayoutAdapter } from '../../../lib/controllers/adapters/layout-adapter.js';
import { LayoutDto } from '../../../lib/dtos/LayoutDto.js';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import LayoutDto.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to remove the unused import statement for LayoutDto from the file QualityControl/test/lib/controllers/LayoutController.test.js. This will clean up the code and eliminate the unnecessary import, improving readability and potentially performance.

Suggested changeset 1
QualityControl/test/lib/controllers/LayoutController.test.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/QualityControl/test/lib/controllers/LayoutController.test.js b/QualityControl/test/lib/controllers/LayoutController.test.js
--- a/QualityControl/test/lib/controllers/LayoutController.test.js
+++ b/QualityControl/test/lib/controllers/LayoutController.test.js
@@ -21,3 +21,3 @@
 import { LayoutAdapter } from '../../../lib/controllers/adapters/layout-adapter.js';
-import { LayoutDto } from '../../../lib/dtos/LayoutDto.js';
+
 
EOF
@@ -21,3 +21,3 @@
import { LayoutAdapter } from '../../../lib/controllers/adapters/layout-adapter.js';
import { LayoutDto } from '../../../lib/dtos/LayoutDto.js';


Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant