Browse Source

Merge pull request 'dev-wahyun' (#77) from dev-wahyun into staging

Reviewed-on: ibnu/generic-ospro-frontend#77
pull/1/head
farhantock 9 months ago
parent
commit
9f2a268d83
  1. 12
      src/const/ApiConst.js
  2. 1
      src/containers/DefaultLayout/DefaultLayout.js
  3. 31
      src/views/Master/MasterCompany/DialogForm.js
  4. 3
      src/views/Master/MasterCompany/index.js
  5. 24
      src/views/Master/MasterTransaction/index.js
  6. 11
      src/views/Pages/Login/Login.js
  7. 7
      src/views/SimproV2/CreatedProyek/AsignCustProject.js
  8. 8
      src/views/SimproV2/CreatedProyek/AsignHrProject.js
  9. 34
      src/views/SimproV2/CreatedProyek/DialogDocument.js
  10. 2
      src/views/SimproV2/CreatedProyek/DialogFormProyek.js
  11. 24
      src/views/SimproV2/CreatedProyek/DialogGantt.js
  12. 17
      src/views/SimproV2/CreatedProyek/FormDocument.js
  13. 4
      src/views/SimproV2/CreatedProyek/FormFolderDocument.js
  14. 78
      src/views/SimproV2/CreatedProyek/index.js
  15. 6
      src/views/SimproV2/Gantt/GanttFrame.js
  16. 6
      src/views/SimproV2/Gantt/index.js
  17. 2
      src/views/SimproV2/Settings/DialogForm.js
  18. 4
      src/views/SimproV2/Settings/components/MyProfile/Index.js

12
src/const/ApiConst.js

@ -121,11 +121,11 @@ export let BASE_OSPRO = "http://localhost:8444/generic-ospro-backend";
export let BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`;
export let BASE_SIMPRO_LUMEN_IMAGE = `${BASE_OSPRO}/assets/image`;
export let BASE_SIMPRO_LUMEN_FILE = `${BASE_OSPRO}/assets/file/project`;
export let BASE_SIMPRO_LUMEN_FILE_COMPANY = (file, company_name) => {
return `${BASE_OSPRO}/assets/${company_name}/file/project/${file}`;
export let BASE_SIMPRO_LUMEN_FILE_COMPANY = (file, company_name, dateFile) => {
return `${BASE_OSPRO}/assets/${company_name}/${dateFile}/file/project/${file}`;
}
export let BASE_SIMPRO_LUMEN_IMAGE_COMPANY = (file, company_name) => {
return `${BASE_OSPRO}/assets/${company_name}/image/${file}`;
export let BASE_SIMPRO_LUMEN_IMAGE_COMPANY = (file, company_name, dateFile) => {
return `${BASE_OSPRO}/assets/${company_name}/${dateFile}/image/${file}`;
}
export const USERROLE_ADD = `${BASE_SIMPRO}/user-role/add`;
@ -736,8 +736,8 @@ export const FOLDER_DOCUMENT_PROYEK_ADD = `${BASE_SIMPRO_LUMEN}/folder-document-
export const FOLDER_DOCUMENT_PROYEK_SEARCH = `${BASE_SIMPRO_LUMEN}/folder-document-proyek/search`;
export const FOLDER_DOCUMENT_PROYEK_UPDATE = (id) =>
`${BASE_SIMPRO_LUMEN}/folder-document-proyek/update/${id}`;
export const FOLDER_DOCUMENT_PROYEK_DELETE = (id) =>
`${BASE_SIMPRO_LUMEN}/folder-document-proyek/delete/${id}`;
export const FOLDER_DOCUMENT_PROYEK_DELETE = (id, company_id) =>
`${BASE_SIMPRO_LUMEN}/folder-document-proyek/delete/${id}/${company_id}`;
export const FOLDER_DOCUMENT_PROYEK_GET_TREE = (proyek_id) =>
`${BASE_SIMPRO_LUMEN}/folder-document-proyek/get-tree/${proyek_id}`;

1
src/containers/DefaultLayout/DefaultLayout.js

@ -370,6 +370,7 @@ class DefaultLayout extends Component {
token={props.location.state ? props.location.state.token : localStorage.getItem("token")}
menu_login={props.location.state ? props.location.state.menu_login : localStorage.getItem("menu_login")}
user_name={props.location.state ? props.location.state.user_name : localStorage.getItem("user_name")}
configApp={props.location.state ? props.location.state.configApp : localStorage.getItem("configApp")}
{...props}
/>
)} />

