Update Title and Picker dropdown
This commit is contained in:
parent
ac1d11c7f5
commit
bd69442a83
|
@ -61,6 +61,9 @@ class ArTagScanner extends React.Component<any, any>{
|
|||
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'ArTag Scanner';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
if (this.token) {
|
||||
|
|
|
@ -11,13 +11,13 @@ import moment from "moment"
|
|||
import { fetchBaseUrl } from '@constants/Constants' //NOSONAR
|
||||
|
||||
class AttendanceDetailView extends React.Component<any, any>{
|
||||
static navigationOptions = ({ navigation,route }: any) => ({
|
||||
headerTitle: () => (<View>
|
||||
<Text style={[BaseStyles.font18, { color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold'}]}>
|
||||
{moment(route.params?.data.date_time).format('DD-MM-YYYY')}</Text>
|
||||
<Text style={{ color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold'}}>Attendance Report</Text>
|
||||
</View>),
|
||||
});
|
||||
// static navigationOptions = ({ navigation,route }: any) => ({
|
||||
// headerTitle: () => (<View>
|
||||
// <Text style={[BaseStyles.font18, { color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold'}]}>
|
||||
// {moment(route.params?.data.date_time).format('DD-MM-YYYY')}</Text>
|
||||
// <Text style={{ color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold'}}>Attendance Report</Text>
|
||||
// </View>),
|
||||
// });
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -29,6 +29,13 @@ class AttendanceDetailView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = (<View>
|
||||
<Text style={[BaseStyles.font18, { color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold'}]}>
|
||||
{moment(route.params?.data.date_time).format('DD-MM-YYYY')}</Text>
|
||||
<Text style={{ color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold'}}>Attendance Report</Text>
|
||||
</View>);
|
||||
navigation.setOptions({ title });
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
this.imageBaseUrl = await fetchBaseUrl()
|
||||
if (this.token) {
|
||||
|
|
|
@ -12,9 +12,6 @@ import BaseColors from "@theme/Colors" //NOSONAR
|
|||
import Toast from 'react-native-simple-toast'
|
||||
|
||||
class AttendanceView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Attendances',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -29,6 +26,9 @@ class AttendanceView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Attendances';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -10,9 +10,6 @@ import { CalendarList } from 'react-native-calendars'
|
|||
import moment from "moment"
|
||||
|
||||
class StudentAttendanceView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Attendance',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -27,6 +24,9 @@ class StudentAttendanceView extends React.Component<any, any>{
|
|||
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Attendance';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react"
|
||||
import { StyleSheet, Text, View, TouchableOpacity, TextInput, ScrollView, ActivityIndicator, Alert, Modal, Image } from 'react-native'
|
||||
import { AppStyles, BaseStyles } from "@theme/BaseStyles" //NOSONAR
|
||||
import { AppStyles, BaseStyles, PickerStyle } from "@theme/BaseStyles" //NOSONAR
|
||||
import { Formik } from 'formik'
|
||||
import * as yup from 'yup'
|
||||
import { Picker } from '@react-native-picker/picker'
|
||||
|
@ -11,10 +11,11 @@ import { ActionCreators } from "@actions" //NOSONAR
|
|||
import PropTypes, { array } from 'prop-types'
|
||||
import MultiSelect from 'react-native-multiple-select'
|
||||
import Images from "@assets/Assets" //NOSONAR
|
||||
import { FontAwesome } from "@expo/vector-icons"
|
||||
import { FontAwesome, Ionicons } from "@expo/vector-icons"
|
||||
import BaseColors from "@theme/Colors" //NOSONAR
|
||||
import * as ImagePicker from 'expo-image-picker'
|
||||
import Constants from "expo-constants"
|
||||
import RNPickerSelect from "react-native-picker-select"
|
||||
|
||||
const diaryValidationSchema = yup.object().shape({
|
||||
diary_type: yup
|
||||
|
@ -36,9 +37,9 @@ const diaryValidationSchema = yup.object().shape({
|
|||
const Sepator = ({ style }: any) => <View style={[BaseStyles.separator, style]} />
|
||||
|
||||
class DiaryCreate extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Diary',
|
||||
};
|
||||
// static navigationOptions = {
|
||||
// title: 'Diary',
|
||||
// };
|
||||
multiSelect: any;
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
|
@ -67,6 +68,9 @@ class DiaryCreate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Create Diary';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
this.imageBaseUrl = await fetchBaseUrl()
|
||||
|
@ -288,6 +292,18 @@ class DiaryCreate extends React.Component<any, any>{
|
|||
}
|
||||
}
|
||||
|
||||
getDataOptions = (data:any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label:item.value,
|
||||
value: item.id
|
||||
}))
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
let itemData: any = []
|
||||
|
@ -335,7 +351,7 @@ class DiaryCreate extends React.Component<any, any>{
|
|||
<View style={styles.item}>
|
||||
<Text style={[AppStyles.cardHeader]}>Category<Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.diary_type}
|
||||
name="diary_type"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -347,7 +363,22 @@ class DiaryCreate extends React.Component<any, any>{
|
|||
<Picker.Item key={index} label={category.value} value={category.id} />
|
||||
))
|
||||
}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.diary_type}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange(itemValue, 'diary_type', setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Category Type--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.categoryList.data)}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
{(errors.diary_type && touched.diary_type) && <Text style={AppStyles.error}>{errors.diary_type}</Text>}
|
||||
</View>
|
||||
|
|
|
@ -31,9 +31,6 @@ const tagsStyles = {
|
|||
|
||||
class DiaryView extends React.PureComponent<any, any>{
|
||||
// contentWidth:any = useWindowDimensions().width;
|
||||
static navigationOptions = {
|
||||
title: 'Diary',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
signedUserId: any;
|
||||
|
@ -54,6 +51,9 @@ class DiaryView extends React.PureComponent<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Diary';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -20,9 +20,6 @@ const InstantFeedbackCreateValidationSchema = yup.object().shape({
|
|||
|
||||
|
||||
class InstantFeedbackCreate extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Create Instant Feedback',
|
||||
};
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
token: any;
|
||||
|
@ -37,6 +34,9 @@ class InstantFeedbackCreate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Create Instant Feedback';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -11,9 +11,6 @@ import Constants from "expo-constants"
|
|||
import { fetchBaseUrl } from '@constants/Constants'
|
||||
|
||||
class InstantFeedbackDetail extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Instance Feedback Report',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -25,6 +22,9 @@ class InstantFeedbackDetail extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Instance Feedback Report';
|
||||
navigation.setOptions({ title });
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
this.imageBaseUrl = await fetchBaseUrl()
|
||||
if (this.token) {
|
||||
|
|
|
@ -11,9 +11,6 @@ import Constants from "expo-constants"
|
|||
import { fetchBaseUrl } from '@constants/Constants'
|
||||
|
||||
class InstantFeedbackDetailView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Instance Feedback Report',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -25,6 +22,9 @@ class InstantFeedbackDetailView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Instance Feedback Report';
|
||||
navigation.setOptions({ title });
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
this.imageBaseUrl = await fetchBaseUrl()
|
||||
if (this.token) {
|
||||
|
|
|
@ -11,9 +11,6 @@ import moment from "moment"
|
|||
import BaseColors from "@theme/Colors" //NOSONAR
|
||||
|
||||
class InstantFeedbackView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Instant Feedbacks',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -28,6 +25,9 @@ class InstantFeedbackView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Instant Feedbacks';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -18,9 +18,6 @@ import { WebView } from 'react-native-webview'
|
|||
const Sepator = ({ style }: any) => <View style={[BaseStyles.separator, style]} />
|
||||
const contentWidth = Dimensions.get('window').width
|
||||
class NoticeBoardView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Noticeboard',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -40,6 +37,9 @@ class NoticeBoardView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Noticeboard';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -21,9 +21,6 @@ class HomePsychometric extends React.Component<any, any>{
|
|||
// static navigationOptions = ({ navigation }: any) => ({
|
||||
// headerTitle: navigation.state.params?.data?.question_name || 'Quizzes',
|
||||
// });
|
||||
static navigationOptions = {
|
||||
title: 'Psychometric',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
scrollView: any;
|
||||
|
@ -37,6 +34,9 @@ class HomePsychometric extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Psychometric';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -20,9 +20,6 @@ class QuestionListPsychometric extends React.Component<any, any>{
|
|||
// static navigationOptions = ({ navigation }: any) => ({
|
||||
// headerTitle: navigation.state.params?.data?.question_name || 'Quizzes',
|
||||
// });
|
||||
static navigationOptions = {
|
||||
title: 'Psychometric',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
scrollView: any;
|
||||
|
@ -36,6 +33,9 @@ class QuestionListPsychometric extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Psychometric';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -21,9 +21,6 @@ const { width, height } = Dimensions.get('window')
|
|||
const VictoryZoomVoronoiContainer: any = createContainer("zoom", "voronoi")
|
||||
|
||||
class ReportPsychometric extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Psychometric',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
scrollView: any;
|
||||
|
@ -37,6 +34,9 @@ class ReportPsychometric extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Psychometric';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -20,9 +20,6 @@ class StudentListPsychometric extends React.Component<any, any>{
|
|||
// static navigationOptions = ({ navigation }: any) => ({
|
||||
// headerTitle: navigation.state.params?.data?.question_name || 'Quizzes',
|
||||
// });
|
||||
static navigationOptions = {
|
||||
title: 'Psychometric',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
scrollView: any;
|
||||
|
@ -36,6 +33,9 @@ class StudentListPsychometric extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Psychometric';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -78,9 +78,9 @@ const initialQuestionValue: any = {
|
|||
const MyInput = ({ field, form, ...props }: any) => <TextInput {...field} {...props} />
|
||||
|
||||
class QuestionSetCreate extends React.Component<any, any>{
|
||||
static navigationOptions = ({ navigation }: any) => ({
|
||||
headerTitle: 'Create Question Set',
|
||||
});
|
||||
// static navigationOptions = ({ navigation }: any) => ({
|
||||
// headerTitle: 'Create Question Set',
|
||||
// });
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
|
@ -94,6 +94,9 @@ class QuestionSetCreate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Create Question Set';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -75,9 +75,9 @@ const initialQuestionValue: any = {
|
|||
const MyInput = ({ field, form, ...props }: any) => <TextInput {...field} {...props} />
|
||||
|
||||
class QuestionSetUpdate extends React.Component<any, any>{
|
||||
static navigationOptions = ({ navigation }: any) => ({
|
||||
headerTitle: 'Update Question Set',
|
||||
});
|
||||
// static navigationOptions = ({ navigation }: any) => ({
|
||||
// headerTitle: 'Update Question Set',
|
||||
// });
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
|
@ -93,6 +93,9 @@ class QuestionSetUpdate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Update Question Set';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react"
|
||||
import { StyleSheet, Text, View, TouchableOpacity, Image, ActivityIndicator } from 'react-native'
|
||||
import { AppStyles, BaseStyles } from "@theme/BaseStyles" //NOSONAR
|
||||
import { AppStyles, BaseStyles, PickerStyle } from "@theme/BaseStyles" //NOSONAR
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage"
|
||||
import { connect } from "react-redux"
|
||||
import { ActionCreators } from "@actions" //NOSONAR
|
||||
|
@ -11,16 +11,18 @@ import { ScrollView } from "react-native-gesture-handler"
|
|||
import { Picker } from '@react-native-picker/picker'
|
||||
import { Collapse, CollapseHeader, CollapseBody } from "accordion-collapse-react-native"
|
||||
import Constants from "expo-constants"
|
||||
import RNPickerSelect from "react-native-picker-select"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
const Sepator = ({ style }: any) => <View style={[BaseStyles.borderSeparator, style]} />
|
||||
|
||||
class QuizSummaryDetails extends React.Component<any, any>{
|
||||
static navigationOptions = ({ navigation,route }: any) => ({
|
||||
headerTitle: () => (<View>
|
||||
<Text style={[BaseStyles.font18, { color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold' }]}>{route.params?.data?.question_set_name}</Text>
|
||||
<Text style={{ color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold' }}>Quiz Result</Text>
|
||||
</View>),
|
||||
});
|
||||
// static navigationOptions = ({ navigation,route }: any) => ({
|
||||
// headerTitle: () => (<View>
|
||||
// <Text style={[BaseStyles.font18, { color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold' }]}>{route.params?.data?.question_set_name}</Text>
|
||||
// <Text style={{ color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold' }}>Quiz Result</Text>
|
||||
// </View>),
|
||||
// });
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -35,6 +37,12 @@ class QuizSummaryDetails extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = (<View>
|
||||
<Text style={[BaseStyles.font18, { color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold' }]}>{route.params?.data?.question_set_name}</Text>
|
||||
<Text style={{ color: BaseColors.white, fontFamily: 'Quicksand_600SemiBold' }}>Quiz Result</Text>
|
||||
</View>);
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
@ -123,6 +131,18 @@ class QuizSummaryDetails extends React.Component<any, any>{
|
|||
this.props.navigation.navigate("StudentProfile", { info: this.props.route.params.info, studentInfo: { card_id: studentInfo.card_id } })
|
||||
}
|
||||
|
||||
getDataOptions = (data:any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label: `${item?.card_id}. ${item?.name} - (${item?.percentage})`,
|
||||
value: item.card_id
|
||||
}))
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
render() {
|
||||
let quizzesInfo: any = {}
|
||||
let summaryDetails: any = {}
|
||||
|
@ -151,7 +171,7 @@ class QuizSummaryDetails extends React.Component<any, any>{
|
|||
}
|
||||
return (<View style={[AppStyles.containerWoPadding, {}]}>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop10, BaseStyles.marHorizontal5, { width: '98%' }]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={studentCardId}
|
||||
style={AppStyles.inputText}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
|
@ -161,7 +181,23 @@ class QuizSummaryDetails extends React.Component<any, any>{
|
|||
{this.props.studentsList.data && this.props.studentsList.data.map((student: any, index: any) => (
|
||||
<Picker.Item key={index} label={`${student?.card_id}. ${student?.name} - (${student?.percentage})`} value={student?.card_id} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
{this.props.studentsList && this.props.studentsList?.data ?
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={studentCardId}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange('card_id', itemValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select School--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.studentsList.data)}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>: null}
|
||||
</View>
|
||||
|
||||
{studentCardId === '' ?
|
||||
|
|
|
@ -12,9 +12,9 @@ import { ScrollView } from "react-native-gesture-handler"
|
|||
const Sepator = ({ style }: any) => <View style={[BaseStyles.borderSeparator, style]} />
|
||||
|
||||
class QuizzesDetailView extends React.Component<any, any>{
|
||||
static navigationOptions = ({ navigation,route }: any) => ({
|
||||
headerTitle: route.params?.data?.question_name || 'Quizzes',
|
||||
});
|
||||
// static navigationOptions = ({ navigation,route }: any) => ({
|
||||
// headerTitle: route.params?.data?.question_name || 'Quizzes',
|
||||
// });
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -27,6 +27,9 @@ class QuizzesDetailView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = route.params?.data?.question_name || 'Quizzes';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -11,9 +11,6 @@ import BaseColors from "@theme/Colors" //NOSONAR
|
|||
|
||||
|
||||
class QuizzesSummaryView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Results',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -28,6 +25,9 @@ class QuizzesSummaryView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Results';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
@ -98,6 +98,7 @@ class QuizzesSummaryView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
toQuizzesDetail = (data: any) => {
|
||||
console.log("view")
|
||||
this.props.navigation.navigate("QuizSummaryDetails", { info: this.props.route.params.info, data: data, studentInfo: { card_id: '' } })
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,6 @@ import BaseColors from "@theme/Colors" //NOSONAR
|
|||
|
||||
|
||||
class QuizzesView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Quizzes',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -29,6 +26,9 @@ class QuizzesView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Quizzes';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -17,9 +17,9 @@ const { width } = Dimensions.get('window')
|
|||
|
||||
|
||||
class TakeQuizzes extends React.Component<any, any>{
|
||||
static navigationOptions = ({ navigation , route}: any) => ({
|
||||
headerTitle: route.params?.data?.question_name || 'Quizzes',
|
||||
});
|
||||
// static navigationOptions = ({ navigation , route}: any) => ({
|
||||
// headerTitle: route.params?.data?.question_name || 'Quizzes',
|
||||
// });
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
scrollView: any;
|
||||
|
@ -33,6 +33,9 @@ class TakeQuizzes extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = route.params?.data?.question_name || 'Quizzes';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -46,9 +46,6 @@ const StudentCreateValidationSchema = yup.object().shape({
|
|||
|
||||
|
||||
class StudentCreate extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Student',
|
||||
};
|
||||
formikActions: any;
|
||||
isLoggedinAs: any;
|
||||
imageBaseUrl: any;
|
||||
|
@ -67,6 +64,9 @@ class StudentCreate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Student';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
if (this.token) {
|
||||
|
|
|
@ -19,9 +19,6 @@ const Sepator = ({ style }: any) => <View style={[BaseStyles.separator, style]}
|
|||
const VictoryZoomVoronoiContainer: any = createContainer("zoom", "voronoi")
|
||||
|
||||
class StudentProfile extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Student Profile',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
imageBaseUrl: any;
|
||||
|
@ -40,6 +37,9 @@ class StudentProfile extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Student Profile';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react"
|
||||
import { StyleSheet, Text, View, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'
|
||||
|
||||
import { AppStyles, BaseStyles } from "@theme/BaseStyles" //NOSONAR
|
||||
import { AppStyles, BaseStyles, PickerStyle } from "@theme/BaseStyles" //NOSONAR
|
||||
import { Picker } from '@react-native-picker/picker'
|
||||
import { VictoryChart, VictoryBar, createContainer } from "victory-native"
|
||||
import { common, UserRoles, currentYear, currentAcademicYear } from '@constants/Constants' //NOSONAR
|
||||
|
@ -11,6 +11,8 @@ import { ActionCreators } from "@actions" //NOSONAR
|
|||
import PropTypes from 'prop-types'
|
||||
import { Formik } from 'formik'
|
||||
import * as yup from 'yup'
|
||||
import RNPickerSelect from "react-native-picker-select"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
const perfomanceReportValidationSchema = yup.object().shape({
|
||||
class_id: yup
|
||||
|
@ -23,9 +25,6 @@ const Sepator = ({ style }: any) => <View style={[BaseStyles.separator, style]}
|
|||
const VictoryZoomVoronoiContainer: any = createContainer("zoom", "voronoi")
|
||||
|
||||
class StudentReport extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Feedback',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
token: any;
|
||||
|
@ -43,6 +42,9 @@ class StudentReport extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Feedback';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
@ -137,6 +139,18 @@ class StudentReport extends React.Component<any, any>{
|
|||
}
|
||||
}
|
||||
|
||||
getDataOptions = (data:any, action: any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label: action === "class" ? item.grade_standard : item.student_name,
|
||||
value: action === "class" ? item.id : item.studentclass_details[0].card_id
|
||||
}))
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
render() {
|
||||
let perfomanceReportByTopic: any = {}
|
||||
let classId: any
|
||||
|
@ -184,6 +198,7 @@ class StudentReport extends React.Component<any, any>{
|
|||
</View>}
|
||||
<ScrollView style={{ marginVertical: 12, marginHorizontal: 15 }}>
|
||||
<View style={{ flex: 1, flexDirection: "column", }}>
|
||||
{this.props.studentsList.data &&
|
||||
<Formik
|
||||
validationSchema={perfomanceReportValidationSchema}
|
||||
enableReinitialize={true}
|
||||
|
@ -198,7 +213,7 @@ class StudentReport extends React.Component<any, any>{
|
|||
{this.isLoggedinAs && ((this.isLoggedinAs === UserRoles.schoolAdmin) || this.isLoggedinAs === UserRoles.teacher) &&
|
||||
<View>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5, { width: '100%' }]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.class_id}
|
||||
enabled={false}
|
||||
name="class_id"
|
||||
|
@ -210,10 +225,25 @@ class StudentReport extends React.Component<any, any>{
|
|||
{this.props.classes.data && this.props.classes.data.map((student: any, index: any) => (
|
||||
<Picker.Item key={index} label={student.grade_standard} value={student.id} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.class_id}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange('class_id', itemValue, setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Class--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.classes.data, 'class')}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop10, { width: '100%' }]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.card_id}
|
||||
name="card_id"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -224,13 +254,28 @@ class StudentReport extends React.Component<any, any>{
|
|||
{this.props.studentsList.data && this.props.studentsList.data.map((student: any, index: any) => (
|
||||
<Picker.Item key={index} label={student?.student_name} value={student?.studentclass_details[0]?.card_id} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.card_id}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange("card_id", itemValue, setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Student--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.studentsList.data, 'student')}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
</>
|
||||
)}
|
||||
</Formik>
|
||||
</Formik>}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -46,9 +46,6 @@ const StudentUpdateValidationSchema = yup.object().shape({
|
|||
|
||||
|
||||
class StudentUpdate extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Student',
|
||||
};
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
|
@ -67,6 +64,9 @@ class StudentUpdate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Student';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
this.imageBaseUrl = await fetchBaseUrl()
|
||||
|
|
|
@ -13,9 +13,6 @@ import BaseColors from "@theme/Colors" //NOSONAR
|
|||
import Constants from "expo-constants"
|
||||
|
||||
class StudentView extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Students',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
imageBaseUrl: any;
|
||||
|
@ -33,6 +30,9 @@ class StudentView extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Students';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
|
|
@ -17,9 +17,6 @@ const MapSubjectValidationSchema = yup.object().shape({
|
|||
})
|
||||
|
||||
class MapClass extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Class Mapping',
|
||||
};
|
||||
multiSelect: any;
|
||||
formikActions: any;
|
||||
isLoggedinAs: any;
|
||||
|
@ -36,6 +33,9 @@ class MapClass extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Class Mapping';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
if (this.token) {
|
||||
|
|
|
@ -19,9 +19,6 @@ const classValidationSchema = yup.object().shape({
|
|||
})
|
||||
|
||||
class MapClassUpdate extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Class Mapping',
|
||||
};
|
||||
multiSelect: any;
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
|
@ -39,6 +36,9 @@ class MapClassUpdate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Class Mapping';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
if (this.token) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react"
|
||||
import { StyleSheet, Text, View, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'
|
||||
import { AppStyles, BaseStyles } from "@theme/BaseStyles" //NOSONAR
|
||||
import { AppStyles, BaseStyles, PickerStyle } from "@theme/BaseStyles" //NOSONAR
|
||||
import { Formik } from 'formik'
|
||||
import * as yup from 'yup'
|
||||
import { Picker } from '@react-native-picker/picker'
|
||||
|
@ -10,6 +10,8 @@ import { ActionCreators } from "@actions" //NOSONAR
|
|||
import PropTypes from 'prop-types'
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage"
|
||||
import { currentYear, UserRoles, currentAcademicYear } from "@constants/Constants" //NOSONAR
|
||||
import RNPickerSelect from "react-native-picker-select"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
const MapSubjectValidationSchema = yup.object().shape({
|
||||
class_ids: yup
|
||||
|
@ -22,9 +24,6 @@ const MapSubjectValidationSchema = yup.object().shape({
|
|||
|
||||
|
||||
class MapSubject extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Subject Mapping',
|
||||
};
|
||||
multiSelect: any;
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
|
@ -42,6 +41,9 @@ class MapSubject extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Subject Mapping';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
if (this.token) {
|
||||
|
@ -141,6 +143,18 @@ class MapSubject extends React.Component<any, any>{
|
|||
}
|
||||
}
|
||||
|
||||
getDataOptions = (data:any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label:item.name,
|
||||
value: item.id
|
||||
}))
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
let itemData: any = []
|
||||
|
@ -208,7 +222,7 @@ class MapSubject extends React.Component<any, any>{
|
|||
<View style={styles.item}>
|
||||
<Text style={[AppStyles.cardHeader]}>Subject<Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.subject_id}
|
||||
name="subject_id"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -219,7 +233,22 @@ class MapSubject extends React.Component<any, any>{
|
|||
{this.props.subjects.data && this.props.subjects.data.map((subject: any, index: any) => (
|
||||
<Picker.Item key={index} label={subject.name} value={subject.id} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.subject_id}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange(itemValue, 'subject_id', setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Subject--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.subjects.data)}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
{(errors.subject_id && touched.subject_id) && <Text style={AppStyles.error}>{errors.subject_id}</Text>}
|
||||
</View>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react"
|
||||
import { StyleSheet, Text, View, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'
|
||||
import { AppStyles, BaseStyles } from "@theme/BaseStyles" //NOSONAR
|
||||
import { AppStyles, BaseStyles, PickerStyle } from "@theme/BaseStyles" //NOSONAR
|
||||
import { Formik } from 'formik'
|
||||
import * as yup from 'yup'
|
||||
import { Picker } from '@react-native-picker/picker'
|
||||
|
@ -10,6 +10,8 @@ import { ActionCreators } from "@actions" //NOSONAR
|
|||
import PropTypes from 'prop-types'
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage"
|
||||
import { currentYear, UserRoles, currentAcademicYear } from "@constants/Constants" //NOSONAR
|
||||
import RNPickerSelect from "react-native-picker-select"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
const MapSubjectValidationSchema = yup.object().shape({
|
||||
class_id: yup
|
||||
|
@ -21,9 +23,6 @@ const MapSubjectValidationSchema = yup.object().shape({
|
|||
})
|
||||
|
||||
class MapSubjectUpdate extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Subject Mapping',
|
||||
};
|
||||
multiSelect: any;
|
||||
formikActions: any;
|
||||
static propTypes = {};
|
||||
|
@ -43,6 +42,9 @@ class MapSubjectUpdate extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Subject Mapping';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
if (this.token) {
|
||||
|
@ -153,6 +155,18 @@ class MapSubjectUpdate extends React.Component<any, any>{
|
|||
}
|
||||
}
|
||||
|
||||
getDataOptions = (data:any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label:item.name,
|
||||
value: item.id
|
||||
}))
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
|
||||
|
@ -224,7 +238,7 @@ class MapSubjectUpdate extends React.Component<any, any>{
|
|||
<View style={styles.item}>
|
||||
<Text style={[AppStyles.cardHeader]}>Subject <Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.subject_id}
|
||||
name="subject_id"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -237,7 +251,22 @@ class MapSubjectUpdate extends React.Component<any, any>{
|
|||
<Picker.Item key={index} label={subject.name} value={subject.id} />
|
||||
))
|
||||
}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.subject_id}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange(itemValue, 'subject_id', setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Subject--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.subjects.data)}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
{(errors.subject_id && touched.subject_id) && <Text style={AppStyles.error}>{errors.subject_id}</Text>}
|
||||
</View>
|
||||
|
|
|
@ -14,9 +14,6 @@ import { StackActions, NavigationActions } from 'react-navigation'
|
|||
import { CommonActions } from "@react-navigation/native"
|
||||
|
||||
class TeacherAttendance extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Teacher Attendance',
|
||||
};
|
||||
static propTypes = {};
|
||||
map: any;
|
||||
token: any;
|
||||
|
@ -43,6 +40,9 @@ class TeacherAttendance extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Teacher Attendance';
|
||||
navigation.setOptions({ title });
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
|
||||
this.props.initTeacherAttendance()
|
||||
|
|
|
@ -14,9 +14,6 @@ import { FontAwesome } from "@expo/vector-icons"
|
|||
const Sepator = ({ style }: any) => <View style={[BaseStyles.separator, style]} />
|
||||
|
||||
class TeacherInfo extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Profile',
|
||||
};
|
||||
static propTypes = {};
|
||||
isLoggedinAs: any;
|
||||
state: any = {
|
||||
|
@ -34,6 +31,9 @@ class TeacherInfo extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Profile';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
if (this.token) {
|
||||
|
|
|
@ -13,9 +13,6 @@ import Constants from "expo-constants"
|
|||
|
||||
|
||||
class TeacherProfile extends React.Component<any, any>{
|
||||
static navigationOptions = {
|
||||
title: 'Teacher Details',
|
||||
};
|
||||
isLoggedinAs: any;
|
||||
imageBaseUrl: any;
|
||||
static propTypes = {};
|
||||
|
@ -33,6 +30,9 @@ class TeacherProfile extends React.Component<any, any>{
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { navigation, route } = this.props;
|
||||
const title = 'Teacher Details';
|
||||
navigation.setOptions({ title });
|
||||
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
|
||||
this.token = await AsyncStorage.getItem('token')
|
||||
this.imageBaseUrl = await fetchBaseUrl()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react"
|
||||
import { StyleSheet, Text, View, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'
|
||||
import { AppStyles, BaseStyles } from "@theme/BaseStyles" //NOSONAR
|
||||
import { AppStyles, BaseStyles, PickerStyle } from "@theme/BaseStyles" //NOSONAR
|
||||
import { Formik } from 'formik'
|
||||
import * as yup from 'yup'
|
||||
import { Picker } from '@react-native-picker/picker'
|
||||
|
@ -8,6 +8,8 @@ import { connect } from "react-redux"
|
|||
import { ActionCreators } from "@actions" //NOSONAR
|
||||
import PropTypes from 'prop-types'
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage"
|
||||
import RNPickerSelect from "react-native-picker-select"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
const classValidationSchema = yup.object().shape({
|
||||
grade: yup
|
||||
|
@ -78,6 +80,19 @@ class ClassCreate extends React.Component<any, any>{
|
|||
this.props.createClass({ data, token: this.token })
|
||||
}
|
||||
|
||||
getDataOptions = (data:any, action: any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label:item.value,
|
||||
value: action === "grade" ? item.id : item.value
|
||||
}))
|
||||
// console.log(options)
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
return (<View style={[AppStyles.containerWoPadding, {}]}>
|
||||
|
@ -101,7 +116,7 @@ class ClassCreate extends React.Component<any, any>{
|
|||
<View style={styles.item}>
|
||||
<Text style={[AppStyles.cardHeader]}>Grade<Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.grade}
|
||||
name="grade"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -113,14 +128,29 @@ class ClassCreate extends React.Component<any, any>{
|
|||
<Picker.Item key={index} label={standard.value} value={standard.id} />
|
||||
))
|
||||
}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.grade}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange(itemValue, 'grade', setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Grade--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.grade.data, 'grade')}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
{(errors.grade && touched.grade) && <Text style={AppStyles.error}>{errors.grade}</Text>}
|
||||
</View>
|
||||
<View style={styles.item}>
|
||||
<Text style={[AppStyles.cardHeader]}>Section<Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.standard}
|
||||
name="standard"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -131,7 +161,21 @@ class ClassCreate extends React.Component<any, any>{
|
|||
{this.props.standard.data && this.props.standard.data.map((section: any, index: any) => (
|
||||
<Picker.Item key={index} label={section.value} value={section.value} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.standard}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange(itemValue, 'standard', setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Standard--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.standard.data, 'standard')}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
{(errors.standard && touched.standard) && <Text style={AppStyles.error}>{errors.standard}</Text>}
|
||||
</View>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react"
|
||||
import { StyleSheet, Text, View, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native'
|
||||
|
||||
import { AppStyles, BaseStyles } from "@theme/BaseStyles" //NOSONAR
|
||||
import { AppStyles, BaseStyles, PickerStyle } from "@theme/BaseStyles" //NOSONAR
|
||||
import { Formik } from 'formik'
|
||||
import * as yup from 'yup'
|
||||
import { Picker } from '@react-native-picker/picker'
|
||||
|
@ -9,6 +9,8 @@ import { connect } from "react-redux"
|
|||
import { ActionCreators } from "@actions" //NOSONAR
|
||||
import PropTypes from 'prop-types'
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage"
|
||||
import RNPickerSelect from "react-native-picker-select"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
|
||||
const classValidationSchema = yup.object().shape({
|
||||
|
@ -81,6 +83,19 @@ class ClasslUpdate extends React.Component<any, any>{
|
|||
this.props.updateClass({ class_id: this.props.route.params.class_id, data, token: this.token})
|
||||
}
|
||||
|
||||
getDataOptions = (data:any, action: any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label:item.value,
|
||||
value: action === "grade" ? item.id : item.value
|
||||
}))
|
||||
// console.log(options)
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
let grade: any
|
||||
|
@ -115,7 +130,7 @@ class ClasslUpdate extends React.Component<any, any>{
|
|||
<View style={styles.item}>
|
||||
<Text style={[AppStyles.cardHeader]}>Grade<Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.grade}
|
||||
name="grade"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -127,14 +142,29 @@ class ClasslUpdate extends React.Component<any, any>{
|
|||
<Picker.Item key={index} label={standard.value} value={standard.id} />
|
||||
))
|
||||
}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.grade}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange(itemValue, 'grade', setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Grade--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.grade.data, 'grade')}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
{(errors.grade && touched.grade) && <Text style={AppStyles.error}>{errors.grade}</Text>}
|
||||
</View>
|
||||
<View style={styles.item}>
|
||||
<Text style={[AppStyles.cardHeader]}>Section <Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.standard}
|
||||
name="standard"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -146,7 +176,22 @@ class ClasslUpdate extends React.Component<any, any>{
|
|||
{this.props.standard.data && this.props.standard.data.map((section: any, index: any) => (
|
||||
<Picker.Item key={index} label={section.value} value={section.value} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.standard}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
this.onSelectChange(itemValue, 'standard', setFieldValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Standard--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDataOptions(this.props.standard.data, 'standard')}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
{(errors.standard && touched.standard) && <Text style={AppStyles.error}>{errors.standard}</Text>}
|
||||
</View>
|
||||
|
|
|
@ -304,6 +304,18 @@ class SchoolUpdate extends React.Component<any, any>{
|
|||
return categoryOptions && categoryOptions.length > 0 ? categoryOptions : []
|
||||
}
|
||||
|
||||
getDateOptions = (data:any) => {
|
||||
const options = data && data.map((item: any, index: any) => ({
|
||||
key:index,
|
||||
label:item.month,
|
||||
value: item.code
|
||||
}))
|
||||
if(options && options.length >= 0){
|
||||
return options
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
handleConfirm = (selectedDate:any,setFieldValue: any, startTimeValue: any) => {
|
||||
this.setState({ startTimeShown: false })
|
||||
let startTime: any = startTimeValue
|
||||
|
@ -328,6 +340,8 @@ class SchoolUpdate extends React.Component<any, any>{
|
|||
schoolInfo = this.props.info.data
|
||||
}
|
||||
}
|
||||
console.log("SCL")
|
||||
console.log(schoolInfo)
|
||||
return (<View style={[AppStyles.containerWoPadding, {}]}>
|
||||
|
||||
<Text style={BaseStyles.topHeader}>Update School Details</Text>
|
||||
|
@ -340,7 +354,7 @@ class SchoolUpdate extends React.Component<any, any>{
|
|||
shadowOpacity: 0.01, shadowRadius: 16, elevation: 3, zIndex: 10
|
||||
}}>
|
||||
|
||||
|
||||
{schoolInfo && Object.keys(schoolInfo).length > 0 &&
|
||||
<Formik
|
||||
enableReinitialize={true}
|
||||
validationSchema={schoolValidationSchema}
|
||||
|
@ -471,7 +485,7 @@ class SchoolUpdate extends React.Component<any, any>{
|
|||
<View style={{ flexDirection: 'column', width: '50%' }}>
|
||||
<Text style={[AppStyles.cardHeader, BaseStyles.marTop5]}>Start Month<Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5, { width: '90%' }]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.acadamic_start_month}
|
||||
name="acadamic_start_month"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -482,13 +496,28 @@ class SchoolUpdate extends React.Component<any, any>{
|
|||
{MONTHLIST.map((month: any, index: any) => (
|
||||
<Picker.Item key={index} label={month.month} value={month.code} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.acadamic_start_month}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
setFieldValue("acadamic_start_month", itemValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select Start Month--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDateOptions(MONTHLIST)}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'column', width: '50%' }}>
|
||||
<Text style={[AppStyles.cardHeader, BaseStyles.marTop5]}>End Month<Text style={AppStyles.required}> *</Text></Text>
|
||||
<View style={[AppStyles.inputView, BaseStyles.marTop5,]}>
|
||||
<Picker
|
||||
{/* <Picker
|
||||
selectedValue={values.acadamic_end_month}
|
||||
name="acadamic_end_month"
|
||||
style={AppStyles.inputText}
|
||||
|
@ -499,7 +528,22 @@ class SchoolUpdate extends React.Component<any, any>{
|
|||
{MONTHLIST.map((month: any, index: any) => (
|
||||
<Picker.Item key={index} label={month.month} value={month.code} />
|
||||
))}
|
||||
</Picker>
|
||||
</Picker> */}
|
||||
|
||||
<RNPickerSelect
|
||||
style={PickerStyle}
|
||||
value={values.acadamic_end_month}
|
||||
onValueChange={(itemValue, itemIndex) =>
|
||||
setFieldValue("acadamic_end_month", itemValue)
|
||||
}
|
||||
placeholder={{
|
||||
label: '--Select End Month--',
|
||||
value: null,
|
||||
}}
|
||||
useNativeAndroidPickerStyle={false}
|
||||
items={this.getDateOptions(MONTHLIST)}
|
||||
Icon={() => <Ionicons name="caret-down" size={14} color="gray" />}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -561,7 +605,7 @@ class SchoolUpdate extends React.Component<any, any>{
|
|||
|
||||
</>
|
||||
)}
|
||||
</Formik>
|
||||
</Formik>}
|
||||
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
|
Loading…
Reference in New Issue