mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-10 19:03:12 +00:00
Merge pull request 'fix: Remove hardcode for recovery support articles' (#563) from naiji/how-messages into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/563 Reviewed-by: Inex Code <inex.code@selfprivacy.org>
This commit is contained in:
commit
7ab158ef14
|
@ -56,6 +56,13 @@ enum DnsProviderType {
|
|||
desec => 'deSEC',
|
||||
unknown => 'Unknown',
|
||||
};
|
||||
|
||||
String get supportArticle => switch (this) {
|
||||
digitalOcean => 'how_digital_ocean',
|
||||
cloudflare => 'how_cloudflare',
|
||||
desec => 'how_desec',
|
||||
unknown => '',
|
||||
};
|
||||
}
|
||||
|
||||
extension DnsProviderTypeIsSpecified on DnsProviderType? {
|
||||
|
|
|
@ -24,6 +24,8 @@ class RecoveryConfirmDns extends StatelessWidget {
|
|||
final String providerDisplayName =
|
||||
appConfig.state.serverDomain?.provider.displayName ??
|
||||
'DNS Provider';
|
||||
final String providerSupportArticle =
|
||||
appConfig.state.serverDomain?.provider.supportArticle ?? '';
|
||||
return BrandHeroScreen(
|
||||
heroTitle: 'recovering.provider_connected'.tr(
|
||||
args: [providerDisplayName],
|
||||
|
@ -60,7 +62,7 @@ class RecoveryConfirmDns extends StatelessWidget {
|
|||
builder: (final context) => BrandButton.text(
|
||||
onPressed: () =>
|
||||
context.read<SupportSystemCubit>().showArticle(
|
||||
article: 'how_cloudflare',
|
||||
article: providerSupportArticle,
|
||||
context: context,
|
||||
),
|
||||
title: 'initializing.how'.tr(),
|
||||
|
|
|
@ -17,6 +17,12 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
|||
final ServerInstallationCubit appConfig =
|
||||
context.watch<ServerInstallationCubit>();
|
||||
|
||||
final displayName = appConfig.state.serverDetails?.provider.displayName ??
|
||||
'Server Provider';
|
||||
|
||||
final supportArticle =
|
||||
appConfig.state.serverDetails?.provider.supportArticle ?? '';
|
||||
|
||||
if (appConfig.state.serverDetails?.provider == ServerProviderType.unknown) {
|
||||
return BrandHeroScreen(
|
||||
heroTitle: 'recovering.server_provider_unknown'.tr(),
|
||||
|
@ -45,8 +51,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
|||
builder: (final BuildContext context) => BrandHeroScreen(
|
||||
heroTitle: 'recovering.provider_connected'.tr(
|
||||
args: [
|
||||
appConfig.state.serverDetails?.provider.displayName ??
|
||||
'Server Provider',
|
||||
displayName,
|
||||
],
|
||||
),
|
||||
heroSubtitle: 'recovering.provider_connected_description'.tr(
|
||||
|
@ -67,8 +72,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
|||
border: const OutlineInputBorder(),
|
||||
labelText: 'recovering.provider_connected_placeholder'.tr(
|
||||
args: [
|
||||
appConfig.state.serverDetails?.provider.displayName ??
|
||||
'Server Provider',
|
||||
displayName,
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -84,7 +88,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
|||
builder: (final context) => BrandButton.text(
|
||||
title: 'initializing.how'.tr(),
|
||||
onPressed: () => context.read<SupportSystemCubit>().showArticle(
|
||||
article: 'how_hetzner',
|
||||
article: supportArticle,
|
||||
context: context,
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue