Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
26a2efe5
Commit
26a2efe5
authored
Jul 14, 2022
by
muhammad ridwan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'env/ridwan' into 'ENV-DEV-CR-CAFRM'
Env/ridwan See merge request
!1586
parents
0a3ec303
cfc267f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
47 deletions
+3
-47
CarfmDocument.js
src/container/CRFM/CarfmDocument.js
+3
-45
CreateCarfmDoc.js
src/container/CRFM/CreateCarfmDoc.js
+0
-1
CreateDocumentManagement.js
src/container/DocumentManagement/CreateDocumentManagement.js
+0
-1
No files found.
src/container/CRFM/CarfmDocument.js
View file @
26a2efe5
...
@@ -8,7 +8,6 @@ import ReactTooltip from 'react-tooltip';
...
@@ -8,7 +8,6 @@ import ReactTooltip from 'react-tooltip';
import
api
from
'../../api'
;
import
api
from
'../../api'
;
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
TableDocument
from
"./TableDocument"
;
import
TableDocument
from
"./TableDocument"
;
import
PopUpKonfirmasi
from
"../DocumentManagement/PopUpKonfirmasi"
;
import
CreateCarfmDoc
from
"./CreateCarfmDoc"
;
import
CreateCarfmDoc
from
"./CreateCarfmDoc"
;
const
Alert
=
withStyles
({})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
const
Alert
=
withStyles
({})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
...
@@ -198,48 +197,13 @@ export default class CarfmDocument extends Component {
...
@@ -198,48 +197,13 @@ export default class CarfmDocument extends Component {
})
})
}
}
async
createUploadDocument
()
{
this
.
setState
({
visibleCreate
:
false
,
konfirmasi
:
false
})
const
formData
=
this
.
state
.
formData
formData
.
append
(
"documentId"
,
this
.
state
.
docId
)
formData
.
append
(
"updated"
,
1
)
this
.
setState
({
loading
:
true
})
await
api
.
create
().
updateDocument
(
formData
).
then
(
response
=>
{
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getDataDocument
(
this
.
state
.
settingID
,
this
.
state
.
menuName
)
this
.
setState
({
konfirmasi
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
visibleCreate
:
false
,
loading
:
false
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
async
createDocument
(
payload
)
{
//upload apinya disini
async
createDocument
(
payload
)
{
//upload apinya disini
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
})
await
api
.
create
().
uploadCarfmDocument
(
payload
).
then
(
response
=>
{
await
api
.
create
().
uploadCarfmDocument
(
payload
).
then
(
response
=>
{
// console.log(response)
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
message
===
"The Document Already Exists in The System, Do You Want to Overwrite It?"
)
{
if
(
response
.
data
.
message
===
"Data was Saved Successfully"
)
{
this
.
setState
({
konfirmasi
:
true
,
formData
:
payload
,
docId
:
response
.
data
.
data
.
document_id
,
loading
:
false
})
}
else
if
(
response
.
data
.
message
===
"Data was Saved Successfully"
)
{
this
.
getDataCarfm
(
'create'
)
this
.
getDataCarfm
(
'create'
)
this
.
setState
({
visibleCreate
:
false
,
loading
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
visibleCreate
:
false
,
loading
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
}
...
@@ -254,10 +218,10 @@ export default class CarfmDocument extends Component {
...
@@ -254,10 +218,10 @@ export default class CarfmDocument extends Component {
})
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
this
.
setState
({
visibleCreate
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
this
.
setState
({
visibleCreate
:
false
,
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
})
})
}
}
...
@@ -359,12 +323,6 @@ export default class CarfmDocument extends Component {
...
@@ -359,12 +323,6 @@ export default class CarfmDocument extends Component {
)}
)}
</div>
</div>
{this.state.konfirmasi && (
<PopUpKonfirmasi
onClickClosePopUp={() => this.setState({ konfirmasi: false })}
uploadDocId={this.createUploadDocument.bind(this)}
/>
)}
{this.state.visibleCreate && (
{this.state.visibleCreate && (
<CreateCarfmDoc
<CreateCarfmDoc
onClickClose={() => this.setState({ visibleCreate: false })}
onClickClose={() => this.setState({ visibleCreate: false })}
...
...
src/container/CRFM/CreateCarfmDoc.js
View file @
26a2efe5
...
@@ -44,7 +44,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -44,7 +44,6 @@ export default class CreateCarfmDoc extends Component {
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
,
messageAlert
:
''
,
fileType
:
''
,
fileType
:
''
,
konfirmasi
:
false
,
docId
:
''
,
docId
:
''
,
sizeUpload
:
"1"
,
sizeUpload
:
"1"
,
disabledPeriode
:
false
,
disabledPeriode
:
false
,
...
...
src/container/DocumentManagement/CreateDocumentManagement.js
View file @
26a2efe5
...
@@ -44,7 +44,6 @@ export default class CreateManagementDoc extends Component {
...
@@ -44,7 +44,6 @@ export default class CreateManagementDoc extends Component {
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
,
messageAlert
:
''
,
fileType
:
''
,
fileType
:
''
,
konfirmasi
:
false
,
docId
:
''
,
docId
:
''
,
sizeUpload
:
"1"
,
sizeUpload
:
"1"
,
disabledPeriode
:
false
disabledPeriode
:
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment