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
cfc267f6
Commit
cfc267f6
authored
Jul 14, 2022
by
muhammad ridwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed upload / update
parent
890db147
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
45 deletions
+1
-45
CarfmDocument.js
src/container/CRFM/CarfmDocument.js
+1
-43
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 @
cfc267f6
...
@@ -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'
})
}
}
...
@@ -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 @
cfc267f6
...
@@ -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 @
cfc267f6
...
@@ -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