Fakultas Ilmu Komputer UI

Commit 5ee49c44 authored by Zafir Rasyidi Taufik's avatar Zafir Rasyidi Taufik
Browse files

[CHORES]Polished some features requested

parent 27ff03ff
Pipeline #82119 failed with stage
in 2 minutes and 1 second
......@@ -73,7 +73,7 @@ declare global {
type AlertType = {
illustration?: ImageSourcePropType;
message?: string;
message?: string | Element;
}
type SetAlertType = React.Dispatch<React.SetStateAction<AlertType>>
......@@ -141,7 +141,7 @@ const navigationTheme = {
const App = () => {
console.disableYellowBox = true;
const [cache, cacheDispatch] = useReducer(cacheReducer, initialCacheState);
const [token, setToken] = useState();
const [token, setToken] = useState<string>();
const [user, setUser] = useState();
const [shouldLoading, setShouldLoading] = useState<boolean>(false);
......@@ -192,7 +192,10 @@ const App = () => {
// Token is not valid
setAlert({
illustration: WonderingIllustration,
message: "Akun anda belum diaktifkan, silakan hubungi \nppticabangkotadepok@gmail.com",
message: <>
<Text> {"Akun anda belum aktif, silahkan hubungi\n"} </Text>
<Text color='#0DCE66'> ppticabangkotadepok@gmail.com </Text>
</>,
})
setToken('')
}
......
......@@ -21,7 +21,7 @@ import initialCacheState from 'contexts/AppContext/cache';
const ButtonRow = styled.View`
margin-top: 30px;
margin-bottom: 12px;
margin-bottom: 48px;
display: flex;
justify-content: flex-end;
`;
......
const KECAMATAN_VALUES: {label: string; value: string}[] = [
{label: 'Beji', value: 'Beji'},
{label: 'Bojongsari', value: 'Bojongsari'},
{label: 'Cilodong', value: 'Cilodong'},
{label: 'Cimanggis', value: 'Cimanggis'},
{label: 'Cinere', value: 'Cinere'},
{label: 'Cipayung', value: 'Cipayung'},
{label: 'Limo', value: 'Limo'},
{label: 'Pancoran Mas', value: 'Pancoran Mas'},
{label: 'Sawangan', value: 'Sawangan'},
{label: 'Sukmajaya', value: 'Sukmajaya'},
{label: 'Tapos', value: 'Tapos'},
];
const KELURAHAN_VALUES: {label: string; value: string}[] = [
{label: 'Beji', value: 'Beji'},
{label: 'Beji Timur', value: 'Beji Timur'},
{label: 'Kemirimuka', value: 'Kemirimuka'},
{label: 'Kukusan', value: 'Kukusan'},
{label: 'Pondok Cina', value: 'Pondok Cina'},
{label: 'Tanah Baru', value: 'Tanah Baru'},
{label: 'Bojongsari Baru', value: 'Bojongsari Baru'},
{label: 'Bojongsari Lama', value: 'Bojongsari Lama'},
{label: 'Curug', value: 'Curug'},
{label: 'Duren Mekar', value: 'Duren Mekar'},
{label: 'Duren Seribu', value: 'Duren Seribu'},
{label: 'Pondok Petir', value: 'Pondok Petir'},
{label: 'Serua', value: 'Serua'},
{label: 'Cilodong', value: 'Cilodong'},
{label: 'Jatimulya', value: 'Jatimulya'},
{label: 'Kalibaru', value: 'Kalibaru'},
{label: 'Kalimulya', value: 'Kalimulya'},
{label: 'Sukamaju', value: 'Sukamaju'},
{label: 'Cisalak Pasar', value: 'Cisalak Pasar'},
{label: 'Curug', value: 'Curug'},
{label: 'Harjamukti', value: 'Harjamukti'},
{label: 'Mekarsari', value: 'Mekarsari'},
{label: 'Pasir Gunung Selatan', value: 'Pasir Gunung Selatan'},
{label: 'Tugu', value: 'Tugu'},
{label: 'Cinere', value: 'Cinere'},
{label: 'Gandul', value: 'Gandul'},
{label: 'Pangkalan Jati', value: 'Pangkalan Jati'},
{label: 'Pangkalan Jati Baru', value: 'Pangkalan Jati Baru'},
{label: 'Bojong Pondok Terong', value: 'Bojong Pondok Terong'},
{label: 'Cipayung', value: 'Cipayung'},
{label: 'Cipayung Jaya', value: 'Cipayung Jaya'},
{label: 'Pondok Jaya', value: 'Pondok Jaya'},
{label: 'Ratujaya', value: 'Ratujaya'},
{label: 'Grogol', value: 'Grogol'},
{label: 'Krukut', value: 'Krukut'},
{label: 'Limo', value: 'Limo'},
{label: 'Meruyung', value: 'Meruyung'},
{label: 'Depok', value: 'Depok'},
{label: 'Depok Jaya', value: 'Depok Jaya'},
{label: 'Mampang', value: 'Mampang'},
{label: 'Pancoran Mas', value: 'Pancoran Mas'},
{label: 'Rangkapan Jaya', value: 'Rangkapan Jaya'},
{label: 'Rangkapan Jaya Baru', value: 'Rangkapan Jaya Baru'},
{label: 'Bedahan', value: 'Bedahan'},
{label: 'Cinangka', value: 'Cinangka'},
{label: 'Kedaung', value: 'Kedaung'},
{label: 'Pasir Putih', value: 'Pasir Putih'},
{label: 'Pengasinan', value: 'Pengasinan'},
{label: 'Sawangan Baru', value: 'Sawangan Baru'},
{label: 'Sawangan Lama', value: 'Sawangan Lama'},
{label: 'Abadijaya', value: 'Abadijaya'},
{label: 'Bakti Jaya', value: 'Bakti Jaya'},
{label: 'Cisalak', value: 'Cisalak'},
{label: 'Mekar Jaya', value: 'Mekar Jaya'},
{label: 'Sukmajaya', value: 'Sukmajaya'},
{label: 'Tirtajaya', value: 'Tirtajaya'},
{label: 'Cilangkap', value: 'Cilangkap'},
{label: 'Cimpaeun', value: 'Cimpaeun'},
{label: 'Jatijajar', value: 'Jatijajar'},
{label: 'Leuwinanggung', value: 'Leuwinanggung'},
{label: 'Sukamaju Baru', value: 'Sukamaju Baru'},
{label: 'Sukatani', value: 'Sukatani'},
{label: 'Tapos', value: 'Tapos'},
];
{ label: 'Beji', value: 'Beji' },
{ label: 'Bojongsari', value: 'Bojongsari' },
{ label: 'Cilodong', value: 'Cilodong' },
{ label: 'Cimanggis', value: 'Cimanggis' },
{ label: 'Cinere', value: 'Cinere' },
{ label: 'Cipayung', value: 'Cipayung' },
{ label: 'Limo', value: 'Limo' },
{ label: 'Pancoran Mas', value: 'Pancoran Mas' },
{ label: 'Sawangan', value: 'Sawangan' },
{ label: 'Sukmajaya', value: 'Sukmajaya' },
{ label: 'Tapos', value: 'Tapos' },
];
const KELURAHAN_VALUES: { [key: string]: {label: string; value: string}[] } = {
'Beji': [
{ label: 'Beji', value: 'Beji' },
{ label: 'Beji Timur', value: 'Beji Timur' },
{ label: 'Kemirimuka', value: 'Kemirimuka' },
{ label: 'Kukusan', value: 'Kukusan' },
{ label: 'Pondok Cina', value: 'Pondok Cina' },
{ label: 'Tanah Baru', value: 'Tanah Baru' },
],
'Bojongsari': [
{ label: 'Bojongsari Baru', value: 'Bojongsari Baru' },
{ label: 'Bojongsari Lama', value: 'Bojongsari Lama' },
{ label: 'Curug', value: 'Curug' },
{ label: 'Duren Mekar', value: 'Duren Mekar' },
{ label: 'Duren Seribu', value: 'Duren Seribu' },
{ label: 'Pondok Petir', value: 'Pondok Petir' },
{ label: 'Serua', value: 'Serua' },
],
'Cilodong': [
{ label: 'Cilodong', value: 'Cilodong' },
{ label: 'Jatimulya', value: 'Jatimulya' },
{ label: 'Kalibaru', value: 'Kalibaru' },
{ label: 'Kalimulya', value: 'Kalimulya' },
{ label: 'Sukamaju', value: 'Sukamaju' },
],
'Cimanggis': [
{ label: 'Cisalak Pasar', value: 'Cisalak Pasar' },
{ label: 'Curug', value: 'Curug' },
{ label: 'Harjamukti', value: 'Harjamukti' },
{ label: 'Mekarsari', value: 'Mekarsari' },
{ label: 'Pasir Gunung Selatan', value: 'Pasir Gunung Selatan' },
{ label: 'Tugu', value: 'Tugu' },
],
'Cinere': [
{ label: 'Cinere', value: 'Cinere' },
{ label: 'Gandul', value: 'Gandul' },
{ label: 'Pangkalan Jati', value: 'Pangkalan Jati' },
{ label: 'Pangkalan Jati Baru', value: 'Pangkalan Jati Baru' },
],
'Cipayung': [
{ label: 'Bojong Pondok Terong', value: 'Bojong Pondok Terong' },
{ label: 'Cipayung', value: 'Cipayung' },
{ label: 'Cipayung Jaya', value: 'Cipayung Jaya' },
{ label: 'Pondok Jaya', value: 'Pondok Jaya' },
{ label: 'Ratujaya', value: 'Ratujaya' },
],
'Limo': [
{ label: 'Grogol', value: 'Grogol' },
{ label: 'Krukut', value: 'Krukut' },
{ label: 'Limo', value: 'Limo' },
{ label: 'Meruyung', value: 'Meruyung' },
],
'Pancoran Mas': [
{ label: 'Depok', value: 'Depok' },
{ label: 'Depok Jaya', value: 'Depok Jaya' },
{ label: 'Mampang', value: 'Mampang' },
{ label: 'Pancoran Mas', value: 'Pancoran Mas' },
{ label: 'Rangkapan Jaya', value: 'Rangkapan Jaya' },
{ label: 'Rangkapan Jaya Baru', value: 'Rangkapan Jaya Baru' },
],
'Sawangan': [
{ label: 'Bedahan', value: 'Bedahan' },
{ label: 'Cinangka', value: 'Cinangka' },
{ label: 'Kedaung', value: 'Kedaung' },
{ label: 'Pasir Putih', value: 'Pasir Putih' },
{ label: 'Pengasinan', value: 'Pengasinan' },
{ label: 'Sawangan Baru', value: 'Sawangan Baru' },
{ label: 'Sawangan Lama', value: 'Sawangan Lama' },
],
'Sukmajaya': [
{ label: 'Abadijaya', value: 'Abadijaya' },
{ label: 'Bakti Jaya', value: 'Bakti Jaya' },
{ label: 'Cisalak', value: 'Cisalak' },
{ label: 'Mekar Jaya', value: 'Mekar Jaya' },
{ label: 'Sukmajaya', value: 'Sukmajaya' },
{ label: 'Tirtajaya', value: 'Tirtajaya' },
],
'Tapos': [
{ label: 'Cilangkap', value: 'Cilangkap' },
{ label: 'Cimpaeun', value: 'Cimpaeun' },
{ label: 'Jatijajar', value: 'Jatijajar' },
{ label: 'Leuwinanggung', value: 'Leuwinanggung' },
{ label: 'Sukamaju Baru', value: 'Sukamaju Baru' },
{ label: 'Sukatani', value: 'Sukatani' },
{ label: 'Tapos', value: 'Tapos' },
],
};
const JENIS_KONTAK_VALUES: {label: string; value: string}[] = [
{label: 'Serumah', value: 'Serumah'},
......
......@@ -97,7 +97,7 @@ const ContactInvestigationFormStep2 = () => {
setField("sub_district", case_subject.sub_district)
setField("case_relation", case_relation)
} else {
setField("sub_district", KELURAHAN_VALUES[0].value)
setField("sub_district", KELURAHAN_VALUES[0])
setField("district", KECAMATAN_VALUES[0].value)
setField("case_relation", JENIS_KONTAK_VALUES[0].value)
}
......@@ -157,20 +157,24 @@ const ContactInvestigationFormStep2 = () => {
/>
<Gap axis={2} gap={15} />
<Field
name="Kelurahan"
value={form.fields.sub_district.value || KELURAHAN_VALUES[0].value}
id="district"
type={Field.Type.Dropdown}
isRequired
values={KELURAHAN_VALUES}
updateValue={val => onFormChange('sub_district', val)}
/>
<Field
name="Kecamatan"
isRequired
placeholder="Pilih Kecamatan"
isRequired={true}
value={form.fields.district.value || KECAMATAN_VALUES[0].value}
type={Field.Type.Dropdown}
values={KECAMATAN_VALUES}
updateValue={val => onFormChange('district', val)}
values={KECAMATAN_VALUES}
/>
<Field
id="sub_district"
type={Field.Type.Dropdown}
name="Kelurahan"
placeholder="Pilih Kelurahan"
isRequired={true}
value={form.fields.sub_district.value || KELURAHAN_VALUES[KECAMATAN_VALUES[0].value][0].value}
updateValue={val => onFormChange('sub_district', val)}
values={(form.fields.district.value) ? KELURAHAN_VALUES[form.fields.district.value] : KELURAHAN_VALUES[KECAMATAN_VALUES[0].value]}
/>
<Field
name="Jenis Kontak"
......
......@@ -34,7 +34,7 @@ const OfficerSignupFormFinishPage = () => {
Bila ada pertanyaan silahkan kirim ke alamat email
</Text>
<Text color='#0DCE66' fontSize={subNoticeSize} isBold={true}>
pengurus@ppti.id
ppticabangkotadepok@gmail.com
</Text>
</FieldControl>
</ContainerContent>
......
......@@ -166,7 +166,7 @@ const OfficerSignupFormGoogleSignin = () => {
district: translateError(errors.district[0] || ""),
sub_district: translateError(errors.sub_district[0] || ""),
})
} else if (response.status === 500) {
} else if (response.status === 500 || response.status === 400) {
if (response.data.includes("IntegrityError")) {
setServerHasError(false);
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment