Browse Source

Add LessPass Database Url text field on the login screen

pull/763/head
Guillaume Vincent 1 year ago
parent
commit
b6584414f7
8 changed files with 30 additions and 79 deletions
  1. +2
    -2
      mobile/android/app/build.gradle
  2. +2
    -2
      mobile/ios/LessPass.xcodeproj/project.pbxproj
  3. +1
    -1
      mobile/package.json
  4. +16
    -27
      mobile/src/auth/SignInScreen.js
  5. +8
    -2
      mobile/src/auth/SignUpScreen.js
  6. +0
    -1
      mobile/src/messages/messagesReducer.js
  7. +0
    -43
      mobile/src/password/PasswordGeneratorScreen.js
  8. +1
    -1
      mobile/src/version.json

+ 2
- 2
mobile/android/app/build.gradle View File

@@ -147,8 +147,8 @@ android {
applicationId "com.lesspass.android"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 9007006
versionName "9.7.6"
versionCode 9007007
versionName "9.7.7"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {


+ 2
- 2
mobile/ios/LessPass.xcodeproj/project.pbxproj View File

@@ -529,7 +529,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 9.7.6;
MARKETING_VERSION = 9.7.7;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -557,7 +557,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 9.7.6;
MARKETING_VERSION = 9.7.7;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",


+ 1
- 1
mobile/package.json View File

@@ -1,6 +1,6 @@
{
"name": "lesspass-mobile",
"version": "9.7.6",
"version": "9.7.7",
"description": "LessPass mobile application",
"license": "(MPL-2.0 OR GPL-3.0)",
"author": "Guillaume Vincent <guillaume@oslab.fr>",


+ 16
- 27
mobile/src/auth/SignInScreen.js View File

@@ -7,10 +7,8 @@ import {
Platform,
TouchableWithoutFeedback,
Keyboard,
View,
Linking,
} from "react-native";
import { Text, Button, Title, useTheme } from "react-native-paper";
import { Button, Title } from "react-native-paper";
import MasterPassword from "../password/MasterPassword";
import TextInput from "../ui/TextInput";
import Styles from "../ui/Styles";
@@ -18,7 +16,7 @@ import { addError } from "../errors/errorsActions";
import { signIn } from "./authActions";
import routes from "../routes";
import { useNavigation } from "@react-navigation/native";
import { readMessage } from "../messages/messagesActions";
import { setSettings } from "../settings/settingsActions";

export default function SignInScreen() {
const [email, setEmail] = useState("");
@@ -26,10 +24,10 @@ export default function SignInScreen() {
const [isLoading, setIsLoading] = useState(false);
const navigation = useNavigation();
const dispatch = useDispatch();
const theme = useTheme();
const encryptMasterPassword = useSelector(
(state) => state.settings.encryptMasterPassword
);
const baseURL = useSelector((state) => state.settings.baseURL);
return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
@@ -37,7 +35,13 @@ export default function SignInScreen() {
>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<ScrollView contentContainerStyle={Styles.innerContainer}>
<Title style={Styles.title}>Connect to Lesspass Database</Title>
<Title style={Styles.title}>Connect to your Lesspass Database</Title>
<TextInput
mode="outlined"
label="LessPass Database Url"
value={baseURL}
onChangeText={(text) => dispatch(setSettings(text))}
/>
<TextInput
mode="outlined"
label="Email"
@@ -59,7 +63,6 @@ export default function SignInScreen() {
}}
disabled={isEmpty(email) || isEmpty(password) || isLoading}
onPress={() => {
dispatch(readMessage("LessPassServerWillBeTurnedOffOnMarch"));
setIsLoading(true);
dispatch(
signIn(
@@ -85,26 +88,12 @@ export default function SignInScreen() {
>
Sign In
</Button>
<View>
<Text style={{ color: theme.colors.error }}>
LessPass Database server will be turned off on March 1th, 2023.
You can export your passwords using the web extension, the CLI or
the web site.
</Text>
<Button
mode="text"
onPress={() => {
Linking.openURL(
"https://blog.lesspass.com/2022-12-29/decommissioning-lesspass-database"
);
}}
style={{
marginTop: 10,
}}
>
See announcement
</Button>
</View>
<Button
mode="text"
onPress={() => navigation.navigate(routes.SIGN_UP)}
>
Create an account
</Button>
</ScrollView>
</TouchableWithoutFeedback>
</KeyboardAvoidingView>


+ 8
- 2
mobile/src/auth/SignUpScreen.js View File

@@ -6,7 +6,7 @@ import {
TouchableWithoutFeedback,
Keyboard,
} from "react-native";
import { Button, Title, useTheme } from "react-native-paper";
import { Button, Title } from "react-native-paper";
import MasterPassword from "../password/MasterPassword";
import TextInput from "../ui/TextInput";
import Styles from "../ui/Styles";
@@ -23,10 +23,10 @@ export default function SignUpScreen() {
const [isLoading, setIsLoading] = useState(false);
const navigation = useNavigation();
const dispatch = useDispatch();
const theme = useTheme();
const encryptMasterPassword = useSelector(
(state) => state.settings.encryptMasterPassword
);
const baseURL = useSelector((state) => state.settings.baseURL);

return (
<KeyboardAvoidingView
@@ -38,6 +38,12 @@ export default function SignUpScreen() {
<Title style={Styles.title}>Create an account</Title>
<TextInput
mode="outlined"
label="LessPass Database Url"
value={baseURL}
onChangeText={(text) => dispatch(setSettings(text))}
/>
<TextInput
mode="outlined"
label="Email"
value={email}
onChangeText={setEmail}


+ 0
- 1
mobile/src/messages/messagesReducer.js View File

@@ -1,7 +1,6 @@
import * as types from "./messagesActionsTypes";

const initialState = {
LessPassServerWillBeTurnedOffOnMarch: false,
};

export default function (state = initialState, action) {


+ 0
- 43
mobile/src/password/PasswordGeneratorScreen.js View File

@@ -6,7 +6,6 @@ import {
KeyboardAvoidingView,
Platform,
Keyboard,
Linking,
} from "react-native";
import { generatePassword } from "./passwordGenerator";
import TextInput from "../ui/TextInput";
@@ -26,7 +25,6 @@ import {
} from "./validations";
import { Button, Snackbar, Text, useTheme } from "react-native-paper";
import { addError, cleanErrors } from "../errors/errorsActions";
import { readMessage } from "../messages/messagesActions";

function _getInitialState(settings) {
return {
@@ -62,7 +60,6 @@ export default function PasswordGeneratorScreen() {
const profile = useSelector((state) => state.profile);
const settings = useSelector((state) => state.settings);
const auth = useSelector((state) => state.auth);
const messages = useSelector((state) => state.messages);
const dispatch = useDispatch();
const [copied, setCopied] = useState(false);
const [seePassword, setSeePassword] = useState(false);
@@ -310,46 +307,6 @@ export default function PasswordGeneratorScreen() {
</Text>
</View>
)}
{auth.isAuthenticated &&
!messages["LessPassServerWillBeTurnedOffOnMarch"] && (
<>
<Text style={{ color: theme.colors.error, marginTop: 20 }}>
LessPass Database server will be turned off on March 1th,
2023. You can export your passwords using the web extension,
the CLI or the web site.
<Text
style={{ color: theme.colors.primary }}
onPress={() => {
Linking.openURL(
"https://blog.lesspass.com/2022-12-29/decommissioning-lesspass-database"
);
}}
>
{" "}
See announcement
</Text>
</Text>
<Button
mode="text"
onPress={() =>
dispatch(
readMessage("LessPassServerWillBeTurnedOffOnMarch")
)
}
>
<Text
style={{
color: theme.colors.error,
fontWeight: "bold",
marginTop: 5,
}}
onPress={() => {}}
>
Hide
</Text>
</Button>
</>
)}
</ScrollView>
</TouchableWithoutFeedback>
<Snackbar


+ 1
- 1
mobile/src/version.json View File

@@ -1,3 +1,3 @@
{
"version": "9.7.6"
"version": "9.7.7"
}

Loading…
Cancel
Save