Browse Source

Fix Dashboard, show hide password

pull/2/head
farhan048 2 years ago
parent
commit
63c1df628c
  1. 5
      src/views/Dashboard/DashboardProject.js
  2. 30
      src/views/Pages/Login/Login.js
  3. 8
      src/views/SimproV2/CreatedProyek/DialogDocument.js

5
src/views/Dashboard/DashboardProject.js

@ -157,7 +157,6 @@ const DashboardProject = () => {
// "end_date": moment(new Date()).format('YYYY-MM-DD') // "end_date": moment(new Date()).format('YYYY-MM-DD')
} }
const result = await axios.post(URL, payload, HEADER).then(res => res).catch(err => err.response) const result = await axios.post(URL, payload, HEADER).then(res => res).catch(err => err.response)
console.log('getSCurve', result);
if (!result) { if (!result) {
NotificationManager.error(`Could not connect to internet.`, "Failed"); NotificationManager.error(`Could not connect to internet.`, "Failed");
setIsReadySCurve(true); setIsReadySCurve(true);
@ -254,7 +253,6 @@ const DashboardProject = () => {
return; return;
} }
else if (result.status == 200 && result.data.data) { else if (result.status == 200 && result.data.data) {
// console.log()
if (result.data.data.data) { if (result.data.data.data) {
let total_invoice = result.data.data.data.total_invoice_amount; let total_invoice = result.data.data.data.total_invoice_amount;
let cash_in = result.data.data.data.total_invoice_paid_amount; let cash_in = result.data.data.data.total_invoice_paid_amount;
@ -601,9 +599,12 @@ const DashboardProject = () => {
<Col span={7} style={{ fontSize: 11, fontWeight: 'bold' }}><i className="fa fa-calendar" style={{ marginRight: 8 }}></i>Est. at Completion</Col> <Col span={7} style={{ fontSize: 11, fontWeight: 'bold' }}><i className="fa fa-calendar" style={{ marginRight: 8 }}></i>Est. at Completion</Col>
<Col span={5} style={{ fontSize: 11 }}> <Col span={5} style={{ fontSize: 11 }}>
{isReadySCurve ? {isReadySCurve ?
plannedCost !== null && bcwp !== null ?
plannedCost > bcwp ? renderFormatRupiah(plannedCost, 'Rp.') : renderFormatRupiah(bcwp, 'Rp.') plannedCost > bcwp ? renderFormatRupiah(plannedCost, 'Rp.') : renderFormatRupiah(bcwp, 'Rp.')
: '-'
: <SingleTextLoader width={100} height={10} /> : <SingleTextLoader width={100} height={10} />
} }
</Col> </Col>
</Row> </Row>
<Row> <Row>

30
src/views/Pages/Login/Login.js

@ -5,7 +5,7 @@ import "slick-carousel/slick/slick-theme.css";
import Slider from "react-slick"; import Slider from "react-slick";
import { Spin } from 'antd'; import { Spin } from 'antd';
import { Checkbox } from 'antd'; import { Checkbox } from 'antd';
import { LoadingOutlined } from '@ant-design/icons'; import { LoadingOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';
import { import {
Button, Button,
Card, Card,
@ -64,11 +64,19 @@ class Login extends Component {
validate: { validate: {
emailState: '', emailState: '',
}, },
loader: false loader: false,
type: 'password'
} }
this.handleChange = this.handleChange.bind(this); this.handleChange = this.handleChange.bind(this);
this.showHide = this.showHide.bind(this);
}
showHide(e) {
e.preventDefault();
e.stopPropagation();
this.setState({
type: this.state.type === 'input' ? 'password' : 'input'
})
} }
validateEmail(e) { validateEmail(e) {
const emailRex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; const emailRex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const { validate } = this.state const { validate } = this.state
@ -163,7 +171,9 @@ class Login extends Component {
window.localStorage.setItem('user_name', data_user.name); window.localStorage.setItem('user_name', data_user.name);
window.localStorage.setItem('role_id', data_user.role_id); window.localStorage.setItem('role_id', data_user.role_id);
} else { } else {
NotificationManager.error('Cek username atau password anda!', 'Gagal Login!'); console.log("kode : ", doLogin.data.code);
// NotificationManager.error('Cek username atau password anda!', 'Gagal Login!');
NotificationManager.error(doLogin.data.message, 'Login Failed!');
this.setState({ loader: false }); this.setState({ loader: false });
} }
@ -286,15 +296,23 @@ class Login extends Component {
<i className="icon-lock"></i> <i className="icon-lock"></i>
</InputGroupText> </InputGroupText>
</InputGroupAddon> </InputGroupAddon>
<Input <Input
type="password" type={this.state.type}
name="password" name="password"
id="examplePassword" id="examplePassword"
placeholder="********" placeholder="********"
value={password} value={password}
onChange={(e) => this.setState({ password: e.target.value })} onChange={(e) => this.setState({ password: e.target.value })}
/> />
<InputGroupAddon addonType="prepend">
<InputGroupText
onClick={this.showHide}
>
{this.state.type === 'input' ? <EyeOutlined /> : <EyeInvisibleOutlined />}
</InputGroupText>
</InputGroupAddon>
<span className="password__show" ></span>
</InputGroup> </InputGroup>
<Row> <Row>
<Col xs="8"> <Col xs="8">

8
src/views/SimproV2/CreatedProyek/DialogDocument.js

@ -119,7 +119,7 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
if (fileExt == "pdf" || fileExt == "png" || fileExt == "jpg" || fileExt == "jpeg" || fileExt == "gif") { if (fileExt == "pdf" || fileExt == "png" || fileExt == "jpg" || fileExt == "jpeg" || fileExt == "gif") {
return ( return (
<Tooltip title="View Document"> <Tooltip title="View Document">
<Button size="small" size={"sm"} color='info' style={{color: "#FFFFFF"}} onClick={() => handleShow(file)}><i className="fa fa-eye"></i></Button> <Button size={"sm"} color='info' style={{ color: "#FFFFFF" }} onClick={() => handleShow(file)}><i className="fa fa-eye"></i></Button>
</Tooltip> </Tooltip>
) )
} }
@ -134,13 +134,13 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
render: (text, record) => render: (text, record) =>
<> <>
{!record.isDir && <Tooltip title="Delete Document"> {!record.isDir && <Tooltip title="Delete Document">
<Button size="small" size={"sm"} color='danger' onClick={() => handleDelete(text.id)}><i className="fa fa-trash"></i></Button> <Button size={"sm"} color='danger' onClick={() => handleDelete(text.id)}><i className="fa fa-trash"></i></Button>
</Tooltip>}{" "} </Tooltip>}{" "}
{record.isDir && <Tooltip title="Delete Folder"> {record.isDir && <Tooltip title="Delete Folder">
<Button size="small" size={"sm"} color='danger' onClick={() => handleDeleteFolder(text.id)}><i className="fa fa-trash"></i></Button> <Button size={"sm"} color='danger' onClick={() => handleDeleteFolder(text.id)}><i className="fa fa-trash"></i></Button>
</Tooltip>}{" "} </Tooltip>}{" "}
{!record.isDir && <Tooltip title="Download Document"> {!record.isDir && <Tooltip title="Download Document">
<Button size="small" size={"sm"} color='primary' onClick={() => handleDownload(text.id)}><i className="fa fa-download"></i></Button> <Button size={"sm"} color='primary' onClick={() => handleDownload(text.id)}><i className="fa fa-download"></i></Button>
</Tooltip>}{" "} </Tooltip>}{" "}
{record.isDir && <Tooltip title="New Folder"> {record.isDir && <Tooltip title="New Folder">
<Button size="sm" color="success" onClick={() => handleNewFolderParent(record.id)}><i className="fa fa-folder"></i></Button> <Button size="sm" color="success" onClick={() => handleNewFolderParent(record.id)}><i className="fa fa-folder"></i></Button>

Loading…
Cancel
Save