upd: pembatasan user role pada kegiatan
This commit is contained in:
@@ -38,6 +38,8 @@ export default function CreateProject() {
|
||||
const entitiesMember = useSelector((state: any) => state.memberChoose);
|
||||
const taskCreate = useSelector((state: any) => state.taskCreate);
|
||||
const update = useSelector((state: any) => state.projectUpdate)
|
||||
const entityUser = useSelector((state: any) => state.user);
|
||||
const userLogin = useSelector((state: any) => state.entities)
|
||||
const [fileForm, setFileForm] = useState<any[]>([])
|
||||
const [indexDelFile, setIndexDelFile] = useState<number>(0)
|
||||
const [disableBtn, setDisableBtn] = useState(true)
|
||||
@@ -185,6 +187,10 @@ export default function CreateProject() {
|
||||
/>
|
||||
<ScrollView>
|
||||
<View style={[Styles.p15, Styles.mb100]}>
|
||||
{
|
||||
(entityUser.role == "supadmin" || entityUser.role == "developer")
|
||||
&&
|
||||
(
|
||||
<SelectForm
|
||||
label="Lembaga Desa"
|
||||
placeholder="Pilih Lembaga Desa"
|
||||
@@ -198,6 +204,8 @@ export default function CreateProject() {
|
||||
error={error.group}
|
||||
errorText="Lembaga Desa tidak boleh kosong"
|
||||
/>
|
||||
)
|
||||
}
|
||||
<InputForm
|
||||
label="Kegiatan"
|
||||
type="default"
|
||||
@@ -222,6 +230,7 @@ export default function CreateProject() {
|
||||
<ButtonSelect
|
||||
value="Pilih Anggota"
|
||||
onPress={() => {
|
||||
if (entityUser.role == "supadmin" || entityUser.role == "developer") {
|
||||
if (chooseGroup.val != "") {
|
||||
setSelect(true);
|
||||
setValSelect("member");
|
||||
@@ -231,6 +240,12 @@ export default function CreateProject() {
|
||||
ToastAndroid.SHORT
|
||||
);
|
||||
}
|
||||
} else {
|
||||
validationForm('group', userLogin.idGroup, userLogin.group);
|
||||
setValChoose(userLogin.idGroup)
|
||||
setSelect(true);
|
||||
setValSelect("member");
|
||||
}
|
||||
}}
|
||||
error={error.member}
|
||||
errorText="Anggota tidak boleh kosong"
|
||||
|
||||
@@ -30,6 +30,8 @@ export default function HeaderRightProjectList() {
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
(entityUser.role == 'supadmin' || entityUser.role == 'developer') &&
|
||||
<MenuItemRow
|
||||
icon={<AntDesign name="filter" color="black" size={25} />}
|
||||
title="Filter"
|
||||
@@ -38,6 +40,7 @@ export default function HeaderRightProjectList() {
|
||||
setFilter(true)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
<ModalFilter
|
||||
|
||||
Reference in New Issue
Block a user