Skip to content

Commit

Permalink
lintfix
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Dec 6, 2024
1 parent 30ab197 commit aca1551
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
15 changes: 8 additions & 7 deletions source/components/Layout/VisGridView/SideView/SideView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { useState, useRef, useEffect, useContext, useMemo } from 'react';
import React, {
useState, useRef, useEffect, useContext, useMemo,
} from 'react';
import { debounce } from 'lodash';
import PropTypes from 'prop-types';
import VisItem from './VisItem/VisItem';
Expand All @@ -24,13 +26,12 @@ function SideView({ fullVisScreenHandler, fullScreened, designation }) {
const self = useRef();

const visConfig = useMemo(() => {
if (designation === "*") {
if (designation === '*') {
return AllVisConfig; // For '*' don't filter, just show all
} else {
return AllVisConfig.filter(
(x) => x.designation === designation || (!x.designation && designation === "default")
);
}
return AllVisConfig.filter(
(x) => x.designation === designation || (!x.designation && designation === 'default'),
);
}, [AllVisConfig, designation]);

const updateViewSize = () => {
Expand Down Expand Up @@ -103,5 +104,5 @@ SideView.propTypes = {
};

SideView.defaultProps = {
designation: "*",
designation: '*',
};
10 changes: 5 additions & 5 deletions source/components/Layout/VisGridView/SideView/VisItem/VisItem.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState, useContext, useEffect } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import VisItemContent from './VisItemContent/VisItemContent';
import VisItemHeader from './VisItemHeader/VisItemHeader';
import { DataContext } from '../../../../../contexts/DataContext';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
// css class
import './VisItem.css';

Expand All @@ -19,7 +19,7 @@ function VisItem(props) {
};

const toggleCollapse = () => {
setIsCollapsed(prevState => !prevState); // Toggle collapse state
setIsCollapsed((prevState) => !prevState); // Toggle collapse state
};

const {
Expand All @@ -37,7 +37,7 @@ function VisItem(props) {
onMouseLeave={onMouseLeaveHandle}
style={{
height: isCollapsed ? '25px' : '300px', // Adjust height based on collapsed state
//transition: 'height 0.3s ease', // Smooth transition for height change
// transition: 'height 0.3s ease', // Smooth transition for height change
}}
>
<VisItemHeader
Expand All @@ -57,7 +57,7 @@ function VisItem(props) {
{/* Render content based on isCollapsed */}
{isCollapsed ? (

Check failure on line 58 in source/components/Layout/VisGridView/SideView/VisItem/VisItem.js

View workflow job for this annotation

GitHub Actions / Run npm lint

Do not nest ternary expressions
<div className="collapsed-state">
<p></p>
<p />
</div>
) : (
props.isResizing ? (
Expand Down Expand Up @@ -107,7 +107,7 @@ VisItem.propTypes = {
}),
fullScreened: PropTypes.bool.isRequired,
toggleFullScreen: PropTypes.func.isRequired,
isResizing: PropTypes.bool, // Ensuring isResizing is also considered
isResizing: PropTypes.bool, // Ensuring isResizing is also considered
logScale: PropTypes.bool,

Check failure on line 111 in source/components/Layout/VisGridView/SideView/VisItem/VisItem.js

View workflow job for this annotation

GitHub Actions / Run npm lint

propType "logScale" is not required, but has no corresponding defaultProps declaration
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ function VisItemContent(props) {
case 'VisDataTable':
component = <VisDataTable {...props} />;
break;
case 'SelectDataTable':
component = <SelectDataTable {...props} />;
break;
case 'VisCard':
component = <VisCard {...props} />;
break;
Expand All @@ -68,7 +65,7 @@ function VisItemContent(props) {
default:
component = (
<div>
I&apos;m Sorry. There Is No
I&apos;m Sorry. There Is No
{TagName}
{' '}
Component...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ function VisItemControl(props) {
background: 'none',
border: 'none',
}}
aria-label={props.isCollapsed ? "Expand" : "Collapse"}
aria-label={props.isCollapsed ? 'Expand' : 'Collapse'}
onClick={props.toggleCollapse}
>
<FontAwesomeIcon icon={props.isCollapsed ? faUpRightAndDownLeftFromCenter : faSquareMinus} />
<FontAwesomeIcon icon={props.isCollapsed ? faUpRightAndDownLeftFromCenter : faSquareMinus} />

Check failure on line 43 in source/components/Layout/VisGridView/SideView/VisItem/VisItemControl/VisItemControl.js

View workflow job for this annotation

GitHub Actions / Run npm lint

This line has a length of 105. Maximum allowed is 100
</Button>
<Button
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ VisItemHeader.propTypes = {
fullScreened: PropTypes.bool.isRequired,
toggleFullScreen: PropTypes.func.isRequired,
setHover: PropTypes.func.isRequired,
toggleCollapse: PropTypes.func.isRequired,
toggleCollapse: PropTypes.func.isRequired,
isCollapsed: PropTypes.bool.isRequired,
};

0 comments on commit aca1551

Please sign in to comment.