show SMAPI 3.0 readiness for unofficial updates too (#606)

This commit is contained in:
Jesse Plamondon-Willard 2018-12-15 14:35:39 -05:00
parent 39341d772e
commit 0130416bd1
No known key found for this signature in database
GPG Key ID: 7D7C8097B62033CE
2 changed files with 8 additions and 5 deletions

View File

@ -65,7 +65,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="mod in mods" :key="mod.Name" v-bind:id="mod.Slug" :key="mod.Slug" v-bind:data-status="mod.BetaCompatibility != null ? mod.BetaCompatibility.Status : mod.Compatibility.Status" v-show="mod.Visible"> <tr v-for="mod in mods" :key="mod.Name" v-bind:id="mod.Slug" :key="mod.Slug" v-bind:data-status="mod.LatestCompatibility.Status" v-show="mod.Visible">
<td> <td>
{{mod.Name}} {{mod.Name}}
<small class="mod-alt-names" v-if="mod.AlternateNames">(aka {{mod.AlternateNames}})</small> <small class="mod-alt-names" v-if="mod.AlternateNames">(aka {{mod.AlternateNames}})</small>
@ -87,13 +87,13 @@
</div> </div>
<div v-for="(warning, i) in mod.Warnings">⚠ {{warning}}</div> <div v-for="(warning, i) in mod.Warnings">⚠ {{warning}}</div>
</td> </td>
<td class="mod-broke-in" v-html="mod.BetaCompatibility ? mod.BetaCompatibility.BrokeIn : mod.Compatibility.BrokeIn" v-show="showAdvanced"></td> <td class="mod-broke-in" v-html="mod.LatestCompatibility.BrokeIn" v-show="showAdvanced"></td>
<td v-show="showAdvanced"> <td v-show="showAdvanced">
<span v-if="mod.SourceUrl"><a v-bind:href="mod.SourceUrl">source</a></span> <span v-if="mod.SourceUrl"><a v-bind:href="mod.SourceUrl">source</a></span>
<span v-else class="mod-closed-source">no source</span> <span v-else class="mod-closed-source">no source</span>
</td> </td>
<td v-show="showAdvanced"> <td v-show="showAdvanced">
<template v-if="(mod.BetaCompatibility || mod.Compatibility).Status == 'ok' || mod.Smapi3Status == 'ok' || mod.Smapi3Status == 'soon'"> <template v-if="mod.LatestCompatibility.Status == 'ok' || mod.LatestCompatibility.Status == 'unofficial' || mod.Smapi3Status == 'ok' || mod.Smapi3Status == 'soon'">
<small v-if="mod.Smapi3Status == 'ok'">✓</small> <small v-if="mod.Smapi3Status == 'ok'">✓</small>
<small v-else-if="mod.Smapi3Status == 'broken'">✖</small> <small v-else-if="mod.Smapi3Status == 'broken'">✖</small>
<small v-else-if="mod.Smapi3Status == 'soon' && mod.Smapi3Url"><a v-bind:href="mod.Smapi3Url">↻ soon</a></small> <small v-else-if="mod.Smapi3Status == 'soon' && mod.Smapi3Url"><a v-bind:href="mod.Smapi3Url">↻ soon</a></small>

View File

@ -124,6 +124,9 @@ smapi.modList = function (mods) {
// set initial visibility // set initial visibility
mod.Visible = true; mod.Visible = true;
// set overall compatibility
mod.LatestCompatibility = mod.BetaCompatibility || mod.Compatibility;
// concatenate searchable text // concatenate searchable text
mod.SearchableText = [mod.Name, mod.AlternateNames, mod.Author, mod.AlternateAuthors, mod.Compatibility.Summary, mod.BrokeIn]; mod.SearchableText = [mod.Name, mod.AlternateNames, mod.Author, mod.AlternateAuthors, mod.Compatibility.Summary, mod.BrokeIn];
if (mod.Compatibility.UnofficialVersion) if (mod.Compatibility.UnofficialVersion)
@ -202,7 +205,7 @@ smapi.modList = function (mods) {
return false; return false;
// check status // check status
var status = (mod.BetaCompatibility || mod.Compatibility).Status; var status = mod.LatestCompatibility.Status;
if (filters.status[status] && !filters.status[status].value) if (filters.status[status] && !filters.status[status].value)
return false; return false;
@ -250,7 +253,7 @@ smapi.modList = function (mods) {
* @returns {string} The compatibility group (one of 'compatible', 'workaround', 'soon', 'broken', 'abandoned', or 'invalid'). * @returns {string} The compatibility group (one of 'compatible', 'workaround', 'soon', 'broken', 'abandoned', or 'invalid').
*/ */
getCompatibilityGroup: function (mod) { getCompatibilityGroup: function (mod) {
var status = (mod.BetaCompatibility || mod.Compatibility).Status; var status = mod.LatestCompatibility.Status;
switch (status) { switch (status) {
// obsolete // obsolete
case "abandoned": case "abandoned":