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

Approximate Functional Dependencies frontend #111

Draft
wants to merge 3 commits into
base: web-app-dev
Choose a base branch
from

Conversation

LiaSolo
Copy link
Collaborator

@LiaSolo LiaSolo commented Dec 19, 2023

No description provided.

web-app/client/src/constants/primitiveInfoType.ts Outdated Show resolved Hide resolved
Comment on lines 89 to 88
title={
'No clusters have been discovered (functional dependency holds)'
}
description={'Try restarting the task with different parameters'}
icon={<Arrow />}
/>
)}
{!clustersTotalCount && !data.result && (
<ReportFiller
title={
'No clusters have been discovered (functional dependency may not hold)'
}
description={'Try restarting the task with different parameters'}
icon={<ArrowCrossed />}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

prop="abc"

Comment on lines 3 to 17
.greenHighlighted {
background: $success-25 !important; // stylelint-disable-line declaration-no-important
}

.greenEven {
background: $success-05 !important; // stylelint-disable-line declaration-no-important
}

.greenOdd {
background: $success-10 !important; // stylelint-disable-line declaration-no-important
}

.redHighlighted {
background: $error-25 !important; // stylelint-disable-line declaration-no-important
}

.redEven {
background: $error-05 !important; // stylelint-disable-line declaration-no-important
}

.redOdd {
background: $error-10 !important; // stylelint-disable-line declaration-no-important
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Зачем important ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

и вроде бы highlighted не используется

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

highlated действительно не нужны, а без important получается вот так

Copy link
Collaborator

@kirill-stupakov kirill-stupakov Jan 1, 2024

Choose a reason for hiding this comment

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

Надо понять, почему так происходит (скорее всего из-за этой строчки).
Может быть можно добавить возможность контролировать альтернацию цветов через пропы ScrollableTable

Почитай ещё про specificity, если ещё не знаешь что это

Comment on lines 27 to 25
.checkmark {
path {
fill: $success-100;
stroke: none;
}
}

.cross {
path {
fill: $error-100;
stroke: none;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Это лучше сделать через currentColor

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

то есть? не понимаю

Copy link
Collaborator

@kirill-stupakov kirill-stupakov Jan 1, 2024

Choose a reason for hiding this comment

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

То есть импортировать иконки с _TEMPLATE_COLOR_-ом, и менять у них цвет через свойство color

Copy link
Collaborator

Choose a reason for hiding this comment

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

А зачем ты добавила страницу onScroll ?)

Каждый файл, находящиеся в папочке pages --- это отдельная страница

Copy link
Collaborator

Choose a reason for hiding this comment

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

Плюс этот хук надо ещё использовать в MFD


useEffect(() => {
shouldIgnoreScrollEvent.current = false;
}, [shouldIgnoreScrollEvent]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не уверен, что по логике тут должна быть эта зависимость. Вообще при изменении рефов компонент не обновляется, поэтому в общем случае писать рефы в зависимостях не стоит. Скорее тут limit

Copy link
Collaborator

Choose a reason for hiding this comment

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

UPD: В оригинале логика такая, что эвент должен игнорироваться пока не подтянутся новые данные. Надо предусмотреть это в API хука

const defaultLimit = 150;
const defaultOffsetDifference = 50;

export const Scrolling = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

по логике это кастомный хук. А у хуков есть конвеншен по наименованию

Copy link
Collaborator

Choose a reason for hiding this comment

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

И вообще название не очень) Лучше сделать что-то типа useInfiniteScroll, а initialLimit и offsetDistance принимать как параметры

shouldIgnoreScrollEvent.current = false;
}, [shouldIgnoreScrollEvent]);

return useCallback(
Copy link
Collaborator

Choose a reason for hiding this comment

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

из кастомных хуков обычно возвращают объект. То есть лучше сделать так:

const onScroll = useCallback(...);

return { onScroll };

@kirill-stupakov kirill-stupakov marked this pull request as draft January 5, 2024 13:10
web-app/client/src/pages/reports/onScroll.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Плюс этот хук надо ещё использовать в MFD


useEffect(() => {
shouldIgnoreScrollEvent.current = false;
}, [shouldIgnoreScrollEvent]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

UPD: В оригинале логика такая, что эвент должен игнорироваться пока не подтянутся новые данные. Надо предусмотреть это в API хука

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