It is really helpful to be able to add sample data to the Courses app to show in the reference environment, especially as terms "age" out and you want to ensure that new terms and courses are added.
The good news is that creating sample data is not that difficult. It does require a little work in Github, but you do not need to write code. This page assumes that you are using Github via the web interface since that is generally the most user-friendly approach, but you can also use other pathways to manage repositories and commit files
Step 1: Open a Jira
This will allow whatever dev team is maintaining mod-courses to manage the work they need to do. Open a ticket in the MODCR project in Jira and title it something like "Adding new sample data on reference environments."
Step 2: Log into Github and create a fork of the mod-courses repository.
Create a fork of https://github.com/folio-org/mod-courses in your Github account. You will create the new sample data in your fork, and then create a pull request to merge the sample data into production.
Step 3: Create new sample data in your fork of mod-courses
Sample data lives in mod-courses in src/main/resources/sample-data
Here, you want to add your sample data to your forked repository. The easiest way to generate the sample data is to go to a current reference environment and create the sample data there, and then use developer tools (Intro to Developer Tools in Google Chrome) to get the json that you need.
For example, suppose you wanted to add a new term for Fall 2024. This is how you could do it:
- Go to https://folio-snapshot.dev.folio.org and go to Settings > Courses > Terms.
- Open Developer Tools (see Intro to Developer Tools in Google Chrome for more help with developer tools.)
- Select the New button and create the term for Fall 2024.
- When you save the term, in Developer Tools on the Network panel, you should see the API call that FOLIO sends to create the term
- In the Response tab, you'll see the JSON that was created when you added the term. This is the thing that you want to copy out and use in Github.
- Copy the term and in your forked copy of github, create a new file in the Terms folder called 'Term009.json' (or whatever the next number is in that folder.) Paste in the JSON from the term you just created, and save the file.
Step 4: Create a pull request with your new files
Once you've added all of the new sample data you want to add, you'll create a pull request back to the parent copy of mod-courses.
There are various ways to create a pull request, but the important thing is to make sure the title includes the Jira number from step 1. E.g., if you created a Jira and the number