Browse Source

fix: Currency symbol default value

pull/1/head
Watiah11 8 months ago
parent
commit
c96031ae6e
  1. 19
      src/views/SimproV2/CreatedProyek/DialogFormProyek.js

19
src/views/SimproV2/CreatedProyek/DialogFormProyek.js

@ -1,15 +1,12 @@
import React, { useEffect, useState, useMemo } from "react"; import React, { useEffect, useState } from "react";
import { Modal, ModalHeader, ModalBody, ModalFooter } from "reactstrap"; import { Modal, ModalHeader, ModalBody, ModalFooter } from "reactstrap";
import { Button, Form, FormGroup, Label, Input, Col, Row } from "reactstrap"; import { Button, Form, FormGroup, Label, Input, Col, Row } from "reactstrap";
import { DatePicker, Tooltip, Select, Divider, Spin } from "antd"; import { DatePicker, Tooltip, Select, Divider, Spin, message } from "antd";
import axios from "../../../const/interceptorApi"; import axios from "../../../const/interceptorApi";
import moment from "moment"; import moment from "moment";
import { CKEditor } from '@ckeditor/ckeditor5-react'; import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import { import {NotificationManager} from "react-notifications";
NotificationContainer,
NotificationManager,
} from "react-notifications";
import "antd/dist/antd.css"; import "antd/dist/antd.css";
import { formatNumber } from "../../../const/CustomFunc"; import { formatNumber } from "../../../const/CustomFunc";
import { import {
@ -72,7 +69,7 @@ const DialogFormProyek = ({
const [currencyList, setCurrencyList] = useState(null); const [currencyList, setCurrencyList] = useState(null);
const [currency, setCurrency] = useState(""); // merge of code | symbol | name const [currency, setCurrency] = useState(""); // merge of code | symbol | name
const [currencyCode, setCurrencyCode] = useState(""); const [currencyCode, setCurrencyCode] = useState("");
const [currencySymbol, setCurrencySymbol] = useState(null); const [currencySymbol, setCurrencySymbol] = useState("IDR|Rp|Indonesian rupiah");
const [currencyName, setCurrencyName] = useState(""); const [currencyName, setCurrencyName] = useState("");
const [objectives, setObjectives] = useState(""); const [objectives, setObjectives] = useState("");
const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState(""); const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState("");
@ -213,7 +210,7 @@ const DialogFormProyek = ({
setCompanyId(null) setCompanyId(null)
setCurrency(""); setCurrency("");
setCurrencyCode(""); setCurrencyCode("");
setCurrencySymbol(null); setCurrencySymbol("IDR|Rp|Indonesian rupiah");
setCurrencyName(""); setCurrencyName("");
setObjectives(""); setObjectives("");
setImage(""); setImage("");
@ -425,6 +422,10 @@ const DialogFormProyek = ({
alert("Currency Symbol cannot be empty!"); alert("Currency Symbol cannot be empty!");
return false; return false;
} }
if (!divisiProject || divisiProject === "") {
alert("Division cannot be empty!");
return false;
}
setStep(2); setStep(2);
}; };
@ -810,7 +811,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={4}> <Col md={4}>
<Select <Select
value={currencySymbol || "IDR|Rp|Indonesian rupiah"} value={currencySymbol}
onChange={onChangeCurrency} onChange={onChangeCurrency}
defaultValue="IDR|Rp|Indonesian rupiah" defaultValue="IDR|Rp|Indonesian rupiah"
style={{ width: "100%" }} style={{ width: "100%" }}

Loading…
Cancel
Save