Commit 3e5e08b3 authored by Internship UKSW 2019's avatar Internship UKSW 2019

Initial commit

parent dbbe60b5
......@@ -16,7 +16,7 @@
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.1/jspdf.debug.js" integrity="sha384-THVO/sM0mFD9h7dfSndI6TS0PgAGavwKvB5hAxRRvc0o9cPLohB0wb/PTA7LdUHs" crossorigin="anonymous"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.1/jspdf.debug.js" integrity="sha384-THVO/sM0mFD9h7dfSndI6TS0PgAGavwKvB5hAxRRvc0o9cPLohB0wb/PTA7LdUHs" crossorigin="anonymous"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js"></script>
<script src="//tinymce.cachefly.net/4.2/tinymce.min.js"></script>
......
......@@ -7,7 +7,7 @@ const ApproverDocumentRoute = ({ component: Component, ...rest }) => {
{...rest}
render={
props =>
localStorage.getItem("user") && (
localStorage.getItem("dataLDAP") && (
JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Approver") ||
JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Additional Approver") ||
JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Compliance Officer") ||
......
......@@ -7,7 +7,7 @@ const CreatorDocumentRoute = ({ component: Component, ...rest }) => {
{...rest}
render={
props =>
localStorage.getItem("user") && JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Creator") ? (
localStorage.getItem("dataLDAP") && JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Creator") ? (
<Component {...props} />
) : (
<Redirect to={{ pathname: '/', state: { from: props.location } }} />
......
......@@ -226,25 +226,6 @@ class FormCreate extends Component {
e.preventDefault();
let data = tableReference.row($(this).parents("tr")).data();
window.open("http://10.10.86.48:3000/previewdocument?subject=" + data[1], "_blank");
// let listReference = document.getElementsByName("listReference[]");
// for (let i = 0; i < listReference.length; i++) {
// if (listReference[i].value == data[1]) {
// if (listReference[i].checked) {
// listReference[i].checked = false;
// let j = self.state.copyReferences.indexOf(listReference[i].value);
// self.state.copyReferences.splice(j, 1);
// if (self.state.copyReferences.length == 0) {
// self.state.validAddReference = false;
// }
// } else {
// listReference[i].checked = true;
// self.state.copyReferences.push(listReference[i].value);
// self.state.validAddReference = true;
// }
// self.setState({ validAddReference: self.state.validAddReference });
// break;
// }
// }
})
} catch (err) {
console.log(err + "");
......@@ -879,7 +860,7 @@ class FormCreate extends Component {
"emailcc": JSON.parse(localStorage.getItem("dataLogin")).email[0],
"emailsend": dataApprover[0].EMail[0],
"message": "<p>Dengan hormat,</p> \
<p>Terdapat pengajuan dokumen dengan No." + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + " " + this.state.subject + " yang diajukan oleh " + JSON.parse(localStorage.getItem("user"))["Full Name"] + ".<br /> Untuk review dan approval silahkan klik link berikut ini <a href='http://10.10.86.48:3000' target='_blank'>Link Dokumen</a></p> \
<p>Terdapat pengajuan dokumen dengan No." + this.state.businessUnit + "-" + this.state.documentType + "-" + this.state.revisionCode + " " + this.state.subject + " yang diajukan oleh " + JSON.parse(localStorage.getItem("dataLDAP"))["Full Name"] + ".<br /> Untuk review dan approval silahkan klik link berikut ini <a href='http://10.10.86.48:3000' target='_blank'>Link Dokumen</a></p> \
<p>Terimakasih</p> \
<p>Regards,</p> \
<p>Admin</p><br /> \
......
......@@ -50,7 +50,6 @@ class FormLogin extends Component {
dataUser = result.user_dataCollection.user_data;
})
if (dataUser != undefined) {
localStorage.setItem('dataLDAP', JSON.stringify(responseDataLoginLDAP.data));
localStorage.setItem('dataLogin', JSON.stringify(dataUser[0]));
let store = createStore(sessionReducer);
let todoAction = { type: "add_session", payload: responseDataLoginLDAP.data };
......@@ -63,27 +62,6 @@ class FormLogin extends Component {
} catch (error) {
this.setState({ isLoginFailed: true, loggingIn: false, errMessage: "" + error })
}
// let URLItop = "http://10.10.88.182:8280/services/VionaApi/auth";
// fetch(URLItop, {
// method: "GET",
// headers: {
// "Authorization": "Basic " + Buffer.from(this.state.username + ":" + this.state.password).toString("base64")
// }
// })
// .then(response => response.json())
// .then((response) => {
// //console.log("res", response.values)
// if (response.message == "Operation success") {
// let store = createStore(sessionReducer);
// let todoAction = { type: "add_session", payload: response.values };
// store.dispatch(todoAction);
// this.props.history.push("/home");
// } else if (response.message == "Invalid username / password") {
// this.setState({ isLoginFailed: true, loggingIn: false, errMessage: "Username or Password is Invalid!" })
// }
// }).catch((err) => {
// this.setState({ isLoginFailed: true, loggingIn: false, errMessage: "" + err })
// })
}
}
render() {
......
......@@ -15,7 +15,6 @@ class Home extends Component {
}
}
componentDidMount = async () => {
console.log(JSON.parse(localStorage.getItem("dataLogin")).email[0]);
try {
let response = await axios.get(process.env.REACT_APP_MAIN_APIURL + '/DocumentManagement/home', { headers: { 'accept': 'application/xml' } })
var parseString = require('xml2js').parseString;
......
......@@ -7,7 +7,7 @@ const ManageUserRoute = ({ component: Component, ...rest }) => {
{...rest}
render={
props =>
localStorage.getItem("user") && JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Admin") ? (
localStorage.getItem("dataLDAP") && JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Admin") ? (
<Component {...props} />
) : (
<Redirect to={{ pathname: '/', state: { from: props.location } }} />
......
import React, { useState, Component } from 'react';
import { Collapse, Navbar, NavbarToggler, NavbarBrand, Nav, NavItem, NavLink, UncontrolledDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
import SvgIcon from '@material-ui/core/SvgIcon';
import Avatar from 'react-avatar-edit';
class Navbar1 extends Component {
constructor(props) {
......@@ -34,7 +33,6 @@ class Navbar1 extends Component {
this.props.history.push("/");
}
render() {
const session = JSON.parse(localStorage.getItem("user"))
return (
<div>
<div className="modal fade" id="myModal" role="dialog">
......@@ -48,7 +46,7 @@ class Navbar1 extends Component {
</div>
<div className="modal-body">
<div className="row">
<div className="col-xl-8 col-lg-8 col-md-8 col-sm-8">
<div className="col-xl-12 col-lg-12 col-md-12 col-sm-12">
<div className="form-group row">
<div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
<label className="control-label">Username</label>
......@@ -100,32 +98,6 @@ class Navbar1 extends Component {
</div>
</div>
</div>
<div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
<a href="#" onClick={(e) => this.handleImageClick(e)}>
<img src={(this.state.preview == null ? "add-image-profile.png" : this.state.preview)} data-toggle="modal" data-target="#Modal" width="200px" height="200px" alt="Image Upload" />
</a>
<div className="modal fade" id="Modal" role="dialog">
<div className="modal-dialog modal-md">
<div className="modal-header">
<h4 className="modal-title">Upload Image</h4>
<div className="text-right">
<button type="button" className="close">&times;</button>
</div>
</div>
<div className="modal-content">
<div className="modal-body">
<Avatar
width={460}
height={350}
onCrop={this.onCrop}
onClose={this.onClose}
src={this.state.preview}
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -174,7 +146,7 @@ class Navbar1 extends Component {
<SvgIcon>
<path fill="#000000" d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z" />
</SvgIcon>&nbsp;
<label className="text-light">Welcome {session["Full Name"]}</label>
<label className="text-light">Welcome {JSON.parse(localStorage.getItem("dataLDAP"))["Full Name"]}</label>
</DropdownToggle>
<DropdownMenu right>
<DropdownItem>
......@@ -202,157 +174,4 @@ class Navbar1 extends Component {
}
}
// const Navbar2 = (props) => {
// const handleSignOut = () => {
// localStorage.removeItem("user")
// this.props.history.push("/")
// }
// const session = JSON.parse(localStorage.getItem("user"))
// const [isOpen, setIsOpen] = useState(false);
// const toggle = () => setIsOpen(!isOpen);
// return (
// <div>
// <div className="modal fade" id="myModal" role="dialog">
// <div className="modal-dialog modal-lg">
// <div className="modal-content">
// <div className="modal-header">
// <h4 className="modal-title">Profile</h4>
// <div className="text-right">
// <button type="button" className="close" data-dismiss="modal">&times;</button>
// </div>
// </div>
// <div className="modal-body">
// <div className="row">
// <div className="col-xl-8 col-lg-8 col-md-8 col-sm-8">
// <div className="form-group row">
// <div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
// <label className="control-label">Username</label>
// </div>
// <div className="col-xl-8 col-lg-8 col-md-8 col-sm-8">: &nbsp;
// {
// JSON.parse(localStorage.getItem('dataLogin')).user_name[0]
// }
// </div>
// </div>
// <div className="form-group row">
// <div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
// <label className="control-label">Role</label>
// </div>
// <div className="col-xl-8 col-lg-8 col-md-8 col-sm-8">: &nbsp;
// {
// JSON.parse(localStorage.getItem('dataLogin')).user_role[0]
// }
// </div>
// </div>
// <div className="form-group row">
// <div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
// <label className="control-label">Department</label>
// </div>
// <div className="col-xl-8 col-lg-8 col-md-8 col-sm-8">: &nbsp;
// {
// JSON.parse(localStorage.getItem('dataLogin')).user_dpt[0]
// }
// </div>
// </div>
// <div className="form-group row">
// <div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
// <label className="control-label">Manager Name</label>
// </div>
// <div className="col-xl-8 col-lg-8 col-md-8 col-sm-8">: &nbsp;
// {
// JSON.parse(localStorage.getItem('dataLogin')).manager_name[0]
// }
// </div>
// </div>
// <div className="form-group row">
// <div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
// <label className="control-label">Email</label>
// </div>
// <div className="col-xl-8 col-lg-8 col-md-8 col-sm-8">: &nbsp;
// {
// JSON.parse(localStorage.getItem('dataLogin')).email[0]
// }
// </div>
// </div>
// </div>
// <div className="col-xl-4 col-lg-4 col-md-4 col-sm-4">
// <svg style={{ width: "200px", height: "200px" }} viewBox="0 0 24 24">
// <path fill="currentColor" d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7.07,18.28C7.5,17.38 10.12,16.5 12,16.5C13.88,16.5 16.5,17.38 16.93,18.28C15.57,19.36 13.86,20 12,20C10.14,20 8.43,19.36 7.07,18.28M18.36,16.83C16.93,15.09 13.46,14.5 12,14.5C10.54,14.5 7.07,15.09 5.64,16.83C4.62,15.5 4,13.82 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,13.82 19.38,15.5 18.36,16.83M12,6C10.06,6 8.5,7.56 8.5,9.5C8.5,11.44 10.06,13 12,13C13.94,13 15.5,11.44 15.5,9.5C15.5,7.56 13.94,6 12,6M12,11A1.5,1.5 0 0,1 10.5,9.5A1.5,1.5 0 0,1 12,8A1.5,1.5 0 0,1 13.5,9.5A1.5,1.5 0 0,1 12,11Z" />
// </svg>
// </div>
// </div>
// </div>
// </div>
// </div>
// </div>
// <Navbar color="dark" dark expand="lg">
// <NavbarBrand href="#"><img src="logo-visionet.png" alt="visionet" width="140px" height="70px" /></NavbarBrand>
// <NavbarToggler onClick={toggle} />
// <Collapse isOpen={isOpen} navbar>
// <Nav className="mr-auto" navbar>
// <NavItem>
// <NavLink className={"text-" + (props.menu == "home" ? "warning" : "light")} href="/home">
// <SvgIcon>
// <path fill="#000000" d="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z" />
// </SvgIcon> Home
// </NavLink>
// </NavItem>
// {
// (
// JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Approver") ||
// JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Compliance Officer") ||
// JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Creator") ||
// JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Manager Representative")) &&
// <NavItem>
// <NavLink className={"text-" + (props.menu == "yourdocument" ? "warning" : "light")} href="/yourdocument">
// <SvgIcon>
// <path fill="#000000" d="M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z" />
// </SvgIcon> Your Document
// </NavLink>
// </NavItem>
// }
// {
// JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Admin") &&
// <NavItem>
// <NavLink className={"text-" + (props.menu == "manageuser" ? "warning" : "light")} href="/manageuser">
// <SvgIcon>
// <path fill="#000000" d="M10 4C7.79 4 6 5.79 6 8S7.79 12 10 12 14 10.21 14 8 12.21 4 10 4M10 14C5.58 14 2 15.79 2 18V20H11.5C11.17 19.21 11 18.36 11 17.5C11 16.31 11.33 15.15 11.95 14.14C11.32 14.06 10.68 14 10 14M22.77 18.32L21.7 17.5C21.72 17.33 21.74 17.17 21.74 17S21.73 16.67 21.7 16.5L22.76 15.68C22.85 15.6 22.88 15.47 22.82 15.36L21.82 13.63C21.76 13.5 21.63 13.5 21.5 13.5L20.27 14C20 13.82 19.73 13.65 19.42 13.53L19.23 12.21C19.22 12.09 19.11 12 19 12H17C16.87 12 16.76 12.09 16.74 12.21L16.55 13.53C16.25 13.66 15.96 13.82 15.7 14L14.46 13.5C14.35 13.5 14.22 13.5 14.15 13.63L13.15 15.36C13.09 15.47 13.11 15.6 13.21 15.68L14.27 16.5C14.25 16.67 14.24 16.83 14.24 17S14.25 17.33 14.27 17.5L13.21 18.32C13.12 18.4 13.09 18.53 13.15 18.64L14.15 20.37C14.21 20.5 14.34 20.5 14.46 20.5L15.7 20C15.96 20.18 16.24 20.35 16.55 20.47L16.74 21.79C16.76 21.91 16.86 22 17 22H19C19.11 22 19.22 21.91 19.24 21.79L19.43 20.47C19.73 20.34 20 20.18 20.27 20L21.5 20.5C21.63 20.5 21.76 20.5 21.83 20.37L22.83 18.64C22.89 18.53 22.86 18.4 22.77 18.32M18 18.5C17.16 18.5 16.5 17.83 16.5 17S17.17 15.5 18 15.5 19.5 16.17 19.5 17 18.83 18.5 18 18.5Z" />
// </SvgIcon> Manage User
// </NavLink>
// </NavItem>
// }
// </Nav>
// <Nav navbar>
// <UncontrolledDropdown nav inNavbar>
// <DropdownToggle nav caret>
// <SvgIcon>
// <path fill="#000000" d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z" />
// </SvgIcon>&nbsp;
// <label className="text-light">Welcome {session["Full Name"]}</label>
// </DropdownToggle>
// <DropdownMenu right>
// <DropdownItem>
// <NavLink className="text-dark" data-toggle="modal" data-target="#myModal">
// <SvgIcon>
// <path fill="#000000" d="M11 9C11 10.66 9.66 12 8 12C6.34 12 5 10.66 5 9C5 7.34 6.34 6 8 6C9.66 6 11 7.34 11 9M14 20H2V18C2 15.79 4.69 14 8 14C11.31 14 14 15.79 14 18M22 12V14H13V12M22 8V10H13V8M22 4V6H13V4Z" />
// </SvgIcon> Profile
// </NavLink>
// </DropdownItem>
// <DropdownItem divider />
// <DropdownItem>
// <NavLink className="text-dark" href="/" onClick={handleSignOut}>
// <SvgIcon>
// <path fill="#000000" d="M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z" />
// </SvgIcon> Log Out
// </NavLink>
// </DropdownItem>
// </DropdownMenu>
// </UncontrolledDropdown>
// </Nav>
// </Collapse>
// </Navbar>
// </div>
// );
// }
export default Navbar1;
\ No newline at end of file
......@@ -563,50 +563,6 @@ class PreviewDocument extends Component {
</div>
</div>
}
{/* <p>A Canadian with $1,000 a Year Can Live Very Comfortably and Enjoyably in Paris</p>
<p>
But if change were normal he would starve to death. Pleasant hotels are cheap, but at the big tourist hotels they charge you ruinous prices.
Restaurant prices low in terms of dollars. PARIS—Paris in the winter is rainy, cold, beautiful and cheap. It is also noisy, jostling,
crowded and cheap. It is anything you want—and cheap.
</p>
<p>
The dollar, either Canadian or American, is the key to Paris. With the U.S. dollar worth twelve and a half francs and the Canadian dollar
quoted at something over eleven francs, it is a very effective key.
</p>
<p>
Ernest Hemingway, photographed in his Paris apartment, circa 1924. THE HEMINGWAY COLLECTION/JOHN F. KENNEDY PRESIDENTIAL LIBRARY AND MUSEUM
At the present rate of exchange, a Canadian with an income of one thousand dollars a year can live comfortably and enjoyably in Paris.
If exchange were normal the same Canadian would starve to death. Exchange is a wonderful thing.
</p>
<p>Two of us are living in a comfortable hotel in the Rue Jacob. It is just back of the Academy of the Beaux Arts and a few minutes’ walk from the Tuileries. Our room costs twelve francs a day for two. It is clean, light, well heated, has hot and cold running water and a bathroom on the same floor. That makes a cost for rent of thirty dollars a month.</p>
<p>
Breakfast costs us both two francs and a half. That totals seventy-five francs a month, or about six dollars and three or four cents.
At the corner of the Rue Bonaparte and the Rue Jacob there is a splendid restaurant where the prices are à la carte. Soup costs sixty
centimes and a fish is 1.20 francs. The meals are roast beef, veal cutlet, lamb, mutton and thick steaks served with potatoes prepared
as only the French can cook them. These cost 2.40 francs an order. Brussels sprouts in butter, creamed spinach, beans, sifted peas,
and cauliflower vary in price from forty to eighty-five centimes. Salad is sixty centimes. Desserts are seventy-five centimes and
sometimes as much as a franc. Red wine is sixty centimes a bottle and beer is forty centimes a glass.
</p>
<p>
My wife and I have an excellent meal there, equal in cooking and quality of food to the best restaurants in America, for
fifty cents apiece. After dinner you can go anywhere on the subway for four cents in American money or take a bus to
the farthest part of the city for the same amount. It sounds unbelievable but it is simply a case of prices not having
advanced in proportion to the increased value of the dollar.
</p>
<p>
All of Paris is not so cheap, however, for the big hotels located around the Opera and the Madeleine are more expensive than ever.
We ran into two girls from New York the other day in the Luxembourg Gardens. All of us crossed on the same boat, and they had gone to one of
the big, highly advertised hotels. Their rooms were costing them sixty francs a day apiece, and other charges in proportion. For two days
and three nights at their hotel they received a bill for five hundred francs, or forty-two dollars. They are now located in a hotel
on the left bank of the Seine, where five hundred francs will last two weeks instead of two days, and are as comfortable as they
were at the tourist hotel.
</p>
<p>
It is from tourists who stop at the large hotels that the reports come that living in Paris is very high. The big
hotelkeepers charge all they think the traffic can bear. But there are several hundred small hotels in all parts
of Paris where an American or Canadian can live comfortably, eat at attractive restaurants and find
amusement for a total expenditure of two and one half to three dollars a day.
</p> */}
</div>
</div>
}
......
......@@ -7,7 +7,7 @@ const PrivateRoute = ({ component: Component, ...rest }) => {
{...rest}
render={
props =>
localStorage.getItem("user") ? (
localStorage.getItem("dataLDAP") ? (
<Component {...props} />
) : (
<Redirect to={{ pathname: '/', state: { from: props.location } }} />
......
......@@ -7,7 +7,7 @@ const PublishDocumentRoute = ({ component: Component, ...rest }) => {
{...rest}
render={
props =>
localStorage.getItem("user") && JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Compliance Officer") ? (
localStorage.getItem("dataLDAP") && JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Compliance Officer") ? (
<Component {...props} />
) : (
<Redirect to={{ pathname: '/', state: { from: props.location } }} />
......
......@@ -64,7 +64,7 @@ class YourDocument extends Component {
datarow.push(dataAllDocument[i].subject[0]);
datarow.push(dataAllDocument[i].doc_status[0]);
datarow.push(dataRevision[dataRevision.length - 1].status);
datarow.push(JSON.parse(localStorage.getItem("user"))["Full Name"]);
datarow.push(JSON.parse(localStorage.getItem("dataLDAP"))["Full Name"]);
datarow.push(content);
this.state.dataDocument.push(datarow);
}
......
......@@ -7,7 +7,7 @@ const YourDocumentRoute = ({ component: Component, ...rest }) => {
{...rest}
render={
props =>
localStorage.getItem("user") && (
localStorage.getItem("dataLDAP") && (
JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Approver") ||
JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Additional Approver") ||
JSON.parse(localStorage.getItem('dataLogin')).user_role[0].includes("Compliance Officer") ||
......
const session = JSON.parse(localStorage.getItem("user"))
const session = JSON.parse(localStorage.getItem("dataLDAP"));
const initState = {
session
}
const sessionReducer = (state = initState, action) => {
if(action.type == "add_session") {
localStorage.setItem("user", JSON.stringify(action.payload));
state.session = JSON.parse(localStorage.getItem("user"));
localStorage.setItem("dataLDAP", JSON.stringify(action.payload));
state.session = JSON.parse(localStorage.getItem("dataLDAP"));
}
return state;
}
......
Markdown is supported
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