Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
90abe2f
Added HTML subtab to FD2 School Tab
Feb 9, 2024
39006ce
Modified HTML subtab to include sample harvest report
Feb 9, 2024
e21d970
Improved HTML subtab to use italics and line spacing
Feb 9, 2024
7e6ec37
Improved HTML subtab by adding text field and generate report button
Feb 9, 2024
9129439
Improved HTML subtab by adding crop, field, and date elements
Feb 9, 2024
2d65402
Improved HTML subtab by adding the HTML table at the bottom
Feb 9, 2024
be2af41
Added Vue1 subtab that's identical to HTML subtab
Feb 19, 2024
366e9c2
Modified Vue1 subtab to include data binding between title input fiel…
Feb 19, 2024
6ac6ccb
Modified Vue1 subtab to bind start date, end date, and crop starting …
Feb 19, 2024
334d484
Modified Vue1 subtab so that an empty title will display mock harvest…
Feb 19, 2024
670eed8
Modified Vue1 subtab so that crop and area options are generated from…
Feb 19, 2024
5f98c5d
Modified Vue1 subtab so that the table is generated by arrays from th…
Feb 19, 2024
e795359
Added vue devtools capabilities to FarmData2
Feb 19, 2024
bf11284
updated vuespike.html
Mar 1, 2024
1259e6b
created Vue2 subtab identical to Vue1 subtab
Mar 1, 2024
f8537f9
modified Vue2 subtab so it generates a row of data after clicking Gen…
Mar 3, 2024
380f02c
modified vue instance in vue2 file so that it uses methods to generat…
Mar 3, 2024
b49d93e
created a new column that labels the row number for the table
Mar 3, 2024
09e78a5
Added feature to vue2 subtab so that a message will be displayed when…
Mar 4, 2024
2e28ee3
Used v-bind to bind startDate and endDate values
Mar 4, 2024
cead6e9
Added feature to API subtab with same content as Vue2 subtab
Mar 9, 2024
eaa1970
Binded Farm, User, and Language values to Vue instance
Mar 9, 2024
432cce8
modified API subtab so Generate Report button also generates farm, us…
Mar 9, 2024
9fdb36c
modified addReport method to get data from name, language, user from API
Mar 10, 2024
0177e9a
modified harvest report so that crop dropdown menu contains all crops…
Mar 15, 2024
78312df
added API2 subtab to fd2School tab
Mar 23, 2024
a6de209
converted dates to timestamps and used getAllPages function
Mar 23, 2024
4807c1b
modified computed property so that everything in table is generated c…
Mar 23, 2024
7cc8371
Only specifically selected crops from the dropdown menu will be shown…
Mar 23, 2024
6dbc40e
created first real cypress test
Apr 16, 2024
93c9ff3
Added e2e subtab
Apr 17, 2024
cdf7bd3
created test to check for page header
May 4, 2024
f1e8d25
checked that start and end dates had the correct default values
May 4, 2024
8496163
checked that crop dropdown values and length is correct
May 4, 2024
f8684fd
checked whether the generate report button does what it's supposed to
May 4, 2024
7c005c3
made tests for farm name, user name, language
May 4, 2024
f384b52
created FD2 subtab
May 4, 2024
60f8ffe
modified dropdown to use new farmdata vue components
May 4, 2024
bd41b16
modified fd2 test file to visit fd2 instead of e2e
May 4, 2024
00a9ba6
fixed failing tests by using new data-cy attributes
May 4, 2024
33aadbf
created the CustomTableComponent over the original HTML table
May 4, 2024
b1ce499
created fd2 table test file that has the same content as defaults.spe…
May 4, 2024
0112bb2
added tests for the table headers
May 4, 2024
8f6df11
added tests for the table columns
May 4, 2024
2c76295
added test to check the crop filtering for zucchini
May 4, 2024
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
86 changes: 86 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<h1>Harvest Report</h1>
<p>This page is a <i>mockup</i> of a simplified harvest report.</p>
<div id="report-title" v-cloak>
<p>Title: <input type="text" size="21" v-model="header" /></p>
<br />
<label>
Start:
<input type="date" v-model="startDate" name="start_date" min="2014-01-01" max="2022-01-1" />
</label>
<label>
End:
<input type="date" v-model="endDate" name="end_date" min="2020-05-05" max="2022-01-1" />
</label>
<br />
<br />
<label>
Crop:
<select id="crop" name="crop">
<option v-for="crop in crops">{{ crop }}</option>
</select>
</label>
<label>
Area:
<select id="area" name="area">
<option v-for="area in areas">{{ area }}</option>
</select>
</label>
<br />
<br />
<button type="button">Generate Report</button>
<hr />
<h1>{{ header == "" ? "Mock Harvest Report" : header }}</h1>
<p>Details:</p>
<ul>
<li><strong>Farm:</strong>Sample Farm</li>
<li><strong>User:</strong>manager1</li>
<li><strong>Language:</strong>English</li>
</ul>
<br />
<ul>
<li><strong>Start:</strong>05/01/2018</li>
<li><strong>End:</strong>05/15/2018</li>
<li><strong>Crop:</strong>Kale</li>
</ul>
<table border="1">
<tr>
<th>Date</th>
<th>Area</th>
<th>Crop</th>
<th>Yield</th>
<th>Units</th>
</tr>
<tr v-for="log in logs">
<td>{{ log.date }}</td>
<td>{{ log.area }}</td>
<td>{{ log.crop }}</td>
<td>{{ log.yield }}</td>
<td>{{ log.units }}</td>
</tr>
</table>
</div>
<script>
var reportTitle = new Vue({
el: "#report-title",
data: {
header: "My Sample Harvest Report",
startDate: "2020-05-05",
endDate: "2020-05-15",
crops: [
"Broccoli",
"Kale",
"Peas",
],
areas: [
"All",
"Chuau-1",
"SQ7",
],
logs: [

{ 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" }],
}
})
Vue.config.devtools = true;
</script>
98 changes: 98 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<h1>Harvest Report</h1>
<p>This page is a <i>mockup</i> of a simplified harvest report.</p>
<div id="report-title" v-cloak>
<p>Title: <input type="text" size="21" v-model="header" /></p>
<br />
<label>
Start:
<input type="date" id="start_date" v-model="startDate" name="start_date" v-bind:max="endDate" value="2020-05-05" />
</label>
<label>
End:
<input type="date" id='end_date' v-model="endDate" name="end_date" v-bind:min="startDate" value="2020-05-15" />
</label>
<br />
<br />
<label>
Crop:
<select id="crop" name="crop">
<option v-for="crop in crops">{{ crop }}</option>
</select>
</label>
<label>
Area:
<select id="area" name="area">
<option v-for="area in areas">{{ area }}</option>
</select>
</label>
<br />
<br />
<button type="button" @click="addReport">Generate Report</button>
<hr />
<h1>{{ header == "" ? "Mock Harvest Report" : header }}</h1>
<p>Details:</p>
<ul>
<li><strong>Farm:</strong>Sample Farm</li>
<li><strong>User:</strong>manager1</li>
<li><strong>Language:</strong>English</li>
</ul>
<br />
<ul>
<li><strong>Start:</strong>05/01/2018</li>
<li><strong>End:</strong>05/15/2018</li>
<li><strong>Crop:</strong>Kale</li>
</ul>
<div v-if="logs.length > 0">
<table border="1">
<tr>
<th>Date</th>
<th>Area</th>
<th>Crop</th>
<th>Yield</th>
<th>Units</th>
<th>Row</th>
</tr>
<tr v-for="(log, index) in logs">
<td>{{ index }}</td>
<td>{{ log.date }}</td>
<td>{{ log.area }}</td>
<td>{{ log.crop }}</td>
<td>{{ log.yield }}</td>
<td>{{ log.units }}</td>
</tr>
</table>
</div>
<p v-else>There are no matching records found.</p>
</div>
<script>
var reportTitle = new Vue({
el: "#report-title",
data: {
header: "My Sample Harvest Report",
startDate: "2020-05-05",
endDate: "2020-05-15",
crops: [
"Broccoli",
"Kale",
"Peas",
],
areas: [
"All",
"Chuau-1",
"SQ7",
],
logs: [

{}
],
} ,

methods: {
addReport: function() {
this.logs.push({date: "2018-05-01", area: "Orion-3", crop: "Kale", yield: "12", units: "Bunches"});
}
}

})
Vue.config.devtools = true;
</script>
132 changes: 132 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/api/api.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<h1>Harvest Report</h1>
<p>This page is a <i>mockup</i> of a simplified harvest report.</p>
<div id="report-title" v-cloak>
<p>Title: <input type="text" size="21" v-model="header" /></p>
<br />
<label>
Start:
<input type="date" id="start_date" v-model="startDate" name="start_date" v-bind:max="endDate"
value="2020-05-05" />
</label>
<label>
End:
<input type="date" id='end_date' v-model="endDate" name="end_date" v-bind:min="startDate" value="2020-05-15" />
</label>
<br />
<br />
<label>
Crop:
<select id="crop" name="crop">
<option v-for="crop in cropNames">{{ crop }}</option>
</select>
</label>
<label>
Area:
<select id="area" name="area">
<option v-for="area in areas">{{ area }}</option>
</select>
</label>
<br />
<br />
<button type="button" @click="addReport">Generate Report</button>
<hr />
<h1>{{ header == "" ? "Mock Harvest Report" : header }}</h1>
<p>Details:</p>
<ul>
<li><strong>Farm:</strong>{{ farm }}</li>
<li><strong>User:</strong>{{ user }}</li>
<li><strong>Language:</strong>{{ language }}</li>
</ul>
<br />
<ul>
<li><strong>Start:</strong>05/01/2018</li>
<li><strong>End:</strong>05/15/2018</li>
<li><strong>Crop:</strong>Kale</li>
</ul>
<div v-if="logs.length > 0">
<table border="1">
<tr>
<th>Date</th>
<th>Area</th>
<th>Crop</th>
<th>Yield</th>
<th>Units</th>
<th>Row</th>
</tr>
<tr v-for="(log, index) in logs">
<td>{{ index }}</td>
<td>{{ log.date }}</td>
<td>{{ log.area }}</td>
<td>{{ log.crop }}</td>
<td>{{ log.yield }}</td>
<td>{{ log.units }}</td>
</tr>
</table>
</div>
<p v-else>There are no matching records found.</p>
</div>
<script>
var reportTitle = new Vue({
el: "#report-title",
created() {
console.log("HarvestReport Vue instance created!")
getIDToCropMap()
.then((theMap) => {
console.log("Map received")
this.idToCropMap = theMap
})

.catch((err) => {
console.log("Error Occurred")
console.log(error)
})


},

computed: {
cropNames() {
return Array.from(this.idToCropMap.values());
}
} ,

data: {
header: "My Sample Harvest Report",
startDate: "2020-05-05",
endDate: "2020-05-15",
farm: "",
user: "",
language: "",
idToCropMap: new Map(),

areas: [
"All",
"Chuau-1",
"SQ7",
],
logs: [

{}
],
},

methods: {
addReport: function () {
axios.get('/farm.json') // this line sends the request.
.then((response) => {
this.farm = response.data.name;
this.user = response.data.user.name;
this.language = response.data.languages.en.name;
})
.catch((error) => {
console.log("Error Occurred")
console.log(error);
})
this.logs.push({ date: "2018-05-01", area: "Orion-3", crop: "Kale", yield: "12", units: "Bunches" });

}
}

})
Vue.config.devtools = true;
</script>
Loading