From 8bbcc7ff503a141f1145413c9d37e46238fe6cae Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 13 May 2021 21:57:36 -0700 Subject: [PATCH] (dev/release#17) Extension UI - Show developmental icon for alpha/beta-stage extensions Extensions are published with two fields, `` (e.g. `1.1`) and `` (e.g. `alpha`). Confusingly, the two fields sometimes convey redundant information - but not always. A few cases: * For example, sometimes a `` 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 `` which simply says `1.0` or `2.0` -- and then supplemental information where the `` 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 | 12 ++++++++++++ templates/CRM/Admin/Page/Extensions/Main.tpl | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/css/admin.css b/css/admin.css index 41d332fd41..e6964e7c13 100644 --- a/css/admin.css +++ b/css/admin.css @@ -44,6 +44,18 @@ 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; diff --git a/templates/CRM/Admin/Page/Extensions/Main.tpl b/templates/CRM/Admin/Page/Extensions/Main.tpl index 77f6a6b062..70bd3d6440 100644 --- a/templates/CRM/Admin/Page/Extensions/Main.tpl +++ b/templates/CRM/Admin/Page/Extensions/Main.tpl @@ -27,7 +27,13 @@ Depends: CRM/common/enableDisableApi.tpl and CRM/common/jsortable.tpl {/if} {$row.statusLabel} {if $row.upgradable}
({ts}Outdated{/ts}){/if} - {$row.version|escape} + {$row.version|escape} + {if ($row.develStage and $row.develStage != 'stable') or preg_match(";(alpha|beta|dev);", $row.version)} + {icon icon="fa-flask"}{ts}This is a pre-release version. For more details, see the expanded description.{/ts}{/icon} + {else} + {icon icon="fa-check-circle"}{/icon} + {/if} + {$row.type|escape|capitalize} {$row.action|replace:'xx':$row.id} -- 2.25.1