rev: filter tahun
Deskripsi: - tampilan modal filter - tampilan filter disemua fitur yg ada filter nya - pengaplikasian api No Issues
This commit is contained in:
@@ -121,8 +121,9 @@ export default function Discussion() {
|
|||||||
<InputSearch onChange={setSearch} />
|
<InputSearch onChange={setSearch} />
|
||||||
{
|
{
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
<View style={[Styles.mv05]}>
|
<View style={[Styles.mv05, Styles.rowOnly]}>
|
||||||
<Text>Filter : {nameGroup}</Text>
|
<Text>Filter :</Text>
|
||||||
|
<LabelStatus size="small" category="secondary" text={nameGroup} style={[Styles.mh05]} />
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import BorderBottomItem from "@/components/borderBottomItem";
|
import BorderBottomItem from "@/components/borderBottomItem";
|
||||||
import ButtonTab from "@/components/buttonTab";
|
import ButtonTab from "@/components/buttonTab";
|
||||||
import InputSearch from "@/components/inputSearch";
|
import InputSearch from "@/components/inputSearch";
|
||||||
|
import LabelStatus from "@/components/labelStatus";
|
||||||
import PaperGridContent from "@/components/paperGridContent";
|
import PaperGridContent from "@/components/paperGridContent";
|
||||||
import Skeleton from "@/components/skeleton";
|
import Skeleton from "@/components/skeleton";
|
||||||
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
||||||
@@ -195,8 +196,9 @@ export default function ListDivision() {
|
|||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
{(entityUser.role == "supadmin" || entityUser.role == "developer") && (
|
{(entityUser.role == "supadmin" || entityUser.role == "developer") && (
|
||||||
<View style={[Styles.mv05]}>
|
<View style={[Styles.mv05, Styles.rowOnly]}>
|
||||||
<Text>Filter : {nameGroup}</Text>
|
<Text>Filter :</Text>
|
||||||
|
<LabelStatus size="small" category="secondary" text={nameGroup} style={[Styles.mh05]} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import BorderBottomItem from "@/components/borderBottomItem";
|
|||||||
import ButtonTab from "@/components/buttonTab";
|
import ButtonTab from "@/components/buttonTab";
|
||||||
import ImageUser from "@/components/imageNew";
|
import ImageUser from "@/components/imageNew";
|
||||||
import InputSearch from "@/components/inputSearch";
|
import InputSearch from "@/components/inputSearch";
|
||||||
|
import LabelStatus from "@/components/labelStatus";
|
||||||
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
||||||
import Text from "@/components/Text";
|
import Text from "@/components/Text";
|
||||||
import { ConstEnv } from "@/constants/ConstEnv";
|
import { ConstEnv } from "@/constants/ConstEnv";
|
||||||
@@ -124,8 +125,9 @@ export default function Index() {
|
|||||||
<InputSearch onChange={setSearch} />
|
<InputSearch onChange={setSearch} />
|
||||||
{
|
{
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
<View style={[Styles.mv05]}>
|
<View style={[Styles.mv05, Styles.rowOnly]}>
|
||||||
<Text>Filter : {nameGroup}</Text>
|
<Text>Filter :</Text>
|
||||||
|
<LabelStatus size="small" category="secondary" text={nameGroup} style={[Styles.mh05]} />
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ButtonTab from "@/components/buttonTab";
|
|||||||
import DrawerBottom from "@/components/drawerBottom";
|
import DrawerBottom from "@/components/drawerBottom";
|
||||||
import { InputForm } from "@/components/inputForm";
|
import { InputForm } from "@/components/inputForm";
|
||||||
import InputSearch from "@/components/inputSearch";
|
import InputSearch from "@/components/inputSearch";
|
||||||
|
import LabelStatus from "@/components/labelStatus";
|
||||||
import MenuItemRow from "@/components/menuItemRow";
|
import MenuItemRow from "@/components/menuItemRow";
|
||||||
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
import SkeletonTwoItem from "@/components/skeletonTwoItem";
|
||||||
import Text from "@/components/Text";
|
import Text from "@/components/Text";
|
||||||
@@ -166,8 +167,9 @@ export default function Index() {
|
|||||||
<InputSearch onChange={setSearch} />
|
<InputSearch onChange={setSearch} />
|
||||||
{
|
{
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
<View style={[Styles.mv05]}>
|
<View style={[Styles.mv05, Styles.rowOnly]}>
|
||||||
<Text>Filter : {nameGroup}</Text>
|
<Text>Filter :</Text>
|
||||||
|
<LabelStatus size="small" category="secondary" text={nameGroup} style={[Styles.mh05]} />
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -32,16 +32,18 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function ListProject() {
|
export default function ListProject() {
|
||||||
const { status, group, cat } = useLocalSearchParams<{
|
const { status, group, cat, year } = useLocalSearchParams<{
|
||||||
status?: string;
|
status?: string;
|
||||||
group?: string;
|
group?: string;
|
||||||
cat?: string;
|
cat?: string;
|
||||||
|
year?: string;
|
||||||
}>();
|
}>();
|
||||||
const [statusFix, setStatusFix] = useState<'0' | '1' | '2' | '3'>('0')
|
const [statusFix, setStatusFix] = useState<'0' | '1' | '2' | '3'>('0')
|
||||||
const { token, decryptToken } = useAuthSession();
|
const { token, decryptToken } = useAuthSession();
|
||||||
const entityUser = useSelector((state: any) => state.user)
|
const entityUser = useSelector((state: any) => state.user)
|
||||||
const [search, setSearch] = useState("")
|
const [search, setSearch] = useState("")
|
||||||
const [nameGroup, setNameGroup] = useState("")
|
const [nameGroup, setNameGroup] = useState("")
|
||||||
|
const [isYear, setYear] = useState("")
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
const [isList, setList] = useState(false)
|
const [isList, setList] = useState(false)
|
||||||
const update = useSelector((state: any) => state.projectUpdate)
|
const update = useSelector((state: any) => state.projectUpdate)
|
||||||
@@ -63,11 +65,13 @@ export default function ListProject() {
|
|||||||
search: search,
|
search: search,
|
||||||
group: String(group),
|
group: String(group),
|
||||||
kategori: String(cat),
|
kategori: String(cat),
|
||||||
page: thisPage
|
page: thisPage,
|
||||||
|
year: String(year)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setNameGroup(response.filter.name);
|
setNameGroup(response.filter.name);
|
||||||
|
setYear(response.tahun)
|
||||||
if (thisPage == 1) {
|
if (thisPage == 1) {
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
} else if (thisPage > 1 && response.data.length > 0) {
|
} else if (thisPage > 1 && response.data.length > 0) {
|
||||||
@@ -91,7 +95,7 @@ export default function ListProject() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad(true, 1);
|
handleLoad(true, 1);
|
||||||
}, [statusFix, search, group, cat]);
|
}, [statusFix, search, group, cat, year]);
|
||||||
|
|
||||||
const loadMoreData = () => {
|
const loadMoreData = () => {
|
||||||
if (waiting) return
|
if (waiting) return
|
||||||
@@ -194,17 +198,25 @@ export default function ListProject() {
|
|||||||
</View>
|
</View>
|
||||||
<View style={[Styles.mv05]}>
|
<View style={[Styles.mv05]}>
|
||||||
{
|
{
|
||||||
entityUser.role != 'cosupadmin' && entityUser.role != 'admin' &&
|
// entityUser.role != 'cosupadmin' && entityUser.role != 'admin' &&
|
||||||
<Text>Filter :
|
<View style={[Styles.rowOnly]}>
|
||||||
|
<Text style={[Styles.mr05]}>Filter :</Text>
|
||||||
{
|
{
|
||||||
(entityUser.role == "supadmin" || entityUser.role == "developer") && nameGroup
|
(entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
|
<LabelStatus size="small" category="secondary" text={nameGroup} style={{ marginRight: 5 }} />
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(entityUser.role == 'user' || entityUser.role == 'coadmin')
|
(entityUser.role == 'user' || entityUser.role == 'coadmin')
|
||||||
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? 'Kegiatan Saya' : 'Semua Kegiatan'
|
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? <LabelStatus size="small" category="secondary" text="Kegiatan Saya" style={{ marginRight: 5 }} /> : <LabelStatus size="small" category="secondary" text="Semua Kegiatan" style={{ marginRight: 5 }} />
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
</Text>
|
<LabelStatus size="small" category="secondary" text={isYear} style={{ marginRight: 5 }} />
|
||||||
|
{/* {
|
||||||
|
(entityUser.role == 'user' || entityUser.role == 'coadmin')
|
||||||
|
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? <LabelStatus size="small" category="primary" text="Kegiatan Saya" /> : <LabelStatus size="small" category="primary" text="Semua Kegiatan" />
|
||||||
|
: ''
|
||||||
|
} */}
|
||||||
|
</View>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { View } from "react-native";
|
import { View, StyleProp, ViewStyle } from "react-native";
|
||||||
import Text from "./Text";
|
import Text from "./Text";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
category: 'error' | 'success' | 'warning' | 'primary' | 'secondary'
|
category: 'error' | 'success' | 'warning' | 'primary' | 'secondary'
|
||||||
text: string
|
text: string
|
||||||
size: 'small' | 'default'
|
size: 'small' | 'default'
|
||||||
|
style?: StyleProp<ViewStyle>
|
||||||
}
|
}
|
||||||
export default function LabelStatus({ category, text, size }: Props) {
|
export default function LabelStatus({ category, text, size, style }: Props) {
|
||||||
return (
|
return (
|
||||||
<View style={[size == "small" ? Styles.labelStatusSmall : Styles.labelStatus, ColorsStatus[category], Styles.round10, Styles.contentItemCenter]}>
|
<View style={[
|
||||||
|
size == "small" ? Styles.labelStatusSmall : Styles.labelStatus,
|
||||||
|
ColorsStatus[category],
|
||||||
|
Styles.round10,
|
||||||
|
Styles.contentItemCenter,
|
||||||
|
style
|
||||||
|
]}>
|
||||||
<Text style={[size == "small" ? Styles.textSmallSemiBold : Styles.textMediumSemiBold, Styles.cWhite, { textAlign: 'center' }]}>{text}</Text>
|
<Text style={[size == "small" ? Styles.textSmallSemiBold : Styles.textMediumSemiBold, Styles.cWhite, { textAlign: 'center' }]}>{text}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,25 +1,26 @@
|
|||||||
import Styles from "@/constants/Styles"
|
import Styles from "@/constants/Styles"
|
||||||
import { apiGetGroup } from "@/lib/api"
|
import { apiGetGroup, apiGetTahunProject } from "@/lib/api"
|
||||||
import { setEntityFilterGroup } from "@/lib/filterSlice"
|
import { setEntityFilterGroup } from "@/lib/filterSlice"
|
||||||
import { useAuthSession } from "@/providers/AuthProvider"
|
import { useAuthSession } from "@/providers/AuthProvider"
|
||||||
import { AntDesign } from "@expo/vector-icons"
|
|
||||||
import { router } from "expo-router"
|
import { router } from "expo-router"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { Pressable, ScrollView, View } from "react-native"
|
import { ScrollView, TouchableOpacity, View } from "react-native"
|
||||||
import Text from './Text';
|
|
||||||
import { useDispatch, useSelector } from "react-redux"
|
import { useDispatch, useSelector } from "react-redux"
|
||||||
import { ButtonForm } from "./buttonForm"
|
import { ButtonForm } from "./buttonForm"
|
||||||
import DrawerBottom from "./drawerBottom"
|
import DrawerBottom from "./drawerBottom"
|
||||||
|
import Text from './Text'
|
||||||
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
open: boolean,
|
open: boolean,
|
||||||
close: (value: boolean) => void
|
close: (value: boolean) => void
|
||||||
page: 'position' | 'member' | 'discussion' | 'project' | 'division'
|
page: 'position' | 'member' | 'discussion' | 'project' | 'division'
|
||||||
category?: 'filter-group' | 'filter-data'
|
category?: 'filter-group' | 'filter-data' | 'year-only',
|
||||||
|
valueGroup?: string,
|
||||||
|
valueYear?: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ModalFilter({ open, close, page, category }: Props) {
|
export default function ModalFilter({ open, close, page, category, valueGroup, valueYear }: Props) {
|
||||||
const data = [
|
const data = [
|
||||||
{
|
{
|
||||||
id: "data-saya",
|
id: "data-saya",
|
||||||
@@ -34,58 +35,154 @@ export default function ModalFilter({ open, close, page, category }: Props) {
|
|||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const entities = useSelector((state: any) => state.filterGroup)
|
const entities = useSelector((state: any) => state.filterGroup)
|
||||||
const update = useSelector((state: any) => state.groupUpdate)
|
const update = useSelector((state: any) => state.groupUpdate)
|
||||||
const [chooseGroup, setChooseGroup] = useState('')
|
const [chooseGroup, setChooseGroup] = useState(valueGroup || '')
|
||||||
|
const [chooseYear, setChooseYear] = useState(valueYear || '')
|
||||||
|
const [dataTahun, setDataTahun] = useState<{ id: string, name: string }[]>([])
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetGroup({ active: 'true', user: hasil, search: '' })
|
const response = await apiGetGroup({ active: 'true', user: hasil, search: '' })
|
||||||
dispatch(setEntityFilterGroup(response.data))
|
dispatch(setEntityFilterGroup(response.data))
|
||||||
|
|
||||||
|
if (page === 'project') {
|
||||||
|
const responseTahun = await apiGetTahunProject({ user: hasil })
|
||||||
|
setDataTahun(responseTahun.data)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLoad()
|
handleLoad()
|
||||||
}, [dispatch, update]);
|
}, [dispatch, update]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DrawerBottom animation="slide" isVisible={open} setVisible={close} title="Filter" height={75}>
|
<DrawerBottom animation="slide" isVisible={open} setVisible={close} title="Pilih Preferensi" height={75}>
|
||||||
<View style={{ justifyContent: 'space-between', flex: 1 }}>
|
<View style={{ justifyContent: 'space-between', flex: 1 }}>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<View>
|
{
|
||||||
{
|
category != "year-only" &&
|
||||||
category == "filter-data"
|
<View>
|
||||||
?
|
<Text style={[Styles.textDefaultSemiBold, Styles.mb05]}>{category == "filter-data" ? "Filter Data" : "Lembaga Desa"}</Text>
|
||||||
data.map((item: any, index: any) => (
|
<View style={[Styles.rowOnly, { flexWrap: 'wrap' }]}>
|
||||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
{
|
||||||
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
category == "filter-data"
|
||||||
{
|
?
|
||||||
chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'}/>
|
data.map((item: any, index: any) => (
|
||||||
}
|
<TouchableOpacity
|
||||||
</Pressable>
|
key={index}
|
||||||
))
|
style={[
|
||||||
:
|
Styles.chip,
|
||||||
entities.map((item: any, index: any) => (
|
chooseGroup == item.id && Styles.chipSelected,
|
||||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
]}
|
||||||
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
activeOpacity={0.8}
|
||||||
{
|
onPress={() => { setChooseGroup(item.id) }}
|
||||||
chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'}/>
|
>
|
||||||
}
|
{/* {chooseGroup == item.id && (
|
||||||
</Pressable>
|
<View style={Styles.checkIcon}>
|
||||||
))
|
<Ionicons name="checkmark" size={14} color="white" />
|
||||||
}
|
</View>
|
||||||
</View>
|
)} */}
|
||||||
|
|
||||||
|
<Text
|
||||||
|
style={[
|
||||||
|
Styles.chipText,
|
||||||
|
chooseGroup == item.id && Styles.chipTextSelected,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
// <Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
||||||
|
// <Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
||||||
|
// {
|
||||||
|
// chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'} />
|
||||||
|
// }
|
||||||
|
// </Pressable>
|
||||||
|
))
|
||||||
|
:
|
||||||
|
entities.map((item: any, index: any) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
key={index}
|
||||||
|
style={[
|
||||||
|
Styles.chip,
|
||||||
|
chooseGroup == item.id && Styles.chipSelected,
|
||||||
|
]}
|
||||||
|
activeOpacity={0.8}
|
||||||
|
onPress={() => { setChooseGroup(item.id) }}
|
||||||
|
>
|
||||||
|
{/* {chooseGroup == item.id && (
|
||||||
|
<View style={Styles.checkIcon}>
|
||||||
|
<Ionicons name="checkmark" size={14} color="white" />
|
||||||
|
</View>
|
||||||
|
)} */}
|
||||||
|
|
||||||
|
<Text
|
||||||
|
style={[
|
||||||
|
Styles.chipText,
|
||||||
|
chooseGroup == item.id && Styles.chipTextSelected,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
// <Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
||||||
|
// <Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
||||||
|
// {
|
||||||
|
// chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
|
// }
|
||||||
|
// </Pressable>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
|
||||||
|
{page == "project" && (
|
||||||
|
<View>
|
||||||
|
<Text style={[Styles.textDefaultSemiBold, Styles.mb05]}>Tahun</Text>
|
||||||
|
<View style={[Styles.rowOnly, { flexWrap: 'wrap' }]}>
|
||||||
|
{
|
||||||
|
dataTahun.map((item: { id: string, name: string }, index: number) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
key={index}
|
||||||
|
style={[
|
||||||
|
Styles.chip,
|
||||||
|
chooseYear == item.id && Styles.chipSelected,
|
||||||
|
]}
|
||||||
|
activeOpacity={0.8}
|
||||||
|
onPress={() => { setChooseYear(item.id) }}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={[
|
||||||
|
Styles.chipText,
|
||||||
|
chooseYear == item.id && Styles.chipTextSelected,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<View>
|
<View>
|
||||||
<ButtonForm text="Terapkan" onPress={() => {
|
<ButtonForm text="Terapkan" onPress={() => {
|
||||||
close(false)
|
close(false)
|
||||||
page == 'project' ?
|
page == 'project' ?
|
||||||
category == "filter-data"
|
category == "year-only"
|
||||||
?
|
?
|
||||||
router.replace(`/${page}?status=0&cat=${chooseGroup}`)
|
router.replace(`/${page}?status=0&year=${chooseYear}`)
|
||||||
:
|
:
|
||||||
router.replace(`/${page}?status=0&group=${chooseGroup}`)
|
category == "filter-data"
|
||||||
|
?
|
||||||
|
router.replace(`/${page}?status=0&cat=${chooseGroup}&year=${chooseYear}`)
|
||||||
|
:
|
||||||
|
router.replace(`/${page}?status=0&group=${chooseGroup}&year=${chooseYear}`)
|
||||||
:
|
:
|
||||||
router.replace(`/${page}?active=true&group=${chooseGroup}`)
|
router.replace(`/${page}?active=true&group=${chooseGroup}`)
|
||||||
}} />
|
}} />
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default function HeaderRightProjectList() {
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(entityUser.role == "user" || entityUser.role == "coadmin" || entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
// (entityUser.role == "user" || entityUser.role == "coadmin" || entityUser.role == "supadmin" || entityUser.role == "developer") &&
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
icon={<AntDesign name="filter" color="black" size={25} />}
|
icon={<AntDesign name="filter" color="black" size={25} />}
|
||||||
title="Filter"
|
title="Filter"
|
||||||
@@ -50,7 +50,7 @@ export default function HeaderRightProjectList() {
|
|||||||
close={() => { setFilter(false) }}
|
close={() => { setFilter(false) }}
|
||||||
open={isFilter}
|
open={isFilter}
|
||||||
page="project"
|
page="project"
|
||||||
category={entityUser.role == "supadmin" || entityUser.role == "developer" ? "filter-group" : "filter-data"}
|
category={entityUser.role == "admin" || entityUser.role == "cosupadmin" ? 'year-only' : entityUser.role == "supadmin" || entityUser.role == "developer" ? "filter-group" : "filter-data"}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -651,6 +651,35 @@ const Styles = StyleSheet.create({
|
|||||||
width: 40,
|
width: 40,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
|
chip: {
|
||||||
|
paddingVertical: 5,
|
||||||
|
paddingHorizontal: 15,
|
||||||
|
borderRadius: 5,
|
||||||
|
backgroundColor: "#F3F4F6",
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: "transparent",
|
||||||
|
marginRight: 10,
|
||||||
|
marginBottom: 10,
|
||||||
|
},
|
||||||
|
chipSelected: {
|
||||||
|
backgroundColor: "#FFF5F2",
|
||||||
|
borderColor: "#FF5A3C",
|
||||||
|
},
|
||||||
|
chipText: {
|
||||||
|
fontSize: 16,
|
||||||
|
color: "#222",
|
||||||
|
},
|
||||||
|
chipTextSelected: {
|
||||||
|
color: "#FF5A3C",
|
||||||
|
},
|
||||||
|
checkIcon: {
|
||||||
|
position: "absolute",
|
||||||
|
top: -6,
|
||||||
|
left: -6,
|
||||||
|
backgroundColor: "#FF5A3C",
|
||||||
|
borderRadius: 10,
|
||||||
|
padding: 2,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export default Styles;
|
export default Styles;
|
||||||
@@ -315,8 +315,13 @@ export const apiDeleteAnnouncement = async (data: { user: string }, id: string)
|
|||||||
return response.data
|
return response.data
|
||||||
};
|
};
|
||||||
|
|
||||||
export const apiGetProject = async ({ user, status, search, group, kategori, page }: { user: string, status: string, search: string, group?: string, kategori?: string, page?: number }) => {
|
export const apiGetTahunProject = async ({ user }: { user: string }) => {
|
||||||
const response = await api.get(`mobile/project?user=${user}&status=${status}&group=${group}&search=${search}&cat=${kategori}&page=${page}`);
|
const response = await api.get(`mobile/project/tahun?user=${user}`);
|
||||||
|
return response.data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const apiGetProject = async ({ user, status, search, group, kategori, page, year }: { user: string, status: string, search: string, group?: string, kategori?: string, page?: number, year?: string }) => {
|
||||||
|
const response = await api.get(`mobile/project?user=${user}&status=${status}&group=${group}&search=${search}&cat=${kategori}&page=${page}&year=${year}`);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user