Skip to content

Commit

Permalink
Merge branch 'current' into freshness
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshaver authored Jan 19, 2024
2 parents 6eccc9c + dc9ac9a commit 6a8ee06
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 23 deletions.
6 changes: 3 additions & 3 deletions website/snippets/_enterprise-permissions-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ The project roles enable you to work within the projects in various capacities.
| Credentials | W | W | W | W | R | W | | | | R | R | |
| Custom env. variables | W | W | W | W | W | W | R | | | R | W | |
| dbt adapters | W | W | W | W | R | W | | | | R | R | |
| Develop (IDE or dbt Cloud CLI) | W | W | | W | | | | | | | | |
| Develop <br />(IDE or dbt Cloud CLI) | W | W | | W | | | | | | | | |
| Environments | W | R | R | R | R | W | R | | | R | R | |
| Jobs | W | R | R | W | R | W | R | | | R | R | |
| Metadata | R | R | R | R | R | R | R | R | | R | R | |
| Permissions | W | | R | R | R | | | | | | W | |
| Profile | W | R | W | R | R | R | | | | R | R | |
| Permissions (Groups & Licenses) | W | | R | R | R | | | | | | W | |
| Profile (Credentials) | W | R | W | R | R | R | | | | R | R | |
| Projects | W | W | W | W | W | R | R | | | R | W | |
| Repositories | W | | R | R | W | | | | | R | R | |
| Runs | W | R | R | W | R | W | R | | | R | R | |
Expand Down
56 changes: 36 additions & 20 deletions website/src/components/detailsToggle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,49 @@ import styles from './styles.module.css';

function detailsToggle({ children, alt_header = null }) {
const [isOn, setOn] = useState(false);
const [hoverActive, setHoverActive] = useState(true);
const [isScrolling, setIsScrolling] = useState(false); // New state to track scrolling
const [hoverTimeout, setHoverTimeout] = useState(null);

const handleToggleClick = () => {
setHoverActive(true); // Disable hover when clicked
setOn(current => !current); // Toggle the current state
};

const handleMouseEnter = () => {
if (isOn) return; // Ignore hover if already open
setHoverActive(true); // Enable hover
const timeout = setTimeout(() => {
if (hoverActive) setOn(true);
}, 500);
setHoverTimeout(timeout);
};

const handleMouseLeave = () => {
if (!isOn) {
};

const handleMouseEnter = () => {
if (isOn || isScrolling) return; // Ignore hover if already open or if scrolling
const timeout = setTimeout(() => {
if (!isScrolling) setOn(true);
}, 700); //
setHoverTimeout(timeout);
};

const handleMouseLeave = () => {
if (!isOn) {
clearTimeout(hoverTimeout);
setOn(false);
}
};
}
};

const handleScroll = () => {
setIsScrolling(true);
clearTimeout(hoverTimeout);
setOn(false);

// Reset scrolling state after a delay
setTimeout(() => {
setIsScrolling(false);
}, 800);
};

useEffect(() => {
window.addEventListener('scroll', handleScroll);
return () => {
window.removeEventListener('scroll', handleScroll);
};
}, []);

useEffect(() => {
return () => clearTimeout(hoverTimeout);
}, [hoverTimeout]);
useEffect(() => {
return () => clearTimeout(hoverTimeout);
}, [hoverTimeout]);

return (
<div className='detailsToggle'>
Expand Down

0 comments on commit 6a8ee06

Please sign in to comment.