Skip to content

Commit b9bf80c

Browse files
committed
resolved linting errors
1 parent e553c8a commit b9bf80c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/components/ListResultTable/QueryResultList/TableHeader/TableHeader.jsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,26 @@ import "./TableHeader.css";
55
import NorthIcon from "@mui/icons-material/North";
66
import SouthIcon from "@mui/icons-material/South";
77
import LinkIcon from "@mui/icons-material/Link";
8+
import PropTypes from "prop-types";
9+
import { Component } from "react";
810

11+
/**
12+
*
13+
* @param {object} props the props passed down to the component
14+
* @param {Array<Component>} props.children the children of the component
15+
* @param {object} props.config the config object of the application
16+
* @returns {Component} the header of the table containing the column names, the sort icons and ontology links
17+
*/
918
function TableHeader({ children, config }) {
1019
const { sort, setSort, resource } = useListContext();
1120
const { variableOntology } = config.queries.filter(
1221
(query) => query.id === resource
1322
)[0];
23+
24+
/**
25+
* Handles the click on a header and sets the sort state accordingly
26+
* @param {string} target the source of the column that was clicked
27+
*/
1428
function handleHeaderClick(target) {
1529
const newSort = { field: target, order: "DESC" };
1630
if (sort) {
@@ -34,7 +48,6 @@ function TableHeader({ children, config }) {
3448
sx={{ height: "100%", "& > *": { verticalAlign: "middle" } }}
3549
>
3650
<span
37-
variant="span"
3851
role="button"
3952
className="header-button"
4053
onClick={() => handleHeaderClick(child.props.source)}
@@ -77,4 +90,9 @@ function TableHeader({ children, config }) {
7790
);
7891
}
7992

93+
TableHeader.propTypes = {
94+
children: PropTypes.node,
95+
config: PropTypes.object.isRequired,
96+
97+
}
8098
export default TableHeader;

src/dataProvider/SparqlDataProvider.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ async function fetchQuery(query) {
122122
/**
123123
* Given a query and an object, this function returns the predicate of the object in the query.
124124
* @param {object} query the paresed query in which the predicate is to be looked for.
125+
* @returns {object} an object with the variable as key and the predicate as value.
125126
*/
126127
function findPredicates(query) {
127128
const ontologyMapper = {};
@@ -165,6 +166,7 @@ async function executeQuery(query) {
165166
/**
166167
* Generates the context for a query execution to be passed to Comunica engine when querying.
167168
* @param {object} context the context for the query given in the config file.
169+
* @returns {object} the context for the query execution.
168170
*/
169171
function generateContext(context) {
170172
if (!context) {

0 commit comments

Comments
 (0)