fix : ios
Deskripsi: - tambah edit banner - tambah edit anggota - new folder dokumen divisi - rename file folder dokumen divisi - tambah kalendar divisi > tanggal dan time - edit kalender divisi > tanggal dan time - tambah diskusi umum - multi file pada tambah file project - multi file pada tambah file task divisi No Issues
This commit is contained in:
1
app.json
1
app.json
@@ -42,6 +42,7 @@
|
||||
}
|
||||
],
|
||||
"expo-font",
|
||||
"expo-image-picker",
|
||||
"expo-web-browser",
|
||||
[
|
||||
"@react-native-firebase/app",
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function EditBanner() {
|
||||
const pickImageAsync = async () => {
|
||||
let result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ["images"],
|
||||
allowsEditing: true,
|
||||
allowsEditing: false,
|
||||
quality: 1,
|
||||
aspect: [1535, 450],
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function CreateBanner() {
|
||||
const pickImageAsync = async () => {
|
||||
let result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ["images"],
|
||||
allowsEditing: true,
|
||||
allowsEditing: false,
|
||||
quality: 1,
|
||||
aspect: [1535, 450],
|
||||
});
|
||||
|
||||
@@ -84,6 +84,9 @@ export default function CreateDiscussionGeneral() {
|
||||
checkForm();
|
||||
}, [error, dataForm]);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(setMemberChoose([]))
|
||||
}, [])
|
||||
|
||||
function handleBack() {
|
||||
dispatch(setMemberChoose([]))
|
||||
@@ -171,6 +174,7 @@ export default function CreateDiscussionGeneral() {
|
||||
error={error.desc}
|
||||
errorText="Diskusi tidak boleh kosong"
|
||||
onChange={(val) => { validationForm("desc", val) }}
|
||||
multiline
|
||||
/>
|
||||
<ButtonSelect
|
||||
value="Pilih Anggota"
|
||||
|
||||
@@ -135,6 +135,7 @@ export default function EditDiscussionGeneral() {
|
||||
value={dataForm.desc}
|
||||
errorText="Diskusi tidak boleh kosong"
|
||||
onChange={(val) => validationForm("desc", val)}
|
||||
multiline
|
||||
/>
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
@@ -550,9 +550,7 @@ export default function DocumentDivision() {
|
||||
title="Ganti Nama"
|
||||
isVisible={isRename}
|
||||
setVisible={() => { setRename(false) }}
|
||||
onSubmit={() => {
|
||||
handleRename();
|
||||
}}
|
||||
onSubmit={() => { handleRename() }}
|
||||
disableSubmit={bodyRename.name == ""}
|
||||
>
|
||||
<View>
|
||||
|
||||
@@ -36,19 +36,21 @@ export default function TaskDivisionAddFile() {
|
||||
const pickDocumentAsync = async () => {
|
||||
let result = await DocumentPicker.getDocumentAsync({
|
||||
type: ["*/*"],
|
||||
multiple: false,
|
||||
multiple: true,
|
||||
});
|
||||
if (!result.canceled) {
|
||||
if (result.assets?.[0].uri) {
|
||||
const check = await handleCheckFile(result.assets?.[0]);
|
||||
for (let i = 0; i < result.assets?.length; i++) {
|
||||
if (result.assets?.[i].uri) {
|
||||
const check = await handleCheckFile(result.assets?.[i]);
|
||||
if (check) {
|
||||
setFileForm([...fileForm, result.assets?.[0]]);
|
||||
setListFile([...listFile, result.assets?.[0].name]);
|
||||
setFileForm((prev) => [...prev, result.assets?.[i]]);
|
||||
setListFile((prev) => [...prev, result.assets?.[i].name]);
|
||||
} else {
|
||||
Toast.show({ type: 'small', text1: 'File sudah ada', })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function deleteFile(index: number) {
|
||||
|
||||
@@ -52,11 +52,13 @@ export default function CreateTaskDivision() {
|
||||
const pickDocumentAsync = async () => {
|
||||
let result = await DocumentPicker.getDocumentAsync({
|
||||
type: ["*/*"],
|
||||
multiple: false
|
||||
multiple: true
|
||||
});
|
||||
if (!result.canceled) {
|
||||
if (result.assets[0].uri) {
|
||||
setFileForm([...fileForm, result.assets[0]])
|
||||
for (let i = 0; i < result.assets?.length; i++) {
|
||||
if (result.assets[i].uri) {
|
||||
setFileForm((prev) => [...prev, result.assets[i]])
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -187,7 +187,7 @@ export default function EditProfile() {
|
||||
const pickImageAsync = async () => {
|
||||
let result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ["images"],
|
||||
allowsEditing: true,
|
||||
allowsEditing: false,
|
||||
quality: 1,
|
||||
aspect: [1, 1],
|
||||
});
|
||||
|
||||
@@ -36,6 +36,7 @@ export default function CreateMember() {
|
||||
const [chooseGender, setChooseGender] = useState({ val: "", label: "" });
|
||||
const [selectedImage, setSelectedImage] = useState<string | undefined>(undefined);
|
||||
const entityUser = useSelector((state: any) => state.user);
|
||||
const entities = useSelector((state: any) => state.entities)
|
||||
const [isSelect, setSelect] = useState(false);
|
||||
const [disableBtn, setDisableBtn] = useState(true)
|
||||
const [valChoose, setValChoose] = useState("")
|
||||
@@ -142,6 +143,12 @@ export default function CreateMember() {
|
||||
checkForm()
|
||||
}, [error, dataForm])
|
||||
|
||||
useEffect(() => {
|
||||
if(entityUser.role !="supadmin" && entityUser.role != "developer"){
|
||||
validationForm("group", entities.idGroup, entities.group)
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
||||
async function handleCreate() {
|
||||
try {
|
||||
@@ -162,7 +169,7 @@ export default function CreateMember() {
|
||||
fd.append("file", "undefined")
|
||||
}
|
||||
|
||||
const response = await apiCreateUser(fd)
|
||||
const response = await apiCreateUser({data: fd})
|
||||
if (response.success) {
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
||||
dispatch(setUpdateMember(!update))
|
||||
@@ -179,7 +186,7 @@ export default function CreateMember() {
|
||||
const pickImageAsync = async () => {
|
||||
let result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ["images"],
|
||||
allowsEditing: true,
|
||||
allowsEditing: false,
|
||||
quality: 1,
|
||||
aspect: [1, 1],
|
||||
});
|
||||
|
||||
@@ -212,7 +212,7 @@ export default function EditMember() {
|
||||
const pickImageAsync = async () => {
|
||||
let result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ["images"],
|
||||
allowsEditing: true,
|
||||
allowsEditing: false,
|
||||
quality: 1,
|
||||
aspect: [1, 1],
|
||||
});
|
||||
|
||||
@@ -30,16 +30,19 @@ export default function ProjectAddFile() {
|
||||
const pickDocumentAsync = async () => {
|
||||
let result = await DocumentPicker.getDocumentAsync({
|
||||
type: ["*/*"],
|
||||
multiple: false
|
||||
multiple: true
|
||||
});
|
||||
|
||||
if (!result.canceled) {
|
||||
if (result.assets?.[0].uri) {
|
||||
const check = await handleCheckFile(result.assets?.[0])
|
||||
for (let i = 0; i < result.assets?.length; i++) {
|
||||
if (result.assets?.[i].uri) {
|
||||
const check = await handleCheckFile(result.assets?.[i])
|
||||
if (check) {
|
||||
setFileForm([...fileForm, result.assets?.[0]])
|
||||
setListFile([...listFile, result.assets?.[0].name])
|
||||
setFileForm((prev) => [...prev, result.assets?.[i]])
|
||||
setListFile((prev) => [...prev, result.assets?.[i].name])
|
||||
} else {
|
||||
Toast.show({ type: 'small', text1: 'File sudah ada', })
|
||||
Toast.show({ type: 'small', text1: 'File yg telah terupload tidak bisa diupload ulang', })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,11 +146,13 @@ export default function CreateProject() {
|
||||
const pickDocumentAsync = async () => {
|
||||
let result = await DocumentPicker.getDocumentAsync({
|
||||
type: ["*/*"],
|
||||
multiple: false
|
||||
multiple: true
|
||||
});
|
||||
if (!result.canceled) {
|
||||
if (result.assets[0].uri) {
|
||||
setFileForm([...fileForm, result.assets[0]])
|
||||
for (let i = 0; i < result.assets?.length; i++) {
|
||||
if (result.assets[i].uri) {
|
||||
setFileForm((prev) => [...prev, result.assets[i]])
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
14
lib/api.ts
14
lib/api.ts
@@ -150,7 +150,7 @@ export const apiGetUser = async ({ user, active, search, group, page }: { user:
|
||||
};
|
||||
|
||||
|
||||
export const apiCreateUser = async (data: FormData) => {
|
||||
export const apiCreateUser = async ({data}: {data: FormData}) => {
|
||||
const response = await api.post('/mobile/user', data, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
@@ -219,7 +219,7 @@ export const apiEditDiscussionGeneral = async (data: { user: string, title: stri
|
||||
};
|
||||
|
||||
export const apiCreateDiscussionGeneral = async ({ data }: { data: { idGroup: string, title: string, desc: string, user: string, member: [] } }) => {
|
||||
const response = await api.post(`/mobile/discussion-general/`, data)
|
||||
const response = await api.post(`/mobile/discussion-general`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -604,7 +604,7 @@ export const apiGetDocumentInformasi = async ({ user, item, cat }: { user: strin
|
||||
};
|
||||
|
||||
export const apiDocumentRename = async (data: { name: string, user: string, id: string, path: string, idDivision: string, extension: string }) => {
|
||||
const response = await api.put(`/mobile/document/`, data)
|
||||
const response = await api.put(`/mobile/document`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -614,7 +614,7 @@ export const apiDocumentDelete = async (data: { user: string, data: any[] }) =>
|
||||
};
|
||||
|
||||
export const apiCreateFolderDocument = async ({ data }: { data: { name: string, path: string, idDivision: string, user: string } }) => {
|
||||
const response = await api.post(`/mobile/document/`, data)
|
||||
const response = await api.post(`/mobile/document`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -646,12 +646,12 @@ export const apiShareDocument = async (data: { dataDivision: any[], dataItem: an
|
||||
};
|
||||
|
||||
export const apiRegisteredToken = async (data: { user: string, token: string }) => {
|
||||
const response = await api.post(`/mobile/auth-token/`, data)
|
||||
const response = await api.post(`/mobile/auth-token`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiUnregisteredToken = async (data: { user: string, token: string }) => {
|
||||
const response = await api.put(`/mobile/auth-token/`, data)
|
||||
const response = await api.put(`/mobile/auth-token`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -661,6 +661,6 @@ export const apiGetNotification = async ({ user, page }: { user: string, page?:
|
||||
};
|
||||
|
||||
export const apiReadOneNotification = async (data: { user: string, id: string }) => {
|
||||
const response = await api.put(`/mobile/home/notification/`, data)
|
||||
const response = await api.put(`/mobile/home/notification`, data)
|
||||
return response.data;
|
||||
};
|
||||
Reference in New Issue
Block a user