Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Datahub Datahub
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ICAT
  • DatahubDatahub
  • Issues
  • #225
Closed
Open
Issue created Apr 22, 2020 by Alejandro De Maria Antolinos@demariaaOwner

Improve UserMessage Component

@mchaille

Users messages should be displayed in the same way over the whole application. I think that was the goal of the UserMessage Component. So I find that UserMessages might be very useful.

However, I see two problems:

  1. It is not obvious its usage as we need to do several imports if we want to use it:
import {  ERROR_MESSAGE_TYPE, INFO_MESSAGE_TYPE } from '../../constants/EventTypes.js';
import UserMessage from '../../components/UserMessage.js';

Besides, I don't think constants/EventTypes is the right place for the ERROR_MESSAGE_TYPE, INFO_MESSAGE_TYPE definition.

  1. I would composite ErrorUserMessage, InfoUserMessage and WarningUserMesssage that will allow an easier usage. Probably just sending as props the title and the message to show. These components will use the existing UserMessage component that should be not exported.

Example:

<ErrorUserMessage title="Network connection Problem" message="An error was produced while retrieving data for the servers." />
Assignee
Assign to
Time tracking