Skip to content
Open
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
37 changes: 9 additions & 28 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "mcr.microsoft.com/devcontainers/base:debian",
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
Expand Down Expand Up @@ -66,64 +66,45 @@
"runOn": "folderOpen"
},
"presentation": {
"reveal": "never"
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Open Loading Page",
"type": "shell",
"command": "code -r .devcontainer/fd2_loading.md",
"presentation": {
"reveal": "never"
}
"command": "code -r .devcontainer/fd2_loading.md"
},
{
"label": "Customize Welcome Page",
"type": "shell",
"command": "./.devcontainer/homepage.bash",
"presentation": {
"reveal": "never"
}
"command": "./.devcontainer/homepage.bash"
},
{
"label": "Run fd2-up.bash Script",
"type": "shell",
"command": "bin/fd2-up.bash",
"presentation": {
"reveal": "never"
}
"command": "bin/fd2-up.bash"
},
{
"label": "Open Welcome Page",
"type": "shell",
"command": "code -r .devcontainer/fd2_welcome.md",
"presentation": {
"reveal": "never"
}
"command": "code -r .devcontainer/fd2_welcome.md"
},
{
"label": "Start Heartbeat Server",
"type": "shell",
"command": ".devcontainer/startHeartbeat.bash",
"presentation": {
"reveal": "never"
}
"command": ".devcontainer/startHeartbeat.bash"
},
{
"label": "Open Running Page",
"type": "shell",
"command": "sleep 300; code -r .devcontainer/fd2_running.md",
"presentation": {
"reveal": "never",
"panel": "new"
}
"command": "sleep 300; code -r .devcontainer/fd2_running.md"
},
{
"label": "Start Heartbeat Listener",
"type": "shell",
"command": "fuser -k 8888/tcp; ncat -lk 8888",
"presentation": {
"reveal": "always",
"panel": "new"
}
}
Expand Down
10 changes: 5 additions & 5 deletions .devcontainer/homepage_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<center>
<h1>The FarmData2 Development Environment</h1>
<h3>The Development Enviornment is Ready</h3>
<h3>The Development Environment is Ready</h3>
</center>

<table>
Expand All @@ -11,7 +11,7 @@
CODESPACE_NAME and CACHE_KEY are replaced by homepage.bash
The value of CACHE_KEY is set to the timestamp.
This prevents the browser from using a cached version of the
page, whcih does not work when the codespace is restarted.
page, which does not work when the codespace is restarted.
-->
Click here to <a href="https://%CODESPACE_NAME%-6901.app.github.dev?autoconnect=true&resize=remote&key=%CACHE_KEY%" target="_blank">Open the Development Environment in a Browser Tab</a>.
<br>
Expand All @@ -34,13 +34,13 @@
<i>Notes:</i>
<ol>
<li>
The browser based version of the Development Environment has the limitation that you cannot copy and paste direclty between the Development Environment and your machine. Using a VNC client on your machine as described in Note #2 removes this limitation.
The browser based version of the Development Environment has the limitation that you cannot copy and paste directly between the Development Environment and your machine. Using a VNC client on your machine as described in Note #2 removes this limitation.
</li>
<li>
Opening in VNC requires that both the <code>gh</code> command line interface and a VNC client be installed on your machine. You can find more information about each of these in the <a href="../docs/install/codespaces.md" target="_blank">installaion documentation</a>.
Opening in VNC requires that both the <code>gh</code> command line interface and a VNC client be installed on your machine. You can find more information about each of these in the <a href="../docs/install/codespaces.md" target="_blank">installation documentation</a>.
</li>
<li>
The <code>gh cs ports forward 5901:5902</code> command forwards port <code>5901</code> in the codespace to port <code>5902</code> on your local machine to enable VNC to connet. If port <code>5902</code> is in use on your machine you can change <code>5902</code> to any available port. Then use your VNC client to connect to the new port.
The <code>gh cs ports forward 5901:5902</code> command forwards port <code>5901</code> in the codespace to port <code>5902</code> on your local machine to enable VNC to connect. If port <code>5902</code> is in use on your machine you can change <code>5902</code> to any available port. Then use your VNC client to connect to the new port.
</li>
</ol>
</td>
Expand Down
2 changes: 1 addition & 1 deletion .fd2dev/db.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v3.7.0
v3.7.1
db.sample.tar.gz
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---

### Description

_A clear and concise description of the bug._

### Steps to Reproduce

1. Go to '…'
2. Click '…'
3. Scroll down to '…'
4. See error

### Observed Behavior

