From 2cb795256892db3975f4af5be542ee16f7b1574f Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 11:57:05 -0400 Subject: [PATCH 01/37] Added HTML sub-tab to FD2 School Tab --- farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html | 0 farmdata2/farmdata2_modules/fd2_school/fd2_school.module | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 167ca8ef2a..36442d012f 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -52,6 +52,15 @@ function fd2_school_menu() { 'weight' => -30, // larger weights appear further right. ); + $items['farm/fd2-school/HTML'] = array( + 'title' => 'HTML', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('HTML'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + // Define the name and URL for the default sub-tab that appears when the tab is opened. // Content for this default sub-tab is provided by the 'page arguments' above. $items['farm/fd2-school/info'] = array( From 0ed148bfdc11f150547ca010c2cad9b122be2c1c Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 12:42:02 -0400 Subject: [PATCH 02/37] Added content to HTML.html file --- .../fd2_school/HTML/HTML.html | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html index e69de29bb2..e3724e7314 100644 --- a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -0,0 +1,24 @@ + + +

Harvest Report

+

This page is a mockup of a simplified harvest report.

+ + + +
+

My Sample Harvest Report

+

Details:

+ + + + + + \ No newline at end of file From 342d26c24822ba7e6924870cbfaab3ca71fe3490 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 12:52:21 -0400 Subject: [PATCH 03/37] Added italics and breaks to HTML.html file --- farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html index e3724e7314..08afabd92e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -1,20 +1,20 @@

Harvest Report

-

This page is a mockup of a simplified harvest report.

+

This page is a mockup of a simplified harvest report.


My Sample Harvest Report

Details:

- +
  • Farm:technologists
  • User:manager1
  • Language:English
- +
  • Start:05/01/2018
  • End:05/15/2018
  • From 43a64add1ca6da18974c53cd1ff3a1271ccbd3ba Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 13:11:20 -0400 Subject: [PATCH 04/37] Added Title and Buttom to HTML.html --- farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html index 08afabd92e..ef2d0a8056 100644 --- a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -6,9 +6,12 @@

    Harvest Report


    -

    My Sample Harvest Report

    + +

    + +

    Details:

    - +
    • Farm:technologists
    • User:manager1
    • @@ -20,5 +23,7 @@

      My Sample Harvest Report

    • End:05/15/2018
    • Crop:Kale
    +
    + \ No newline at end of file From f88991cdf733f226f164eba468dd6e9cb7d98c8a Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 13:53:48 -0400 Subject: [PATCH 05/37] Added crops dropdown to HTML.html --- .../fd2_school/HTML/HTML.html | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html index ef2d0a8056..880eeb947a 100644 --- a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -1,15 +1,25 @@ - -

    Harvest Report

    -

    This page is a mockup of a simplified harvest report.

    - - -
    +

    +

    Harvest Report

    +

    This page is a mockup of a simplified harvest report.

    + -

    - -

    + +
    + + + + +

    + +
    + +

    Details:

      From 0ac4be54e65815b4d3f89bbaec5b693c029d4777 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 13:58:47 -0400 Subject: [PATCH 06/37] Added area dropdown to HTML.html --- farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html index 880eeb947a..57c899c462 100644 --- a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -8,12 +8,17 @@

      Harvest Report


      - - + +

      From df9ae6e555c6ce3c64b4abe5dc0405c3d95f91c6 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 14:12:27 -0400 Subject: [PATCH 07/37] Added start and end date ranges to HTML.html --- .../fd2_school/HTML/HTML.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html index 57c899c462..f86c9413aa 100644 --- a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -3,10 +3,21 @@

      Harvest Report

      This page is a mockup of a simplified harvest report.

      - +
      +
      +
      +
      + + + + +

      +
      - +
      +
      +


      @@ -38,7 +51,5 @@

      Harvest Report

    • End:05/15/2018
    • Crop:Kale
    -
    - \ No newline at end of file From 6ab51054bc1baa3986d5dbca84b8855d028702fb Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 15 Sep 2023 14:30:15 -0400 Subject: [PATCH 08/37] Added table to HTML.html --- .../fd2_school/HTML/HTML.html | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html index f86c9413aa..73ee01416f 100644 --- a/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -36,8 +36,7 @@

    Harvest Report


    - - +

    My Sample Harvest Report

    Details:

      @@ -51,5 +50,33 @@

      Harvest Report

    • End:05/15/2018
    • Crop:Kale
    + +
    + + + + + + + + + + + + + + + + + + + + + + +
    DateAreaCropYieldUnits
    05/02/2018Chuau-1Kale10Bunches
    05/05/2018SQ7Kale7Bunches
    + + +
    \ No newline at end of file From 6868f9360c6e24a4d85a410414cb51e08bd1c126 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 21 Sep 2023 22:02:17 -0400 Subject: [PATCH 09/37] Added Vue1 subtab and Vue1.html file --- .../fd2_school/Vue1/vue1.html | 82 +++++++++++++++++++ .../fd2_school/fd2_school.module | 9 ++ 2 files changed, 91 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html new file mode 100644 index 0000000000..73ee01416f --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -0,0 +1,82 @@ + + +

    +

    Harvest Report

    +

    This page is a mockup of a simplified harvest report.

    +
    + + +
    +
    +
    + + + + +
    +
    +
    + + + + +
    +
    + +

    + +
    +

    My Sample Harvest Report

    +

    Details:

    + +
      +
    • Farm:technologists
    • +
    • User:manager1
    • +
    • Language:English
    • +
    +
    +
      +
    • Start:05/01/2018
    • +
    • End:05/15/2018
    • +
    • Crop:Kale
    • +
    + +
    + + + + + + + + + + + + + + + + + + + + + + +
    DateAreaCropYieldUnits
    05/02/2018Chuau-1Kale10Bunches
    05/05/2018SQ7Kale7Bunches
    + + +
    + + \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 36442d012f..84bde7d2e9 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -61,6 +61,15 @@ function fd2_school_menu() { 'weight' => 110, ); + $items['farm/fd2-school/Vue1'] = array( + 'title' => 'Vue1', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('Vue1'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + // Define the name and URL for the default sub-tab that appears when the tab is opened. // Content for this default sub-tab is provided by the 'page arguments' above. $items['farm/fd2-school/info'] = array( From 537e9f9be2d8cd7ae81f7a5b5e54349185884d70 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Sat, 23 Sep 2023 22:18:36 -0400 Subject: [PATCH 10/37] Made sample report title text dynamic --- .../fd2_school/Vue1/vue1.html | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html index 73ee01416f..69e16bd63e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -1,13 +1,17 @@ + +

    Harvest Report

    This page is a mockup of a simplified harvest report.

    -
    + + - -
    + +
    +
    Harvest Report
    +
    +
    +
    + -


    -

    My Sample Harvest Report

    + + +

    {{ title }}

    + +

    Details:

      @@ -44,7 +55,9 @@

      My Sample Harvest Report

    • User:manager1
    • Language:English
    +
    +
    • Start:05/01/2018
    • End:05/15/2018
    • @@ -79,4 +92,15 @@

      My Sample Harvest Report

    + + + + \ No newline at end of file From 15cbffa468f9f991c3b03dc50302d597dad2f39a Mon Sep 17 00:00:00 2001 From: anemervontage Date: Sat, 23 Sep 2023 22:41:46 -0400 Subject: [PATCH 11/37] Made startdate, enddate, and crop dropdowns dynamic --- .../fd2_school/Vue1/vue1.html | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html index 69e16bd63e..010943785f 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -15,23 +15,23 @@

    Harvest Report

    + v-model ="startDate" min="2014-01-01" max="2022-01-01" /> + v-model ="endDate" min="2020-05-05" max="2022-01-01" />

    - + - @@ -59,9 +59,9 @@

    Harvest Report


      -
    • Start:05/01/2018
    • -
    • End:05/15/2018
    • -
    • Crop:Kale
    • +
    • Start: {{ startDate }}
    • +
    • End: {{ endDate }}
    • +
    • Crop: {{ crop }}
    @@ -98,7 +98,11 @@

    Harvest Report

    var vueSpike = new Vue({ el: "#vue_spike1", data: { - title: "My Sample Harvest Report" + title: "My Sample Harvest Report", + startDate: "2020-05-05", + endDate: "2020-05-15", + crop: "Kale", + area: "All" } }) From ad131ea611786465e2f1dae5f1df78d06f8af1ec Mon Sep 17 00:00:00 2001 From: anemervontage Date: Wed, 27 Sep 2023 00:20:07 -0400 Subject: [PATCH 12/37] Added Temp text for title if empty --- farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html index 010943785f..08d1fc1f09 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -31,7 +31,7 @@

    Harvest Report

    - @@ -45,7 +45,7 @@

    Harvest Report


    -

    {{ title }}

    +

    {{ title ? title : "Mock Harvest Report" }}

    Details:

    @@ -101,8 +101,7 @@

    Harvest Report

    title: "My Sample Harvest Report", startDate: "2020-05-05", endDate: "2020-05-15", - crop: "Kale", - area: "All" + crop: "Kale" } }) From 1026af451777b568514591b30c71ed7656293f60 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Wed, 27 Sep 2023 01:06:18 -0400 Subject: [PATCH 13/37] populated crops and areas dropdown using arrays in vue --- .../fd2_school/Vue1/vue1.html | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html index 08d1fc1f09..19f50aa862 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -25,16 +25,13 @@

    Harvest Report

    - + + - +
    @@ -61,7 +58,7 @@

    Harvest Report

    • Start: {{ startDate }}
    • End: {{ endDate }}
    • -
    • Crop: {{ crop }}
    • +
    • Crop: {{ crops }}
    @@ -101,7 +98,8 @@

    Harvest Report

    title: "My Sample Harvest Report", startDate: "2020-05-05", endDate: "2020-05-15", - crop: "Kale" + crops: ["Kale", "Peas", "Broccoli"], + areas: ["All", "Chuau-1", "SQ7"] } }) From afd054f83353b2784b02fa1617c230278822a300 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Wed, 27 Sep 2023 01:31:06 -0400 Subject: [PATCH 14/37] populated table using data from objects in vue --- .../fd2_school/Vue1/vue1.html | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html index 19f50aa862..df2a22e10c 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -70,20 +70,13 @@

    Harvest Report

    Yield Units - - 05/02/2018 - Chuau-1 - Kale - 10 - Bunches - - - 05/05/2018 - SQ7 - Kale - 7 - Bunches - + + {{ cell.date }} + {{ cell.area }} + {{ cell.crop }} + {{ cell.yield }} + {{ cell.units }} + @@ -99,7 +92,11 @@

    Harvest Report

    startDate: "2020-05-05", endDate: "2020-05-15", crops: ["Kale", "Peas", "Broccoli"], - areas: ["All", "Chuau-1", "SQ7"] + areas: ["All", "Chuau-1", "SQ7"], + cells: [ + {date: "2018-05-02", area: "Chuau-1", crop: "Kale", yield: 10, units: "Bunches"}, + {date: "2018-05-05", area: "SQ7", crop: "Kale", yield: 7, units: "Bunches"} + ] } }) From 6cd591e49c54b4e4b723c66f2de51e616b517a67 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Wed, 27 Sep 2023 01:51:51 -0400 Subject: [PATCH 15/37] added vue dev tools --- farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html | 1 + 1 file changed, 1 insertion(+) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html index df2a22e10c..a78814a2e8 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -99,6 +99,7 @@

    Harvest Report

    ] } }) + Vue.config.devtools = true \ No newline at end of file From 665aa6757a09c2422880abdbabc681bd6e0e89a5 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 28 Sep 2023 20:14:22 -0400 Subject: [PATCH 16/37] Added Vue2 subtab and Vue2.html file --- .../fd2_school/Vue2/vue2.html | 105 ++++++++++++++++++ .../fd2_school/fd2_school.module | 9 ++ 2 files changed, 114 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html new file mode 100644 index 0000000000..a78814a2e8 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html @@ -0,0 +1,105 @@ + + +
    + +

    +

    Harvest Report

    +

    This page is a mockup of a simplified harvest report.

    + + + + + +
    + +
    + + + + +
    + +
    + +
    + + + + + +
    + +
    + + + +
    + + +

    {{ title ? title : "Mock Harvest Report" }}

    + + +

    Details:

    + +
      +
    • Farm:technologists
    • +
    • User:manager1
    • +
    • Language:English
    • +
    + +
    + +
      +
    • Start: {{ startDate }}
    • +
    • End: {{ endDate }}
    • +
    • Crop: {{ crops }}
    • +
    + +
    + + + + + + + + + + + + + + + +
    DateAreaCropYieldUnits
    {{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
    + + +
    + +
    + + + + \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 84bde7d2e9..4aa2ad9a94 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -70,6 +70,15 @@ function fd2_school_menu() { 'weight' => 110, ); + $items['farm/fd2-school/Vue2'] = array( + 'title' => 'Vue2', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('Vue2'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + // Define the name and URL for the default sub-tab that appears when the tab is opened. // Content for this default sub-tab is provided by the 'page arguments' above. $items['farm/fd2-school/info'] = array( From 1167fb58e12a05a89b2eb03c78b093370fd6c1da Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 28 Sep 2023 20:48:06 -0400 Subject: [PATCH 17/37] Added click event on button to generate table --- .../farmdata2_modules/fd2_school/Vue2/vue2.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html index a78814a2e8..7d9458222e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html @@ -1,6 +1,6 @@ -
    +

    Harvest Report

    @@ -37,7 +37,7 @@

    Harvest Report


    - +
    @@ -70,7 +70,7 @@

    Harvest Report

    Yield Units - + {{ cell.date }} {{ cell.area }} {{ cell.crop }} @@ -86,17 +86,16 @@

    Harvest Report

    From e97b0525ba11472f306cc6e201abb3ba36945856 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 28 Sep 2023 21:28:09 -0400 Subject: [PATCH 19/37] added row column to table with index --- farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html index 526a15e5bd..30afb308f9 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html @@ -64,13 +64,15 @@

    Harvest Report

    + - + + @@ -98,8 +100,7 @@

    Harvest Report

    }, methods: { saveReport: function(){ - this.harvestLogs.push(this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"})); - + this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); } } From d558d417eb5f0e21608148f53de44ce669ba0dcf Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 28 Sep 2023 23:48:45 -0400 Subject: [PATCH 20/37] made table show only if generated and added message when empty --- farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html index 30afb308f9..e8cc9c6c2b 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html @@ -37,7 +37,7 @@

    Harvest Report


    - +
    @@ -61,7 +61,8 @@

    Harvest Report

  • Crop: {{ crops }}
  • -
    +

    There are no matching records

    +
    Row Date Area Crop Yield Units
    {{ index + 1 }} {{ cell.date }} {{ cell.area }} {{ cell.crop }}
    @@ -77,7 +78,7 @@

    Harvest Report

    - +
    Row {{ cell.area }} {{ cell.crop }} {{ cell.yield }}{{ cell.units }}{{ cell.units }}
    @@ -90,6 +91,7 @@

    Harvest Report

    var vueSpike = new Vue({ el: "#vue_spike2", data: { + state: "nullReport", title: "My Sample Harvest Report", startDate: "2020-05-05", endDate: "2020-05-15", @@ -101,6 +103,9 @@

    Harvest Report

    methods: { saveReport: function(){ this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); + }, + changeState: function(newState){ + this.state = newState } } From 3d59e01e86f0ee62a117948c45f40754e44af7d5 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Fri, 29 Sep 2023 00:52:33 -0400 Subject: [PATCH 21/37] made start and end dates consistent --- farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html index e8cc9c6c2b..4054076c6f 100644 --- a/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html +++ b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html @@ -15,10 +15,10 @@

    Harvest Report

    + v-model ="startDate" min="2014-01-01" :max="endDate"/> - +

    From c0ee99d1bcf618e8877312fbaf1549aa3f4a4594 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Sun, 29 Oct 2023 19:02:41 -0400 Subject: [PATCH 22/37] Added API subtab to FarmData --- .../farmdata2_modules/fd2_school/API/api.html | 116 ++++++++++++++++++ .../fd2_school/fd2_school.module | 9 ++ 2 files changed, 125 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/API/api.html diff --git a/farmdata2/farmdata2_modules/fd2_school/API/api.html b/farmdata2/farmdata2_modules/fd2_school/API/api.html new file mode 100644 index 0000000000..4054076c6f --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/API/api.html @@ -0,0 +1,116 @@ + + +
    + +

    +

    Harvest Report

    +

    This page is a mockup of a simplified harvest report.

    + + + + + +
    + +
    + + + + +
    + +
    + +
    + + + + + +
    + +
    + + + +
    + + +

    {{ title ? title : "Mock Harvest Report" }}

    + + +

    Details:

    + +
      +
    • Farm:technologists
    • +
    • User:manager1
    • +
    • Language:English
    • +
    + +
    + +
      +
    • Start: {{ startDate }}
    • +
    • End: {{ endDate }}
    • +
    • Crop: {{ crops }}
    • +
    + +

    There are no matching records

    +
    + + + + + + + + + + + + + + + + + +
    RowDateAreaCropYieldUnits
    {{ index + 1 }}{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
    + + +
    + +
    + + + + \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 4aa2ad9a94..e0cea7a71e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -79,6 +79,15 @@ function fd2_school_menu() { 'weight' => 110, ); + $items['farm/fd2-school/API'] = array( + 'title' => 'API', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('api'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + // Define the name and URL for the default sub-tab that appears when the tab is opened. // Content for this default sub-tab is provided by the 'page arguments' above. $items['farm/fd2-school/info'] = array( From fa6ca089fb7f32ab96844ab6a47a138e8820d304 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Mon, 30 Oct 2023 16:26:55 -0400 Subject: [PATCH 23/37] added data fields for farm, language and user in vue --- farmdata2/farmdata2_modules/fd2_school/API/api.html | 9 ++++++--- farmdata2/farmdata2_modules/fd2_school/fd2_school.module | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/API/api.html b/farmdata2/farmdata2_modules/fd2_school/API/api.html index 4054076c6f..3c0744924e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/API/api.html +++ b/farmdata2/farmdata2_modules/fd2_school/API/api.html @@ -48,9 +48,9 @@

    Harvest Report

    Details:

      -
    • Farm:technologists
    • -
    • User:manager1
    • -
    • Language:English
    • +
    • Farm:{{ farm }}
    • +
    • User:{{ user }}
    • +
    • Language:{{ language }}

    @@ -91,6 +91,9 @@

    Harvest Report

    var vueSpike = new Vue({ el: "#vue_spike2", data: { + farm: "", + user: "", + language: "", state: "nullReport", title: "My Sample Harvest Report", startDate: "2020-05-05", diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index e0cea7a71e..a6873801ea 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -83,7 +83,7 @@ function fd2_school_menu() { 'title' => 'API', 'type' => MENU_LOCAL_TASK, 'page callback' => 'fd2_school_view', - 'page arguments' => array('api'), + 'page arguments' => array('API'), 'access arguments' => array('view fd2 school'), 'weight' => 110, ); From 081b54bfe3604c60103471364ddff7e77adda884 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Mon, 30 Oct 2023 16:46:35 -0400 Subject: [PATCH 24/37] Generate button generateds data for farm, language, user --- .../farmdata2_modules/fd2_school/API/api.html | 15 ++++++++++----- .../fd2_school/fd2_school.module | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/API/api.html b/farmdata2/farmdata2_modules/fd2_school/API/api.html index 3c0744924e..8af3d756c5 100644 --- a/farmdata2/farmdata2_modules/fd2_school/API/api.html +++ b/farmdata2/farmdata2_modules/fd2_school/API/api.html @@ -48,9 +48,9 @@

    Harvest Report

    Details:

      -
    • Farm:{{ farm }}
    • -
    • User:{{ user }}
    • -
    • Language:{{ language }}
    • +
    • Farm: {{ farm }}
    • +
    • User: {{ user }}
    • +
    • Language: {{ language }}

    @@ -91,7 +91,8 @@

    Harvest Report

    var vueSpike = new Vue({ el: "#vue_spike2", data: { - farm: "", + love: "" + ,farm: "", user: "", language: "", state: "nullReport", @@ -106,10 +107,14 @@

    Harvest Report

    methods: { saveReport: function(){ this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); + this.language = "English"; + this.user = "manager1"; + this.farm = "Sample Farm"; }, changeState: function(newState){ - this.state = newState + this.state = newState; } + } }) diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index a6873801ea..67956d3bb2 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -79,11 +79,11 @@ function fd2_school_menu() { 'weight' => 110, ); - $items['farm/fd2-school/API'] = array( + $items['farm/fd2-school/api'] = array( 'title' => 'API', 'type' => MENU_LOCAL_TASK, 'page callback' => 'fd2_school_view', - 'page arguments' => array('API'), + 'page arguments' => array('api'), 'access arguments' => array('view fd2 school'), 'weight' => 110, ); From cab40094ec5e2d1547485fc886d600c2b383b749 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Mon, 30 Oct 2023 20:48:04 -0400 Subject: [PATCH 25/37] Added Axios APi to html page --- .../farmdata2_modules/fd2_school/API/api.html | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/API/api.html b/farmdata2/farmdata2_modules/fd2_school/API/api.html index 8af3d756c5..e2f0d0fe1e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/API/api.html +++ b/farmdata2/farmdata2_modules/fd2_school/API/api.html @@ -106,10 +106,23 @@

    Harvest Report

    }, methods: { saveReport: function(){ - this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); - this.language = "English"; - this.user = "manager1"; - this.farm = "Sample Farm"; + + + axios.get('/farm.json') // this line sends the request. + .then((response) => { + console.log("Got Response") + console.log(response) + + }) + .catch((error) => { + console.log("Error Occurred") + console.log(error) + + }) + this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); + this.language = "English"; + this.user = "manager1"; + this.farm = "Sample Farm"; }, changeState: function(newState){ this.state = newState; From 5acd265d8d330a5a42dd304774ab726447ed8d30 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Mon, 30 Oct 2023 22:05:21 -0400 Subject: [PATCH 26/37] made farm, user, and language data be grabbed from api --- .../farmdata2_modules/fd2_school/API/api.html | 17 +++++++---------- .../fd2_school/fd2_school.module | 4 ++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/API/api.html b/farmdata2/farmdata2_modules/fd2_school/API/api.html index e2f0d0fe1e..223a71a8d9 100644 --- a/farmdata2/farmdata2_modules/fd2_school/API/api.html +++ b/farmdata2/farmdata2_modules/fd2_school/API/api.html @@ -91,8 +91,7 @@

    Harvest Report

    var vueSpike = new Vue({ el: "#vue_spike2", data: { - love: "" - ,farm: "", + farm: "", user: "", language: "", state: "nullReport", @@ -106,12 +105,11 @@

    Harvest Report

    }, methods: { saveReport: function(){ - - axios.get('/farm.json') // this line sends the request. .then((response) => { - console.log("Got Response") - console.log(response) + this.language = response.data.languages.en.name; + this.user = response.data.user.name; + this.farm = response.data.name; }) .catch((error) => { @@ -119,10 +117,9 @@

    Harvest Report

    console.log(error) }) - this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); - this.language = "English"; - this.user = "manager1"; - this.farm = "Sample Farm"; + + this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); + }, changeState: function(newState){ this.state = newState; diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 67956d3bb2..a6873801ea 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -79,11 +79,11 @@ function fd2_school_menu() { 'weight' => 110, ); - $items['farm/fd2-school/api'] = array( + $items['farm/fd2-school/API'] = array( 'title' => 'API', 'type' => MENU_LOCAL_TASK, 'page callback' => 'fd2_school_view', - 'page arguments' => array('api'), + 'page arguments' => array('API'), 'access arguments' => array('view fd2 school'), 'weight' => 110, ); From d3077a415fbee19d31a66db4fbe47f0b1eaa5f32 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Mon, 30 Oct 2023 23:36:53 -0400 Subject: [PATCH 27/37] populated crop dropdown with data from api --- .../farmdata2_modules/fd2_school/API/api.html | 22 +++++++++++++++++-- .../fd2_school/fd2_school.module | 4 ++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/API/api.html b/farmdata2/farmdata2_modules/fd2_school/API/api.html index 223a71a8d9..38c17b5b94 100644 --- a/farmdata2/farmdata2_modules/fd2_school/API/api.html +++ b/farmdata2/farmdata2_modules/fd2_school/API/api.html @@ -26,7 +26,7 @@

    Harvest Report

    @@ -102,6 +102,7 @@

    Harvest Report

    areas: ["All", "Chuau-1", "SQ7"], harvestLogs: [ ], + idToCropMap: new Map() }, methods: { saveReport: function(){ @@ -126,7 +127,24 @@

    Harvest Report

    } - } + }, + + computed: { + cropNames(){ + return Array.from(this.idToCropMap.values()); + } + }, + + created() { + getIDToCropMap() + .then((theMap) => { + this.idToCropMap = theMap; + }) + + .catch((err) => { + console.log("error getting ID to CropMap") + }) + }, }) Vue.config.devtools = true diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index a6873801ea..67956d3bb2 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -79,11 +79,11 @@ function fd2_school_menu() { 'weight' => 110, ); - $items['farm/fd2-school/API'] = array( + $items['farm/fd2-school/api'] = array( 'title' => 'API', 'type' => MENU_LOCAL_TASK, 'page callback' => 'fd2_school_view', - 'page arguments' => array('API'), + 'page arguments' => array('api'), 'access arguments' => array('view fd2 school'), 'weight' => 110, ); From 8cc3febb02486b8daa253ac798bc26c357cabd92 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Tue, 31 Oct 2023 10:01:53 -0400 Subject: [PATCH 28/37] Added API2 subtab to HTML --- .../fd2_school/API2/api2.html | 152 ++++++++++++++++++ .../fd2_school/fd2_school.module | 9 ++ 2 files changed, 161 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/API2/api2.html diff --git a/farmdata2/farmdata2_modules/fd2_school/API2/api2.html b/farmdata2/farmdata2_modules/fd2_school/API2/api2.html new file mode 100644 index 0000000000..38c17b5b94 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/API2/api2.html @@ -0,0 +1,152 @@ + + +
    + +

    +

    Harvest Report

    +

    This page is a mockup of a simplified harvest report.

    + + + + + +
    + +
    + + + + +
    + +
    + +
    + + + + + +
    + +
    + + + +
    + + +

    {{ title ? title : "Mock Harvest Report" }}

    + + +

    Details:

    + +
      +
    • Farm: {{ farm }}
    • +
    • User: {{ user }}
    • +
    • Language: {{ language }}
    • +
    + +
    + +
      +
    • Start: {{ startDate }}
    • +
    • End: {{ endDate }}
    • +
    • Crop: {{ crops }}
    • +
    + +

    There are no matching records

    +
    + + + + + + + + + + + + + + + + + +
    RowDateAreaCropYieldUnits
    {{ index + 1 }}{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
    + + +
    + +
    + + + + \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 67956d3bb2..6e22d6e25d 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -88,6 +88,15 @@ function fd2_school_menu() { 'weight' => 110, ); + $items['farm/fd2-school/api2'] = array( + 'title' => 'API2', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('api2'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + // Define the name and URL for the default sub-tab that appears when the tab is opened. // Content for this default sub-tab is provided by the 'page arguments' above. $items['farm/fd2-school/info'] = array( From b2b273fe19fb57d80202a7e12e954eb9a9e76759 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Tue, 31 Oct 2023 13:23:20 -0400 Subject: [PATCH 29/37] Added script to pull harvest logs from API into array in HTML --- .../fd2_school/API2/api2.html | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/API2/api2.html b/farmdata2/farmdata2_modules/fd2_school/API2/api2.html index 38c17b5b94..8e3c0db951 100644 --- a/farmdata2/farmdata2_modules/fd2_school/API2/api2.html +++ b/farmdata2/farmdata2_modules/fd2_school/API2/api2.html @@ -91,6 +91,10 @@

    Harvest Report

    var vueSpike = new Vue({ el: "#vue_spike2", data: { + harvestPages: [], + harvestRequest: "", + endTimestamp: "", + startTimestamp: "", farm: "", user: "", language: "", @@ -111,7 +115,7 @@

    Harvest Report

    this.language = response.data.languages.en.name; this.user = response.data.user.name; this.farm = response.data.name; - + }) .catch((error) => { console.log("Error Occurred") @@ -119,6 +123,25 @@

    Harvest Report

    }) + let startTimestamp = dayjs(this.startDate).unix(); + let endTimestamp = dayjs(this.endDate).unix(); + console.log(startTimestamp) + console.log(endTimestamp) + let harvestRequest = "/log.json?type=farm_harvest×tamp[ge]=" + startTimestamp + + "×tamp[le]=" + endTimestamp; + console.log(harvestRequest) + + getAllPages(harvestRequest) + .then((res) => { + this.harvestPages = res + }) + .catch((err) => { + console.log("Error Occurred Getting Pages") + console.log(error) + }) + + + this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); }, From 1d3dd48c46161fd232fd3c9acaab9d55332600ca Mon Sep 17 00:00:00 2001 From: anemervontage Date: Tue, 31 Oct 2023 13:51:06 -0400 Subject: [PATCH 30/37] Populated report table with harvest log info from API --- .../fd2_school/API2/api2.html | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/API2/api2.html b/farmdata2/farmdata2_modules/fd2_school/API2/api2.html index 8e3c0db951..365841ae2a 100644 --- a/farmdata2/farmdata2_modules/fd2_school/API2/api2.html +++ b/farmdata2/farmdata2_modules/fd2_school/API2/api2.html @@ -72,7 +72,7 @@

    Harvest Report

    Yield Units - + {{ index + 1 }} {{ cell.date }} {{ cell.area }} @@ -142,7 +142,7 @@

    Harvest Report

    - this.harvestLogs.push({date:"2018-05-01", area:"Orion-3", crop:"Kale", yield:12, units:"Bunches"}); + this.harvestLogs.push({date:"", area:"", crop:"", yield:"", units:""}); }, changeState: function(newState){ @@ -155,7 +155,23 @@

    Harvest Report

    computed: { cropNames(){ return Array.from(this.idToCropMap.values()); - } + }, + + harvestReportRows() { + let tableRows = [] + for(let log of this.harvestPages) { + let tableRow = { + date: dayjs.unix(log.timestamp).format('MM/DD/YYYY'), + area: log.area[0].name, + yield: log.quantity[0].value, + units: log.quantity[0].unit.name, + crop: this.idToCropMap.get(log.data.crop_tid) + } + tableRows.push(tableRow) + } + return tableRows + } + }, created() { From 321ec5000301987075785bb39b09030a351edfc3 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Tue, 31 Oct 2023 21:07:16 -0400 Subject: [PATCH 31/37] completed cypress tutorial --- .../farmdata2_modules/fd2_school/first.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/first.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_school/first.spec.js b/farmdata2/farmdata2_modules/fd2_school/first.spec.js new file mode 100644 index 0000000000..829dbb7710 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/first.spec.js @@ -0,0 +1,17 @@ +describe('My First Test', () => { + it('Gets, types and asserts', () => { + cy.visit('https://example.cypress.io') + + cy.contains('type').click() + + // Should be on a new URL which + // includes '/commands/actions' + cy.url().should('include', '/commands/actions') + + // Get an input, type into it + cy.get('.action-email').type('fake@email.com') + + // Verify that the value has been updated + cy.get('.action-email').should('have.value', 'fake@email.com') + }) +}) \ No newline at end of file From 98a1346d653710d3f3a3c8b9e0c4b119bd8b1429 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 2 Nov 2023 22:10:01 -0400 Subject: [PATCH 32/37] Added E2E subtab to HTML --- .../farmdata2_modules/fd2_school/E2E/e2e.html | 191 ++++++++++++++++++ .../fd2_school/fd2_school.module | 9 + 2 files changed, 200 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html new file mode 100644 index 0000000000..365841ae2a --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html @@ -0,0 +1,191 @@ + + +
    + +

    +

    Harvest Report

    +

    This page is a mockup of a simplified harvest report.

    + + + + + +
    + +
    + + + + +
    + +
    + +
    + + + + + +
    + +
    + + + +
    + + +

    {{ title ? title : "Mock Harvest Report" }}

    + + +

    Details:

    + +
      +
    • Farm: {{ farm }}
    • +
    • User: {{ user }}
    • +
    • Language: {{ language }}
    • +
    + +
    + +
      +
    • Start: {{ startDate }}
    • +
    • End: {{ endDate }}
    • +
    • Crop: {{ crops }}
    • +
    + +

    There are no matching records

    +
    + + + + + + + + + + + + + + + + + +
    RowDateAreaCropYieldUnits
    {{ index + 1 }}{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
    + + +
    + +
    + + + + \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 6e22d6e25d..da4e91906b 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -97,6 +97,15 @@ function fd2_school_menu() { 'weight' => 110, ); + $items['farm/fd2-school/E2E'] = array( + 'title' => 'E2E', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('E2E'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + // Define the name and URL for the default sub-tab that appears when the tab is opened. // Content for this default sub-tab is provided by the 'page arguments' above. $items['farm/fd2-school/info'] = array( From 8aa8a1fb83fd733ab79c10a4b2add736892d15cf Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 2 Nov 2023 22:25:06 -0400 Subject: [PATCH 33/37] Created Farmdata E2E test using Cypress --- .../fd2_school/E2E/e2e.defaults.spec.js | 14 ++++++++++++++ .../farmdata2_modules/fd2_school/E2E/e2e.html | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js new file mode 100644 index 0000000000..d5a2949a85 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js @@ -0,0 +1,14 @@ +describe("Test the harvest report default values", () => { + beforeEach(() => { + cy.login("manager1", "farmdata2") + cy.visit("/farm/fd2-school/e2e") + }) + + it("Check the page header", () => { + + cy.get("[data-cy=page-header]") + .should("have.text","Harvest Rpt") + + + }) +}) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html index 365841ae2a..36926f0bf5 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html @@ -3,7 +3,7 @@

    -

    Harvest Report

    +

    Harvest Report

    This page is a mockup of a simplified harvest report.

    From 503eb83f44124fac875cc100e6e769f559c567da Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 2 Nov 2023 22:36:08 -0400 Subject: [PATCH 34/37] Created Farmdata E2E test for start and end date default values --- .../fd2_school/E2E/e2e.defaults.spec.js | 13 ++++++++++++- farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js index d5a2949a85..526467339d 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js @@ -7,8 +7,19 @@ describe("Test the harvest report default values", () => { it("Check the page header", () => { cy.get("[data-cy=page-header]") - .should("have.text","Harvest Rpt") + .should("have.text","Harvest Report") }) + + it("Check the default start and end dates", () => { + + cy.get("[data-cy=start-date]") + .should("have.value", "2020-05-05") + + cy.get("[data-cy=end-date]") + .should("have.value", "2020-05-15") + }) + + }) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html index 36926f0bf5..c37f8ab0bc 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html @@ -14,10 +14,10 @@

    Harvest Report

    - -
    From 9e38006ae8969d4da27095cf268f6cd497cb443d Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 2 Nov 2023 22:51:36 -0400 Subject: [PATCH 35/37] Created Farmdata E2E test for crop dropdown element --- .../fd2_school/E2E/e2e.defaults.spec.js | 15 +++++++++++++++ .../farmdata2_modules/fd2_school/E2E/e2e.html | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js index 526467339d..b3e3fdee01 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js @@ -22,4 +22,19 @@ describe("Test the harvest report default values", () => { }) + it("Check the crops in crop dropdown", () => { + + cy.get("[data-cy=crop-drop]").children().eq(0) + .should("have.text", "ARUGULA") + + cy.get("[data-cy=crop-drop]").children().eq(4) + .should("have.text", "BEAN-FAVA") + + cy.get("[data-cy=crop-drop]").children().eq(110) + .should("have.text", "ZUCCHINI") + + cy.get("[data-cy=crop-drop]").children() + .should("have.length", "111") + }) + }) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html index c37f8ab0bc..c72990f2e8 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html @@ -25,7 +25,7 @@

    Harvest Report

    - From c7cef9e2d3c5c35f78cb47f45b2b367126e591fd Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 2 Nov 2023 23:12:18 -0400 Subject: [PATCH 36/37] Created Farmdata E2E test for Generate Button --- .../fd2_school/E2E/e2e.generate.spec.js | 21 +++++++++++++++++++ .../farmdata2_modules/fd2_school/E2E/e2e.html | 11 +++++----- 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js new file mode 100644 index 0000000000..080c43dfb7 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js @@ -0,0 +1,21 @@ +describe("Test values after clicking Generate Report", () => { + beforeEach(() => { + cy.login("manager1", "farmdata2") + cy.visit("/farm/fd2-school/e2e") + }) + + it("Check Generate Button", () => { + + cy.get("[data-cy=title-element]") + .should("not.exist") + + cy.get("[data-cy=generate-report-button]").click() + + cy.get("[data-cy=title-element]") + .should("be.visible") + + + }) + + +}) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html index c72990f2e8..32ee4c3352 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html @@ -37,17 +37,16 @@

    Harvest Report


    - +
    - -

    {{ title ? title : "Mock Harvest Report" }}

    +

    {{ title ? title : "Mock Harvest Report" }}

    -

    Details:

    +

    Details:

    -
      +
      • Farm: {{ farm }}
      • User: {{ user }}
      • Language: {{ language }}
      • @@ -55,7 +54,7 @@

        Harvest Report


        -
          +
          • Start: {{ startDate }}
          • End: {{ endDate }}
          • Crop: {{ crops }}
          • From 4430ca8e06b3204ff6f70e2a96e39b72cbcb8168 Mon Sep 17 00:00:00 2001 From: anemervontage Date: Thu, 2 Nov 2023 23:25:36 -0400 Subject: [PATCH 37/37] Update Farmdata E2E test for Generate Button to include tests for report details --- .../fd2_school/E2E/e2e.generate.spec.js | 15 +++++++++++++++ .../farmdata2_modules/fd2_school/E2E/e2e.html | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js index 080c43dfb7..ddbfe0d503 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js @@ -16,6 +16,21 @@ describe("Test values after clicking Generate Report", () => { }) + it("Check Report Info", () => { + + cy.get("[data-cy=generate-report-button]").click() + + cy.get("[data-cy=report-info]").children().eq(0) + .should("contain.text", "Sample Farm") + + cy.get("[data-cy=report-info]").children().eq(1) + .should("contain.text", "manager1") + + cy.get("[data-cy=language]") + .should("contain.text", "English") + + }) + }) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html index 32ee4c3352..b054fda162 100644 --- a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html @@ -46,10 +46,10 @@

            Harvest Report

            Details:

            -
              +
              • Farm: {{ farm }}
              • User: {{ user }}
              • -
              • Language: {{ language }}
              • +
              • Language: {{ language }}