-
Notifications
You must be signed in to change notification settings - Fork 34
New metric boxes #1279
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
Merged
Merged
New metric boxes #1279
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
327bf39
Generate metric cards dynamically
ribalba 33f9c4a
Adds font files
ribalba a0d40e1
os swith
ribalba 8914163
First working example
ribalba 7c9f1ea
Review comments
ribalba 4795553
Merge branch 'main' into new-metric-boxes
ArneTR 1999954
renamed variable to reflext dimension [skip ci]
ArneTR ea90224
adds the new card with more information
ribalba 8521784
Merge branch 'new-metric-boxes' of github.com:green-coding-solutions/…
ribalba 2f8e8f9
fix typo
ribalba 0463ece
hover fix
ribalba 7a1463c
Adapted tests to new div layouts [skip ci]
ArneTR b1cc117
Added clarifying comment [skip ci]
ArneTR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,14 @@ class PhaseMetrics extends HTMLElement { | |
<div class="ui ${colourClass} card ${cardClass}"> | ||
<div class="content"> | ||
<i class="${icon} icon"></i><span class="metric-name">${name}</span> | ||
<div class="right floated meta si-unit"></div> | ||
<div class="right floated meta source"></div> | ||
|
||
</div> | ||
<div class="extra content"> | ||
<div class="description"> | ||
<span class="value bold">N/A</span> | ||
<span class="value bold">N/A</span> <span class="si-unit"></span> | ||
<div class="right floated meta help" data-tooltip="No data available" data-position="bottom right" data-inverted> | ||
<i class="question circle outline icon"></i> | ||
<span class="metric-type"></span><i class="question circle outline icon"></i> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -312,14 +313,24 @@ const updateKeyMetric = ( | |
const unitNode = card.querySelector('.si-unit'); | ||
if (unitNode) unitNode.innerText = unit; | ||
|
||
const typeNode = card.querySelector('.metric-type'); | ||
|
||
if(std_dev_text != ''){ | ||
if (typeNode) typeNode.innerText = `(AVG + STD.DEV)`; | ||
} else { | ||
if(String(value).indexOf('%') !== -1) { | ||
if (typeNode) typeNod.innerText = `(Diff. in %)`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is a typo. Must be typeNode not typeNod |
||
} | ||
} | ||
|
||
const helpNode = card.querySelector('.help'); | ||
if (helpNode) helpNode.setAttribute('data-tooltip', explanation || 'No data available'); | ||
|
||
const metricNameNode = card.querySelector('.metric-name'); | ||
if (metricNameNode) metricNameNode.innerText = clean_name || ''; | ||
|
||
const sourceNode = card.querySelector('.source'); | ||
if (sourceNode) sourceNode.innerText = source || ''; | ||
if (sourceNode) sourceNode.innerText = `via ${source}` || ''; | ||
}); | ||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.