feat(studio): show module origin store ('from <store>')
StoreItem gains source (mapped from StoreEntry.source); the store grid shows a 'from <store>' label for operator-added stores (bundled seed unlabelled). Foundation for grouping by store. EN+DE l10n. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
255348c062
commit
27cf7e8382
7 changed files with 44 additions and 0 deletions
|
|
@ -786,6 +786,7 @@ class HubService {
|
|||
kind: e.kind,
|
||||
provider: e.provider,
|
||||
sourceKind: e.sourceKind,
|
||||
source: e.source,
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
|
|
@ -1793,6 +1794,12 @@ class StoreItem {
|
|||
/// from `kind` for pre-0.12 hubs.
|
||||
final String sourceKind;
|
||||
|
||||
/// Name of the store this entry came from ("bundled" for the built-in
|
||||
/// seed, otherwise the operator-added store's name). Distinct from
|
||||
/// `sourceKind` (the transport) — this is the ORIGIN store, used to
|
||||
/// label and group modules by where they came from.
|
||||
final String source;
|
||||
|
||||
bool get isFederated => kind == 'federated';
|
||||
|
||||
const StoreItem({
|
||||
|
|
@ -1817,5 +1824,6 @@ class StoreItem {
|
|||
required this.kind,
|
||||
required this.provider,
|
||||
this.sourceKind = '',
|
||||
this.source = '',
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
"@@locale": "de",
|
||||
"errModuleDownload": "Modul-Download fehlgeschlagen",
|
||||
"errModuleDownloadHint": "Die Bundle-URL des Moduls ist nicht erreichbar (Statuscode unten). Der Hub läuft — URL/Host korrigieren oder anderen Store wählen.",
|
||||
"storeFromSource": "aus {store}",
|
||||
"guidedSetupTitle": "Setup-Assistent",
|
||||
"guidedSetupIntro": "Beantworte drei Fragen — Ch∆In stellt passende Konfiguration, Modul-Set und Start-Flow zusammen.",
|
||||
"guidedSetupScenario": "Szenario",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
"@@locale": "en",
|
||||
"errModuleDownload": "Module download failed",
|
||||
"errModuleDownloadHint": "The module's bundle URL is unreachable (status code below). The hub is running fine — fix the URL/host or choose another store.",
|
||||
"storeFromSource": "from {store}",
|
||||
"@storeFromSource": {
|
||||
"placeholders": {
|
||||
"store": { "type": "String" }
|
||||
}
|
||||
},
|
||||
"guidedSetupTitle": "Setup assistant",
|
||||
"guidedSetupIntro": "Answer three questions and Ch∆In assembles a tailored config, module set and starter flow.",
|
||||
"guidedSetupScenario": "Scenario",
|
||||
|
|
|
|||
|
|
@ -110,6 +110,12 @@ abstract class AppLocalizations {
|
|||
/// **'The module\'s bundle URL is unreachable (status code below). The hub is running fine — fix the URL/host or choose another store.'**
|
||||
String get errModuleDownloadHint;
|
||||
|
||||
/// No description provided for @storeFromSource.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'from {store}'**
|
||||
String storeFromSource(String store);
|
||||
|
||||
/// No description provided for @guidedSetupTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
String get errModuleDownloadHint =>
|
||||
'Die Bundle-URL des Moduls ist nicht erreichbar (Statuscode unten). Der Hub läuft — URL/Host korrigieren oder anderen Store wählen.';
|
||||
|
||||
@override
|
||||
String storeFromSource(String store) {
|
||||
return 'aus $store';
|
||||
}
|
||||
|
||||
@override
|
||||
String get guidedSetupTitle => 'Setup-Assistent';
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
String get errModuleDownloadHint =>
|
||||
'The module\'s bundle URL is unreachable (status code below). The hub is running fine — fix the URL/host or choose another store.';
|
||||
|
||||
@override
|
||||
String storeFromSource(String store) {
|
||||
return 'from $store';
|
||||
}
|
||||
|
||||
@override
|
||||
String get guidedSetupTitle => 'Setup assistant';
|
||||
|
||||
|
|
|
|||
|
|
@ -1930,6 +1930,19 @@ class _StoreCardState extends State<_StoreCard> {
|
|||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
// Origin store ("from <store>") — only for
|
||||
// operator-added stores; the built-in seed
|
||||
// ("bundled") needs no label.
|
||||
if (item.source.isNotEmpty &&
|
||||
item.source != 'bundled')
|
||||
Text(
|
||||
l.storeFromSource(item.source),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue