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',
|
desec => 'deSEC',
|
||||||
unknown => 'Unknown',
|
unknown => 'Unknown',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
String get supportArticle => switch (this) {
|
||||||
|
digitalOcean => 'how_digital_ocean',
|
||||||
|
cloudflare => 'how_cloudflare',
|
||||||
|
desec => 'how_desec',
|
||||||
|
unknown => '',
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
extension DnsProviderTypeIsSpecified on DnsProviderType? {
|
extension DnsProviderTypeIsSpecified on DnsProviderType? {
|
||||||
|
|
|
@ -24,6 +24,8 @@ class RecoveryConfirmDns extends StatelessWidget {
|
||||||
final String providerDisplayName =
|
final String providerDisplayName =
|
||||||
appConfig.state.serverDomain?.provider.displayName ??
|
appConfig.state.serverDomain?.provider.displayName ??
|
||||||
'DNS Provider';
|
'DNS Provider';
|
||||||
|
final String providerSupportArticle =
|
||||||
|
appConfig.state.serverDomain?.provider.supportArticle ?? '';
|
||||||
return BrandHeroScreen(
|
return BrandHeroScreen(
|
||||||
heroTitle: 'recovering.provider_connected'.tr(
|
heroTitle: 'recovering.provider_connected'.tr(
|
||||||
args: [providerDisplayName],
|
args: [providerDisplayName],
|
||||||
|
@ -60,7 +62,7 @@ class RecoveryConfirmDns extends StatelessWidget {
|
||||||
builder: (final context) => BrandButton.text(
|
builder: (final context) => BrandButton.text(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
context.read<SupportSystemCubit>().showArticle(
|
context.read<SupportSystemCubit>().showArticle(
|
||||||
article: 'how_cloudflare',
|
article: providerSupportArticle,
|
||||||
context: context,
|
context: context,
|
||||||
),
|
),
|
||||||
title: 'initializing.how'.tr(),
|
title: 'initializing.how'.tr(),
|
||||||
|
|
|
@ -17,6 +17,12 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
||||||
final ServerInstallationCubit appConfig =
|
final ServerInstallationCubit appConfig =
|
||||||
context.watch<ServerInstallationCubit>();
|
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) {
|
if (appConfig.state.serverDetails?.provider == ServerProviderType.unknown) {
|
||||||
return BrandHeroScreen(
|
return BrandHeroScreen(
|
||||||
heroTitle: 'recovering.server_provider_unknown'.tr(),
|
heroTitle: 'recovering.server_provider_unknown'.tr(),
|
||||||
|
@ -45,8 +51,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
||||||
builder: (final BuildContext context) => BrandHeroScreen(
|
builder: (final BuildContext context) => BrandHeroScreen(
|
||||||
heroTitle: 'recovering.provider_connected'.tr(
|
heroTitle: 'recovering.provider_connected'.tr(
|
||||||
args: [
|
args: [
|
||||||
appConfig.state.serverDetails?.provider.displayName ??
|
displayName,
|
||||||
'Server Provider',
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
heroSubtitle: 'recovering.provider_connected_description'.tr(
|
heroSubtitle: 'recovering.provider_connected_description'.tr(
|
||||||
|
@ -67,8 +72,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
labelText: 'recovering.provider_connected_placeholder'.tr(
|
labelText: 'recovering.provider_connected_placeholder'.tr(
|
||||||
args: [
|
args: [
|
||||||
appConfig.state.serverDetails?.provider.displayName ??
|
displayName,
|
||||||
'Server Provider',
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -84,7 +88,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
|
||||||
builder: (final context) => BrandButton.text(
|
builder: (final context) => BrandButton.text(
|
||||||
title: 'initializing.how'.tr(),
|
title: 'initializing.how'.tr(),
|
||||||
onPressed: () => context.read<SupportSystemCubit>().showArticle(
|
onPressed: () => context.read<SupportSystemCubit>().showArticle(
|
||||||
article: 'how_hetzner',
|
article: supportArticle,
|
||||||
context: context,
|
context: context,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue