-
Notifications
You must be signed in to change notification settings - Fork 30
Feature color cylc message bubbles #1436
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
aa1dd2f
50547fb
fa55091
687f201
901538e
8c222c6
fd6afe2
b9624ad
476474b
880b4d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright (C) NIWA & British Crown (Met Office) & Contributors. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import MessageChip from '@/components/cylc/MessageChip.vue' | ||
|
||
describe('View MessageChip Component', () => { | ||
const mountMessageChip = (props) => { | ||
cy.vmount( | ||
MessageChip, | ||
{ | ||
props | ||
} | ||
).as('wrapper') | ||
// add the classes Vuetify requires | ||
cy.addVuetifyStyles(cy) | ||
} | ||
|
||
it('checks messageChip colors', () => { | ||
// mount the toolbar with a couple of controls | ||
mountMessageChip( | ||
{ | ||
level: 'this is a debug message', | ||
message: 'Task Message :this is a debug message', | ||
isMessage: true | ||
} | ||
) | ||
|
||
// are the messages the correct colours? | ||
cy | ||
.get('.v-chip') | ||
.should('have.class', 'bg-blue') | ||
.contains('this is a debug message') | ||
}) | ||
}) |
MetRonnie marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||||||||||||||||||||
<!-- | ||||||||||||||||||||||||
Copyright (C) NIWA & British Crown (Met Office) & Contributors. | ||||||||||||||||||||||||
This program is free software: you can redistribute it and/or modify | ||||||||||||||||||||||||
it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||
the Free Software Foundation, either version 3 of the License, or | ||||||||||||||||||||||||
(at your option) any later version. | ||||||||||||||||||||||||
This program is distributed in the hope that it will be useful, | ||||||||||||||||||||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||||||||||||||||
GNU General Public License for more details. | ||||||||||||||||||||||||
You should have received a copy of the GNU General Public License | ||||||||||||||||||||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||
--> | ||||||||||||||||||||||||
<template> | ||||||||||||||||||||||||
<div> | ||||||||||||||||||||||||
<v-tooltip :activator="null"> | ||||||||||||||||||||||||
<template v-slot:activator="{ props }"> | ||||||||||||||||||||||||
<v-chip | ||||||||||||||||||||||||
v-bind="props" | ||||||||||||||||||||||||
:class="chipClass" | ||||||||||||||||||||||||
class="ml-2 message-output" | ||||||||||||||||||||||||
size="small" | ||||||||||||||||||||||||
> | ||||||||||||||||||||||||
{{ level }} | ||||||||||||||||||||||||
</v-chip> | ||||||||||||||||||||||||
</template> | ||||||||||||||||||||||||
<span>{{ message }}</span> | ||||||||||||||||||||||||
</v-tooltip> | ||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||
</template> | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
<script setup> | ||||||||||||||||||||||||
import { computed } from 'vue' | ||||||||||||||||||||||||
const props = defineProps({ | ||||||||||||||||||||||||
level: String, | ||||||||||||||||||||||||
message: String, | ||||||||||||||||||||||||
isMessage: Boolean | ||||||||||||||||||||||||
}) | ||||||||||||||||||||||||
const classMap = new Map([ | ||||||||||||||||||||||||
['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'], | ||||||||||||||||||||||||
|
['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)
Uh oh!
There was an error while loading. Please reload this page.