@brightlayer-ui/react-native-template-authentication-typescript 3.0.0-alpha.0 → 3.0.0-alpha.2
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/CHANGELOG.md +76 -0
- package/package.json +2 -2
- package/template/.buckconfig +6 -0
- package/template/.node-version +1 -0
- package/template/.prettierignore +2 -0
- package/template/.ruby-version +1 -0
- package/template/.watchmanconfig +1 -1
- package/template/Gemfile +2 -4
- package/template/Gemfile.lock +10 -14
- package/template/__mocks__/svgMock.js +8 -0
- package/template/_gitignore +64 -0
- package/template/android/app/build.gradle +4 -3
- package/template/android/app/src/main/java/com/{workflow → example}/MainActivity.kt +3 -9
- package/template/android/app/src/main/java/com/{workflow → example}/MainApplication.kt +4 -2
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +1 -2
- package/template/android/app/src/main/res/values/strings.xml +1 -1
- package/template/android/build.gradle +3 -3
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/android/gradlew +7 -7
- package/template/android/gradlew.bat +10 -10
- package/template/android/link-assets-manifest.json +23 -23
- package/template/android/settings.gradle +1 -1
- package/template/app.json +2 -2
- package/template/assets/images/Logo.svg +11 -0
- package/template/babel.config.js +1 -0
- package/template/index.js +0 -2
- package/template/ios/Podfile +24 -5
- package/template/ios/Podfile.lock +517 -570
- package/template/ios/{blankTemplate → example}/AppDelegate.mm +3 -3
- package/template/ios/{blankTemplate → example}/Info.plist +25 -24
- package/template/ios/{blankTemplate → example}/LaunchScreen.storyboard +1 -1
- package/template/ios/{blankTemplate.xcodeproj → example.xcodeproj}/project.pbxproj +123 -136
- package/template/ios/{blankTemplate.xcodeproj/xcshareddata/xcschemes/blankTemplate.xcscheme → example.xcodeproj/xcshareddata/xcschemes/example.xcscheme} +12 -12
- package/template/ios/{blankTemplate.xcworkspace → example.xcworkspace}/contents.xcworkspacedata +1 -1
- package/template/ios/{blankTemplateTests/blankTemplateTests.m → exampleTests/exampleTests.m} +2 -2
- package/template/ios/link-assets-manifest.json +23 -23
- package/template/jest.config.js +9 -0
- package/template/jestSetupFile.js +38 -0
- package/template/metro.config.js +13 -8
- package/template/package.json +43 -35
- package/template/react-native.config.js +3 -0
- package/template/src/components/DebugComponent.tsx +0 -1
- package/template/src/components/{UserMenuExample.tsx → UserMenuComponent.tsx} +1 -1
- package/template/src/navigation/navigation-drawer.tsx +23 -18
- package/template/src/screens/Dashboard.tsx +2 -2
- package/template/src/screens/Homepage.tsx +2 -2
- package/template/src/screens/Locations.tsx +2 -2
- package/template/translations/dictionary/french.ts +3 -3
- package/template/translations/dictionary/portuguese.ts +1 -1
- package/template/translations/dictionary/spanish.ts +1 -1
- package/template/tsconfig.json +3 -3
- package/template/yarn.lock +2672 -1377
- package/template.config.js +1 -1
- package/template/assets/images/Logo.png +0 -0
- package/template/eslint.config.mjs +0 -10
- package/template/ios/blankTemplate/PrivacyInfo.xcprivacy +0 -37
- package/template/src/components/AuthCustomScreen.tsx +0 -50
- package/template/src/components/CustomScreen.tsx +0 -77
- package/template/src/components/ForgotPasswordScreenBaseExample.tsx +0 -42
- package/template/src/components/ResetPasswordScreenBaseExample.tsx +0 -41
- /package/template/ios/{blankTemplate → example}/AppDelegate.h +0 -0
- /package/template/ios/{blankTemplate → example}/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
- /package/template/ios/{blankTemplate → example}/Images.xcassets/Contents.json +0 -0
- /package/template/ios/{blankTemplate → example}/main.m +0 -0
- /package/template/ios/{blankTemplate.xcworkspace → example.xcworkspace}/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- /package/template/ios/{blankTemplateTests → exampleTests}/Info.plist +0 -0
package/template.config.js
CHANGED
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
import tseslint from "typescript-eslint";
|
|
3
|
-
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default [
|
|
7
|
-
{languageOptions: { globals: globals.browser }},
|
|
8
|
-
...tseslint.configs.recommended,
|
|
9
|
-
pluginReactConfig,
|
|
10
|
-
];
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>NSPrivacyAccessedAPITypes</key>
|
|
6
|
-
<array>
|
|
7
|
-
<dict>
|
|
8
|
-
<key>NSPrivacyAccessedAPIType</key>
|
|
9
|
-
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
|
10
|
-
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
11
|
-
<array>
|
|
12
|
-
<string>C617.1</string>
|
|
13
|
-
</array>
|
|
14
|
-
</dict>
|
|
15
|
-
<dict>
|
|
16
|
-
<key>NSPrivacyAccessedAPIType</key>
|
|
17
|
-
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
18
|
-
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
19
|
-
<array>
|
|
20
|
-
<string>CA92.1</string>
|
|
21
|
-
</array>
|
|
22
|
-
</dict>
|
|
23
|
-
<dict>
|
|
24
|
-
<key>NSPrivacyAccessedAPIType</key>
|
|
25
|
-
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
|
26
|
-
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
27
|
-
<array>
|
|
28
|
-
<string>35F9.1</string>
|
|
29
|
-
</array>
|
|
30
|
-
</dict>
|
|
31
|
-
</array>
|
|
32
|
-
<key>NSPrivacyCollectedDataTypes</key>
|
|
33
|
-
<array/>
|
|
34
|
-
<key>NSPrivacyTracking</key>
|
|
35
|
-
<false/>
|
|
36
|
-
</dict>
|
|
37
|
-
</plist>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
WorkflowCard,
|
|
4
|
-
WorkflowCardActions,
|
|
5
|
-
WorkflowCardBody,
|
|
6
|
-
WorkflowCardHeader,
|
|
7
|
-
useAuthContext,
|
|
8
|
-
} from '@brightlayer-ui/react-native-auth-workflow';
|
|
9
|
-
import { Text } from 'react-native-paper';
|
|
10
|
-
import { View } from 'react-native';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
|
|
13
|
-
export const AuthCustomScreen: React.FC = () => {
|
|
14
|
-
const { actions } = useAuthContext();
|
|
15
|
-
|
|
16
|
-
const handleOnNext = useCallback(async () => {
|
|
17
|
-
try {
|
|
18
|
-
await actions.forgotPassword('email@email.email');
|
|
19
|
-
} catch (_error) {
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
console.log('Error ::', _error);
|
|
22
|
-
}
|
|
23
|
-
}, [actions]);
|
|
24
|
-
|
|
25
|
-
const { t } = useTranslation();
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<WorkflowCard>
|
|
29
|
-
<WorkflowCardHeader title="Auth Screen" />
|
|
30
|
-
<WorkflowCardBody>
|
|
31
|
-
<View
|
|
32
|
-
style={{
|
|
33
|
-
justifyContent: 'center',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
paddingTop: 50,
|
|
36
|
-
paddingBottom: 50,
|
|
37
|
-
}}
|
|
38
|
-
>
|
|
39
|
-
<Text variant="headlineSmall">Auth Translations</Text>
|
|
40
|
-
<Text variant="bodyMedium">{`Auth Translations: ${t('bluiAuth:FORGOT_PASSWORD.ERROR')}`}</Text>
|
|
41
|
-
<Text variant="bodyMedium">{`Common Translations: ${t(
|
|
42
|
-
'bluiCommon:ACTIONS.CHANGE_LANGUAGE'
|
|
43
|
-
)}`}</Text>
|
|
44
|
-
<Text variant="bodyMedium">{`App Translations: ${t('app:PAGE_DETAILS.AUTHORISED_MESSAGE')}`}</Text>
|
|
45
|
-
</View>
|
|
46
|
-
</WorkflowCardBody>
|
|
47
|
-
<WorkflowCardActions showNext nextLabel={'Press'} onNext={(): void => void handleOnNext()} />
|
|
48
|
-
</WorkflowCard>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
-
// import { useRegistrationWorkflowContext } from '../../contexts';
|
|
3
|
-
import {
|
|
4
|
-
WorkflowCard,
|
|
5
|
-
WorkflowCardActions,
|
|
6
|
-
WorkflowCardBody,
|
|
7
|
-
WorkflowCardHeader,
|
|
8
|
-
useRegistrationWorkflowContext,
|
|
9
|
-
useRegistrationContext,
|
|
10
|
-
} from '@brightlayer-ui/react-native-auth-workflow';
|
|
11
|
-
import { TextInput } from 'react-native-paper';
|
|
12
|
-
import { useTranslation } from 'react-i18next';
|
|
13
|
-
|
|
14
|
-
type CustomScreenProps = {
|
|
15
|
-
/**
|
|
16
|
-
* Used to pre-populate the data when the screen loads
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
organisationName?: any;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const CustomScreen: React.FC<CustomScreenProps> = (props) => {
|
|
23
|
-
const regWorkflow = useRegistrationWorkflowContext();
|
|
24
|
-
const { navigate } = useRegistrationContext();
|
|
25
|
-
const { nextScreen, screenData, currentScreen, totalScreens, resetScreenData, previousScreen } = regWorkflow;
|
|
26
|
-
const { organisationName } = props;
|
|
27
|
-
const { t } = useTranslation();
|
|
28
|
-
|
|
29
|
-
const [organisationNameInput, setOrganisationNameInput] = useState(
|
|
30
|
-
organisationName ? organisationName : screenData.Other?.organisationName
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const onNext = useCallback(() => {
|
|
34
|
-
void nextScreen({
|
|
35
|
-
screenId: 'Custom',
|
|
36
|
-
values: { organisationName: organisationNameInput },
|
|
37
|
-
// isAccountExist: true,
|
|
38
|
-
});
|
|
39
|
-
}, [organisationNameInput, nextScreen]);
|
|
40
|
-
|
|
41
|
-
const onIconPress = useCallback(() => {
|
|
42
|
-
navigate(-1);
|
|
43
|
-
resetScreenData();
|
|
44
|
-
}, [navigate, resetScreenData]);
|
|
45
|
-
|
|
46
|
-
const onPrevious = useCallback(() => {
|
|
47
|
-
void previousScreen({
|
|
48
|
-
screenId: 'Custom',
|
|
49
|
-
values: { organisationName: organisationNameInput },
|
|
50
|
-
// isAccountExist: true,
|
|
51
|
-
});
|
|
52
|
-
}, [organisationNameInput, previousScreen]);
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<WorkflowCard>
|
|
56
|
-
<WorkflowCardHeader title="Custom Screen" onIconPress={onIconPress} icon={{ name: 'arrow-back' }} />
|
|
57
|
-
<WorkflowCardBody>
|
|
58
|
-
<TextInput
|
|
59
|
-
label={t('app:ORGANAIZATION_DETAILS.NAME')}
|
|
60
|
-
mode="flat"
|
|
61
|
-
value={organisationNameInput}
|
|
62
|
-
onChangeText={(value) => setOrganisationNameInput(value)}
|
|
63
|
-
/>
|
|
64
|
-
</WorkflowCardBody>
|
|
65
|
-
<WorkflowCardActions
|
|
66
|
-
showPrevious
|
|
67
|
-
showNext
|
|
68
|
-
previousLabel={t('bluiCommon:ACTIONS.BACK')}
|
|
69
|
-
nextLabel={t('bluiCommon:ACTIONS.OKAY')}
|
|
70
|
-
currentStep={currentScreen}
|
|
71
|
-
totalSteps={totalScreens}
|
|
72
|
-
onNext={onNext}
|
|
73
|
-
onPrevious={onPrevious}
|
|
74
|
-
/>
|
|
75
|
-
</WorkflowCard>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ForgotPasswordScreen,
|
|
4
|
-
AuthContextProvider,
|
|
5
|
-
ErrorContextProvider,
|
|
6
|
-
} from '@brightlayer-ui/react-native-auth-workflow';
|
|
7
|
-
import { useNavigation } from '@react-navigation/native';
|
|
8
|
-
import { useApp } from '../contexts/AppContextProvider';
|
|
9
|
-
import { ProjectAuthUIActions } from '../actions/AuthUIActions';
|
|
10
|
-
import i18nAppInstance from '../../translations/i18n';
|
|
11
|
-
|
|
12
|
-
export const ForgotPasswordScreenBaseExample: React.FC = () => {
|
|
13
|
-
const app = useApp();
|
|
14
|
-
const navigation = useNavigation();
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<AuthContextProvider
|
|
18
|
-
language={app.language}
|
|
19
|
-
actions={ProjectAuthUIActions(app)}
|
|
20
|
-
i18n={i18nAppInstance}
|
|
21
|
-
navigate={(destination: -1 | string) => {
|
|
22
|
-
if (typeof destination === 'string') {
|
|
23
|
-
navigation.navigate(destination);
|
|
24
|
-
} else {
|
|
25
|
-
navigation.goBack();
|
|
26
|
-
}
|
|
27
|
-
}}
|
|
28
|
-
routeConfig={{
|
|
29
|
-
LOGIN: 'Home',
|
|
30
|
-
FORGOT_PASSWORD: undefined,
|
|
31
|
-
RESET_PASSWORD: undefined,
|
|
32
|
-
REGISTER_INVITE: undefined,
|
|
33
|
-
REGISTER_SELF: undefined,
|
|
34
|
-
SUPPORT: undefined,
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<ErrorContextProvider>
|
|
38
|
-
<ForgotPasswordScreen />
|
|
39
|
-
</ErrorContextProvider>
|
|
40
|
-
</AuthContextProvider>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AuthContextProvider, ResetPasswordScreen } from '@brightlayer-ui/react-native-auth-workflow';
|
|
3
|
-
import { useApp } from '../contexts/AppContextProvider';
|
|
4
|
-
import { useNavigation } from '@react-navigation/native';
|
|
5
|
-
import { ProjectAuthUIActions } from '../actions/AuthUIActions';
|
|
6
|
-
import i18nAppInstance from '../../translations/i18n';
|
|
7
|
-
|
|
8
|
-
export const ResetPasswordScreenBaseExample: React.FC = () => {
|
|
9
|
-
const app = useApp();
|
|
10
|
-
const navigation = useNavigation();
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<AuthContextProvider
|
|
14
|
-
language={app.language}
|
|
15
|
-
actions={ProjectAuthUIActions(app)}
|
|
16
|
-
i18n={i18nAppInstance}
|
|
17
|
-
navigate={(destination: -1 | string) => {
|
|
18
|
-
if (typeof destination === 'string') {
|
|
19
|
-
navigation.navigate(destination);
|
|
20
|
-
} else {
|
|
21
|
-
navigation.goBack();
|
|
22
|
-
}
|
|
23
|
-
}}
|
|
24
|
-
routeConfig={{
|
|
25
|
-
LOGIN: 'Home',
|
|
26
|
-
FORGOT_PASSWORD: undefined,
|
|
27
|
-
RESET_PASSWORD: undefined,
|
|
28
|
-
REGISTER_INVITE: undefined,
|
|
29
|
-
REGISTER_SELF: undefined,
|
|
30
|
-
SUPPORT: undefined,
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
<ResetPasswordScreen
|
|
34
|
-
accountParams={{
|
|
35
|
-
code: '123',
|
|
36
|
-
email: 'test@eaton.com',
|
|
37
|
-
}}
|
|
38
|
-
/>
|
|
39
|
-
</AuthContextProvider>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
File without changes
|
/package/template/ios/{blankTemplate → example}/Images.xcassets/AppIcon.appiconset/Contents.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|