31
src/views/Master/MasterCompany/DialogForm.js

@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next';
import axios from "../../../const/interceptorApi"
import moment from 'moment';
import {
USER_SEARCH, MENU_COMPANY_DELETE, USER_DELETE, ROLE_SEARCH, COMPANY_MANAGEMENT_GET_ID, MENU_COMPANY_SEARCH, BASE_SIMPRO_LUMEN_IMAGE
USER_SEARCH, MENU_COMPANY_DELETE, USER_DELETE, ROLE_SEARCH, COMPANY_MANAGEMENT_GET_ID, MENU_COMPANY_SEARCH, BASE_SIMPRO_LUMEN_IMAGE_COMPANY
} from '../../../const/ApiConst';
const token = window.localStorage.getItem('token');
const config = {
@ -594,6 +594,24 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company
}
};
const imageUrl = (() => {
let imageType = '';
let createdAt = '';
if (typeImage === 'imageHeader' && imageHeader) {
imageType = imageHeader.image;
createdAt = moment(imageHeader.created_at).format('YYYY-MM');
} else if (typeImage === 'imageLogin' && imageLogin) {
imageType = imageLogin.image;
createdAt = moment(imageLogin.created_at).format('YYYY-MM');
} else if (typeImage === 'favIcon' && imageFavIcon) {
imageType = imageFavIcon.image;
createdAt = moment(imageFavIcon.created_at).format('YYYY-MM');
}
return BASE_SIMPRO_LUMEN_IMAGE_COMPANY(imageType, companyNameProp, createdAt);
})();
const renderFromCompany = () => {
return (
<>
@ -823,21 +841,16 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, company
typeImage !== 'imageSlider' ? (
imageLogin || imageHeader || imageFavIcon ? (
<img
src={
`${BASE_SIMPRO_LUMEN_IMAGE}/` +
(typeImage === 'imageHeader' && imageHeader ? imageHeader.image :
typeImage === 'imageLogin' && imageLogin ? imageLogin.image :
typeImage === 'favIcon' && imageFavIcon ? imageFavIcon.image : '')
}
src={imageUrl}
style={{ maxWidth: "100%" }}
alt="Image Preview"
alt="Not Image Preview"
/>
) : ('-')
) : (
<Row style={{ display: 'flex', justifyContent: 'center' }}>
{imageSlider && imageSlider.map((item, index) => (
<Col md={6} style={{ marginBottom: '20px' }}>
<img key={index} src={`${BASE_SIMPRO_LUMEN_IMAGE}/` + item.image} style={{ width: '150px', display: 'block' }}></img>
<img key={index} src={`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(item?.image, companyNameProp, moment(item?.created_at).format('YYYY-MM'))}`} style={{ width: '150px', display: 'block' }}></img>
</Col>
))}
</Row>

3
src/views/Master/MasterCompany/index.js

@ -147,7 +147,8 @@ const MasterCompany = ({ params }) => {
.then((res) => res)
.catch((err) => err.response);
if (result && result.data && result.data.code === 200) {
setProjectImageHeader(result.data.data);
const dataRes = result.data.data;
setProjectImageHeader(dataRes);
}
}

24
src/views/Master/MasterTransaction/index.js

@ -86,21 +86,25 @@ class index extends Component {
</Tooltip>
</>,
},
{
title: this.state.role_name === 'Super Admin' ? "Company Name" : null,
dataIndex: "join_first_company_name",
key: "join_first_company_name",
render: (text, record) => {
return this.state.role_name === 'Super Admin' ? (
<span>{record.join_first_company_name}</span>
) : null;
...(this.state.role_name === 'Super Admin' ? [
{
title: "Company Name",
dataIndex: "join_first_company_name",
key: "join_first_company_name",
render: (text, record) => {
return <span>{ record.join_first_company_name }</span>;
}
}] : [])
,
{ title: 'Type Paket', dataIndex: 'type_paket', key: 'type_paket', className: "nowrap",
render: (text,record) => {
return <span>{ !["Basic","Free"].includes(record.type_paket) ? 'Enterprise' : record.type_paket}</span>
}
},
{ title: 'Type Paket', dataIndex: 'type_paket', key: 'type_paket', className: "nowrap" },
{
title: this.props.t('Expired Date'), dataIndex: 'exp_ospro', key: 'exp_ospro',
render: (text,record) => {
return moment(record.exp_ospro).format('DD MMMM, YYYY');
return <span>{ moment(record.exp_ospro).format('DD MMMM, YYYY') }</span>;
}
},
];

11
src/views/Pages/Login/Login.js

@ -212,7 +212,8 @@ class Login extends Component {
company_id,
role_name,
all_project,
user_name
user_name,
configApp
}
});
}
@ -375,7 +376,7 @@ class Login extends Component {
<h1 className="mb-1" style={{coror:'#232323'}}>Welcome to OSPRO!</h1>
<p style={{fontSize:'16px', color:'#898989'}}>Please sign-in to your account and start the adventure</p>
</div>
<InputGroup className="mb-3">
<InputGroupAddon addonType="prepend">
<InputGroupText>
@ -393,7 +394,7 @@ class Login extends Component {
}}
/>
</InputGroup>
<InputGroup >
<InputGroupAddon addonType="prepend">
<InputGroupText>
@ -427,7 +428,7 @@ class Login extends Component {
</Col>
</Row>
<Row>
<Col className="text-right ">
{this.state.loader ? (
<Spin indicator={antIcon} />
@ -436,7 +437,7 @@ class Login extends Component {
)}
</Col>
</Row>
</Form>
</CardBody>
</Card>

7
src/views/SimproV2/CreatedProyek/AsignCustProject.js

@ -13,8 +13,7 @@ import { NotificationContainer, NotificationManager } from 'react-notifications'
import SweetAlert from 'react-bootstrap-sweetalert';
import FormAsignCust from './DialogAssignCust';
const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, company_id }) => {
const token = localStorage.getItem("token")
const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, company_id, token }) => {
const HEADER = {
headers: {
"Content-Type": "application/json",
@ -42,7 +41,7 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy
},
"columns": [
{ "name": "name", "logic_operator": "ilike", "value": "", "table_name": "m_users" },
{ "name": "proyek_id", "logic_operator": "=", "value": idTask },
{ "name": "proyek_id", "logic_operator": "=", "value": parseInt(idTask) },
{ "name": "is_customer", "logic_operator": "=", "value": "true" }
],
"joins": [
@ -84,7 +83,7 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy
}
const onConfirmDelete = async () => {
let urlDel = ASSIGN_HR_PROJECT_DELETE(idDelete, company_id)
let urlDel = ASSIGN_HR_PROJECT_DELETE(idDelete, parseInt(company_id))
const result = await axios.delete(urlDel, HEADER)
.then(res => res)
.catch((error) => error.response);

8
src/views/SimproV2/CreatedProyek/AsignHrProject.js

@ -11,8 +11,7 @@ import SweetAlert from 'react-bootstrap-sweetalert';
import FormAsignHr from './FormAsignHr';
import { formatThousand } from '../../../const/CustomFunc';
const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, company_id, proyekName }) => {
const token = localStorage.getItem("token")
const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, company_id, proyekName, token }) => {
const HEADER = {
headers: {
"Content-Type": "application/json",
@ -93,7 +92,7 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, compan
"length": -1
},
"columns": [
{ "name": "company_id", "logic_operator": "=", "value": company_id },
{ "name": "company_id", "logic_operator": "=", "value": parseInt(company_id) },
],
"orders": {
"columns": [
@ -119,8 +118,7 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, compan
"length": -1
},
"columns": [
{ "name": "created_by", "logic_operator": "ilike", "value": "" },
{ "name": "company_id", "logic_operator": "=", "value": company_id },
{ "name": "company_id", "logic_operator": "=", "value": parseInt(company_id) },
],
"joins": [],
"orders": {

34
src/views/SimproV2/CreatedProyek/DialogDocument.js

@ -10,9 +10,7 @@ import axios from "../../../const/interceptorApi"
import { NotificationContainer, NotificationManager } from 'react-notifications';
import DialogRequest from './FormDocument';
import DialogRequestFolder from './FormFolderDocument';
const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName }) => {
const token = localStorage.getItem("token")
const role = window.localStorage.getItem('role_name');
const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, companyId, token, role_name, companyName }) => {
const HEADER = {
headers: {
"Content-Type": "application/json",
@ -34,7 +32,7 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
setLoading(true);
getDataDocument();
}
}, [parseInt(idTask), openDialog])
}, [openDialog])
useEffect(() => {
if (!openDialog) {
@ -75,7 +73,7 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
}
const handleDownload = (id, file) => {
fetch(DOCUMENT_DOWNLOAD(id, parseInt(idTask)), {
fetch(DOCUMENT_DOWNLOAD(id, parseInt(companyId)), {
headers: new Headers({
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
@ -93,12 +91,8 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
});
}
const handleShow = (file) => {
let configApp = '';
if (role !== 'Super Admin') {
configApp = JSON.parse(window.localStorage.getItem('configApp'));
}
const urlShow = `${BASE_SIMPRO_LUMEN_FILE_COMPANY(file, configApp != '' ? configApp.company_name : 'undifined')}`
const handleShow = (file, dateFile) => {
const urlShow = `${BASE_SIMPRO_LUMEN_FILE_COMPANY(file, companyName, dateFile)}`
window.open(urlShow);
}
@ -122,15 +116,16 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
openDialogRequest()
}
const renderShowDokumen = (file) => {
let arrayFile = file.split(".")
const renderShowDokumen = (data) => {
let arrayFile = data.file.split(".")
const dateFile = moment(data.created_at).format('YYYY-MM');
let length = arrayFile.length
length = length - 1
const fileExt = arrayFile[length];
if (fileExt == "pdf" || fileExt == "png" || fileExt == "jpg" || fileExt == "jpeg" || fileExt == "gif") {
if (["pdf", "png", "jpg", "jpeg", "gif"].includes(fileExt)) {
return (
<Tooltip title="View Document">
<Button 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(data.file, dateFile)}><i className="fa fa-eye"></i></Button>
</Tooltip>
)
}
@ -159,7 +154,7 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
{record.isDir && <Tooltip title="New File">
<Button size="sm" color="primary" onClick={() => handleNewFileParent(record.id)}><i className="fa fa-file"></i></Button>
</Tooltip>}{" "}
{text.file ? renderShowDokumen(text.file) : ""}
{text.file ? renderShowDokumen(text) : ""}
</>
,
},
@ -205,7 +200,7 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
}
const onConfirmDelete = async () => {
let urlDel = DOCUMENT_DELETE(idDelete, parseInt(idTask))
let urlDel = DOCUMENT_DELETE(idDelete, parseInt(companyId))
const result = await axios.delete(urlDel, HEADER)
.then(res => res)
.catch((error) => error.response);
@ -223,7 +218,7 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
}
const onConfirmDeleteFolder = async () => {
let urlDel = FOLDER_DOCUMENT_PROYEK_DELETE(idDelete)
let urlDel = FOLDER_DOCUMENT_PROYEK_DELETE(idDelete, parseInt(companyId))
const result = await axios.delete(urlDel, HEADER)
.then(res => res)
.catch((error) => error.response);
@ -319,6 +314,9 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
idTask={parseInt(idTask)}
parentIdNewFolder={parentIdNewFolder}
dataEdit={dataEdit}
companyId={companyId}
token={token}
role_name={role_name}
/>
<DialogRequestFolder

2
src/views/SimproV2/CreatedProyek/DialogFormProyek.js

@ -37,9 +37,9 @@ const DialogFormProyek = ({
projectImage,
company_id,
role_name,
token,
companyList
}) => {
const token = localStorage.getItem("token");
const HEADER = {
headers: {
"Content-Type": "application/json",

24
src/views/SimproV2/CreatedProyek/DialogGantt.js

@ -13,18 +13,7 @@ import DialogUserGantt from './DialogUserGantt';
import { Link } from 'react-router-dom';
const { Option } = Select
const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName, openDialogHierarchy, isLogin, token, role_id, user_id, dataViewStartDate }) => {
if (role_id && user_id && token && isLogin) {
role_id = role_id;
user_id = user_id;
token = token;
isLogin = isLogin;
} else {
role_id = localStorage.getItem("role_id");
user_id = localStorage.getItem("user_id");
token = localStorage.getItem("token");
isLogin = localStorage.getItem("isLogin");
}
const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, companyId, hierarchyId, hierarchyName, openDialogHierarchy, isLogin, token, role_id, user_id, dataViewStartDate }) => {
const HEADER = {
headers: {
"Content-Type": "application/json",
@ -140,11 +129,12 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
<Link to={{
pathname: `/projects/${text.id}/${idTask}/gantt`,
state: {
isLogin: isLogin,
token: token,
role_id: role_id,
user_id: user_id,
dataViewStartDate: dataViewStartDate
isLogin,
token,
role_id,
user_id,
company_id: companyId,
dataViewStartDate
}
}}>
<Tooltip title="Gantt">

17
src/views/SimproV2/CreatedProyek/FormDocument.js

@ -6,9 +6,8 @@ import { DOCUMENT_ADD } from '../../../const/ApiConst';
import 'antd/dist/antd.css';
import { NotificationManager } from 'react-notifications';
const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentIdNewFolder }) => {
const token = localStorage.getItem("token");
const role = window.localStorage.getItem('role_name');
const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentIdNewFolder, token, role_name, companyId }) => {
const HEADER = {
headers: {
"Content-Type": "application/json",
@ -34,12 +33,9 @@ const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentId
}
const uploadDokumen = async () => {
let configApp = ''
const formData = new FormData;
if (role !== 'Super Admin') {
configApp = JSON.parse(window.localStorage.getItem('configApp'));
formData.append('company_name',configApp.company_name);
}
formData.append('company_id', parseInt(companyId));
formData.append('dokumen', file, file.name);
if (parentIdNewFolder > 0) {
formData.append('ref_id', parentIdNewFolder); // folder_id
@ -73,8 +69,9 @@ const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentId
return (
<Form>
<FormGroup>
<Label className="capitalize">Upload File</Label>
<Input type="file" onChange={(e) => setFile(e.target.files[0])} />
<Label className="capitalize">Upload File<span style={{ color:'red' }}>*</span></Label>
<Input type="file" onChange={(e) => setFile(e.target.files[0])}/>
<small><span style={{ color:'red' }}>*</span>All Type File Accepted</small>
</FormGroup>
</Form>
)

4
src/views/SimproV2/CreatedProyek/FormFolderDocument.js

@ -33,10 +33,6 @@ const DialogRequestFolder = ({ openDialog, closeDialog, toggleDialog, idTask, pa
}
const saveFolder = async () => {
let payload = {
"proyek_id": idTask,
"name_folder": folderName

78
src/views/SimproV2/CreatedProyek/index.js

@ -91,7 +91,7 @@ const url = "";
const format = "DD-MM-YYYY";
const CreatedProyek = ({ params, ...props }) => {
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '';
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '', configApp={};
if (props && props.role_id && props.user_id) {
role_id = props.role_id;
user_id = props.user_id;
@ -155,6 +155,8 @@ const CreatedProyek = ({ params, ...props }) => {
const [openDialogDoc, setOpenDialogDoc] = useState(false);
const [proyekName, setProyekName] = useState("");
const [openDialogProyek, setOpenDialogProyek] = useState(false);
const [companyId, setCompanyId] = useState(props.role_name !== 'Super Admin' ? company_id : 0);
const [companyName, setCompanyName] = useState('');
// project charter
const [projectCharter, setProjectCharter] = useState(null);
const [projectParticipant, setProjectParticipant] = useState(null);
@ -369,7 +371,14 @@ const CreatedProyek = ({ params, ...props }) => {
}
const payload = {
columns: [],
columns: [
{
name: "deleted_at",
logic_operator: "isnull",
value: "null",
operator: "AND"
}
],
group_column: {
"operator": "AND",
"group_operator": "OR",
@ -401,6 +410,9 @@ const CreatedProyek = ({ params, ...props }) => {
"currency_symbol",
"mulai_proyek",
"akhir_proyek",
"company_id",
"deleted_at",
"deleted_by_id"
],
joins: [
{
@ -553,11 +565,12 @@ const CreatedProyek = ({ params, ...props }) => {
};
const handleOpenDialogProyek = async (id) => {
const handleOpenDialogProyek = async (text) => {
setCompanyId(text.company_id);
setOpenDialogProyek(true);
setidTask(id);
if (id !== 0) {
await getProjectImage(id);
setidTask(text.id);
if (text.id !== 0) {
await getProjectImage(text.id);
}
};
@ -565,6 +578,7 @@ const CreatedProyek = ({ params, ...props }) => {
setDataViewStartDate(data.mulai_proyek)
setidTask(data.id);
setProyekName(data.nama);
setCompanyId(data.company_id);
setOpenDialogGantt(true);
};
@ -599,12 +613,16 @@ const CreatedProyek = ({ params, ...props }) => {
const handleOpenAsignHr = (data) => {
setidTask(data.id);
setProyekName(data.nama);
setCompanyId(data.company_id);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(props.configApp).company_name);
setOpenDialogAsignHR(true);
};
const handleOpenAsignCust = (data) => {
setidTask(data.id);
setProyekName(data.nama);
setCompanyId(data.company_id);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(props.configApp).company_name);
setOpenDialogAsignCust(true);
};
@ -1375,7 +1393,14 @@ const CreatedProyek = ({ params, ...props }) => {
const handleExportExcel = async () => {
const payload = {
columns: [],
columns: [
{
name: "deleted_at",
logic_operator: "isnull",
value: "null",
operator: "AND"
}
],
group_column: {
"operator": "AND",
"group_operator": "OR",
@ -1462,7 +1487,14 @@ const CreatedProyek = ({ params, ...props }) => {
];
const payload = {
columns: [],
columns: [
{
name: "deleted_at",
logic_operator: "isnull",
value: "null",
operator: "AND"
}
],
group_column: {
"operator": "AND",
"group_operator": "OR",
@ -1568,6 +1600,8 @@ const CreatedProyek = ({ params, ...props }) => {
const handleOpenDokumen = async (data) => {
await setidTask(data.id);
setProyekName(data.nama);
setCompanyId(data.company_id);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(props.configApp).company_name);
setOpenDialogDoc(true);
};
@ -1627,7 +1661,7 @@ const CreatedProyek = ({ params, ...props }) => {
</div>
<div
className="menu-list"
onClick={() => handleOpenDialogProyek(text.id)}
onClick={() => handleOpenDialogProyek(text)}
>
<span className="menu-icon">
<i className="fa fa-edit"></i>
@ -1656,7 +1690,17 @@ const CreatedProyek = ({ params, ...props }) => {
{!loadVersionGantt && text.type_proyek_id !== 9 && (
<>
{dataVersionGantt.slice(0, 8).map((res) => (
<Link to={`/projects/${res.id}/${text.id}/gantt`}>
<Link to={{
pathname : `/projects/${res.id}/${text.id}/gantt`,
state: {
isLogin,
token,
role_id,
user_id,
company_id: text.company_id,
dataViewStartDate
}
}}>
<div className="menu-list">
<span className="menu-icon">
<i className="fa fa-file"></i>
@ -1888,9 +1932,10 @@ const CreatedProyek = ({ params, ...props }) => {
dataDivisions={dataDivisions}
dataPM={dataPm}
projectImage={image}
company_id={company_id}
company_id={companyId}
role_name={role_name}
companyList={companyList}
token={token}
/>
),
[
@ -1952,7 +1997,8 @@ const CreatedProyek = ({ params, ...props }) => {
handleClose={handleCloseDialogAsignHr}
idTask={idTask}
proyekName={proyekName}
company_id={company_id}
company_id={companyId}
token={token}
/>
),
[openDialogAsignHR]
@ -1968,7 +2014,8 @@ const CreatedProyek = ({ params, ...props }) => {
handleClose={handleCloseDialogAsignCust}
idTask={idTask}
proyekName={proyekName}
company_id={company_id}
company_id={companyId}
token={token}
/>
),
[openDialogAsignCust]
@ -2003,6 +2050,10 @@ const CreatedProyek = ({ params, ...props }) => {
handleClose={handleCloseDialogDoc}
idTask={idTask}
proyekName={proyekName}
companyId={companyId}
token={token}
role_name={role_name}
companyName={companyName}
/>
),
[openDialogDoc]
@ -2053,6 +2104,7 @@ const CreatedProyek = ({ params, ...props }) => {
token={token}
isLogin={isLogin}
proyekName={proyekName}
companyId={companyId}
dataViewStartDate={dataViewStartDate}
/>
),

6
src/views/SimproV2/Gantt/GanttFrame.js

@ -4,9 +4,9 @@ import { BASE_SIMPRO_LUMEN } from '../../../const/ApiConst';
const GanttFrame = React.memo((props) => {
const history = useHistory();
const { versionGanttId, idProject, ro, timestamp, dataViewStartDate, token, company_id, role_name } = props;
const iframeSrc = `https://project-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${company_id}`;
// const iframeSrc = `http://localhost:8444/generic-ospro-gantt/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${company_id}`;
const { versionGanttId, idProject, ro, timestamp, dataViewStartDate, token, companyId, role_name } = props;
const iframeSrc = `https://project-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}`;
// const iframeSrc = `http://localhost:8444/generic-ospro-gantt/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}`;
const [batchEntityData, setBatchEntityData] = useState(null);
useEffect(() => {

6
src/views/SimproV2/Gantt/index.js

@ -15,13 +15,13 @@ import GanttFrame from "./GanttFrame";
let roCount = 0;
const Gantt = (props) => {
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name='', hierarchy=[], user_name='';
let role_id = 0, user_id = 0, isLogin = false, token = '', companyId = 0, all_project = null, role_name='', hierarchy=[], user_name='';
if (props && props.role_id && props.user_id) {
role_id = props.role_id;
user_id = props.user_id;
token = props.token;
isLogin = props.isLogin;
company_id = props.company_id;
companyId = props.company_id;
all_project = props.all_project;
role_name = props.role_name;
isLogin = props.isLogin;
@ -114,7 +114,7 @@ const Gantt = (props) => {
token={token}
ro={ro}
role_name={role_name}
company_id={company_id}
companyId={companyId}
timestamp={timestamp}
/>
)}

2
src/views/SimproV2/Settings/DialogForm.js

@ -323,7 +323,7 @@ const DialogForm = ({
<img
src={
imageProfile ? (
`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(imageProfile?.image, role != 'Super Admin' ? configApp.company_name : 'undifined')}`
`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(imageProfile?.image, role != 'Super Admin' ? configApp?.company_name : 'undifined', moment(imageProfile?.created_at).format('YYYY-MM') )}`
) : profile
}
style={{ maxWidth: "100%" }}

4
src/views/SimproV2/Settings/components/MyProfile/Index.js

@ -254,7 +254,7 @@ const Index = () => {
<div className={stylesHead.img} style={{ cursor:imageProfile ? 'pointer' : '' }} onClick={imageProfile ? () => handleImageClick() : ''}>
<img className={stylesHead.obejct11} src={
imageProfile ? (
`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(imageProfile?.image, role != 'Super Admin' ? configApp.company_name : 'undifined')}`
`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(imageProfile?.image, role != 'Super Admin' ? configApp?.company_name : 'undifined', moment(imageProfile?.created_at).format('YYYY-MM'))}`
) : profile
} />
</div>
@ -416,7 +416,7 @@ const Index = () => {
<img
src={
imageProfile ? (
`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(imageProfile?.image, role != 'Super Admin' ? configApp.company_name : 'undifined')}`
`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(imageProfile?.image, role != 'Super Admin' ? configApp?.company_name : 'undifined', moment(imageProfile?.created_at).format('YYYY-MM'))}`
) : profile
}
style={{ maxWidth: "100%" }}

Loading…
Cancel
Save