Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: events permissions #346

Merged

Conversation

slash-84
Copy link
Contributor

@slash-84 slash-84 commented Apr 10, 2024

move event permissions logic inside dedicate hook.

also address #343 (comment) for editable events, using priority control to event specific value

const triggerViewer = (el?: MouseEvent<Element>) => {
if (!el?.currentTarget && deleteConfirm) {
setDeleteConfirm(false);
}
setAnchorEl(el?.currentTarget || null);
};

const isDraggable = useMemo(() => {
// if Disabled
if (event.disabled || !editable) return false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aldabil21 inside the hook you will see I've removed event.disabled check because the button is already disabled, and the drag & drop is already prevented. This will help to implement priority control to event specific data.

@slash-84 slash-84 mentioned this pull request Apr 10, 2024
@aldabil21 aldabil21 changed the base branch from master to focus-cell-event April 10, 2024 07:23
@aldabil21 aldabil21 merged commit 92fd8e3 into aldabil21:focus-cell-event Apr 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants