-
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
dot/LED view, w/ dismissable pulse on state change #128
dot/LED view, w/ dismissable pulse on state change #128
Conversation
😄 that makes sense I guess, for the dot view.
For now I think the I have a post-it to start investigating how to write simple unit tests for the small components (Task, Job, new Header). For views it will be a little harder I think. |
src/components/cylc/Dot.vue
Outdated
|
||
<script> | ||
// This script customises the default 'dot' icons and animations on them: | ||
import 'status-indicator/styles.css' |
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.
At least for me the component was installed in node_modules
as vue-status-indicator
... the IDE failed to locate the CSS, but this one worked? import 'vue-status-indicator/styles.css'
(I think their docs also use this value).
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.
Ah, great spot, thank you! For context, there are actually two separate components status-indicator
& vue-status-indicator
(where the creator specifies on the README.md
for the latter 'This is a fork of status-indicator with a few changes for use with Vue.js'), & on my development branch by mistake I installed both instead of just the Vue version. And when I tidied up for this branch, I removed the non-Vue variation as I got build errors for it without it in my package-lock.json
, without realising, as it turns out from your observation, I was importing the wrong one. Then I was very confused as to why Travis threw an error in the same way on the status-indicator
aspect, which I thought had gone completely from the code!
I'll get vue-
prepended in my next commit.
src/components/cylc/Dot.vue
Outdated
if (stateString == null || | ||
this.stateToDotClassMappings[stateString] == null || | ||
this.stateToDotClassMappings[stateString] != requiredState) { | ||
return false; |
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.
In JS it is safer to use ===
and !==
... https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness.
I think this function can be rewritten as:
return !(stateString == null ||
this.stateToDotClassMappings[stateString] == null ||
this.stateToDotClassMappings[stateString] != requiredState);
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.
In JS it is safer to use === and !==
Sure, I remember reading about that. But in this case I have just checked & null === undefined
evaluates to false
, so I think I might need to change null
-> undefined
. too in that case. I'll hack the code to try & observe these cases, & see what works; I want to make sure all error cases are covered. I guess I am adjusting from my native language, Python, as there isn't a KeyError
equivalent raised in JS for an invalid dict key.
I think this function can be rewritten
Absolutely, good point (confused as to how I missed that, as it is pure Boolean logic, but I didn't really do a self-review for consolidation etc. at this stage, & think I was just eager to get everything working).
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 would probably write it like you did too. My IDE warned me about the === and also suggest the rewrite 😁
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.
Good old emacs doesn't have that sort of feature, sadly. Maybe it is time for me to transition to using Atom 🤔
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.
Actually, for your suggestion on strict (in)equality being safer than abstract (in)equality for comparison, I have just amended the final !=
, because (I forgot I already checked this, hence my original approach!) in the first pair of cases, comparing in the abstract to null
catches both the null
& undefined
, whereas comparing strictly will only catch one. There's a good thread on that here that I learnt this from.
v-on:click="dismissPulse()" | ||
:pulse="isPulseOn" | ||
> | ||
</status-indicator> |
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 think you will still need to load the component. You can do it local or globally .
Something like this
diff --git a/src/components/cylc/Dot.vue b/src/components/cylc/Dot.vue
index 8f535eb..0bdb955 100644
--- a/src/components/cylc/Dot.vue
+++ b/src/components/cylc/Dot.vue
@@ -22,11 +22,15 @@
<script>
// This script customises the default 'dot' icons and animations on them:
- import 'status-indicator/styles.css'
+ import 'vue-status-indicator/styles.css'
+ import { StatusIndicator } from 'vue-status-indicator'
export default {
name: 'Dot',
props: ['dotClass'],
+ components: {
+ 'status-indicator': StatusIndicator
+ },
watch: {
// Start the pulse animation if the task state (hence dot class) changes
hasDotClassChanged: function() {
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 see, thank you for the advice. That does make full sense, though strangely it worked for me without (for reasons unknown). I'll add this in for the next commit anyway, for reassurance.
} | ||
} | ||
} | ||
</script> |
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.
Great work on linking everything together! The computed property, props, watcher. 👏 👏 👏 ! I still get confused and sometimes have to go for a walk when things start to get too complicated with all the values and their relationships 😁
src/lang/pt-BR/DotView.json
Outdated
@@ -0,0 +1,4 @@ | |||
{ | |||
"tableHeader": "Ponto Vista", | |||
"tableSubHeader": "O status das tarefas de um conjunto conforme organizado por ponto de ciclo" |
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.
Ponto Vista sounds like Point of View in Portuguese (ponto de vista). But "vista" doesn't really mean the same as in English like a display or visualization... I guess we would need to go with visualization here.
Maybe "Visualização por Pontos" for the tableHeader
and for tableSubHeader
"Os status das tarefas de uma suite organizados por pontos do ciclo."
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.
Excellent, thank you. The subtleties of translation 😁 Google translate has a tough job, for sure!
src/lang/pt-BR/Suites.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"tableHeader": "Lista de Suites", | |||
"tableSubHeader": "Esta é a lista de suites que este usuário possui permissoões para visualizar", | |||
"tableSubHeader": "Esta é a lista de suites que tenho permissoões para visualizar", |
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.
s/tenho/possuo (can't explain why... in this case the verb possuir/possess I guess sounds better)... but if you could fix my old typo as well, please haha. s/permissoões/permissões (extra o)
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.
Oh, BTW, just to clarify in case there is the potential for misinterpretation, I was not changing your own translation here (I do not know Brazilian Portuguese of course so to change your translation would be ridiculous), it is that I changed the text slightly in so that for the en-GB
it reads 'I have' rather than 'the current user', which is more appropriate I think (probably the previous was for information during development). So I tried to change the pt-BR
equivalent using Google translate, awaiting some help from a native speaker 😄.
Thanks for help with the translations here, I'll add them in a new commit soon. Let me know if I missed anything once that goes up.
src/lang/pt-BR/TreeView.json
Outdated
@@ -0,0 +1,4 @@ | |||
{ | |||
"tableHeader": "Vista de árvore", | |||
"tableSubHeader": "Dados personalizáveis baseados em colunas para todas as tarefas desta suíte" |
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.
Grammatically correct, but sounds like "The view from a tree". I think for tableHeader
"Visualização em Árvore". And for the tableSubHeader
maybe "Dados em formato colunar e customizáveis disponíveis para as tarefas desta suite." ("suíte" is the correct translation, but we still use "suite" as in "suite de testes" / "test suite" and "suíte" more for a hotel room name... can't explain why 😕 )
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.
"The view from a tree" - he heh, I like that. I love being up a tree, looking out at the landscape. 😁
I really liked this status indicator! Great idea @sadielbartholomew ! Here's what it looks like after applying a few changes mentioned above, then running Or what it looks after merging locally the #129 changes: And because it looks much nicer with the animation: Bravissimo Sadie! Looking forward to being able to have Gscan, Tree view, Dot view, and Graph all working together! We are almost there |
Codecov Report
@@ Coverage Diff @@
## master #128 +/- ##
=========================================
Coverage ? 80.62%
=========================================
Files ? 16
Lines ? 160
Branches ? 0
=========================================
Hits ? 129
Misses ? 31
Partials ? 0 Continue to review full report at Codecov.
|
Tests now passing (after importing I have a few non-development tasks to address urgently, so won't get back onto this PR until tomorrow. But the next step is to negotiate with everyone how we plan to go ahead with the data provision so I can access the data to formulate it in the Dot View arrangement with cycle point columns. |
Nice, great progress. |
@kinow - how did you record that gif, BTW? |
The second group start, upon a state (hence colour) change for that task, and | ||
stop, upon a user click onto that dot, the pulse animation. | ||
--> | ||
<status-indicator |
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.
Should use or compose the <task>
component here?
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 went for different components, at least for now, since:
- (Predominantly) we haven't decided how to incorporate task-job separation into this view. I don't think the approach applied for the Tree View & Graph View mock-ups, with physically-separated icons for the jobs & tasks, is a good approach here, as since state icons are the only information in this view & they are all condensed in a close-packed arrangement, it would become a cluttered mess of icons. I plan to draw up some ideas on the Design Issue for how to indicate both task & job status here.
- (Also) I wanted to get a POC for state change animations, & we do not have any animated components ready yet (or indeed a decision on how they would look when animated).
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.
The dot view is a little awkward here I agree but having separated the task an job icons we really don't want to go back to merging them. I guess would expect the dot view to just show task state with job state available on request (e.g. context menu)?
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.
but having separated the task an job icons we really don't want to go back to merging them
Agreed, I wasn't suggesting that. We should be definitely be consistent with the segregation. I was thinking either along the line you suggest, where the table could be toggled to display either all tasks or all jobs (collecting multiple jobs for one task entry together in some condensed way, like in a self-contained grid rather than linearly in a row, for clarity), or having a new design component that indicates both task & job status in a discrete way (all within one shape). I will try to get up some drawings soon.
Hi all, I will close this PR since the code is probably too out of date now, such that it will be easier for me to start from scratch, but I would still like to implement the Dot View eventually (I think the natural time to add it would be when @kinow's Tree Component is ready), where I will use the experience in Vue & the We can also view this closed PR as a POC for task state transition animations. |
WIP (awaiting agreed cross-view data provision approach, see ⭐). Close #79 & provide a POC example for #127.
Cylc 8 UI live implementation of the old Dot/LED
gcylc
view, with some (proposed) changes:Tips for those (eventually) reviewing (or just trying this branch out):
cylc reset
to manually reset some task states to test the pulse animation.master
& systemised my commits, but I developed this all on another branch, should you be confused as to timestamps implying this took just a few hours!This PR will (with progress indicated):
.../suites/dot/<suite name>
(renaming the Tree View path correspondingly to.../suites/tree/<suite name>
), with both accessible, for now, via separate icons in individual table columns from the Suites Listing page (.../suites
)./dot/
page with a table with information for all tasks for a suite.status-indicator
Vue component which has been incorporated into the repository.Create tests (or do so as a follow-on PR)?[agreed that in context this should be future work]