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')
}
const result = await axios.post(URL, payload, HEADER).then(res => res).catch(err => err.response)
console.log('getSCurve', result);
if (!result) {
NotificationManager.error(`Could not connect to internet.`, "Failed");
setIsReadySCurve(true);
@ -254,7 +253,6 @@ const DashboardProject = () => {
return;
}
else if (result.status == 200 && result.data.data) {
// console.log()
if (result.data.data.data) {
let total_invoice = result.data.data.data.total_invoice_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={5} style={{ fontSize: 11 }}>
{isReadySCurve ?
plannedCost !== null && bcwp !== null ?
plannedCost > bcwp ? renderFormatRupiah(plannedCost, 'Rp.') : renderFormatRupiah(bcwp, 'Rp.')
: '-'
: <SingleTextLoader width={100} height={10} />
}
</Col>
</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 { Spin } from 'antd';
import { Checkbox } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
import { LoadingOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';
import {
Button,
Card,
@ -64,11 +64,19 @@ class Login extends Component {
validate: {
emailState: '',
},
loader: false
loader: false,
type: 'password'
}
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) {
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
@ -163,7 +171,9 @@ class Login extends Component {
window.localStorage.setItem('user_name', data_user.name);
window.localStorage.setItem('role_id', data_user.role_id);
} 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 });
}
@ -286,15 +296,23 @@ class Login extends Component {
<i className="icon-lock"></i>
</InputGroupText>
</InputGroupAddon>
<Input
type="password"
type={this.state.type}
name="password"
id="examplePassword"
placeholder="********"
value={password}
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>
<Row>
<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") {
return (
<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>
)
}
@ -134,13 +134,13 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
render: (text, record) =>
<>
{!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>}{" "}
{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>}{" "}
{!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>}{" "}
{record.isDir && <Tooltip title="New Folder">
<Button size="sm" color="success" onClick={() => handleNewFolderParent(record.id)}><i className="fa fa-folder"></i></Button>

Loading…
Cancel
Save