-
Notifications
You must be signed in to change notification settings - Fork 27
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
Feature color cylc message bubbles #1436
base: master
Are you sure you want to change the base?
Feature color cylc message bubbles #1436
Conversation
Co-authored-by: Ronnie Dutta <[email protected]>
Co-authored-by: Ronnie Dutta <[email protected]>
Co-authored-by: Ronnie Dutta <[email protected]>
src/components/cylc/MessageChip.vue
Outdated
['this is a debug message', ''], | ||
['this is a info message', 'bg-grey'], | ||
['this is a warning message', 'bg-warning'], | ||
['this is an error message', 'bg-error'], | ||
['this is a critical message', 'bg-black font-weight-bold'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't do anything until cylc/cylc-flow#5713 is addressed, but this is how it should be
['this is a debug message', ''], | |
['this is a info message', 'bg-grey'], | |
['this is a warning message', 'bg-warning'], | |
['this is an error message', 'bg-error'], | |
['this is a critical message', 'bg-black font-weight-bold'], | |
['DEBUG', ''], | |
['INFO', 'bg-grey'], | |
['WARNING', 'bg-warning'], | |
['ERROR', 'bg-error'], | |
['CRITICAL', 'bg-black font-weight-bold'], |
Can you take a look at
Line 70 in 63bdcc2
function jobMessageOutputs (jobNode) { |
and add some logic to extract the severity level from the message which will be in the form SEVERITY:rest of message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I've got a fix for the "output vs ordinary message" logic at #1456)
…rahamdawson/cylc-ui into feature-color-cylc-message-bubbles
@@ -71,7 +71,8 @@ function jobMessageOutputs (jobNode) { | |||
const ret = [] | |||
let messageOutput | |||
|
|||
for (const message of jobNode.node.messages || []) { | |||
for (const messageString of jobNode.node.messages || []) { | |||
const [level, message] = messageString.split(':') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately as Oliver pointed out to me, we can't use String.split()
as there could be multiple colons after the first severity level one. We'll have to use a regex here, I think something like
/^(?:(DEBUG|INFO|WARNING|ERROR|CRITICAL):)?(.*)/
Converted to draft pending resolution of cylc/cylc-flow#5714 |
Closes #1276
Moved the message chip into a new component
Added functionality to style based on props
Note - at the moment the 'level' isn't coming through from the api so chip color is decided based on message label.
This will need addressing in the future.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.