Browse Source

Merge branch 'general' of https://git.oslog.id/ordo/adw-frontend

pull/2/head
root 11 months ago
parent
commit
16c364b1f3
  1. 25
      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

25
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,7 +1150,8 @@ const DashboardProject = () => {
</div> </div>
</div> </div>
</Col> </Col>
{/* <Col span={16}> {isScurve === true ? (
<Col span={16}>
<div <div
style={{ style={{
border: "solid", border: "solid",
@ -1366,7 +1374,8 @@ const DashboardProject = () => {
</div> </div>
</div> </div>
</div> </div>
</Col> */} </Col>
) : ''}
</Row> </Row>
<div <div
style={{ style={{
@ -1553,7 +1562,8 @@ const DashboardProject = () => {
</Row> </Row>
</Col> </Col>
</Row> </Row>
{/* <Row> <Row>
{isScurve === true ? (
<Col span={24}> <Col span={24}>
<div <div
style={{ style={{
@ -1565,12 +1575,12 @@ const DashboardProject = () => {
marginBottom: 5, marginBottom: 5,
marginRight: 2, marginRight: 2,
}} }}
> */} >
{/* <div style={{color: '#000000', textAlign: 'center', marginBottom: 10, fontWeight: 'bold', fontSize: 12}}>Health By Schedule</div> {/* <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={{backgroundColor: '#52AC0B', color: '#FFFFFF', padding: 5, borderRadius: 10, marginBottom: 10}}>
<div style={{textAlign: 'center', fontWeight: 500, fontSize: 12}}>On Budget</div> <div style={{textAlign: 'center', fontWeight: 500, fontSize: 12}}>On Budget</div>
</div> */} </div> */}
{/* <Row> <Row>
<Col span={12}>Total Invoice</Col> <Col span={12}>Total Invoice</Col>
<Col span={12} style={{ textAlign: "right" }}> <Col span={12} style={{ textAlign: "right" }}>
{isReadyIntegrationInvoice ? ( {isReadyIntegrationInvoice ? (
@ -1626,7 +1636,8 @@ const DashboardProject = () => {
</Row> </Row>
</div> </div>
</Col> </Col>
</Row> */} ):''}
</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