Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Mobile
Commits
8934e142
Commit
8934e142
authored
Apr 16, 2020
by
Irwanto
Browse files
Merge branch 'coldfix-sprint_2' into 'staging'
Coldfix sprint 2 See merge request
!20
parents
99b9d264
556e9ba0
Pipeline
#40623
failed with stages
in 84 minutes and 16 seconds
Changes
26
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
src/App/index.tsx
View file @
8934e142
...
...
@@ -130,23 +130,35 @@ const App = () => {
};
useEffect
(()
=>
{
const
startFromHomePage
=
()
=>
{
navigatorRef
.
current
?.
reset
({
index
:
0
,
routes
:
[{
name
:
'
home
'
}]
})
}
const
startFromLoginPage
=
()
=>
{
navigatorRef
.
current
?.
reset
({
index
:
0
,
routes
:
[{
name
:
'
login
'
}]
})
}
if
(
token
)
{
const
getUser
=
async
()
=>
{
const
response
=
await
mainService
.
me
()
if
(
response
.
status
===
200
)
{
// Token is valid
setUser
(
response
.
data
)
navigatorRef
.
current
?.
reset
({
index
:
0
,
routes
:
[{
name
:
'
home
'
}]
}
)
startFromHomePage
()
}
else
{
// Token is not valid
setToken
(
''
)
}
}
getUser
()
}
else
if
(
token
===
''
)
{
navigatorRef
.
current
?.
reset
({
index
:
0
,
routes
:
[{
name
:
'
login
'
}]
})
startFromLoginPage
()
}
},
[
token
])
...
...
src/components/Log/__snapshots__/index.test.tsx.snap
View file @
8934e142
...
...
@@ -234,3 +234,708 @@ exports[`renders correctly 1`] = `
</RNCSafeAreaView>
</View>
`;
exports[`successfully call edit log callback 1`] = `
<View
style={
Object {
"flex": 1,
}
}
>
<RNCSafeAreaView
onInsetsChange={[Function]}
style={
Object {
"flex": 1,
}
}
>
<View
onLayout={[Function]}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
<View
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
closing={false}
gestureVelocityImpact={0.3}
importantForAccessibility="auto"
onClose={[Function]}
onGestureBegin={[Function]}
onGestureCanceled={[Function]}
onOpen={[Function]}
onTransitionStart={[Function]}
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
transitionSpec={
Object {
"close": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
"open": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
}
}
>
<View
pointerEvents="box-none"
style={
Object {
"flex": 1,
"marginTop": 64,
}
}
>
<View
collapsable={false}
forwardedRef={[Function]}
onGestureHandlerEvent={[Function]}
onGestureHandlerStateChange={[Function]}
style={
Object {
"flex": 1,
"transform": Array [
Object {
"translateX": 0,
},
Object {
"translateX": 0,
},
],
}
}
>
<View
pointerEvents="none"
style={
Object {
"backgroundColor": "#fff",
"bottom": 0,
"left": 0,
"position": "absolute",
"shadowColor": "#000",
"shadowOffset": Object {
"height": 1,
"width": -1,
},
"shadowOpacity": 0.3,
"shadowRadius": 5,
"top": 0,
"width": 3,
}
}
/>
<View
style={
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
Array [
Object {
"backgroundColor": "rgb(242, 242, 242)",
},
undefined,
],
]
}
>
<View
style={
Object {
"flex": 1,
"flexDirection": "column-reverse",
}
}
>
<View
style={
Object {
"flex": 1,
}
}
>
<View
style={
Array [
Object {
"marginTop": 20,
"paddingRight": 30,
"width": "100%",
},
]
}
>
<Modal
animationType="fade"
hardwareAccelerated={false}
transparent={true}
visible={true}
>
<View
style={
Array [
Object {
"alignItems": "center",
"backgroundColor": "#00000080",
"flexBasis": 0,
"flexDirection": "column",
"flexGrow": 1,
"flexShrink": 1,
"justifyContent": "center",
},
]
}
>
<ActivityIndicator
animating={true}
color="#fff"
hidesWhenStopped={true}
size="large"
/>
</View>
</Modal>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
<View
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
importantForAccessibility="auto"
onLayout={[Function]}
pointerEvents="box-none"
style={null}
/>
</View>
</RNCSafeAreaView>
</View>
`;
exports[`successfully change log page 1`] = `
<View
style={
Object {
"flex": 1,
}
}
>
<RNCSafeAreaView
onInsetsChange={[Function]}
style={
Object {
"flex": 1,
}
}
>
<View
onLayout={[Function]}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
<View
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
closing={false}
gestureVelocityImpact={0.3}
importantForAccessibility="auto"
onClose={[Function]}
onGestureBegin={[Function]}
onGestureCanceled={[Function]}
onOpen={[Function]}
onTransitionStart={[Function]}
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
transitionSpec={
Object {
"close": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
"open": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
}
}
>
<View
pointerEvents="box-none"
style={
Object {
"flex": 1,
"marginTop": 64,
}
}
>
<View
collapsable={false}
forwardedRef={[Function]}
onGestureHandlerEvent={[Function]}
onGestureHandlerStateChange={[Function]}
style={
Object {
"flex": 1,
"transform": Array [
Object {
"translateX": 0,
},
Object {
"translateX": 0,
},
],
}
}
>
<View
pointerEvents="none"
style={
Object {
"backgroundColor": "#fff",
"bottom": 0,
"left": 0,
"position": "absolute",
"shadowColor": "#000",
"shadowOffset": Object {
"height": 1,
"width": -1,
},
"shadowOpacity": 0.3,
"shadowRadius": 5,
"top": 0,
"width": 3,
}
}
/>
<View
style={
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
Array [
Object {
"backgroundColor": "rgb(242, 242, 242)",
},
undefined,
],
]
}
>
<View
style={
Object {
"flex": 1,
"flexDirection": "column-reverse",
}
}
>
<View
style={
Object {
"flex": 1,
}
}
>
<View
style={
Array [
Object {
"marginTop": 20,
"paddingRight": 30,
"width": "100%",
},
]
}
>
<Modal
animationType="fade"
hardwareAccelerated={false}
transparent={true}
visible={true}
>
<View
style={
Array [
Object {
"alignItems": "center",
"backgroundColor": "#00000080",
"flexBasis": 0,
"flexDirection": "column",
"flexGrow": 1,
"flexShrink": 1,
"justifyContent": "center",
},
]
}
>
<ActivityIndicator
animating={true}
color="#fff"
hidesWhenStopped={true}
size="large"
/>
</View>
</Modal>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
<View
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
importantForAccessibility="auto"
onLayout={[Function]}
pointerEvents="box-none"
style={null}
/>
</View>
</RNCSafeAreaView>
</View>
`;
exports[`successfully fetch log data 1`] = `
<View
style={
Object {
"flex": 1,
}
}
>
<RNCSafeAreaView
onInsetsChange={[Function]}
style={
Object {
"flex": 1,
}
}
>
<View
onLayout={[Function]}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
<View
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
closing={false}
gestureVelocityImpact={0.3}
importantForAccessibility="auto"
onClose={[Function]}
onGestureBegin={[Function]}
onGestureCanceled={[Function]}
onOpen={[Function]}
onTransitionStart={[Function]}
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
transitionSpec={
Object {
"close": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
"open": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
}
}
>
<View
pointerEvents="box-none"
style={
Object {
"flex": 1,
"marginTop": 64,
}
}
>
<View