@fto-consult/expo-ui 6.64.21 → 6.64.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/App.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import AppEntry from "./src";
|
2
|
+
import {disableAuth} from "$econtext/hooks";
|
2
3
|
|
3
4
|
export default function MainExpoApp(props){
|
4
5
|
return <AppEntry
|
@@ -7,8 +8,7 @@ export default function MainExpoApp(props){
|
|
7
8
|
drawerItems:require("./docs/drawerItems").default,
|
8
9
|
}}
|
9
10
|
init ={({appConfig})=>{
|
10
|
-
|
11
|
-
appConfig.set("authDefaultUser",{code:"root",password:"admin123",label:"Master admin"})
|
11
|
+
disableAuth();
|
12
12
|
return Promise.resolve("test ted")
|
13
13
|
}}
|
14
14
|
{...props}
|
package/bin/create-app/App.js
CHANGED
@@ -35,7 +35,7 @@ export default function AppMainEntry(){
|
|
35
35
|
},*/
|
36
36
|
logo : Logo,//logo component's properties
|
37
37
|
loginPropsMutator : {},//({object})=><{object}>, la fonction permettant de muter les props du composant Login,
|
38
|
-
authEnabled :
|
38
|
+
authEnabled : false,//la gestion de l'authentification est désactivée par défaut
|
39
39
|
customFormFields : {},//custom form fields
|
40
40
|
/*** la fonction permettant de muter les props du composant TableLink, permetant de lier les tables entre elles */
|
41
41
|
tableLinkPropsMutator : (props)=>{
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "6.64.
|
3
|
+
"version": "6.64.23",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"main": "main",
|
6
6
|
"scripts": {
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"@expo/html-elements": "^0.5.1",
|
72
72
|
"@expo/vector-icons": "^13.0.0",
|
73
73
|
"@faker-js/faker": "^8.0.2",
|
74
|
-
"@fto-consult/common": "^3.55.
|
74
|
+
"@fto-consult/common": "^3.55.2",
|
75
75
|
"@pchmn/expo-material3-theme": "^1.3.1",
|
76
76
|
"@react-native-async-storage/async-storage": "1.18.2",
|
77
77
|
"@react-native-community/datetimepicker": "7.2.0",
|
package/src/context/Provider.js
CHANGED
@@ -7,6 +7,7 @@ import {colorsAlias,Colors} from "$theme";
|
|
7
7
|
import {isObj,isNonNullString,defaultStr,extendObj} from "$cutils";
|
8
8
|
import {getMainScreens} from "$escreens/mainScreens";
|
9
9
|
import {ExpoUIContext} from "./hooks";
|
10
|
+
import {enableAuth,disableAuth} from "$cauth/session";
|
10
11
|
import Login from "$eauth/Login";
|
11
12
|
import {modes} from "$ecomponents/TextField";
|
12
13
|
import {isMobileMedia} from "$cdimensions";
|
@@ -77,6 +78,9 @@ const Provider = ({children,getTableData,handleHelpScreen,navigation,swrConfig,c
|
|
77
78
|
}
|
78
79
|
const colorScheme = useColorScheme();
|
79
80
|
const isColorShemeDark = colorScheme ==="dark";
|
81
|
+
if(components.authEnabled === false){
|
82
|
+
disableAuth();
|
83
|
+
} else enableAuth();
|
80
84
|
appConfig.extendAppTheme = (theme,Theme,...rest)=>{
|
81
85
|
if(!isObj(theme)) return;
|
82
86
|
const isDark = theme.dark || theme.isDark || isDynamicThemeSupported && isColorShemeDark ;
|
package/src/context/hooks.js
CHANGED
@@ -6,6 +6,7 @@ import { useWindowDimensions } from "$cdimensions";
|
|
6
6
|
import {isObj,isNonNullString} from "$cutils";
|
7
7
|
import { StyleSheet } from "react-native";
|
8
8
|
import { createContext,useContext as useReactContext } from "react";
|
9
|
+
import appConfig from "$capp/config";
|
9
10
|
|
10
11
|
export const ExpoUIContext = createContext(null);
|
11
12
|
|
@@ -8,6 +8,7 @@ import Login from "$eauth/Login";
|
|
8
8
|
import {navigate} from "$cnavigation";
|
9
9
|
import theme from "$theme";
|
10
10
|
import Logo from "$ecomponents/Logo";
|
11
|
+
import appConfig from "$capp/config";
|
11
12
|
|
12
13
|
const DrawerNavigator = React.forwardRef(({content,children:customChildren,state,...props},ref)=>{
|
13
14
|
const drawerRef = React.useRef(null);
|
@@ -56,7 +57,6 @@ const DrawerNavigator = React.forwardRef(({content,children:customChildren,state
|
|
56
57
|
if(prevIsLoggedIn === isLoggedIn) return;
|
57
58
|
navigate("Home");
|
58
59
|
},[isLoggedIn]);
|
59
|
-
console.log(isLoggedIn," is loggged in heeeinddddd ",Auth.isLoggedIn(),Auth.isMultiUsersAllowed());
|
60
60
|
if(!isLoggedIn) {
|
61
61
|
return <Login withPortal
|
62
62
|
onSuccess = {(data)=>{
|
@@ -64,7 +64,6 @@ export default function ScreenWrapperNavComponent(_props){
|
|
64
64
|
setScreenOptions(options);
|
65
65
|
const allowDrawer = typeof options.allowDrawer ==='boolean'? options.allowDrawer : typeof options.withDrawer =='boolean'? options.withDrawer : typeof Screen.allowDrawer =='boolean'? Screen.allowDrawer : typeof Screen.withDrawer =='boolean' ? Screen.withDrawer : Screen.isModalScreen == true ? false : true;
|
66
66
|
const withFab = typeof options.withFab ==='boolean' ? options.withFab : typeof Screen.withFab =='boolean'? Screen.withFab : allowDrawer;
|
67
|
-
console.log(props," ddddd is props of screeens ",authRequired,Screen,allowDrawer,options,rest)
|
68
67
|
return <Screen
|
69
68
|
withFab = {withFab}
|
70
69
|
groupName = {groupName}
|