_A clear and concise description of what you observed when performing the reproduction steps and why that is incorrect. Include any error messages that are observed and screenshots as helpful to illustrate your description._

### Expected Behavior

_A clear and concise description of what you expected to happen when performing the reproduction steps and why that is correct. Include screenshots as helpful to illustrate your description._

### `bugInfo.bash` Output

_If you are working in the FarmData2 Development Environment run the `bugInfo.bash` script and paste the output in as indicated._

```
Paste bugInfo.bash output here.
```

### Further Details

_Include any further information you think might be helpful here. Note: if you have ideas for how to fix the bug, include those in a comment rather than in this description._
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---

### Feature

_A clear and concise description of the new feature that you want to see. Include screenshots, sketches or any other content that helps to explain your request._

### Rationale

_A clear and concise description of why you want this feature. Ex. It will make it easier to …_

### Alternatives

_A clear and concise description of any alternative solutions you have thought of or any workarounds (hacks) that you are currently using._

### Further Information

_Add any other context or information about the feature request here._
32 changes: 26 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
**Pull Request Description**
### Purpose

_Describe what your Pull Request does here_
_A clear and concise description of the purpose of this pull request._

_Include a "Closes #" line for the issue your PR closes._
### Verification Steps

---
_A clear and concise set of steps that will enable the reviewer to manually verify that this pull request accomplishes its purpose._

**Licensing Certification**
### Approach

