Skip to content
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

Issue #1893 #2709

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

kumarannathan
Copy link

@kumarannathan kumarannathan commented Dec 10, 2024

Pushing for my partner, @mnauli, on the project, as she was not added as a collaborator and couldn't make a PR.
Co-authored-by: Mira Panjaitan mnauli@umich.edu
Added functionality to DemoDataInitializerService:
•    Reads demo_entities.json from the assets folder.   
•    Logs a message if the file is found or defaults to the existing hardcoded setup if not.   
•    Prepares for future insertion of JSON data into the database for scenario-specific demo customization.

Pushing for my partner on the project, as she was not added as a collaborator and couldn't make a PR.

Added functionality to DemoDataInitializerService:
    •    Reads demo_entities.json from the assets folder.
    •    Logs a message if the file is found or defaults to the existing hardcoded setup if not.
    •    Prepares for future insertion of JSON data into the database for scenario-specific demo customization.

Co-Authored-By: Mira Panjaitan <113065773+mnauli@users.noreply.github.com>
Copy link
Member

@sleidig sleidig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing, @mnauli! Welcome to the Aam Digital community 😃

I think you should be able to open Pull Requests yourself without special permissions, if you fork the repository to your personal GitHub space (at least I don't see @kumarannathan having special access to our repository either). We are also happy to add anybody interested to contribute regularly, so that they can create branches directly in the repository.

When running your branch, I see the log message for the entities loaded from file 👍

Are you already looking into the steps to adjust or skip the DemoDataService generating the default data and instead saving the data you loaded from file (using the EntityMapperService)?

Comment on lines +69 to +79

// Load and parse the demo_entities.json file before publishing demo data
const demoDataFromJson = await this.loadDemoEntities();
if (demoDataFromJson?.docs) {
console.log("Loaded demo_entities.json:", demoDataFromJson);
} else {
console.log(
"No demo_entities.json found, proceeding with default demo setup.",
);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the different functionalities separated and easier to understand, maybe you can create a new Angular Service ("DemoDataFromFileService" or something ...) for your logic. Then we can here in the DemoDataInitializerService (or possibly in the DemoDataService) just call the loaded or the generated data service

@sleidig sleidig marked this pull request as draft December 19, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demo setup/generators supporting different setup scenarios
2 participants