feat: create the default workspace on cloud when using appflowy cloud (#4040)

* chore: sync strategy for collab type

* chore: update rev id

* chore: update rev id

* ci: fix test

* ci: fix test
This commit is contained in:
Nathan.fooo
2023-11-28 15:49:47 -08:00
committed by GitHub
parent a5ed145aa3
commit 8036d070ad
34 changed files with 504 additions and 322 deletions

View File

@ -9,10 +9,8 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/stability_
import 'package:appflowy/plugins/trash/application/prelude.dart';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/user/application/auth/af_cloud_auth_service.dart';
import 'package:appflowy/user/application/auth/af_cloud_mock_auth_service.dart';
import 'package:appflowy/user/application/auth/auth_service.dart';
import 'package:appflowy/user/application/auth/supabase_auth_service.dart';
import 'package:appflowy/user/application/auth/supabase_mock_auth_service.dart';
import 'package:appflowy/user/application/prelude.dart';
import 'package:appflowy/user/application/reminder/reminder_bloc.dart';
import 'package:appflowy/user/application/user_listener.dart';
@ -52,7 +50,6 @@ class DependencyResolver {
_resolveHomeDeps(getIt);
_resolveFolderDeps(getIt);
_resolveDocDeps(getIt);
// _resolveGridDeps(getIt);
_resolveCommonService(getIt, mode);
}
}
@ -131,19 +128,10 @@ void _resolveUserDeps(GetIt getIt, IntegrationMode mode) {
);
break;
case AuthenticatorType.supabase:
if (mode.isIntegrationTest) {
getIt.registerFactory<AuthService>(() => SupabaseMockAuthService());
} else {
getIt.registerFactory<AuthService>(() => SupabaseAuthService());
}
getIt.registerFactory<AuthService>(() => SupabaseAuthService());
break;
case AuthenticatorType.appflowyCloud:
if (mode.isIntegrationTest) {
getIt
.registerFactory<AuthService>(() => AppFlowyCloudMockAuthService());
} else {
getIt.registerFactory<AuthService>(() => AppFlowyCloudAuthService());
}
getIt.registerFactory<AuthService>(() => AppFlowyCloudAuthService());
break;
}

View File

@ -45,7 +45,7 @@ class FlowyRunner {
// which is used for dependency injection throughout the app.
// If your functionality depends on 'getIt', ensure to register
// your callback here to execute any necessary actions post-initialization.
Future? didInitGetItCallback,
Future Function()? didInitGetItCallback,
// Passing the envs to the backend
Map<String, String> Function()? rustEnvsBuilder,
// Indicate whether the app is running in anonymous mode.
@ -64,7 +64,7 @@ class FlowyRunner {
// Specify the env
await initGetIt(getIt, mode, f, config);
await didInitGetItCallback;
await didInitGetItCallback?.call();
final applicationDataDirectory =
await getIt<ApplicationDataStorage>().getPath().then(