зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1004506 - Telemetry experiments: Properly handle install states & their transitions in addon manager UI. r=unfocused
This commit is contained in:
Родитель
c2d8fdf055
Коммит
e55c45fbb7
|
@ -250,3 +250,8 @@ richlistitem:not([selected]) * {
|
|||
.view-pane:not([type="experiment"]) #detail-experiment-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.addon[type="experiment"][status="installing"] .experiment-time,
|
||||
.addon[type="experiment"][status="installing"] .experiment-state {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -2649,6 +2649,13 @@ var gListView = {
|
|||
// the existing item
|
||||
if (aInstall.existingAddon)
|
||||
this.removeItem(aInstall, true);
|
||||
|
||||
if (aInstall.addon.type == "experiment") {
|
||||
let item = this.getListItemForID(aInstall.addon.id);
|
||||
if (item) {
|
||||
item.endDate = getExperimentEndDate(aInstall.addon);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addItem: function gListView_addItem(aObj, aIsInstall) {
|
||||
|
|
|
@ -1364,30 +1364,34 @@
|
|||
this._debugBtn.disabled = this._debugBtn.hidden = !debuggable
|
||||
|
||||
if (this.mAddon.type == "experiment") {
|
||||
this.removeAttribute("notification");
|
||||
let prefix = "experiment.";
|
||||
let active = this.mAddon.isActive;
|
||||
|
||||
let stateKey = prefix + "state." + (active ? "active" : "complete");
|
||||
this._experimentState.value = gStrings.ext.GetStringFromName(stateKey);
|
||||
if (!showProgress) {
|
||||
let stateKey = prefix + "state." + (active ? "active" : "complete");
|
||||
this._experimentState.value = gStrings.ext.GetStringFromName(stateKey);
|
||||
|
||||
let now = Date.now();
|
||||
let end = this.endDate;
|
||||
let days = Math.abs(end - now) / (24 * 60 * 60 * 1000);
|
||||
let now = Date.now();
|
||||
let end = this.endDate;
|
||||
let days = Math.abs(end - now) / (24 * 60 * 60 * 1000);
|
||||
|
||||
let timeKey = prefix + "time.";
|
||||
let timeMessage;
|
||||
if (days < 1) {
|
||||
timeKey += (active ? "endsToday" : "endedToday");
|
||||
timeMessage = gStrings.ext.GetStringFromName(timeKey);
|
||||
} else {
|
||||
timeKey += (active ? "daysRemaining" : "daysPassed");
|
||||
days = Math.round(days);
|
||||
let timeString = gStrings.ext.GetStringFromName(timeKey);
|
||||
timeMessage = PluralForm.get(days, timeString)
|
||||
.replace("#1", days);
|
||||
let timeKey = prefix + "time.";
|
||||
let timeMessage;
|
||||
|
||||
if (days < 1) {
|
||||
timeKey += (active ? "endsToday" : "endedToday");
|
||||
timeMessage = gStrings.ext.GetStringFromName(timeKey);
|
||||
} else {
|
||||
timeKey += (active ? "daysRemaining" : "daysPassed");
|
||||
days = Math.round(days);
|
||||
let timeString = gStrings.ext.GetStringFromName(timeKey);
|
||||
timeMessage = PluralForm.get(days, timeString)
|
||||
.replace("#1", days);
|
||||
}
|
||||
|
||||
this._experimentTime.value = timeMessage;
|
||||
}
|
||||
|
||||
this._experimentTime.value = timeMessage;
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
|
Загрузка…
Ссылка в новой задаче