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

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

@ -11,6 +11,7 @@ import { Pagination, Tooltip, Table } from 'antd';
import { useTranslation } from 'react-i18next';
const token = window.localStorage.getItem('token');
const company_id = window.localStorage.getItem('company_id');
const role_name = window.localStorage.getItem('role_name');
const column = [
{ name: "Nama" },
{ name: "Url" },
@ -94,8 +95,7 @@ const Index = ({ params }) => {
const payload = {
"paging": { "start": start, "length": rowsPerPage },
"columns": [
{ "name": "name", "logic_operator": "ilike", "value": search, "operator": "AND" },
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
{ "name": "name", "logic_operator": "ilike", "value": search, "operator": "AND" }
],
"joins": [{
"name": "m_menu",
@ -106,6 +106,16 @@ const Index = ({ params }) => {
}],
"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
.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 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/";
@ -112,12 +113,19 @@ class index extends Component {
"paging": { "start": start, "length": this.state.rowsPerPage },
"columns": [
{ "name": "name", "logic_operator": "ilike", "value": this.state.search, "operator": "AND" },
{ "name": "company_id", "logic_operator": "=", "value": this.state.company_id, "operator": "AND" }
],
"joins": [],
"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
.post(ROLE_SEARCH, formData, config)
.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';
const token = window.localStorage.getItem('token');
const company_id = window.localStorage.getItem('company_id');
const role_name = window.localStorage.getItem('role_name');
const config = {
headers:
{
@ -76,12 +77,6 @@ const ProjectPhase = ({ params }) => {
"logic_operator": "ilike",
"value": search,
"operator": "AND"
},
{
"name": "company_id",
"logic_operator": "=",
"value": company_id,
"operator": "AND"
}
],
"orders": {
@ -95,7 +90,15 @@ const ProjectPhase = ({ params }) => {
"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
.post(PROJECT_PHASE_SEARCH, payload, HEADER)
.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('role_id', data_user.role_id);
window.localStorage.setItem('company_id', data_user.company_id);
window.localStorage.setItem('role_name', data_user.role.name);
} else {
console.log("kode : ", doLogin.data.code);
// 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';
const token = window.localStorage.getItem('token');
const role_name = window.localStorage.getItem('role_name');
const company_id = window.localStorage.getItem('company_id');
const config = {
headers:
{
@ -87,6 +89,17 @@ const ChecklistK3 = ({ params }) => {
"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
.post(CHECKLIST_K3_SEARCH, payload, config)
.then(res => res)

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

@ -13,6 +13,7 @@ const url = "";
const proyek_id = localStorage.getItem('proyek_id');
const role_id = localStorage.getItem('role_id');
const company_id = localStorage.getItem("company_id")
const role_name = window.localStorage.getItem('role_name');
const format = "DD-MM-YYYY";
const token = window.localStorage.getItem('token');
const config = {
@ -97,12 +98,6 @@ const ProjectType = ({ params }) => {
value: search,
operator: "AND"
},
{
name: "company_id",
logic_operator: "=",
value: company_id,
operator: "AND"
}
],
"orders": {
"ascending": true,
@ -115,6 +110,16 @@ const ProjectType = ({ params }) => {
"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
.post(DIVISI_SEARCH, payload, HEADER)
.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 company_id = window.localStorage.getItem('company_id');
const role_name = window.localStorage.getItem('role_name');
const config = {
headers:
{
@ -74,12 +75,6 @@ const Satuan = ({ params }) => {
"logic_operator": "ilike",
"value": search,
"operator": "AND"
},
{
"name": "company_id",
"logic_operator": "=",
"value": company_id,
"operator": "AND"
}
],
"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
.post(SATUAN_SEARCH, payload, config)
.then(res => res)

Loading…
Cancel
Save