(dev/release#17) Extension UI - Show developmental icon for alpha/beta-stage extensions
authorTim Otten <totten@civicrm.org>
Fri, 14 May 2021 04:57:36 +0000 (21:57 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 14 May 2021 05:25:18 +0000 (22:25 -0700)
Extensions are published with two fields, `<version>` (e.g.  `1.1`) and `<develStage>` (e.g.  `alpha`).
Confusingly, the two fields sometimes convey redundant information - but not always. A few cases:

* For example, sometimes a `<version>` as `1.0-alpha1`, `1.2.beta2`, or `2.3dev`. This would make sense if the
developer does formal tagging/releasing for developmental versions. (In this case, you don't really need the
icon - because the version-number tells you.)

* Other times, you might have a `<version>` which simply says `1.0` or `2.0` -- and then supplemental
information where the `<develStage>` says `alpha` or `beta`.  This could make sense if the developmental
version is being continuously updated without formal tags/releases.

* Under dev/release#17, we have another case -- where the core-extensions have version#s which match the
core version# (because they are released together), but the devel-stage of the extension is only
alpha/beta (because the extension is still evolving/optional/not-fully-supported).

Before: The "Development Stage" is entirely obscure.

After: There's an icon in the table to signal the development stage.

css/admin.css
templates/CRM/Admin/Page/Extensions/Main.tpl

index 41d332fd41ec8c266f2be4fa08b06495c432324a..e6964e7c139edb02c851b870f96e4a4ceb4ffb57 100644 (file)
   text-align: center;
 }
 
+#crm-container .crm-extensions-stage {
+  float: right;
+}
+
+#crm-container .crm-extensions-stage > .fa-flask {
+  color: #eba12d;
+}
+
+#crm-container .crm-extensions-stage > .fa-check-circle {
+  color: #00994D;
+}
+
 @media screen and (min-width: 480px) {
   #crm-container .admin-section-items {
     column-count: 2;
index 77f6a6b062092c2745978f47dd36f70284c5430f..70bd3d644064f50ead2896c0cecdca363b5939e5 100644 (file)
@@ -27,7 +27,13 @@ Depends: CRM/common/enableDisableApi.tpl and CRM/common/jsortable.tpl
               {/if}
           </td>
           <td class="crm-extensions-label">{$row.statusLabel} {if $row.upgradable}<br/>({ts}Outdated{/ts}){/if}</td>
-          <td class="crm-extensions-label">{$row.version|escape}</td>
+          <td class="crm-extensions-label">{$row.version|escape}
+            {if ($row.develStage and $row.develStage != 'stable') or preg_match(";(alpha|beta|dev);", $row.version)}
+              <span class="crm-extensions-stage">{icon icon="fa-flask"}{ts}This is a pre-release version. For more details, see the expanded description.{/ts}{/icon}</span>
+              {else}
+              <span class="crm-extensions-stage">{icon icon="fa-check-circle"}{/icon}</span>
+            {/if}
+          </td>
           <td class="crm-extensions-description">{$row.type|escape|capitalize}</td>
           <td>{$row.action|replace:'xx':$row.id}</td>
         </tr>