Browse Source

Merge pull request 'dev-wahyu' (#54) from dev-wahyu into staging

Reviewed-on: ordo/adw-frontend#54
pull/2/head
ibnu 2 years ago
parent
commit
1100d5d58a
  1. 1
      src/routes.js
  2. 4
      src/views/SimproV2/CreatedProyek/ImportActivity/index.js
  3. 3
      src/views/SimproV2/Gantt/index.js

1
src/routes.js

@ -59,6 +59,7 @@ const routes = [
{ path: '/projects/:id/import/activity', exact: true, name: 'Gantt Import Activity', component: GanttImportActivity }, { path: '/projects/:id/import/activity', exact: true, name: 'Gantt Import Activity', component: GanttImportActivity },
{ path: '/projects/:id/:project/import/activity', exact: true, name: 'Gantt Import Activity', component: GanttImportActivity }, { path: '/projects/:id/:project/import/activity', exact: true, name: 'Gantt Import Activity', component: GanttImportActivity },
{ path: '/projects/:id/:project/gantt', exact: true, name: 'Gantt', component: Gantt }, { path: '/projects/:id/:project/gantt', exact: true, name: 'Gantt', component: Gantt },
{ path: '/projects/:id/:project/:timestamp/gantt/', exact: true, name: 'Gantt', component: Gantt },
{ path: '/human-resource', exact: true, name: 'Human Resource', component: ResourceWorker }, { path: '/human-resource', exact: true, name: 'Human Resource', component: ResourceWorker },
{ path: '/material-resource', exact: true, name: 'Material Resource', component: ResourceMaterial }, { path: '/material-resource', exact: true, name: 'Material Resource', component: ResourceMaterial },
{ path: '/tools-resource', exact: true, name: 'Tools Resource', component: ResourceTools }, { path: '/tools-resource', exact: true, name: 'Tools Resource', component: ResourceTools },

4
src/views/SimproV2/CreatedProyek/ImportActivity/index.js

@ -232,7 +232,9 @@ const ImportActivity = ({ params }) => {
console.log(result) console.log(result)
if (result.data.code == 200) { if (result.data.code == 200) {
window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/gantt' const timestamp = Date.now();
const newTimestamp = timestamp + 60000;
window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/' + newTimestamp + '/gantt'
} }
setIsMovePage(true); setIsMovePage(true);

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

@ -21,6 +21,7 @@ let roCount = 0;
const Gantt = (props) => { const Gantt = (props) => {
const versionGanttId = props.match.params ? props.match.params.id : 0; const versionGanttId = props.match.params ? props.match.params.id : 0;
const idProject = props.match.params.project ? props.match.params.project : 0; const idProject = props.match.params.project ? props.match.params.project : 0;
const timestamp = props.match.params.timestamp ? props.match.params.timestamp : 0;
const [ro, setRo] = useState(1) const [ro, setRo] = useState(1)
const [listUserGant, setListUserGantt] = useState([]) const [listUserGant, setListUserGantt] = useState([])
@ -84,7 +85,7 @@ const Gantt = (props) => {
const RenderGantt = () => ( const RenderGantt = () => (
<iframe <iframe
id="frame-gantt" id="frame-gantt"
src={`https://adw-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}`} src={`https://adw-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}`}
style={{ style={{
width: '100%', width: '100%',
height: '95vh', height: '95vh',

Loading…
Cancel
Save