-
Notifications
You must be signed in to change notification settings - Fork 71
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
🗳 387 adding gateways, slices, selectors and moving calculations to redux/selectors #390
🗳 387 adding gateways, slices, selectors and moving calculations to redux/selectors #390
Conversation
} | ||
|
||
return `Effects ${spanCount} spans`; | ||
return `Affects ${spanCount} spans`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo 😬
@@ -40,7 +40,7 @@ const CreateAssertionModal = ({testId, span, trace, open, onClose, assertion}: I | |||
onClose(); | |||
}, [onClose]); | |||
|
|||
const effectedSpanCount = AssertionService.getEffectedSpansCount(trace, selectorList); | |||
const affectedSpanCount = useAppSelector(AssertionSelectors.selectAffectedSpanCount(testId, resultId, selectorList)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved calculations to selectors
) || [] | ||
); | ||
}, [targetSpan, test?.assertions, trace]); | ||
const assertionsResultList = useAppSelector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More selectors, less react code 😄
@@ -92,62 +87,50 @@ const Trace: React.FC<TraceProps> = ({testId, testResultId, onDismissTrace, onRu | |||
); | |||
|
|||
useGuidedTour(GuidedTours.Trace); | |||
|
|||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving custom logic to hook "usePolling"
|
||
const {createAssertion, getAssertions, updateAssertion} = endpoints; | ||
|
||
const AssertionGateway = () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Facade to facilitate the usage of the async thunk functions from the redux API slice
|
||
interface ITestResultListState { | ||
resultListMap: Record<string, IAssertionResult[]>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New slice that stores the result list info, in the future this will come from the BE
@@ -0,0 +1,45 @@ | |||
import {createSelector} from '@reduxjs/toolkit'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selectors ✨
This PR enables the addition of selectors and slices. It also moves the big calculations out of the component layer and into redux actions, async thunks.
Changes
Fixes
Checklist