upd: project
Deskripsi: - detail project - batal project - edit project - tambah tugas project - update status tugas project No Issues'
This commit is contained in:
@@ -29,9 +29,10 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function ListProject() {
|
||||
const { status, group } = useLocalSearchParams<{
|
||||
const { status, group, cat } = useLocalSearchParams<{
|
||||
status?: string;
|
||||
group?: string;
|
||||
cat?: string;
|
||||
}>();
|
||||
const { token, decryptToken } = useAuthSession();
|
||||
const entityUser = useSelector((state: any) => state.user);
|
||||
@@ -48,6 +49,7 @@ export default function ListProject() {
|
||||
status: String(status),
|
||||
search: search,
|
||||
group: String(group),
|
||||
kategori: String(cat),
|
||||
});
|
||||
|
||||
if (response.success) {
|
||||
@@ -61,7 +63,7 @@ export default function ListProject() {
|
||||
|
||||
useEffect(() => {
|
||||
handleLoad();
|
||||
}, [status, search, group]);
|
||||
}, [status, search, group, cat]);
|
||||
|
||||
return (
|
||||
<SafeAreaView>
|
||||
@@ -73,7 +75,7 @@ export default function ListProject() {
|
||||
value="0"
|
||||
onPress={() => {
|
||||
router.push(
|
||||
`/project?status=0&group=${group}&search=${search}`
|
||||
`/project?status=0&group=${group}&search=${search}&cat=${cat}`
|
||||
);
|
||||
}}
|
||||
label="Segera"
|
||||
@@ -91,7 +93,7 @@ export default function ListProject() {
|
||||
value="1"
|
||||
onPress={() => {
|
||||
router.push(
|
||||
`/project?status=1&group=${group}&search=${search}`
|
||||
`/project?status=1&group=${group}&search=${search}&cat=${cat}`
|
||||
);
|
||||
}}
|
||||
label="Dikerjakan"
|
||||
@@ -109,7 +111,7 @@ export default function ListProject() {
|
||||
value="2"
|
||||
onPress={() => {
|
||||
router.push(
|
||||
`/project?status=2&group=${group}&search=${search}`
|
||||
`/project?status=2&group=${group}&search=${search}&cat=${cat}`
|
||||
);
|
||||
}}
|
||||
label="Selesai"
|
||||
@@ -127,7 +129,7 @@ export default function ListProject() {
|
||||
value="3"
|
||||
onPress={() => {
|
||||
router.push(
|
||||
`/project?status=3&group=${group}&search=${search}`
|
||||
`/project?status=3&group=${group}&search=${search}&cat=${cat}`
|
||||
);
|
||||
}}
|
||||
label="Batal"
|
||||
@@ -155,77 +157,91 @@ export default function ListProject() {
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
{(entityUser.role == "supadmin" ||
|
||||
entityUser.role == "developer") && (
|
||||
<View style={[Styles.mv05]}>
|
||||
<Text>Filter : {nameGroup}</Text>
|
||||
</View>
|
||||
)}
|
||||
{isList ? (
|
||||
<View>
|
||||
{data.map((item, index) => {
|
||||
return (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
onPress={() => { }}
|
||||
borderType="bottom"
|
||||
icon={
|
||||
<View
|
||||
style={[Styles.iconContent, ColorsStatus.lightGreen]}
|
||||
>
|
||||
<AntDesign
|
||||
name="areachart"
|
||||
size={25}
|
||||
color={"#384288"}
|
||||
/>
|
||||
</View>
|
||||
}
|
||||
title={item.title}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
) : (
|
||||
<View>
|
||||
{data.map((item, index) => {
|
||||
return (
|
||||
<PaperGridContent
|
||||
key={index}
|
||||
onPress={() => {
|
||||
router.push(`/project/${item.id}`);
|
||||
}}
|
||||
content="page"
|
||||
title={item.title}
|
||||
headerColor="primary"
|
||||
>
|
||||
<ProgressBar value={item.progress} category="page" />
|
||||
<View style={[Styles.rowSpaceBetween]}>
|
||||
<Text style={[Styles.textDefault, Styles.cGray]}>
|
||||
{item.createdAt}
|
||||
</Text>
|
||||
<LabelStatus
|
||||
size="default"
|
||||
category={
|
||||
item.status === 0 ? 'primary' :
|
||||
item.status === 1 ? 'warning' :
|
||||
item.status === 2 ? 'success' :
|
||||
item.status === 3 ? 'error' :
|
||||
'primary'
|
||||
}
|
||||
text={
|
||||
item.status === 0 ? 'SEGERA' :
|
||||
item.status === 1 ? 'DIKERJAKAN' :
|
||||
item.status === 2 ? 'SELESAI' :
|
||||
item.status === 3 ? 'DIBATALKAN' :
|
||||
'SEGERA'
|
||||
<View style={[Styles.mv05]}>
|
||||
<Text>Filter :
|
||||
{
|
||||
(entityUser.role == "supadmin" || entityUser.role == "developer") && nameGroup
|
||||
}
|
||||
{
|
||||
(entityUser.role == 'user' || entityUser.role == 'coadmin')
|
||||
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? 'Kegiatan Saya' : 'Semua Kegiatan'
|
||||
: ''
|
||||
}
|
||||
</Text>
|
||||
</View>
|
||||
{
|
||||
data.length > 0
|
||||
?
|
||||
isList ? (
|
||||
<View>
|
||||
{data.map((item, index) => {
|
||||
return (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
onPress={() => { router.push(`/project/${item.id}`); }}
|
||||
borderType="bottom"
|
||||
icon={
|
||||
<View
|
||||
style={[Styles.iconContent, ColorsStatus.lightGreen]}
|
||||
>
|
||||
<AntDesign
|
||||
name="areachart"
|
||||
size={25}
|
||||
color={"#384288"}
|
||||
/>
|
||||
</View>
|
||||
}
|
||||
title={item.title}
|
||||
/>
|
||||
</View>
|
||||
</PaperGridContent>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
)}
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
) : (
|
||||
<View>
|
||||
{data.map((item, index) => {
|
||||
return (
|
||||
<PaperGridContent
|
||||
key={index}
|
||||
onPress={() => {
|
||||
router.push(`/project/${item.id}`);
|
||||
}}
|
||||
content="page"
|
||||
title={item.title}
|
||||
headerColor="primary"
|
||||
>
|
||||
<ProgressBar value={item.progress} category="page" />
|
||||
<View style={[Styles.rowSpaceBetween]}>
|
||||
<Text style={[Styles.textDefault, Styles.cGray]}>
|
||||
{item.createdAt}
|
||||
</Text>
|
||||
<LabelStatus
|
||||
size="default"
|
||||
category={
|
||||
item.status === 0 ? 'primary' :
|
||||
item.status === 1 ? 'warning' :
|
||||
item.status === 2 ? 'success' :
|
||||
item.status === 3 ? 'error' :
|
||||
'primary'
|
||||
}
|
||||
text={
|
||||
item.status === 0 ? 'SEGERA' :
|
||||
item.status === 1 ? 'DIKERJAKAN' :
|
||||
item.status === 2 ? 'SELESAI' :
|
||||
item.status === 3 ? 'DIBATALKAN' :
|
||||
'SEGERA'
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
</PaperGridContent>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
)
|
||||
:
|
||||
<View style={[Styles.mt15]}>
|
||||
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada kegiatan</Text>
|
||||
</View>
|
||||
}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
|
||||
Reference in New Issue
Block a user