mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-09-02 05:14:05 +00:00
fix: settings page minor issues (#6354)
This commit is contained in:
parent
da03f40d29
commit
aa06c78b68
@ -3,6 +3,7 @@ import 'package:appflowy/generated/locale_keys.g.dart';
|
|||||||
import 'package:appflowy/shared/appflowy_cache_manager.dart';
|
import 'package:appflowy/shared/appflowy_cache_manager.dart';
|
||||||
import 'package:appflowy/startup/startup.dart';
|
import 'package:appflowy/startup/startup.dart';
|
||||||
import 'package:appflowy/util/share_log_files.dart';
|
import 'package:appflowy/util/share_log_files.dart';
|
||||||
|
import 'package:appflowy/workspace/application/settings/appearance/appearance_cubit.dart';
|
||||||
import 'package:appflowy/workspace/application/settings/appflowy_cloud_urls_bloc.dart';
|
import 'package:appflowy/workspace/application/settings/appflowy_cloud_urls_bloc.dart';
|
||||||
import 'package:appflowy/workspace/application/settings/settings_dialog_bloc.dart';
|
import 'package:appflowy/workspace/application/settings/settings_dialog_bloc.dart';
|
||||||
import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart';
|
import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart';
|
||||||
@ -14,7 +15,6 @@ import 'package:appflowy/workspace/presentation/settings/pages/settings_plan_vie
|
|||||||
import 'package:appflowy/workspace/presentation/settings/pages/settings_shortcuts_view.dart';
|
import 'package:appflowy/workspace/presentation/settings/pages/settings_shortcuts_view.dart';
|
||||||
import 'package:appflowy/workspace/presentation/settings/pages/settings_workspace_view.dart';
|
import 'package:appflowy/workspace/presentation/settings/pages/settings_workspace_view.dart';
|
||||||
import 'package:appflowy/workspace/presentation/settings/shared/settings_category.dart';
|
import 'package:appflowy/workspace/presentation/settings/shared/settings_category.dart';
|
||||||
import 'package:appflowy/workspace/presentation/settings/shared/settings_category_spacer.dart';
|
|
||||||
import 'package:appflowy/workspace/presentation/settings/widgets/feature_flags/feature_flag_page.dart';
|
import 'package:appflowy/workspace/presentation/settings/widgets/feature_flags/feature_flag_page.dart';
|
||||||
import 'package:appflowy/workspace/presentation/settings/widgets/members/workspace_member_page.dart';
|
import 'package:appflowy/workspace/presentation/settings/widgets/members/workspace_member_page.dart';
|
||||||
import 'package:appflowy/workspace/presentation/settings/widgets/settings_menu.dart';
|
import 'package:appflowy/workspace/presentation/settings/widgets/settings_menu.dart';
|
||||||
@ -26,6 +26,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:toastification/toastification.dart';
|
||||||
|
|
||||||
import 'widgets/setting_cloud.dart';
|
import 'widgets/setting_cloud.dart';
|
||||||
|
|
||||||
@ -167,22 +168,35 @@ class _SimpleSettingsDialogState extends State<SimpleSettingsDialog> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
context.watch<AppearanceSettingsCubit>();
|
||||||
|
|
||||||
return FlowyDialog(
|
return FlowyDialog(
|
||||||
width: MediaQuery.of(context).size.width * 0.7,
|
width: MediaQuery.of(context).size.width * 0.7,
|
||||||
constraints: const BoxConstraints(maxWidth: 784, minWidth: 564),
|
constraints: const BoxConstraints(maxWidth: 784, minWidth: 564),
|
||||||
child: const Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(24.0),
|
padding: const EdgeInsets.all(24.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
// header
|
||||||
|
FlowyText(
|
||||||
|
LocaleKeys.signIn_settings.tr(),
|
||||||
|
fontSize: 36.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
const VSpace(18.0),
|
||||||
|
|
||||||
// language
|
// language
|
||||||
_LanguageSettings(),
|
const _LanguageSettings(),
|
||||||
SettingsCategorySpacer(),
|
const VSpace(22.0),
|
||||||
|
|
||||||
// self-host cloud
|
// self-host cloud
|
||||||
_SelfHostSettings(),
|
const _SelfHostSettings(),
|
||||||
SettingsCategorySpacer(),
|
const VSpace(22.0),
|
||||||
|
|
||||||
// support
|
// support
|
||||||
_SupportSettings(),
|
const _SupportSettings(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -232,17 +246,33 @@ class _SelfHostSettingsState extends State<_SelfHostSettings> {
|
|||||||
return SettingsCategory(
|
return SettingsCategory(
|
||||||
title: LocaleKeys.settings_menu_cloudAppFlowySelfHost.tr(),
|
title: LocaleKeys.settings_menu_cloudAppFlowySelfHost.tr(),
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Row(
|
||||||
height: 48,
|
children: [
|
||||||
child: FlowyTextField(
|
Expanded(
|
||||||
controller: textController,
|
child: SizedBox(
|
||||||
autoFocus: false,
|
height: 36,
|
||||||
textStyle: const TextStyle(
|
child: FlowyTextField(
|
||||||
fontSize: 14,
|
controller: textController,
|
||||||
fontWeight: FontWeight.w400,
|
autoFocus: false,
|
||||||
|
textStyle: const TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
hintText: 'https://beta.appflowy.cloud',
|
||||||
|
onEditingComplete: _saveSelfHostUrl,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onEditingComplete: _saveSelfHostUrl,
|
const HSpace(12.0),
|
||||||
),
|
Container(
|
||||||
|
height: 36,
|
||||||
|
constraints: const BoxConstraints(minWidth: 78),
|
||||||
|
child: OutlinedRoundedButton(
|
||||||
|
text: LocaleKeys.button_save.tr(),
|
||||||
|
onTap: _saveSelfHostUrl,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -251,16 +281,33 @@ class _SelfHostSettingsState extends State<_SelfHostSettings> {
|
|||||||
void _saveSelfHostUrl() {
|
void _saveSelfHostUrl() {
|
||||||
final url = textController.text;
|
final url = textController.text;
|
||||||
if (url.isEmpty) {
|
if (url.isEmpty) {
|
||||||
|
showToastNotification(
|
||||||
|
context,
|
||||||
|
message: LocaleKeys.settings_menu_pleaseInputValidURL.tr(),
|
||||||
|
type: ToastificationType.error,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
validateUrl(url).fold(
|
validateUrl(url).fold(
|
||||||
(url) async {
|
(url) async {
|
||||||
|
showToastNotification(
|
||||||
|
context,
|
||||||
|
message: LocaleKeys.settings_menu_changeUrl.tr(args: [url]),
|
||||||
|
);
|
||||||
|
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
await useSelfHostedAppFlowyCloudWithURL(url);
|
await useSelfHostedAppFlowyCloudWithURL(url);
|
||||||
await runAppFlowy();
|
await runAppFlowy();
|
||||||
},
|
},
|
||||||
(err) => Log.error(err),
|
(err) {
|
||||||
|
showToastNotification(
|
||||||
|
context,
|
||||||
|
message: LocaleKeys.settings_menu_pleaseInputValidURL.tr(),
|
||||||
|
type: ToastificationType.error,
|
||||||
|
);
|
||||||
|
Log.error(err);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -280,11 +327,14 @@ class _SupportSettings extends StatelessWidget {
|
|||||||
LocaleKeys.workspace_errorActions_exportLogFiles.tr(),
|
LocaleKeys.workspace_errorActions_exportLogFiles.tr(),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
OutlinedRoundedButton(
|
ConstrainedBox(
|
||||||
text: LocaleKeys.settings_files_export.tr(),
|
constraints: const BoxConstraints(minWidth: 78),
|
||||||
onTap: () {
|
child: OutlinedRoundedButton(
|
||||||
shareLogFiles(context);
|
text: LocaleKeys.settings_files_export.tr(),
|
||||||
},
|
onTap: () {
|
||||||
|
shareLogFiles(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -295,19 +345,22 @@ class _SupportSettings extends StatelessWidget {
|
|||||||
LocaleKeys.settings_files_clearCache.tr(),
|
LocaleKeys.settings_files_clearCache.tr(),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
OutlinedRoundedButton(
|
ConstrainedBox(
|
||||||
text: LocaleKeys.button_clear.tr(),
|
constraints: const BoxConstraints(minWidth: 78),
|
||||||
onTap: () async {
|
child: OutlinedRoundedButton(
|
||||||
await getIt<FlowyCacheManager>().clearAllCache();
|
text: LocaleKeys.button_clear.tr(),
|
||||||
if (context.mounted) {
|
onTap: () async {
|
||||||
showToastNotification(
|
await getIt<FlowyCacheManager>().clearAllCache();
|
||||||
context,
|
if (context.mounted) {
|
||||||
message: LocaleKeys
|
showToastNotification(
|
||||||
.settings_manageDataPage_cache_dialog_successHint
|
context,
|
||||||
.tr(),
|
message: LocaleKeys
|
||||||
);
|
.settings_manageDataPage_cache_dialog_successHint
|
||||||
}
|
.tr(),
|
||||||
},
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -25,8 +25,6 @@ PODS:
|
|||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- local_notifier (0.1.0):
|
- local_notifier (0.1.0):
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- open_file_mac (0.0.1):
|
|
||||||
- FlutterMacOS
|
|
||||||
- package_info_plus (0.0.1):
|
- package_info_plus (0.0.1):
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- path_provider_foundation (0.0.1):
|
- path_provider_foundation (0.0.1):
|
||||||
@ -68,7 +66,6 @@ DEPENDENCIES:
|
|||||||
- hotkey_manager (from `Flutter/ephemeral/.symlinks/plugins/hotkey_manager/macos`)
|
- hotkey_manager (from `Flutter/ephemeral/.symlinks/plugins/hotkey_manager/macos`)
|
||||||
- irondash_engine_context (from `Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos`)
|
- irondash_engine_context (from `Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos`)
|
||||||
- local_notifier (from `Flutter/ephemeral/.symlinks/plugins/local_notifier/macos`)
|
- local_notifier (from `Flutter/ephemeral/.symlinks/plugins/local_notifier/macos`)
|
||||||
- open_file_mac (from `Flutter/ephemeral/.symlinks/plugins/open_file_mac/macos`)
|
|
||||||
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
|
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
|
||||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
|
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
|
||||||
@ -111,8 +108,6 @@ EXTERNAL SOURCES:
|
|||||||
:path: Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/irondash_engine_context/macos
|
||||||
local_notifier:
|
local_notifier:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/local_notifier/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/local_notifier/macos
|
||||||
open_file_mac:
|
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/open_file_mac/macos
|
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
@ -148,7 +143,6 @@ SPEC CHECKSUMS:
|
|||||||
hotkey_manager: c32bf0bfe8f934b7bc17ab4ad5c4c142960b023c
|
hotkey_manager: c32bf0bfe8f934b7bc17ab4ad5c4c142960b023c
|
||||||
irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478
|
irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478
|
||||||
local_notifier: e9506bc66fc70311e8bc7291fb70f743c081e4ff
|
local_notifier: e9506bc66fc70311e8bc7291fb70f743c081e4ff
|
||||||
open_file_mac: 0e554648e2a87ce59e9438e3e5ca3e552e90d89a
|
|
||||||
package_info_plus: fa739dd842b393193c5ca93c26798dff6e3d0e0c
|
package_info_plus: fa739dd842b393193c5ca93c26798dff6e3d0e0c
|
||||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||||
ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979
|
ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979
|
||||||
|
@ -91,6 +91,7 @@ class OutlinedRoundedButton extends StatelessWidget {
|
|||||||
text: FlowyText.regular(
|
text: FlowyText.regular(
|
||||||
text,
|
text,
|
||||||
lineHeight: 1.0,
|
lineHeight: 1.0,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
),
|
),
|
||||||
|
@ -953,6 +953,8 @@
|
|||||||
"selfHostStart": "If you don't have a server, please refer to the",
|
"selfHostStart": "If you don't have a server, please refer to the",
|
||||||
"selfHostContent": "document",
|
"selfHostContent": "document",
|
||||||
"selfHostEnd": "for guidance on how to self-host your own server",
|
"selfHostEnd": "for guidance on how to self-host your own server",
|
||||||
|
"pleaseInputValidURL": "Please input a valid URL",
|
||||||
|
"changeUrl": "Change self-hosted url to {}",
|
||||||
"cloudURLHint": "Input the base URL of your server",
|
"cloudURLHint": "Input the base URL of your server",
|
||||||
"cloudWSURL": "Websocket URL",
|
"cloudWSURL": "Websocket URL",
|
||||||
"cloudWSURLHint": "Input the websocket address of your server",
|
"cloudWSURLHint": "Input the websocket address of your server",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user