FarmData2 is a [Free Cultural Work](https://freedomdefined.org/Definition) and all accepted contributions are licensed as described in the LICENSE.md file. This requires that the contributor holds the rights to do so. By submitting this pull request **I certify that I satisfy the terms of the [Developer Certificate of Origin](https://developercertificate.org/)** for its contents.
_A clear and concise description of the approach taken with rationale for design decisions that were made._

### Testing

_A clear and concise description of automated tests that have been modified or added to verify changes that were made._

### Related issues

_Include "Fixes #" or "Closes #" lines to link to issues resolved by this pull request. Include a "Related to #" line to link to issues related to but not fully resolved by this pull request._

### Further Information

_Include any further information you think might be helpful here._

### Licensing Certification

FarmData2 is a [Free Cultural Work](https://freedomdefined.org/Definition) and all accepted contributions are licensed as described in the LICENSE.md file. This requires that the contributor holds the rights to do so. By submitting this pull request **the contributor (and any listed co-authors) certify that they meet the terms of the [Developer Certificate of Origin](https://developercertificate.org/)** for its contents.

### Co-Authors

_Add a `Co-authored-by: NAME <NAME@EXAMPLE.COM>` line for each collaborator who does not have a commit in this PR. Use the [Coauthors Generator](https://coauthors.me/generator) to get a Co-authored-by line for a GitHub user._
58 changes: 58 additions & 0 deletions bin/bugInfo.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

current_branch=$(git branch --show-current)
if [ "$current_branch" != "development" ]; then
echo "Please run bugInfo.bash from the development branch."
exit 255
fi

upstream_url=$(git remote get-url upstream)
if [ "$upstream_url" == "" ]; then
echo "Please set the upstream remote and try again."
exit 255
fi

upstream_head=$(git ls-remote "$upstream_url" development | cut -f1)
local_head=$(git rev-parse HEAD)
if [ "$local_head" != "$upstream_head" ]; then
echo "Please be sure you are running from the latest development branch."
echo "Update your development branch, confirm the bug still exits and try again."
exit 255
fi

git_status=$(git status --short)
if [ "$git_status" != "" ]; then
echo "Please be sure you are running from the latest development branch."
echo "Stash or restore any local changes you have made, confirm the bug still exits and try again."
exit 255
fi

echo ""
echo "Copy the following information into the bug report under \"bugInfo.bash output\":"

echo ""
echo "BEGIN"

echo ""
echo "git remote -v"
echo "-------------"
git remote -v

echo ""
echo "git log -1 | head -3"
echo "--------------------"
git log -1 | head -3

echo ""
echo "cat ~/FarmData2/.fd2dev/db.conf"
echo "-------------------------------"
cat ~/FarmData2/.fd2dev/db.conf

echo ""
echo "docker ps (Images and Names)"
echo "----------------------------"
docker ps --format "{{.Image}} \t {{.Names}}"

echo ""
echo "END"
echo ""
21 changes: 21 additions & 0 deletions bin/reinstallFD2Module.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

echo "Deleting custom fd2_fields..."
docker exec fd2_farmos drush php-eval "\Drupal\field\Entity\FieldStorageConfig::loadByName('taxonomy_term', 'fd2_unit_conversions')->delete();"
docker exec fd2_farmos drush php-eval "\Drupal\field\Entity\FieldStorageConfig::loadByName('taxonomy_term', 'fd2_harvest_unit')->delete();"
echo "Deleted."
echo "Running cron..."
docker exec fd2_farmos drush cron > /dev/null 2>&1
echo "Done."

echo "Uninstalling farm_fd2 module..."
docker exec fd2_farmos drush pmu farm_fd2 -y
echo "Uninstalled."

echo "Rebuilding farm_fd2 module..."
npm run build:fd2 > /dev/null
echo "Rebuilt."

echo "Reinstalling farm_fd2 module..."
docker exec fd2_farmos drush en farm_fd2 -y
echo "Reinstalled."
2 changes: 1 addition & 1 deletion docs/install/codespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Use the following steps to create a new FarmData2 Development Environment in Cod

1. The browser will display a small dialog box in the lower right corner indicating that the GitHub codespace is being built.<br><center><img src="images/building-codespace.png" alt='Dialog box indicating that the codespace is being built.' width=400 /></center>

1. After about 5 minutes the browser window will change a couple of times and then display a page indicating that the FarmData2 Development Environment is loading.<br><center><img src="images/dev-env-loading.png" alt='The FarmData2 Development Environment loading page.' width=300 /></center>
1. After about 5 minutes the browser window will change a couple of times and then display a page indicating that the FarmData2 Development Environment is loading.<br><center><img src="images/dev-env-loading.png" alt='The FarmData2 Development Environment loading page.' width=300 /></center><br>A terminal window will open at the bottom of this window and will display the output of commands that are executing as part of the startup. You may safely ignore the content in this terminal.

1. After another 5-10 minutes the browser window will display a page giving information about connecting to the FarmData2 Development Environment.<br><center><img src="images/dev-env-ready.png" alt='The FarmData2 Development Environment connections page.' width=650 /></center>

Expand Down
10 changes: 5 additions & 5 deletions library/farmosUtil/farmosUtil.logCategories.unit.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ describe('Test the log categories utility functions', () => {
it('Get the log categories', () => {
cy.wrap(farmosUtil.getLogCategories()).then((categories) => {
expect(categories).to.not.be.null;
expect(categories.length).to.equal(12);
expect(categories.length).to.equal(13);

expect(categories[0].attributes.name).to.equal('amendment');
expect(categories[0].attributes.description.value).to.equal(
'For logs where soil amendments are made.'
);
expect(categories[0].type).to.equal('taxonomy_term--log_category');

expect(categories[11].attributes.name).to.equal('weed_control');
expect(categories[11].attributes.name).to.equal('transplanting');
expect(categories[11].attributes.description.value).to.equal(
'For logs related to weed control.'
'For logs representing transplantation of a plant.'
);
expect(categories[11].type).to.equal('taxonomy_term--log_category');
});
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('Test the log categories utility functions', () => {
it('Get the logCategoryToTerm map', () => {
cy.wrap(farmosUtil.getLogCategoryToTermMap()).then((categoryMap) => {
expect(categoryMap).to.not.be.null;
expect(categoryMap.size).to.equal(12);
expect(categoryMap.size).to.equal(13);

expect(categoryMap.get('seeding_cover_crop')).to.not.be.null;
expect(categoryMap.get('seeding_cover_crop').type).to.equal(
Expand All @@ -77,7 +77,7 @@ describe('Test the log categories utility functions', () => {
it('Get the logCategoryIdToAsset map', () => {
cy.wrap(farmosUtil.getLogCategoryIdToTermMap()).then((categoryIdMap) => {
expect(categoryIdMap).to.not.be.null;
expect(categoryIdMap.size).to.equal(12);
expect(categoryIdMap.size).to.equal(13);

cy.wrap(farmosUtil.getLogCategoryToTermMap()).then((categoryNameMap) => {
const coverId = categoryNameMap.get('seeding_cover_crop').id;
Expand Down
1 change: 1 addition & 0 deletions modules/farm_fd2/src/module/farm_fd2.install
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function add_log_categories() {
['name' => 'tillage', 'parent' => '', 'description' => 'For logs representing soil disturbances.' ],
['name' => 'transplanting', 'parent' => '', 'description' => 'For logs representing transplantation of a plant.' ],
['name' => 'weed_control', 'parent' => '', 'description' => 'For logs related to weed control.' ],
['name' => 'harvest', 'parent' => '', 'description' => 'For logs related to harvesting of a plant.' ],
];

addTerms($vocab, $terms);
Expand Down
Loading