FEATURE: adds security tab to dashboard (#6768)

This commit also includes the new staff_logins report
This commit is contained in:
Joffrey JAFFEUX
2018-12-14 13:47:59 +01:00
committed by GitHub
parent 9f89aadd33
commit 03014b0d05
12 changed files with 147 additions and 17 deletions

View File

@ -276,9 +276,13 @@ const Report = Discourse.Model.extend({
return this._numberLabel(value, opts);
}
if (type === "date") {
const date = moment(value, "YYYY-MM-DD");
const date = moment(value);
if (date.isValid()) return this._dateLabel(value, date);
}
if (type === "precise_date") {
const date = moment(value);
if (date.isValid()) return this._dateLabel(value, date, "LLL");
}
if (type === "text") return this._textLabel(value);
return {
@ -377,10 +381,10 @@ const Report = Discourse.Model.extend({
};
},
_dateLabel(value, date) {
_dateLabel(value, date, format = "LL") {
return {
value,
formatedValue: value ? date.format("LL") : "—"
formatedValue: value ? date.format(format) : "—"
};
},