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

TNO-1848: State bug with home filters #1157

Merged
merged 2 commits into from
Oct 18, 2023
Merged

TNO-1848: State bug with home filters #1157

merged 2 commits into from
Oct 18, 2023

Conversation

jdtoombs
Copy link
Collaborator

@jdtoombs jdtoombs commented Oct 17, 2023

Cleanup the component, and fix state errors so the filter is persisted when navigating back to the list view.

statebug

Added ALL toggle:

image

@jdtoombs jdtoombs added bug Something isn't working subscriber PR contains changes towards the subscriber application, labels Oct 17, 2023
@jdtoombs jdtoombs requested a review from Fosol October 17, 2023 23:31
@jdtoombs jdtoombs self-assigned this Oct 17, 2023
@@ -29,7 +29,7 @@ export const ActionSection: React.FC<IActionSectionProps> = ({ values }) => {
<Row gap="0.5rem" alignItems="center" justifyContent="center">
<ContentActions
init
filter={(a) => a.id !== +alertId && a.contentTypes.includes(values.contentType)}
filter={(a) => a.id !== +alertId && a.contentTypes?.includes(values.contentType)}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was causing an error for me on the editor side when creating a new snippet

const getClassName = (type: HomeFilterType) => (type === active ? 'active' : 'inactive');

useEffect(() => {
switch (filter.contentTypes[0]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this array ever be empty?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually addressing this right now for another ticket (adding the all option) going to push to this branch with updates when complete

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated, additional small ticket added to this PR as well.

setActive(HomeFilterType.RadioTV);
break;
case ContentTypeName.Story:
console.log(filter);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove

@jdtoombs jdtoombs requested a review from Fosol October 18, 2023 03:12
@Fosol Fosol merged commit 7dcbf76 into bcgov:dev Oct 18, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working subscriber PR contains changes towards the subscriber application,
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants