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 code to use the common messaging component #77

Merged
merged 16 commits into from
Jan 26, 2024

Conversation

ledsoft
Copy link

@ledsoft ledsoft commented Jan 16, 2024

Resolves #66.

The alert messages on public routes (login, password reset, password token) are kept as is, because the common messaging component is available only in the MainView, which requires authentication.

ledsoft and others added 15 commits January 7, 2024 15:58
…ent.

Also refactor the statistics to a simple hooks-based functional component.
Also refactor the Institutions.js to a simple hooks-based functional component.
Also fix messaging component style (before it is removed) broken by adding the new messaging component styles.
Also provide common async action error message display.
Also extract the form loading request into an action.
@ledsoft ledsoft requested a review from blcham January 16, 2024 12:31
Copy link

@blcham blcham left a comment

Choose a reason for hiding this comment

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

LGTM, nice cleanup of the code! Can be merged but,
consider two things to fix:

  • slice(0, ?) as mentioned in comment
  • I believe you removed all tests testing for alert messages within components. Isn't it useful to know for a component that it triggers alert messages correctly? Or it would be difficult to test now after refactoring ?

tests/__tests__/actions/InstitutionActions.spec.js Outdated Show resolved Hide resolved
@ledsoft
Copy link
Author

ledsoft commented Jan 24, 2024

  • Fixed action tests - removed the slice calls and instead mock Date.now() to provide the same timestamp so that publish message actions can be checked as well
  • Yes, I did remove all the alert message tests from components, as the components no longer show any alerts. Messaging is now done via actions and publish message actions are now checked in tests as well (see the previous point)

@blcham blcham merged commit 41d16c4 into kbss-cvut:main Jan 26, 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.

Refactor existing alerts to new messaging component
2 participants