FIX: better handling of no prev30Days (#6301)
This commit is contained in:
parent
f01169d6ff
commit
c08dea386b
|
@ -439,7 +439,7 @@ const Report = Discourse.Model.extend({
|
||||||
case "high-trending-down":
|
case "high-trending-down":
|
||||||
return higherIsBetter ? "angle-double-down" : "angle-double-up";
|
return higherIsBetter ? "angle-double-down" : "angle-double-up";
|
||||||
default:
|
default:
|
||||||
return null;
|
return "minus";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,5 +16,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cell value thirty-days-count {{model.thirtyDaysTrend}}" title={{model.thirtyDaysCountTitle}}>
|
<div class="cell value thirty-days-count {{model.thirtyDaysTrend}}" title={{model.thirtyDaysCountTitle}}>
|
||||||
{{number model.lastThirtyDaysCount}} {{d-icon model.thirtyDaysTrendIcon}}
|
{{number model.lastThirtyDaysCount}}
|
||||||
|
|
||||||
|
{{#if model.prev30Days}}
|
||||||
|
{{d-icon model.thirtyDaysTrendIcon}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,6 +59,9 @@
|
||||||
|
|
||||||
&.no-change {
|
&.no-change {
|
||||||
color: $primary-medium;
|
color: $primary-medium;
|
||||||
|
i {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
|
|
|
@ -34,6 +34,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.no-change {
|
||||||
|
i {
|
||||||
|
color: $primary-medium;
|
||||||
|
font-size: $font-down-3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.high-trending-up,
|
&.high-trending-up,
|
||||||
&.trending-up {
|
&.trending-up {
|
||||||
i {
|
i {
|
||||||
|
|
|
@ -217,8 +217,9 @@ class Report
|
||||||
report.icon = 'user'
|
report.icon = 'user'
|
||||||
|
|
||||||
basic_report_about report, UserVisit, :by_day, report.start_date, report.end_date, report.group_id
|
basic_report_about report, UserVisit, :by_day, report.start_date, report.end_date, report.group_id
|
||||||
|
|
||||||
add_counts report, UserVisit, 'visited_at'
|
add_counts report, UserVisit, 'visited_at'
|
||||||
|
|
||||||
|
report.prev30Days = UserVisit.where(mobile: true).where("visited_at >= ? and visited_at < ?", report.start_date - 30.days, report.start_date).count
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.report_mobile_visits(report)
|
def self.report_mobile_visits(report)
|
||||||
|
|
Loading…
Reference in New Issue