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

Domain events activity frontend #2841

Merged
merged 2 commits into from
Aug 6, 2024
Merged

Conversation

nelsonkopliku
Copy link
Member

@nelsonkopliku nelsonkopliku commented Jul 31, 2024

Description

Mapping messages/activity types/resources to the domain events activities in the UI.
I found it useful consolidating the mapping in one place.

As we iterate we'll figure out what kind of mapping should be moved from the frontend to the backend.

How was this tested?

Automated tests.

@nelsonkopliku nelsonkopliku self-assigned this Jul 31, 2024
@nelsonkopliku nelsonkopliku changed the base branch from main to log-domain-events July 31, 2024 09:15
@nelsonkopliku nelsonkopliku added enhancement New feature or request javascript Pull requests that update Javascript code env Create an ephimeral environment for the pr branch and removed env Create an ephimeral environment for the pr branch labels Jul 31, 2024
@nelsonkopliku nelsonkopliku added the env Create an ephimeral environment for the pr branch label Jul 31, 2024
@nelsonkopliku nelsonkopliku reopened this Jul 31, 2024
@nelsonkopliku nelsonkopliku reopened this Jul 31, 2024
@nelsonkopliku nelsonkopliku added env Create an ephimeral environment for the pr branch and removed env Create an ephimeral environment for the pr branch labels Jul 31, 2024
@nelsonkopliku nelsonkopliku reopened this Jul 31, 2024
@nelsonkopliku nelsonkopliku added env Create an ephimeral environment for the pr branch and removed env Create an ephimeral environment for the pr branch labels Jul 31, 2024
@nelsonkopliku nelsonkopliku force-pushed the domain-events-activity-frontend branch from 9e9b8ad to 31c277e Compare July 31, 2024 19:58
@nelsonkopliku nelsonkopliku force-pushed the domain-events-activity-frontend branch 2 times, most recently from af2ba56 to c009c8b Compare July 31, 2024 21:01
@nelsonkopliku nelsonkopliku force-pushed the domain-events-activity-frontend branch from c009c8b to e3128a6 Compare August 1, 2024 08:07
Comment on lines 23 to 30
// Host events
HEARTBEAT_FAILED,
HEARTBEAT_SUCCEEDED,
HOST_CHECKS_HEALTH_CHANGED,
HOST_CHECKS_SELECTED,
HOST_DEREGISTERED,
HOST_DEREGISTRATION_REQUESTED,
HOST_DETAILS_UPDATED,
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible opportunity to evaluate openapi front-end code generation here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could be an option indeed. Let's see how it evolves.

Comment on lines 105 to 108
[HOST_ADDED_TO_CLUSTER]: 'Host Added to Cluster',
[HEARTBEAT_FAILED]: 'Heartbeat Failed',
[HEARTBEAT_SUCCEEDED]: 'Heartbeat Succeeded',
[HOST_CHECKS_HEALTH_CHANGED]: 'Checks Health Changed',
Copy link
Contributor

@gagandeepb gagandeepb Aug 1, 2024

Choose a reason for hiding this comment

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

This could potentially be a string manipulating function, I guess? Turning the event names into a string is a bit like writing a custom serializer, for the most part.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it could be something like

const activityTypesLabels = _.fromPairs(
  ACTIVITY_TYPES.map((type) => [
    type,
    type.split('_').map(_.capitalize).join(' '),
  ])
);

However I'd like to get some more feedback on the rendered entries in order to figure out the transformation rule.

Additionally let's take into account that there is not yet a consistent pattern throughout all the activity types. But we can improve as we proceed.

Base automatically changed from log-domain-events to main August 2, 2024 07:06
@nelsonkopliku nelsonkopliku force-pushed the domain-events-activity-frontend branch 3 times, most recently from 1304bbf to 18a653f Compare August 2, 2024 09:31
@nelsonkopliku nelsonkopliku force-pushed the domain-events-activity-frontend branch from 18a653f to 932ab4d Compare August 2, 2024 09:50
@nelsonkopliku nelsonkopliku marked this pull request as ready for review August 2, 2024 10:12
@nelsonkopliku nelsonkopliku merged commit 07e51f7 into main Aug 6, 2024
26 checks passed
@nelsonkopliku nelsonkopliku deleted the domain-events-activity-frontend branch August 6, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request env Create an ephimeral environment for the pr branch javascript Pull requests that update Javascript code
Development

Successfully merging this pull request may close these issues.

3 participants