Skip to content

Commit e6dbce5

Browse files
author
tfomkin
committed
Merge branch 'development' into PRD-2080-Expo-SDK-54
# Conflicts: # libs/mobile/chat/features/chat/src/lib/component.tsx # libs/mobile/chat/features/menu-list/src/lib/component.tsx # libs/mobile/shared/ui/ui-kit/src/full-screen-search-modal/component.tsx
2 parents d58daf5 + b001ab9 commit e6dbce5

51 files changed

Lines changed: 778 additions & 63 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/mobile/app.config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ const createConfig = (): Omit<ExpoConfig, 'extra'> & { extra: { eas: EASConfig }
2727
slug: process.env.EXPO_PUBLIC_APP_SLUG as string,
2828
scheme: process.env.EXPO_PUBLIC_APP_SCHEME as string,
2929
owner: process.env.EXPO_PUBLIC_APP_OWNER as string,
30-
version: '1.0.0',
30+
version: '1.1.0',
3131
orientation: 'portrait',
3232
icon: './assets/icon.png',
33-
runtimeVersion: '1.0.0',
33+
runtimeVersion: '1.1.0',
3434
experiments: {
3535
reactCompiler: true,
3636
},
@@ -42,7 +42,7 @@ const createConfig = (): Omit<ExpoConfig, 'extra'> & { extra: { eas: EASConfig }
4242
supportsTablet: false,
4343
buildNumber: appEnv.select({
4444
default: '13',
45-
production: '6',
45+
production: '7',
4646
}),
4747
config: {
4848
usesNonExemptEncryption: false,
@@ -52,7 +52,7 @@ const createConfig = (): Omit<ExpoConfig, 'extra'> & { extra: { eas: EASConfig }
5252
package: appId,
5353
versionCode: appEnv.select({
5454
default: 13,
55-
production: 6,
55+
production: 7,
5656
}),
5757
adaptiveIcon: {
5858
foregroundImage: './assets/adaptive-icon.png',
@@ -81,15 +81,15 @@ const createConfig = (): Omit<ExpoConfig, 'extra'> & { extra: { eas: EASConfig }
8181
[
8282
'expo-image-picker',
8383
{
84-
photosPermission: 'Allow Open Web UI to access your photos.',
85-
cameraPermission: 'Allow Open Web UI to access your camera.',
84+
photosPermission: 'Allow Open MobileUI to access your photos.',
85+
cameraPermission: 'Allow Open MobileUI to access your camera.',
8686
},
8787
],
8888
[
8989
'expo-media-library',
9090
{
91-
photosPermission: 'Allow Open Web UI to access your photos.',
92-
savePhotosPermission: 'Allow Open Web UI to save photos.',
91+
photosPermission: 'Allow Open MobileUI to access your photos.',
92+
savePhotosPermission: 'Allow Open MobileUI to save photos.',
9393
},
9494
],
9595
googleAuthIosUrlScheme
-6.32 KB
Loading

apps/mobile/assets/icon.png

-16.5 KB
Loading

apps/mobile/assets/splash-dark.png

34 KB
Loading

apps/mobile/assets/splash.png

-9.6 KB
Loading

i18n/mobile/auth/en.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
"AUTH": {
33
"SIGN_IN": {
44
"TEXT_TITLE_EXTERNAL": "Sign In",
5-
"TEXT_TITLE_INTERNAL": "Sign In to Ronas IT",
6-
"TEXT_TITLE_INTERNAL_SUBTITLE": "OpenWeb UI",
7-
"TEXT_USE_YOUR_RONAS_IT": "Use your Ronas IT",
8-
"TEXT_GOOGLE_ACCOUNT_TO_SIGN_IN": "Google account to sign in",
95
"TEXT_YOU_LOGGED_IN": "You`re now logged in.",
106
"EMAIL_FORM": {
117
"TEXT_EMAIL_ADDRESS": "Email Address",

i18n/mobile/chat/en.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@
121121
"AI_MESSAGE_ACTIONS": {
122122
"TEXT_EDIT": "Edit",
123123
"TEXT_COPY": "Copy",
124-
"TEXT_CONTINUE_RESPONSE": "Continue response"
124+
"TEXT_CONTINUE_RESPONSE": "Continue response",
125+
"TEXT_REGENERATE": "Regenerate",
126+
"REGENERATE_MESSAGE_ACTION_SHEET": {
127+
"TEXT_SUGGEST_A_CHANGE": "Suggest a change",
128+
"TEXT_TRY_AGAIN": "Try again",
129+
"TEXT_ADD_DETAILS": "Add details",
130+
"TEXT_MORE_CONCISE": "More concise"
131+
}
125132
},
126133
"EDIT_MESSAGE_INPUT": {
127134
"TEXT_EDIT_MESSAGE": "Edit message",
@@ -130,6 +137,10 @@
130137
"BUTTON_SEND": "Send",
131138
"BUTTON_CANCEL": "Cancel"
132139
},
140+
"SUGGEST_CHANGE_INPUT": {
141+
"TEXT_SUGGEST_A_CHANGE": "Suggest a change",
142+
"BUTTON_CANCEL": "Cancel"
143+
},
133144
"ARCHIVED_CHATS_FILTERS_SHEET": {
134145
"USE_SEARCH_FILTERS": {
135146
"TEXT_MOST_RECENT": "Most recent",

libs/mobile/auth/features/email-sign-in-form/src/lib/component.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import { EmailFormSchema } from './forms';
1515

1616
interface EmailSignInFormProps {
1717
onSuccess: () => void;
18+
onApiUrlChange?: (url: string) => void;
1819
}
1920

20-
export function EmailSignInForm({ onSuccess }: EmailSignInFormProps): ReactElement {
21+
export function EmailSignInForm({ onSuccess, onApiUrlChange }: EmailSignInFormProps): ReactElement {
2122
const translate = useTranslation('AUTH.SIGN_IN.EMAIL_FORM');
2223
const emailRef = useRef<TextInput>(null);
2324
const passwordRef = useRef<TextInput>(null);
@@ -57,6 +58,7 @@ export function EmailSignInForm({ onSuccess }: EmailSignInFormProps): ReactEleme
5758

5859
useEffect(() => {
5960
setValue('url', query, { shouldValidate: true });
61+
onApiUrlChange?.(query);
6062
}, [query]);
6163

6264
useEffect(() => {

libs/mobile/auth/features/email-sign-in-form/src/lib/forms/email-form.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ export class EmailFormSchema {
2121
.url(i18n.t('SHARED.VALIDATION.TEXT_INVALID_URL'))
2222
.test('no-path', i18n.t('SHARED.VALIDATION.TEXT_INVALID_URL'), (value) => {
2323
if (!value) return true;
24-
if (value.endsWith('/')) return false;
2524

2625
try {
27-
const url = new URL(value);
26+
const normalizedValue = value.trim();
27+
const url = new URL(normalizedValue);
28+
const normalizedPath = url.pathname.replace(/\/+$/, '/');
2829

29-
return url.pathname === '/' && !url.search && !url.hash;
30+
return normalizedPath === '/' && !url.search && !url.hash;
3031
} catch {
3132
return false;
3233
}
Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useTranslation } from '@ronas-it/react-native-common-modules/i18n';
2-
import Constants from 'expo-constants';
3-
import { ReactElement } from 'react';
2+
import { ReactElement, useState } from 'react';
43
import { EmailSignInForm } from '@open-webui-react-native/mobile/auth/features/email-sign-in-form';
54
import { GoogleSignInForm } from '@open-webui-react-native/mobile/auth/features/google-sign-in-form';
65
import { AppText, View } from '@open-webui-react-native/mobile/shared/ui/ui-kit';
6+
import { ronasApiUrl } from '@open-webui-react-native/shared/utils/config';
77
import { ToastService } from '@open-webui-react-native/shared/utils/toast-service';
88

99
export interface SignInProps {
@@ -13,8 +13,11 @@ export interface SignInProps {
1313
export function SignIn(props: SignInProps): ReactElement {
1414
const { onSuccess } = props;
1515
const translate = useTranslation('AUTH.SIGN_IN');
16+
const [apiUrlInput, setApiUrlInput] = useState<string>();
1617

17-
const isInternalRelease = Constants.expoConfig?.extra?.isInternalRelease;
18+
const normalizeUrl = (url?: string): string => (url ?? '').trim().replace(/\/+$/, '');
19+
20+
const showGoogleSignIn = normalizeUrl(apiUrlInput) === normalizeUrl(ronasApiUrl);
1821

1922
const handleSuccess = (): void => {
2023
onSuccess();
@@ -23,32 +26,17 @@ export function SignIn(props: SignInProps): ReactElement {
2326
}, 250);
2427
};
2528

26-
if (isInternalRelease) {
27-
return (
28-
<View className='flex-1'>
29-
<View className='absolute top-0 left-0 right-0 pt-32 pb-8 px-6 z-10'>
30-
<AppText className='text-h2-sm sm:text-h2 font-medium mb-24'>{translate('TEXT_TITLE_INTERNAL')}</AppText>
31-
<AppText className='text-sm-sm sm:text-sm'>{translate('TEXT_TITLE_INTERNAL_SUBTITLE')}</AppText>
32-
</View>
33-
<View className='flex-1 justify-center items-center'>
34-
<View className='w-full max-w-sm'>
35-
<View className='items-center mb-24'>
36-
<AppText className='text-center'>{translate('TEXT_USE_YOUR_RONAS_IT')}</AppText>
37-
<AppText className='text-center'>{translate('TEXT_GOOGLE_ACCOUNT_TO_SIGN_IN')}</AppText>
38-
</View>
39-
<GoogleSignInForm onSuccess={handleSuccess} />
40-
</View>
41-
</View>
42-
</View>
43-
);
44-
}
45-
4629
return (
4730
<View className='flex-1 pt-32'>
4831
<View className='mb-12'>
4932
<AppText className='text-h2-sm sm:text-h2 font-medium mb-24'>{translate('TEXT_TITLE_EXTERNAL')}</AppText>
5033
</View>
51-
<EmailSignInForm onSuccess={handleSuccess} />
34+
<EmailSignInForm onSuccess={handleSuccess} onApiUrlChange={setApiUrlInput} />
35+
{showGoogleSignIn && (
36+
<View className='pt-40'>
37+
<GoogleSignInForm onSuccess={handleSuccess} />
38+
</View>
39+
)}
5240
</View>
5341
);
5442
}

0 commit comments

Comments
 (0)