Skip to content

Commit

Permalink
fix: add link to login
Browse files Browse the repository at this point in the history
  • Loading branch information
qinluhe committed Jul 10, 2024
1 parent 46318a6 commit c043c47
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class AboutSettingGroup extends StatelessWidget {
trailing: const Icon(
Icons.chevron_right,
),
onTap: () => afLaunchUrlString('https://appflowy.io/privacy/app'),
onTap: () => afLaunchUrlString('https://appflowy.io/privacy'),
),
MobileSettingItem(
name: LocaleKeys.settings_mobile_termsAndConditions.tr(),
trailing: const Icon(
Icons.chevron_right,
),
onTap: () => afLaunchUrlString('https://appflowy.io/terms/app'),
onTap: () => afLaunchUrlString('https://appflowy.io/terms'),
),
if (kDebugMode)
MobileSettingItem(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

import 'package:appflowy/core/helpers/url_launcher.dart';

class SignInAgreement extends StatelessWidget {
const SignInAgreement({
super.key,
Expand All @@ -20,15 +23,21 @@ class SignInAgreement extends StatelessWidget {
TextSpan(
text: '${LocaleKeys.web_termOfUse.tr()} ',
style: const TextStyle(color: Colors.blue, fontSize: 12),
mouseCursor: SystemMouseCursors.click,
recognizer: TapGestureRecognizer()
..onTap = () => afLaunchUrlString('https://appflowy.io/terms'),
),
TextSpan(
text: '${LocaleKeys.web_and.tr()} ',
style: const TextStyle(color: Colors.grey, fontSize: 12),
),
TextSpan(
text: LocaleKeys.web_privacyPolicy.tr(),
style: const TextStyle(color: Colors.blue, fontSize: 12),
),
text: LocaleKeys.web_privacyPolicy.tr(),
style: const TextStyle(color: Colors.blue, fontSize: 12),
mouseCursor: SystemMouseCursors.click,
recognizer: TapGestureRecognizer()
..onTap =
() => afLaunchUrlString('https://appflowy.io/privacy')),
],
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@/application/services/js-services/cache';
import { openCollabDB, db } from '@/application/db';
import { StrategyType } from '@/application/services/js-services/cache/types';
import * as Y from 'yjs';

jest.mock('@/application/ydoc/apply', () => ({
applyYDoc: jest.fn(),
Expand Down Expand Up @@ -118,9 +119,8 @@ describe('Cache functions', () => {

describe('getBatchCollabs', () => {
it('should return empty array when no cache found', async () => {
(openCollabDB as jest.Mock).mockResolvedValue(undefined);
const collabs = await getBatchCollabs(['1', '2', '3']);
expect(collabs).toEqual([]);
(openCollabDB as jest.Mock).mockResolvedValue(new Y.Doc());
await expect(getBatchCollabs(['1', '2', '3'])).rejects.toThrow('No cache found');
});

it('should return collabs when cache found', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,28 @@ export class AFClientService implements AFService {
async getPublishDatabaseViewRows(_namespace: string, _publishName: string, _rowIds: string[]) {
return Promise.reject('Method not implemented');
}

getClientId(): string {
return '';
}

loginAuth(_: string): Promise<void> {
return Promise.resolve(undefined);
}

signInDiscord(_params: { redirectTo: string }): Promise<void> {
return Promise.resolve(undefined);
}

signInGithub(_params: { redirectTo: string }): Promise<void> {
return Promise.resolve(undefined);
}

signInGoogle(_params: { redirectTo: string }): Promise<void> {
return Promise.resolve(undefined);
}

signInMagicLink(_params: { email: string; redirectTo: string }): Promise<void> {
return Promise.resolve(undefined);
}
}

0 comments on commit c043c47

Please sign in to comment.