Skip to content

Commit d201276

Browse files
committed
fix: Fixed linting erros
1 parent 111c152 commit d201276

7 files changed

Lines changed: 42 additions & 31 deletions

File tree

frontend/lib/public/Model.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default class Model extends Observable {
5555

5656
/**
5757
* Delegates sub-model actions depending on new location of the page
58+
* @returns {vnode} The page to be loaded
5859
*/
5960
handleLocationChange() {
6061
switch (this.router.params.page) {

frontend/lib/public/components/Filters/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const FILTERS_LIMITS = 5;
2121

2222
/**
2323
* Checkbox filter
24-
* @param {Object} model
25-
* @param {Array} tags
26-
* @return {vnode}
24+
* @param {Object} model Pass the model to access the defined functions
25+
* @param {Array} tags Pass the tags to load in the view
26+
* @return {vnode} Return the form to be shown
2727
*/
2828
const checkboxFilter = (model, tags) => {
2929
const checkboxes = Object.entries(tags).map(([tag, count], index) =>
@@ -56,9 +56,9 @@ const checkboxFilter = (model, tags) => {
5656

5757
/**
5858
* Render the filters
59-
* @param {Object} model
60-
* @param {Array} tags
61-
* @return {vnode}
59+
* @param {Object} model Pass the model to access the defined functions
60+
* @param {Array} tags Pass the tags to load in the view
61+
* @return {vnode} Return final view of the filtering form
6262
*/
6363
const filters = (model, tags) =>
6464
h('.w-25.shadow-level1.p2', [

frontend/lib/public/components/NavBar/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import { iconPerson } from '/js/src/icons.js';
2020

2121
/**
2222
* Top header of the page
23-
* @param {object} model
24-
* @param {pages}
25-
* @return {vnode}
23+
* @param {Object} model Pass the model to access the defined functions
24+
* @param {Array} pages THe pages in defined in the view.js file
25+
* @return {vnode} Returns the navbar
2626
*/
2727
const navBar = (model, pages) =>
2828
h('.flex-row.justify-between.items-center.ph4.pv2.shadow-level2.level2.bg-gray-light', [
@@ -33,9 +33,10 @@ const navBar = (model, pages) =>
3333
}),
3434
h('.f6', 'Logbook'),
3535
]),
36-
h('btn-group', Object.keys(pages).map((tab) => h(`button.btn.btn-tab ${model.router.params.page === tab ? 'selected' : ''}`, {
37-
onclick: () => model.router.go(`?page=${tab}`),
38-
}, tab[0].toUpperCase() + tab.slice(1)))),
36+
h('btn-group', Object.keys(pages).map((tab) =>
37+
h(`button.btn.btn-tab ${model.router.params.page === tab ? 'selected' : ''}`, {
38+
onclick: () => model.router.go(`?page=${tab}`),
39+
}, tab[0].toUpperCase() + tab.slice(1)))),
3940
h('button.btn.h3', iconPerson()),
4041
]);
4142

frontend/lib/public/components/Table/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ import { h } from '/js/src/index.js';
1919

2020
/**
2121
* Table row header
22-
* @param {String} header
23-
* @return {vnode}
22+
* @param {String} header The text of the header elements
23+
* @return {vnode} Return a single row header element
2424
*/
2525
const rowHeader = (header) => [h('th', header)];
2626

2727
/**
2828
* Table data row
29-
* @param {Object} data
30-
* @return {vnode}
29+
* @param {Object} data The data to be rendered in the child element of the row
30+
* @return {vnode} Return a row of data in the table
3131
*/
3232
const rowData = (data) => [h('td', data)];
3333

3434
/**
3535
* Renders the table
36-
* @param {Array} data
37-
* @param {Array} headers
38-
* @returns {vnode}
36+
* @param {Array} data The data array containing the objects with the data per row
37+
* @param {Array} headers The array of of the headers to be rendered in the table
38+
* @returns {vnode} Return the total view of the table to rendered
3939
*/
4040
const table = (data, headers) => h('table.table.shadow-level1.mh3', [
4141
h('tr', [headers.map((header) => rowHeader(header))]),

frontend/lib/public/view.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export default (model) => {
4040

4141
/**
4242
* Page content
43-
* @param {object} model
44-
* @return {vnode}
43+
* @param {Object} model Pass the model object to the child
44+
* @param {Object} pages Pass the pages to the switchcase
45+
* @returns {vnode} Returns a vnode to render the pages
4546
*/
4647
const content = (model, pages) => h('.p4', switchCase(model.router.params.page, pages)(model));

frontend/lib/public/views/Overview/General/page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default (model) => [overviewScreen(model)];
2323

2424
/**
2525
* Table row header
26-
* @param {object} model
27-
* @return {vnode}
26+
* @param {object} model Pass the model to access the defined functions
27+
* @return {vnode} Return the view of the table with the filtering options
2828
*/
2929
const overviewScreen = (model) => {
3030
const headers = model.overview.getHeaders();

frontend/lib/public/views/Overview/Overview.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import { Observable } from '/js/src/index.js';
2222
*/
2323
export default class Overview extends Observable {
2424
/**
25-
* @param {Object} model
25+
* The constructor of the Overview model object
26+
* @param {Object} model Pass the model to access the defined functions
27+
* @returns {Object} Constructs the Overview model
2628
*/
2729
constructor(model) {
2830
super();
@@ -54,14 +56,16 @@ export default class Overview extends Observable {
5456
}
5557

5658
/**
57-
* @returns {Array} headers
59+
* Get the headers from the Overview class
60+
* @returns {Array} Returns the headers
5861
*/
5962
getHeaders() {
6063
return this.headers;
6164
}
6265

6366
/**
64-
* @returns {Array} subentries
67+
* Get the table data
68+
* @returns {Array} The data without the tags to be rendered in a table
6569
*/
6670
getTableData() {
6771
const subentries = this.filtered.map((entry) => {
@@ -79,7 +83,8 @@ export default class Overview extends Observable {
7983

8084
/**
8185
* Add filter to the selection
82-
* @param {string} tag
86+
* @param {string} tag The tag to be added to the filter criteria
87+
* @returns {Array} Sets the data according to the filters applied
8388
*/
8489
addFilter(tag) {
8590
this.filterCriteria = [...this.filterCriteria, tag];
@@ -88,7 +93,8 @@ export default class Overview extends Observable {
8893

8994
/**
9095
* Remove filter from the selection
91-
* @param {string} condition
96+
* @param {string} condition The ocondition to filter the array on
97+
* @returns {Array} Sets the array with the new filter criteria
9298
*/
9399
removeFilter(condition) {
94100
this.filterCriteria = this.filterCriteria.filter((tag) => tag !== condition);
@@ -97,6 +103,7 @@ export default class Overview extends Observable {
97103

98104
/**
99105
* Filter the data
106+
* @returns {Array} Sets the data according to the amount of applied filters
100107
*/
101108
getFilteredData() {
102109
this.filterCriteria.length !== 0
@@ -108,6 +115,7 @@ export default class Overview extends Observable {
108115

109116
/**
110117
* Filter data by tags if applicable
118+
* @returns {Array} Sets the filtered data on the criterium applied by the user
111119
*/
112120
filterByTags() {
113121
this.filtered = this.data
@@ -125,8 +133,8 @@ export default class Overview extends Observable {
125133

126134
/**
127135
* Check for an existing tag
128-
* @param {object} entry
129-
* @return {bool}
136+
* @param {Object} entry The entry in the total array of the data
137+
* @return {Boolean} Returns the status of the existence of a tag in the data entry
130138
*/
131139
checkExistingTag(entry) {
132140
const check = this.filterCriteria.map((tag) => {
@@ -142,7 +150,7 @@ export default class Overview extends Observable {
142150

143151
/**
144152
* Counts the tags with their total appearances
145-
* @return {object}
153+
* @return {Object} Returns the count of each tag
146154
*/
147155
getTagCounts() {
148156
return this.data.reduce((accumulator, currentValue) => {

0 commit comments

Comments
 (0)