Skip to content

refactor: System message component is rendered within event message component #1601

@MartinCupela

Description

@MartinCupela

Motivation
EventComponent renders two types of messages:

  1. message of type system
  2. message carrying attribute event

There may be 3 reasons why we want to separate those two into separate components:

  1. There is no reason why component containing word Event should render system messages if it expects that messages of type system do not carry attribute event
  2. System message is official type of message received from the back-end, meanwhile non-system message with attribute event is a custom message payload. And so, there is no reason, why integrators should know about this custom non-documented attribute.
  3. The fact that message is of type system should not exclude the possibility that it carries custom event attribute

Proposed solution

  1. separate code for rendering a message carrying attribute event into a separate component EventComponent and code for rendering system messages into SystemMessage component (the if (type === 'system' part)
  2. the default component for system messages should be a new SystemMessage component
  3. the EventComponent will not keep the if (type === 'system') branch

This will be a breaking change for those who are using EventComponent to display system messages in their custom code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions