Browse Source

Merge pull request 'Dev-Farhan' (#144) from Dev-Farhan into general

Reviewed-on: ordo/adw-frontend#144
pull/2/head
farhantock 1 year ago
parent
commit
13515c12d4
  1. 177
      src/views/Dashboard/DashboardProject.js
  2. 14
      src/views/Master/MasterMenu/index.js
  3. 12
      src/views/Master/MasterRoles/index.js
  4. 17
      src/views/Master/ProjectPhase/index.js
  5. 1
      src/views/Pages/Login/Login.js
  6. 13
      src/views/SimproV2/ChecklistK3/index.js
  7. 17
      src/views/SimproV2/Divisi/index.js
  8. 18
      src/views/SimproV2/Satuan/index.js

177
src/views/Dashboard/DashboardProject.js

@ -126,6 +126,7 @@ const DashboardProject = () => {
const [isReadyGanttParents, setIsReadyGanttParents] = useState(false); const [isReadyGanttParents, setIsReadyGanttParents] = useState(false);
const [calculationStatus, setCalculationStatus] = useState(false); const [calculationStatus, setCalculationStatus] = useState(false);
const [isHierarchy, setIsHierarchy] = useState(false); const [isHierarchy, setIsHierarchy] = useState(false);
const [isScurve, setIsScurve] = useState(false);
let history = useHistory(); let history = useHistory();
useEffect(() => { useEffect(() => {
@ -136,6 +137,12 @@ const DashboardProject = () => {
getComments(); getComments();
getGantt(); getGantt();
getGanttParents(); getGanttParents();
const currentURL = window.location.href;
if (currentURL.includes("dashboard-project")) {
setIsScurve(true);
} else {
setIsScurve(false);
}
return () => { return () => {
console.log("unmount RenderMap"); console.log("unmount RenderMap");
}; };
@ -1018,7 +1025,7 @@ const DashboardProject = () => {
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span={24}> <Col span={isScurve === true ? 8 : 10}>
<div <div
style={{ style={{
border: "solid", border: "solid",
@ -1143,16 +1150,17 @@ const DashboardProject = () => {
</div> </div>
</div> </div>
</Col> </Col>
{/* <Col span={16}> {isScurve === true ? (
<div <Col span={16}>
style={{ <div
border: "solid", style={{
borderWidth: 1, border: "solid",
borderColor: "#DDDDDD", borderWidth: 1,
padding: 10, borderColor: "#DDDDDD",
margin: 2, padding: 10,
}} margin: 2,
> }}
>
<div <div
style={{ style={{
display: "flex", display: "flex",
@ -1366,7 +1374,8 @@ const DashboardProject = () => {
</div> </div>
</div> </div>
</div> </div>
</Col> */} </Col>
) : ''}
</Row> </Row>
<div <div
style={{ style={{
@ -1553,80 +1562,82 @@ const DashboardProject = () => {
</Row> </Row>
</Col> </Col>
</Row> </Row>
{/* <Row> <Row>
<Col span={24}> {isScurve === true ? (
<div <Col span={24}>
style={{ <div
backgroundColor: "#FFFFFF", style={{
padding: 10, backgroundColor: "#FFFFFF",
border: "solid", padding: 10,
borderWidth: 1, border: "solid",
borderColor: "#DDDDDD", borderWidth: 1,
marginBottom: 5, borderColor: "#DDDDDD",
marginRight: 2, marginBottom: 5,
}} marginRight: 2,
> */} }}
{/* <div style={{color: '#000000', textAlign: 'center', marginBottom: 10, fontWeight: 'bold', fontSize: 12}}>Health By Schedule</div> >
<div style={{backgroundColor: '#52AC0B', color: '#FFFFFF', padding: 5, borderRadius: 10, marginBottom: 10}}> {/* <div style={{color: '#000000', textAlign: 'center', marginBottom: 10, fontWeight: 'bold', fontSize: 12}}>Health By Schedule</div>
<div style={{textAlign: 'center', fontWeight: 500, fontSize: 12}}>On Budget</div> <div style={{backgroundColor: '#52AC0B', color: '#FFFFFF', padding: 5, borderRadius: 10, marginBottom: 10}}>
</div> */} <div style={{textAlign: 'center', fontWeight: 500, fontSize: 12}}>On Budget</div>
{/* <Row> </div> */}
<Col span={12}>Total Invoice</Col> <Row>
<Col span={12} style={{ textAlign: "right" }}> <Col span={12}>Total Invoice</Col>
{isReadyIntegrationInvoice ? ( <Col span={12} style={{ textAlign: "right" }}>
totalInvoice ? ( {isReadyIntegrationInvoice ? (
renderFormatRupiah(totalInvoice, "Rp.") totalInvoice ? (
renderFormatRupiah(totalInvoice, "Rp.")
) : (
"-"
)
) : ( ) : (
"-" <SingleTextLoader width={100} height={10} />
) )}
) : ( </Col>
<SingleTextLoader width={100} height={10} /> </Row>
)} <Row>
</Col> <Col span={12}>Cash In</Col>
</Row> <Col span={12} style={{ textAlign: "right" }}>
<Row> {isReadyIntegrationInvoice ? (
<Col span={12}>Cash In</Col> cashIn ? (
<Col span={12} style={{ textAlign: "right" }}> renderFormatRupiah(cashIn, "Rp.")
{isReadyIntegrationInvoice ? ( ) : (
cashIn ? ( "-"
renderFormatRupiah(cashIn, "Rp.") )
) : ( ) : (
"-" <SingleTextLoader width={100} height={10} />
) )}
) : ( </Col>
<SingleTextLoader width={100} height={10} /> </Row>
)} <Row>
</Col> <Col span={24}>
</Row> <hr style={{ margin: 2 }} />
<Row> </Col>
<Col span={24}> </Row>
<hr style={{ margin: 2 }} /> <Row>
</Col> <Col span={12}>Outstanding Balance</Col>
</Row> <Col
<Row> span={12}
<Col span={12}>Outstanding Balance</Col> style={{
<Col textAlign: "right",
span={12} color: "#E80053",
style={{ fontWeight: 500,
textAlign: "right", }}
color: "#E80053", >
fontWeight: 500, {isReadyIntegrationInvoice ? (
}} outstandingBalance ? (
> renderFormatRupiah(outstandingBalance, "Rp.")
{isReadyIntegrationInvoice ? ( ) : (
outstandingBalance ? ( "-"
renderFormatRupiah(outstandingBalance, "Rp.") )
) : ( ) : (
"-" <SingleTextLoader width={100} height={10} />
) )}
) : ( </Col>
<SingleTextLoader width={100} height={10} /> </Row>
)} </div>
</Col> </Col>
</Row> ):''}
</div> </Row>
</Col>
</Row> */}
<Row> <Row>
<Col span={24}> <Col span={24}>
<div <div

14
src/views/Master/MasterMenu/index.js

@ -11,6 +11,7 @@ import { Pagination, Tooltip, Table } from 'antd';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const token = window.localStorage.getItem('token'); const token = window.localStorage.getItem('token');
const company_id = window.localStorage.getItem('company_id'); const company_id = window.localStorage.getItem('company_id');
const role_name = window.localStorage.getItem('role_name');
const column = [ const column = [
{ name: "Nama" }, { name: "Nama" },
{ name: "Url" }, { name: "Url" },
@ -94,8 +95,7 @@ const Index = ({ params }) => {
const payload = { const payload = {
"paging": { "start": start, "length": rowsPerPage }, "paging": { "start": start, "length": rowsPerPage },
"columns": [ "columns": [
{ "name": "name", "logic_operator": "ilike", "value": search, "operator": "AND" }, { "name": "name", "logic_operator": "ilike", "value": search, "operator": "AND" }
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
], ],
"joins": [{ "joins": [{
"name": "m_menu", "name": "m_menu",
@ -106,6 +106,16 @@ const Index = ({ params }) => {
}], }],
"orders": { "columns": ["id"], "ascending": false } "orders": { "columns": ["id"], "ascending": false }
} }
if (role_name !== "Super Admin") {
payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
)
} else {
payload.columns.push(
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" },
)
}
const result = await axios const result = await axios
.post(MENU_SEARCH, payload, config) .post(MENU_SEARCH, payload, config)

12
src/views/Master/MasterRoles/index.js

@ -13,6 +13,7 @@ import { withTranslation } from 'react-i18next';
const token = window.localStorage.getItem('token'); const token = window.localStorage.getItem('token');
const company_id = window.localStorage.getItem('company_id'); const company_id = window.localStorage.getItem('company_id');
const role_name = window.localStorage.getItem('role_name');
const BASE_URL = "http://siopas.co.id/custom-php/api/geohr/"; const BASE_URL = "http://siopas.co.id/custom-php/api/geohr/";
@ -112,12 +113,19 @@ class index extends Component {
"paging": { "start": start, "length": this.state.rowsPerPage }, "paging": { "start": start, "length": this.state.rowsPerPage },
"columns": [ "columns": [
{ "name": "name", "logic_operator": "ilike", "value": this.state.search, "operator": "AND" }, { "name": "name", "logic_operator": "ilike", "value": this.state.search, "operator": "AND" },
{ "name": "company_id", "logic_operator": "=", "value": this.state.company_id, "operator": "AND" }
], ],
"joins": [], "joins": [],
"orders": { "columns": ["id"], "ascending": false } "orders": { "columns": ["id"], "ascending": false }
} }
if (role_name !== "Super Admin") {
formData.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": this.state.company_id, "operator": "AND" },
)
} else {
formData.columns.push(
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" },
)
}
const result = await axios const result = await axios
.post(ROLE_SEARCH, formData, config) .post(ROLE_SEARCH, formData, config)
.then(res => res) .then(res => res)

17
src/views/Master/ProjectPhase/index.js

@ -11,6 +11,7 @@ import { Pagination, Button, Tooltip, Table } from 'antd';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const token = window.localStorage.getItem('token'); const token = window.localStorage.getItem('token');
const company_id = window.localStorage.getItem('company_id'); const company_id = window.localStorage.getItem('company_id');
const role_name = window.localStorage.getItem('role_name');
const config = { const config = {
headers: headers:
{ {
@ -76,12 +77,6 @@ const ProjectPhase = ({ params }) => {
"logic_operator": "ilike", "logic_operator": "ilike",
"value": search, "value": search,
"operator": "AND" "operator": "AND"
},
{
"name": "company_id",
"logic_operator": "=",
"value": company_id,
"operator": "AND"
} }
], ],
"orders": { "orders": {
@ -95,7 +90,15 @@ const ProjectPhase = ({ params }) => {
"start": start "start": start
} }
} }
// let url = `${BASE_OSPRO}/api/project-phase/list?start=${start}&length=${rowsPerPage}&orderby=id&asc=false&column=name&logic=ilike&value=${search}` if (role_name !== "Super Admin") {
payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
)
} else {
payload.columns.push(
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" },
)
}
const result = await axios const result = await axios
.post(PROJECT_PHASE_SEARCH, payload, HEADER) .post(PROJECT_PHASE_SEARCH, payload, HEADER)
.then((res) => res) .then((res) => res)

1
src/views/Pages/Login/Login.js

@ -216,6 +216,7 @@ 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);
window.localStorage.setItem('company_id', data_user.company_id); window.localStorage.setItem('company_id', data_user.company_id);
window.localStorage.setItem('role_name', data_user.role.name);
} else { } else {
console.log("kode : ", doLogin.data.code); console.log("kode : ", doLogin.data.code);
// NotificationManager.error('Cek username atau password anda!', 'Gagal Login!'); // NotificationManager.error('Cek username atau password anda!', 'Gagal Login!');

13
src/views/SimproV2/ChecklistK3/index.js

@ -12,6 +12,8 @@ import {
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
const token = window.localStorage.getItem('token'); const token = window.localStorage.getItem('token');
const role_name = window.localStorage.getItem('role_name');
const company_id = window.localStorage.getItem('company_id');
const config = { const config = {
headers: headers:
{ {
@ -87,6 +89,17 @@ const ChecklistK3 = ({ params }) => {
"start": start "start": start
} }
} }
if (role_name !== "Super Admin") {
payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
)
} else {
payload.columns.push(
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" },
)
}
const result = await axios const result = await axios
.post(CHECKLIST_K3_SEARCH, payload, config) .post(CHECKLIST_K3_SEARCH, payload, config)
.then(res => res) .then(res => res)

17
src/views/SimproV2/Divisi/index.js

@ -13,6 +13,7 @@ const url = "";
const proyek_id = localStorage.getItem('proyek_id'); const proyek_id = localStorage.getItem('proyek_id');
const role_id = localStorage.getItem('role_id'); const role_id = localStorage.getItem('role_id');
const company_id = localStorage.getItem("company_id") const company_id = localStorage.getItem("company_id")
const role_name = window.localStorage.getItem('role_name');
const format = "DD-MM-YYYY"; const format = "DD-MM-YYYY";
const token = window.localStorage.getItem('token'); const token = window.localStorage.getItem('token');
const config = { const config = {
@ -97,12 +98,6 @@ const ProjectType = ({ params }) => {
value: search, value: search,
operator: "AND" operator: "AND"
}, },
{
name: "company_id",
logic_operator: "=",
value: company_id,
operator: "AND"
}
], ],
"orders": { "orders": {
"ascending": true, "ascending": true,
@ -115,6 +110,16 @@ const ProjectType = ({ params }) => {
"start": start "start": start
} }
} }
if (role_name !== "Super Admin") {
payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
)
} else {
payload.columns.push(
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" },
)
}
const result = await axios const result = await axios
.post(DIVISI_SEARCH, payload, HEADER) .post(DIVISI_SEARCH, payload, HEADER)
.then(res => res) .then(res => res)

18
src/views/SimproV2/Satuan/index.js

@ -11,6 +11,7 @@ import { useTranslation } from 'react-i18next';
const token = window.localStorage.getItem('token'); const token = window.localStorage.getItem('token');
const company_id = window.localStorage.getItem('company_id'); const company_id = window.localStorage.getItem('company_id');
const role_name = window.localStorage.getItem('role_name');
const config = { const config = {
headers: headers:
{ {
@ -74,12 +75,6 @@ const Satuan = ({ params }) => {
"logic_operator": "ilike", "logic_operator": "ilike",
"value": search, "value": search,
"operator": "AND" "operator": "AND"
},
{
"name": "company_id",
"logic_operator": "=",
"value": company_id,
"operator": "AND"
} }
], ],
"orders": { "orders": {
@ -94,6 +89,17 @@ const Satuan = ({ params }) => {
} }
} }
if (role_name !== "Super Admin") {
payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
)
} else {
payload.columns.push(
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" },
)
}
const result = await axios const result = await axios
.post(SATUAN_SEARCH, payload, config) .post(SATUAN_SEARCH, payload, config)
.then(res => res) .then(res => res)

Loading…
Cancel
Save