Skip to content
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

show outdated csi value #45

Merged
merged 22 commits into from
Aug 21, 2018
Merged

show outdated csi value #45

merged 22 commits into from
Aug 21, 2018

Conversation

OleWellnitz
Copy link
Contributor

-The dashboard shows outdated csi values. Then the csi circle turns grey.
-If the csi value was not created today, the date of the csi value is shown in the circle instead of 'today'.
-If the csi value of a page is outdated, the circle also turns grey. A hint shows the calculation date of the csi page value.

def name = it.name
def lastDateOfResult = JobResult.createCriteria().list(max: 1) {
eq("jobGroupName", name)
order("id", "desc")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better sort by date desc to make sure it's the last jobGroup

[
id : it.id,
name : it.name,
dateOfLastResults: lastDateOfResult[0].date.format("yyyy-MM-dd")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may give you a NPE if lastDateOfResult is empty (no job result so far)

@@ -1,7 +1,11 @@
<div class="card">
<div class="card" data-toggle="tooltip"
title="{{isCsiOutdated((pageCsiDate$ | async), lastDateOfResult) ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate code. You could extract that as a method which provides the correct translation-key directly.
You could also put the tooltip in the osm-csi-value.

data-toggle is not needed afaik.

}

private updateDescription() {
if (this.isBig && new Date().toISOString().substring(0, 10) > this.csiDate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this date comparison working? It compares strings, doesn't it?

it('should be described as is set', () =>{
const description: string = "description";
component.description = description;
it('should be described as "CSI" if the circle is not big', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also add test cases for the new cases you defined.

@sburnicki sburnicki merged commit 0b456d1 into develop Aug 21, 2018
@sburnicki sburnicki deleted the feature/showOutdatedCsiValue branch August 21, 2018 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants