diff --git a/src/const/ApiConst.js b/src/const/ApiConst.js
index 1401b07..9c07bd7 100644
--- a/src/const/ApiConst.js
+++ b/src/const/ApiConst.js
@@ -125,7 +125,9 @@ 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_IMAGE_COMPANY = (file, company_name)=>{
+ return `${BASE_OSPRO}/assets/${company_name}/image/${file}`;
+}
// switch (APP_MODE) {
// case 'KIT':
// BASE_OSPRO = "https://kit-api.oslogdev.com"
@@ -300,6 +302,19 @@ export const REFFERAL_EDIT = (id) => {
return `${BASE_SIMPRO_LUMEN}/refferal-code/update/${id}`;
};
+export const TRANSACTION_ADD = `${BASE_SIMPRO_LUMEN}/product-transaction/add`;
+export const TRANSACTION_SEARCH = `${BASE_SIMPRO_LUMEN}/product-transaction/search`;
+export const TRANSACTION_GET_ID = (id) => {
+ return `${BASE_SIMPRO_LUMEN}/product-transaction/edit/${id}`;
+};
+export const TRANSACTION_EDIT = (id) => {
+ return `${BASE_SIMPRO_LUMEN}/product-transaction/update/${id}`;
+};
+
+export const STORAGE_LIMIT_INFORMATION = (company_name) => {
+ return `${BASE_SIMPRO_LUMEN}/information-storage/${company_name}`;
+};
+
export const ABSENSI_ADD = `${BASE_SIMPRO_LUMEN}/permit/add`;
export const ABSENSI_SEARCH = `${BASE_SIMPRO_LUMEN}/permit/search`;
export const ABSENSI_EDIT = (id) => {
@@ -733,12 +748,6 @@ export const ASSIGN_HR_PROJECT_DELETE = (id, company_id) => {
};
export const ASSIGN_HR_PROJECT_LIST = `${BASE_SIMPRO_LUMEN}/user-to-proyek/list`;
-export const IMAGE_GET_BY_ID = (id, category) => {
- return `${BASE_SIMPRO_LUMEN}/image/${id}/${category}`;
-};
-export const IMAGE_SEARCH = `${BASE_SIMPRO_LUMEN}/image/search`;
-export const OSPRO_BASE_IMAGE = `${BASE_OSPRO}/api/assets/image`;
-
export const DASHBOARD_COST_PLANNING_ACTUAL = `${BASE_SIMPRO_LUMEN}/dashboard/cost-planning-actual`;
export const DASHBOARD_PERSENTASE_PROGRESS_PROYEK = `${BASE_SIMPRO_LUMEN}/dashboard/percentage-planning-actual`;
export const DASHBOARD_REPORT_POINTS = `${BASE_SIMPRO_LUMEN}/report-activity/search-point`;
@@ -798,6 +807,11 @@ export const HIERARCHY_FTTH_COUNT_TREE = (id) => {
export const WAYPOINT_SEARCH = `${BASE_SIMPRO_LUMEN}/waypoint/search`;
+export const IMAGE_GET_BY_ID = (id, category) => {
+ return `${BASE_SIMPRO_LUMEN}/image/${id}/${category}`;
+};
+export const IMAGE_SEARCH = `${BASE_SIMPRO_LUMEN}/image/search`;
+export const OSPRO_BASE_IMAGE = `${BASE_OSPRO}/api/assets/image`;
export const IMAGE_UPLOAD = `${BASE_SIMPRO_LUMEN}/image/upload`;
export const IMAGE_MULTIPLE_UPLOAD = `${BASE_SIMPRO_LUMEN}/image/multiple-upload`;
export const IMAGE_MULTIPLE_DELETE = (id, category, company_id) => {
diff --git a/src/containers/DefaultLayout/DefaultHeader.js b/src/containers/DefaultLayout/DefaultHeader.js
index b04fb21..de15875 100644
--- a/src/containers/DefaultLayout/DefaultHeader.js
+++ b/src/containers/DefaultLayout/DefaultHeader.js
@@ -1,296 +1,296 @@
-import React, { Component } from 'react';
-import { NavLink } from 'react-router-dom';
-import { Badge, Nav, NavItem } from 'reactstrap';
-import PropTypes from 'prop-types';
-import { Menu, Dropdown } from 'antd'
-import { ALERTUSER_SEARCH, ALERT_SEARCH, ALERTUSER_STATUSVIEW, ALERT_STATUSVIEW, APP_MODE, BASE_SIMPRO_LUMEN_IMAGE } from '../../const/ApiConst';
-import { AppAsideToggler, AppNavbarBrand, AppSidebarToggler } from '@coreui/react';
-import logo_ospro from '../../assets/img/OSPRO.png'
-import axios from 'axios';
-import './Default.css'
-
-const propTypes = {
- children: PropTypes.node,
-};
-
-
-
-const defaultProps = {};
-
-
-class DefaultHeader extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- fullname: localStorage.getItem('fullname'),
- u_group: localStorage.getItem('u_group'),
- dataAlert: [],
- totalAlert: 0,
- listReadNotif: []
- }
- this.callAlert = "";
- }
-
-
-
- componentDidMount() {
- this.getHeaderMenu();
- const token = window.localStorage.getItem('token');
- const role = window.localStorage.getItem('role_name');
-
- if (role !== 'Super Admin') {
- this.setState({
- configApp: JSON.parse(window.localStorage.getItem('configApp')),
- });
- }
- this.setState({
- config: {
- headers: {
- Authorization: `Bearer ${token}`,
- 'Content-type': `application/json`,
- },
- },
- });
- }
-
- getLogoHeaderContent = () => {
- const { configApp } = this.state;
- const logoHeaderContent = configApp && configApp.logo_header ? configApp.logo_header.content : null;
- return logoHeaderContent
- ? `${BASE_SIMPRO_LUMEN_IMAGE}/${logoHeaderContent}`
- : logo_ospro;
- };
-
- componentDidUpdate(prevProps, prevState) {
- if (this.state.listReadNotif !== prevState.listReadNotif) {
- if (this.state.listReadNotif.length > 0) {
- this.markAsRead();
- }
- }
- }
-
- componentWillUnmount() {
- clearInterval(this.callAlert);
- }
-
- getDataAlert = async () => {
- let url = '';
- let payload = '';
- if (parseInt(localStorage.getItem('role_id')) === 1) {
- url = ALERT_SEARCH;
- payload = {
- "paging": { "start": 0, "length": -1 },
- "columns": [
- { "name": "status_view", "logic_operator": "=", "value": "false", "operator": "AND" },
- ],
- "joins": [
- { "name": "config_alert", "column_join": "config_alert_id", "column_results": ["nama", "keterangan"] },
- { "name": "laporan_planning", "column_join": "laporan_planning_id", "column_results": ["deskripsi", "status", "jumlah_pekerjaan"] },
- { "name": "m_satuan", "column_join": "satuan_id", "column_results": ["name", "description"] }
- ],
- "orders": { "columns": ["created_at"], "ascending": false }
- }
- } else {
- url = ALERTUSER_SEARCH;
- payload = {
- "paging": { "start": 0, "length": -1 },
- "columns": [
- { "name": "status_view", "logic_operator": "=", "value": "false", "operator": "AND" },
- { "name": "user_id", "logic_operator": "=", "value": localStorage.getItem('user_id'), "operator": "AND" },
- ],
- "joins": [
- { "name": "alert", "column_join": "alert_id", "column_results": ["nama", "keterangan"] },
- { "name": "config_alert", "column_join": "config_alert_id", "column_results": ["nama", "keterangan"] },
- { "name": "laporan_planning", "column_join": "laporan_planning_id", "column_results": ["deskripsi", "status", "jumlah_pekerjaan"] },
- { "name": "m_satuan", "column_join": "satuan_id", "column_results": ["name", "description"] },
- { "name": "m_users", "column_join": "user_id", "column_results": ["name", "username", "email", "phone_number", "gender"] }
- ],
- "orders": { "columns": ["created_at"], "ascending": false }
- }
- }
-
- if (localStorage.getItem('userConfigAlert')) {
- if (parseInt(localStorage.getItem('role_id')) === 1) {
- payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": localStorage.getItem('userConfigAlert'), "operator": "AND" })
- } else {
- payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": localStorage.getItem('userConfigAlert'), "operator": "AND", "table_name": "alert" })
- }
- } else {
- if (parseInt(localStorage.getItem('role_id')) === 1) {
- payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": "0", "operator": "AND" })
- } else {
- payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": "0", "operator": "AND", "table_name": "alert" })
- }
- }
-
- const result = await axios
- .post(url, payload, this.state.config)
- .then(res => res)
- .catch((error) => error.response);
- if (result && result.data && result.data.code == 200) {
- this.setState({ dataAlert: result.data.data, totalAlert: result.data.totalRecord });
- }
- }
-
- dropDownMenu = () => {
- const { dataAlert, totalAlert } = this.state
- let dataAlertLength = dataAlert.length
- let currentLoop = 0;
- return (
-
- )
- }
-
- gotoReportAlert = () => {
- this.props.history.replace('/laporan-alert')
- }
-
- onReadNotif = (visible) => {
- if (!visible) {
- const { dataAlert } = this.state
- let currentLoop = 0;
- let listId = []
- dataAlert.map((val, index) => {
- currentLoop++;
- if (currentLoop < 6) {
- listId.push(val.id);
- }
- });
-
- this.setState({ listReadNotif: listId });
- }
- }
-
- markAsRead = async () => {
- let data = this.state.listReadNotif
- const payload = {
- "status_view": true
- }
- let promises = []
- let result = []
- if (data.length > 0) {
- if (parseInt(localStorage.getItem('role_id')) === 1) {
- data.map((val, index) => {
- let url = ALERT_STATUSVIEW(val)
- promises.push(axios.put(url, payload, this.state.config)
- .then(res => result.push(res)));
- });
-
- } else {
- data.map((val, index) => {
- let url = ALERTUSER_STATUSVIEW(val)
- promises.push(axios.put(url, payload, this.state.config)
- .then(res => result.push(res)))
- });
- }
- await Promise.all(promises);
- }
- this.setState({ listReadNotif: [] }, () => {
- });
- }
-
-
- getLogo = () => {
- return (
-
-
-
- )
- }
- // logo_ospro
- getHeaderMenu = () => {
- const { fullname, u_group } = this.state;
- if (u_group == 'kominfo') {
- /*return (
-
- )*/
-
-
- return (
-
-
Layanan Telekomunikasi
-
- )
- }
- else {
- return (
-
- )
- }
- }
-
- render() {
-
- const { children, ...attributes } = this.props;
-
- return (
-
-
- {this.getLogo()}
-
-
-
- );
- }
-}
-
-DefaultHeader.propTypes = propTypes;
-DefaultHeader.defaultProps = defaultProps;
-
-export default DefaultHeader;
+import React, { Component } from 'react';
+import { NavLink } from 'react-router-dom';
+import { Badge, Nav, NavItem } from 'reactstrap';
+import PropTypes from 'prop-types';
+import { Menu, Dropdown } from 'antd'
+import { ALERTUSER_SEARCH, ALERT_SEARCH, ALERTUSER_STATUSVIEW, ALERT_STATUSVIEW, APP_MODE, BASE_SIMPRO_LUMEN_IMAGE } from '../../const/ApiConst';
+import { AppAsideToggler, AppNavbarBrand, AppSidebarToggler } from '@coreui/react';
+import logo_ospro from '../../assets/img/OSPRO.png'
+import axios from 'axios';
+import './Default.css'
+
+const propTypes = {
+ children: PropTypes.node,
+};
+
+
+
+const defaultProps = {};
+
+
+class DefaultHeader extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ fullname: localStorage.getItem('fullname'),
+ u_group: localStorage.getItem('u_group'),
+ dataAlert: [],
+ totalAlert: 0,
+ listReadNotif: []
+ }
+ this.callAlert = "";
+ }
+
+
+
+ componentDidMount() {
+ this.getHeaderMenu();
+ const token = window.localStorage.getItem('token');
+ const role = window.localStorage.getItem('role_name');
+
+ if (role !== 'Super Admin') {
+ this.setState({
+ configApp: JSON.parse(window.localStorage.getItem('configApp')),
+ });
+ }
+ this.setState({
+ config: {
+ headers: {
+ Authorization: `Bearer ${token}`,
+ 'Content-type': `application/json`,
+ },
+ },
+ });
+ }
+
+ getLogoHeaderContent = () => {
+ const { configApp } = this.state;
+ const logoHeaderContent = configApp && configApp.logo_header ? configApp.logo_header.content : null;
+ return logoHeaderContent
+ ? `${BASE_SIMPRO_LUMEN_IMAGE}/${logoHeaderContent}`
+ : logo_ospro;
+ };
+
+ componentDidUpdate(prevProps, prevState) {
+ if (this.state.listReadNotif !== prevState.listReadNotif) {
+ if (this.state.listReadNotif.length > 0) {
+ this.markAsRead();
+ }
+ }
+ }
+
+ componentWillUnmount() {
+ clearInterval(this.callAlert);
+ }
+
+ getDataAlert = async () => {
+ let url = '';
+ let payload = '';
+ if (parseInt(localStorage.getItem('role_id')) === 1) {
+ url = ALERT_SEARCH;
+ payload = {
+ "paging": { "start": 0, "length": -1 },
+ "columns": [
+ { "name": "status_view", "logic_operator": "=", "value": "false", "operator": "AND" },
+ ],
+ "joins": [
+ { "name": "config_alert", "column_join": "config_alert_id", "column_results": ["nama", "keterangan"] },
+ { "name": "laporan_planning", "column_join": "laporan_planning_id", "column_results": ["deskripsi", "status", "jumlah_pekerjaan"] },
+ { "name": "m_satuan", "column_join": "satuan_id", "column_results": ["name", "description"] }
+ ],
+ "orders": { "columns": ["created_at"], "ascending": false }
+ }
+ } else {
+ url = ALERTUSER_SEARCH;
+ payload = {
+ "paging": { "start": 0, "length": -1 },
+ "columns": [
+ { "name": "status_view", "logic_operator": "=", "value": "false", "operator": "AND" },
+ { "name": "user_id", "logic_operator": "=", "value": localStorage.getItem('user_id'), "operator": "AND" },
+ ],
+ "joins": [
+ { "name": "alert", "column_join": "alert_id", "column_results": ["nama", "keterangan"] },
+ { "name": "config_alert", "column_join": "config_alert_id", "column_results": ["nama", "keterangan"] },
+ { "name": "laporan_planning", "column_join": "laporan_planning_id", "column_results": ["deskripsi", "status", "jumlah_pekerjaan"] },
+ { "name": "m_satuan", "column_join": "satuan_id", "column_results": ["name", "description"] },
+ { "name": "m_users", "column_join": "user_id", "column_results": ["name", "username", "email", "phone_number", "gender"] }
+ ],
+ "orders": { "columns": ["created_at"], "ascending": false }
+ }
+ }
+
+ if (localStorage.getItem('userConfigAlert')) {
+ if (parseInt(localStorage.getItem('role_id')) === 1) {
+ payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": localStorage.getItem('userConfigAlert'), "operator": "AND" })
+ } else {
+ payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": localStorage.getItem('userConfigAlert'), "operator": "AND", "table_name": "alert" })
+ }
+ } else {
+ if (parseInt(localStorage.getItem('role_id')) === 1) {
+ payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": "0", "operator": "AND" })
+ } else {
+ payload['columns'].push({ "name": "config_alert_id", "logic_operator": "IN", "value": "0", "operator": "AND", "table_name": "alert" })
+ }
+ }
+
+ const result = await axios
+ .post(url, payload, this.state.config)
+ .then(res => res)
+ .catch((error) => error.response);
+ if (result && result.data && result.data.code == 200) {
+ this.setState({ dataAlert: result.data.data, totalAlert: result.data.totalRecord });
+ }
+ }
+
+ dropDownMenu = () => {
+ const { dataAlert, totalAlert } = this.state
+ let dataAlertLength = dataAlert.length
+ let currentLoop = 0;
+ return (
+
+ )
+ }
+
+ gotoReportAlert = () => {
+ this.props.history.replace('/laporan-alert')
+ }
+
+ onReadNotif = (visible) => {
+ if (!visible) {
+ const { dataAlert } = this.state
+ let currentLoop = 0;
+ let listId = []
+ dataAlert.map((val, index) => {
+ currentLoop++;
+ if (currentLoop < 6) {
+ listId.push(val.id);
+ }
+ });
+
+ this.setState({ listReadNotif: listId });
+ }
+ }
+
+ markAsRead = async () => {
+ let data = this.state.listReadNotif
+ const payload = {
+ "status_view": true
+ }
+ let promises = []
+ let result = []
+ if (data.length > 0) {
+ if (parseInt(localStorage.getItem('role_id')) === 1) {
+ data.map((val, index) => {
+ let url = ALERT_STATUSVIEW(val)
+ promises.push(axios.put(url, payload, this.state.config)
+ .then(res => result.push(res)));
+ });
+
+ } else {
+ data.map((val, index) => {
+ let url = ALERTUSER_STATUSVIEW(val)
+ promises.push(axios.put(url, payload, this.state.config)
+ .then(res => result.push(res)))
+ });
+ }
+ await Promise.all(promises);
+ }
+ this.setState({ listReadNotif: [] }, () => {
+ });
+ }
+
+
+ getLogo = () => {
+ return (
+
+
+
+ )
+ }
+ // logo_ospro
+ getHeaderMenu = () => {
+ const { fullname, u_group } = this.state;
+ if (u_group == 'kominfo') {
+ /*return (
+
+ )*/
+
+
+ return (
+
+
Layanan Telekomunikasi
+
+ )
+ }
+ else {
+ return (
+
+ )
+ }
+ }
+
+ render() {
+
+ const { children, ...attributes } = this.props;
+
+ return (
+
+
+ {this.getLogo()}
+
+
+
+ );
+ }
+}
+
+DefaultHeader.propTypes = propTypes;
+DefaultHeader.defaultProps = defaultProps;
+
+export default DefaultHeader;
diff --git a/src/routes.js b/src/routes.js
index eb71b0f..6fafb24 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -54,7 +54,7 @@ const DashboardCustomer = React.lazy(() => import('./views/Dashboard/DashboardCu
const DashboardProject = React.lazy(() => import('./views/Dashboard/DashboardProject'));
const DashboardProjectCarousell = React.lazy(() => import('./views/Dashboard/DashboardProjectCarousell'));
const MapMonitoring = React.lazy(() => import('./views/MapMonitoring'));
-const Settings = React.lazy(() => import('./views/SimproV2/Settings'));
+const Settings = React.lazy(() => import('./views/SimproV2/Settings/Desktop'));
const CompanyManagement = React.lazy(() => import('./views/Master/MasterCompany'))
const DemoManagement = React.lazy(() => import('./views/SimproV2/Demo'))
const routes = [
diff --git a/src/views/Master/MasterCompany/index.js b/src/views/Master/MasterCompany/index.js
index 9a06900..a7bab4f 100644
--- a/src/views/Master/MasterCompany/index.js
+++ b/src/views/Master/MasterCompany/index.js
@@ -20,7 +20,11 @@ const config = {
const MasterCompany = ({ params }) => {
const token = localStorage.getItem("token")
- const company_id = localStorage.getItem("company_id")
+ let company_id = '';
+ const role = window.localStorage.getItem('role_name');
+ if(role != 'Super Admin') {
+ company_id = localStorage.getItem("company_id");
+ }
const HEADER = {
headers: {
"Content-Type": "application/json",
@@ -53,7 +57,10 @@ const MasterCompany = ({ params }) => {
const [loading, setLoading] = useState(true);
const pageName = params.name;
const { t } = useTranslation();
- const configApp = JSON.parse(window.localStorage.getItem('configApp'));
+ let configApp = '';
+ if (role !== 'Super Admin') {
+ configApp = JSON.parse(window.localStorage.getItem('configApp'));
+ }
useEffect(() => {
setLoading(true)
getDataCompany()
@@ -354,7 +361,9 @@ const MasterCompany = ({ params }) => {
formData.append('ref_id', id);
formData.append('category', 'company_logo_header');
formData.append('files', data);
- formData.append('company_name',configApp.company_name);
+ if(role != 'Super Admin') {
+ formData.append('company_name',configApp.company_name);
+ }
await axios
.post(IMAGE_UPLOAD, formData, HEADER_MULTIPART)
@@ -368,7 +377,9 @@ const MasterCompany = ({ params }) => {
formData.append('ref_id', id);
formData.append('category', 'company_logo_login');
formData.append('files', data);
- formData.append('company_name',configApp.company_name);
+ if(role != 'Super Admin') {
+ formData.append('company_name',configApp.company_name);
+ }
await axios
.post(IMAGE_UPLOAD, formData, HEADER_MULTIPART)
@@ -382,7 +393,9 @@ const MasterCompany = ({ params }) => {
formData.append('ref_id', id);
formData.append('category', 'company_favicon');
formData.append('files', data);
- formData.append('company_name',configApp.company_name);
+ if(role != 'Super Admin') {
+ formData.append('company_name',configApp.company_name);
+ }
await axios
.post(IMAGE_UPLOAD, formData, HEADER_MULTIPART)
@@ -402,7 +415,7 @@ const MasterCompany = ({ params }) => {
// Delete Image Function
const deleteImageHeader = async (id) => {
- const URL = IMAGE_DELETE(id, 'company_logo_header', company_id);
+ const URL = IMAGE_DELETE(id, 'company_logo_header', company_id != '' ? company_id : 'undifined');
await axios
.delete(URL, HEADER)
.then(res => res)
@@ -411,7 +424,7 @@ const MasterCompany = ({ params }) => {
};
const deleteImageLogin = async (id) => {
- const URL = IMAGE_DELETE(id, 'company_logo_login', company_id);
+ const URL = IMAGE_DELETE(id, 'company_logo_login', company_id != '' ? company_id : 'undifined');
await axios
.delete(URL, HEADER)
.then(res => res)
@@ -420,7 +433,7 @@ const MasterCompany = ({ params }) => {
};
const deleteImageFavicon = async (id) => {
- const URL = IMAGE_DELETE(id, 'company_favicon', company_id);
+ const URL = IMAGE_DELETE(id, 'company_favicon', company_id != '' ? company_id : 'undifined');
await axios
.delete(URL, HEADER)
.then(res => res)
@@ -429,7 +442,7 @@ const MasterCompany = ({ params }) => {
};
const deleteImageSlider = async (id) => {
- const URL = IMAGE_MULTIPLE_DELETE(id, 'company_slider_login', company_id);
+ const URL = IMAGE_MULTIPLE_DELETE(id, 'company_slider_login', company_id != '' ? company_id : 'undifined');
await axios
.delete(URL, HEADER)
.then(res => res)
diff --git a/src/views/SimproV2/CreatedProyek/DialogDocument.js b/src/views/SimproV2/CreatedProyek/DialogDocument.js
index 69830d0..8dded7e 100644
--- a/src/views/SimproV2/CreatedProyek/DialogDocument.js
+++ b/src/views/SimproV2/CreatedProyek/DialogDocument.js
@@ -12,6 +12,7 @@ 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 HEADER = {
headers: {
"Content-Type": "application/json",
@@ -99,8 +100,11 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
}
const handleShow = (file) => {
- const configApp = JSON.parse(window.localStorage.getItem('configApp'));
- const urlShow = `${BASE_SIMPRO_LUMEN_FILE_COMPANY(file, configApp.company_name)}`
+ 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')}`
window.open(urlShow);
}
diff --git a/src/views/SimproV2/CreatedProyek/FormDocument.js b/src/views/SimproV2/CreatedProyek/FormDocument.js
index 71edd49..f333717 100644
--- a/src/views/SimproV2/CreatedProyek/FormDocument.js
+++ b/src/views/SimproV2/CreatedProyek/FormDocument.js
@@ -7,7 +7,8 @@ import 'antd/dist/antd.css';
import { NotificationManager } from 'react-notifications';
const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentIdNewFolder }) => {
- const token = localStorage.getItem("token")
+ const token = localStorage.getItem("token");
+ const role = window.localStorage.getItem('role_name');
const HEADER = {
headers: {
"Content-Type": "application/json",
@@ -33,12 +34,13 @@ const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentId
}
const uploadDokumen = async () => {
- const configApp = JSON.parse(window.localStorage.getItem('configApp'));
-
+ 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('dokumen', file, file.name);
- formData.append('company_name',configApp.company_name);
-
if (parentIdNewFolder > 0) {
formData.append('ref_id', parentIdNewFolder); // folder_id
formData.append('type_dokumen', 'project-document-in-folder');
diff --git a/src/views/SimproV2/Settings/Desktop.js b/src/views/SimproV2/Settings/Desktop.js
new file mode 100644
index 0000000..d3feacb
--- /dev/null
+++ b/src/views/SimproV2/Settings/Desktop.js
@@ -0,0 +1,53 @@
+import Index from "./components/MyProfile/Index";
+import styles from "./Desktop.module.css";
+import Plan from "./components/Plan/Container1";
+import React, { useState, useEffect } from 'react';
+import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';
+
+const Desktop = () => {
+ const [activeTab, setActiveTab] = useState('tab1')
+ const [typeTab, setTypeTab] = useState('myprofile')
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default Desktop;
diff --git a/src/views/SimproV2/Settings/Desktop.module.css b/src/views/SimproV2/Settings/Desktop.module.css
new file mode 100644
index 0000000..bdb39c7
--- /dev/null
+++ b/src/views/SimproV2/Settings/Desktop.module.css
@@ -0,0 +1,23 @@
+.myProfile,
+.profile {
+ max-width: 100%;
+}
+.profile {
+ align-self: stretch;
+ padding: 15px 30px 30px;
+ box-sizing: border-box;
+ gap: 15px 0;
+
+}
+.myProfile {
+ width: 1300px;
+ border-radius: 30px;
+ background-color: #fff;
+}
+@media screen and (max-width: 1050px) {
+ .profile {
+ padding-top: 20px;
+ padding-bottom: 20px;
+ box-sizing: border-box;
+ }
+}
diff --git a/src/views/SimproV2/Settings/DialogForm.js b/src/views/SimproV2/Settings/DialogForm.js
index 0f36cc1..d968fc7 100644
--- a/src/views/SimproV2/Settings/DialogForm.js
+++ b/src/views/SimproV2/Settings/DialogForm.js
@@ -1,16 +1,15 @@
import React, { useEffect, useState } from 'react'
import {
Modal, ModalHeader, ModalBody, ModalFooter,
- Button, Form, FormGroup, Label, Input, Col, Row,
- Nav, NavItem, NavLink, TabContent, TabPane
+ Button, Form, FormGroup, Label, Input, Col, Row,TabContent, TabPane
} from 'reactstrap';
-
import { Select, DatePicker } from 'antd';
+import moment from "moment";
+import { BASE_SIMPRO_LUMEN_IMAGE_COMPANY } from '../../../const/ApiConst';
+import profile from '../../../assets/img/profile.png'
const { Option } = Select
-
-
const DialogForm = ({
openDialog,
closeDialog,
@@ -27,28 +26,34 @@ const DialogForm = ({
emailProp,
userNameProp,
refferalCode,
- userProfile
+ userProfile,
+ imageProfile
}) => {
- const token = window.localStorage.getItem('token');
- const [typeDialog, setTypeDialog] = useState(typeDialogProp)
const [userName, setUserName] = useState(userNameProp)
const [name, setName] = useState(nameProp)
const [noHp, setNohp] = useState(noHpProp)
const [gender, setGender] = useState(genderProp)
const [address, setAddres] = useState(addressProp)
const [birthdayPlace, setBirthdayplace] = useState(birthdayPlaceProp)
- const [birthdayDate, setBirthdaydate] = useState(birthdayDateProp)
+ const [birthdayDate, setBirthdaydate] = useState(birthdayDateProp && birthdayDateProp != null ? moment(birthdayDateProp) : moment())
const [idNumber, setIdnumber] = useState(idNumberProp)
const [email, setEmail] = useState(emailProp)
const [refferal, setRefferalCode] = useState('')
const [oldPassword, setOldPassword] = useState('')
const [newPassword, setNewPassword] = useState('')
const [newPasswordConfirm, setNewPasswordConfirm] = useState('')
- const [activeTab, setActiveTab] = useState('tab1')
- console.log('typeDialogProp',typeDialogProp)
+ const [profileImage, setImageProfile] = useState(null)
+ const [modalOpen, setModalOpen] = useState(false)
+
+ const role = window.localStorage.getItem('role_name');
+ let configApp = '';
+ if (role !== 'Super Admin') {
+ configApp = JSON.parse(window.localStorage.getItem('configApp'));
+ }
+
const handleSave = () => {
let data = '';
- if (typeDialog === "Personal" && typeDialogProp !== "Refferal") {
+ if (typeDialogProp === "Personal" && typeDialogProp !== "Refferal") {
data = {
name: name,
phone_number: noHp,
@@ -61,11 +66,14 @@ const DialogForm = ({
data.birth_date = birthdayDate;
}
closeDialog('profile', data)
- } else if (typeDialog === "Account" && typeDialogProp !== "Refferal") {
+ } else if (typeDialogProp === "Account" || typeDialogProp === "Settings" && typeDialogProp !== "Refferal") {
data = {
username: userName,
- email: email,
- password: newPassword,
+ email: email
+ }
+ data.profilePicture = profileImage ? profileImage : null;
+ if(typeDialogProp === "Settings" && newPassword && oldPassword && newPasswordConfirm) {
+ data.password = newPassword;
}
closeDialog('profile', data)
} else {
@@ -95,6 +103,10 @@ const DialogForm = ({
)
}
+ const handleDatePickerEnd = (date, dateString) => {
+ setBirthdaydate(date);
+ };
+
function generateRandomString(length) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
let result = '';
@@ -109,30 +121,38 @@ const DialogForm = ({
setRefferalCode(newReferralCode);
}
+ const toggleModal = () => {
+ setModalOpen(!modalOpen);
+ };
+
+ const handleImageClick = async () => {
+ toggleModal();
+ };
+
const renderForm = () => {
return (