diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 906d51d6a..4676be257 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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": {} }, @@ -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" } } diff --git a/.devcontainer/homepage_template.md b/.devcontainer/homepage_template.md index c55222da2..fc45a8b05 100644 --- a/.devcontainer/homepage_template.md +++ b/.devcontainer/homepage_template.md @@ -1,6 +1,6 @@

The FarmData2 Development Environment

-

The Development Enviornment is Ready

+

The Development Environment is Ready

@@ -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 Open the Development Environment in a Browser Tab.
@@ -34,13 +34,13 @@ Notes:
  1. - 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.
  2. - Opening in VNC requires that both the gh command line interface and a VNC client be installed on your machine. You can find more information about each of these in the installaion documentation. + Opening in VNC requires that both the gh command line interface and a VNC client be installed on your machine. You can find more information about each of these in the installation documentation.
  3. - The gh cs ports forward 5901:5902 command forwards port 5901 in the codespace to port 5902 on your local machine to enable VNC to connet. If port 5902 is in use on your machine you can change 5902 to any available port. Then use your VNC client to connect to the new port. + The gh cs ports forward 5901:5902 command forwards port 5901 in the codespace to port 5902 on your local machine to enable VNC to connect. If port 5902 is in use on your machine you can change 5902 to any available port. Then use your VNC client to connect to the new port.
diff --git a/.fd2dev/db.conf b/.fd2dev/db.conf index 0b31f7d6f..d53fd27f8 100644 --- a/.fd2dev/db.conf +++ b/.fd2dev/db.conf @@ -1,2 +1,2 @@ -v3.7.0 +v3.7.1 db.sample.tar.gz diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..72f7ca197 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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._ diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..a2fa7fbfa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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._ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 551426e7c..43f4f8e3e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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 ` 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._ diff --git a/bin/bugInfo.bash b/bin/bugInfo.bash new file mode 100755 index 000000000..87388324d --- /dev/null +++ b/bin/bugInfo.bash @@ -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 "" diff --git a/bin/reinstallFD2Module.bash b/bin/reinstallFD2Module.bash new file mode 100755 index 000000000..015690fea --- /dev/null +++ b/bin/reinstallFD2Module.bash @@ -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." diff --git a/docs/install/codespaces.md b/docs/install/codespaces.md index b4d165868..a900d8e5c 100644 --- a/docs/install/codespaces.md +++ b/docs/install/codespaces.md @@ -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.
Dialog box indicating that the codespace is being built.
-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.
The FarmData2 Development Environment loading page.
+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.
The FarmData2 Development Environment loading page.

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.
The FarmData2 Development Environment connections page.
diff --git a/library/farmosUtil/farmosUtil.logCategories.unit.cy.js b/library/farmosUtil/farmosUtil.logCategories.unit.cy.js index 7359abf31..bd8d274b8 100644 --- a/library/farmosUtil/farmosUtil.logCategories.unit.cy.js +++ b/library/farmosUtil/farmosUtil.logCategories.unit.cy.js @@ -14,7 +14,7 @@ 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( @@ -22,9 +22,9 @@ describe('Test the log categories utility functions', () => { ); 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'); }); @@ -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( @@ -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; diff --git a/modules/farm_fd2/src/module/farm_fd2.install b/modules/farm_fd2/src/module/farm_fd2.install index 050923f03..f2e600be5 100644 --- a/modules/farm_fd2/src/module/farm_fd2.install +++ b/modules/farm_fd2/src/module/farm_fd2.install @@ -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); diff --git a/modules/farm_fd2_examples/src/entrypoints/crop_selector/App.vue b/modules/farm_fd2_examples/src/entrypoints/crop_selector/App.vue index 0b9242a55..2ccb23e58 100644 --- a/modules/farm_fd2_examples/src/entrypoints/crop_selector/App.vue +++ b/modules/farm_fd2_examples/src/entrypoints/crop_selector/App.vue @@ -25,6 +25,7 @@
+ @@ -38,17 +39,7 @@ v-model="required" /> - - - - + @@ -61,7 +52,7 @@ v-on:click="this.form.selected = 'ARUGULA'" v-bind:disabled="this.form.selected == 'ARUGULA'" > - Select Arugula + Arugula + + + + + +
Prop ControlValue
showValidityStyling - - {{ required }}
selected {{ form.selected }}
showValidityStyling + + {{ validity.showStyling }}
@@ -87,6 +91,10 @@ + + ready + + update:selected {{ form.selected }} diff --git a/modules/farm_fd2_examples/src/entrypoints/picker_base/App.vue b/modules/farm_fd2_examples/src/entrypoints/picker_base/App.vue index 672e73b18..b4995bb72 100644 --- a/modules/farm_fd2_examples/src/entrypoints/picker_base/App.vue +++ b/modules/farm_fd2_examples/src/entrypoints/picker_base/App.vue @@ -26,40 +26,29 @@ Prop Control + Value - required - - - - - - showValidityStyling - - - - - - showAllButton + options - + + Toggle sixth option + @@ -84,24 +73,36 @@ - options + required - - Toggle sixth option - + + + + + showAllButton + + + + + + showValidityStyling + +