Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-web
Commits
be5008e0
Commit
be5008e0
authored
2 years ago
by
devendra
Browse files
Options
Download
Patches
Plain Diff
Feat: Delete Form feature
parent
aa84cca4
master
delete-form
1 merge request
!12
Delete form
This commit is part of merge request
!12
. Comments created here will be created in the context of that merge request.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/form/ListForms.js
+30
-37
src/components/form/ListForms.js
src/constants/LangConstants.ts
+2
-1
src/constants/LangConstants.ts
with
32 additions
and
38 deletions
+32
-38
src/components/form/ListForms.js
+
30
−
37
Edit
View file @
be5008e0
...
@@ -67,24 +67,7 @@ class ListForms extends Component {
...
@@ -67,24 +67,7 @@ class ListForms extends Component {
}
else
{
}
else
{
formData
.
status
=
LANG
.
FORM_STATUS
.
UNPUBLISH
;
formData
.
status
=
LANG
.
FORM_STATUS
.
UNPUBLISH
;
}
}
FormService
.
add
(
formData
).
then
(
this
.
saveFormDetails
(
formData
,
false
);
(
response
)
=>
{
if
(
response
.
statusInfo
.
statusCode
===
APP
.
CODE
.
SUCCESS
)
{
Notify
.
success
(
response
.
statusInfo
.
statusMessage
);
// this.props.updateParent(response.responseData.id);
setTimeout
(()
=>
{
this
.
getAllForms
();
},
500
);
}
else
{
Notify
.
error
(
response
.
statusInfo
.
errorMessage
);
}
},
(
error
)
=>
{
error
.
statusInfo
?
Notify
.
error
(
error
.
statusInfo
.
errorMessage
)
:
Notify
.
error
(
error
.
message
);
}
);
};
};
searchForms
=
(
event
)
=>
{
searchForms
=
(
event
)
=>
{
...
@@ -111,25 +94,35 @@ class ListForms extends Component {
...
@@ -111,25 +94,35 @@ class ListForms extends Component {
// };
// };
deleteForm
=
()
=>
{
deleteForm
=
()
=>
{
this
.
setState
({
showConfirmModal
:
false
});
const
formData
=
{...
this
.
state
.
formToDelete
,
status
:
LANG
.
FORM_STATUS
.
DELETED
}
// FormService.deleteForm(formToDelete?.id).then(
saveFormDetails
(
formData
,
true
);
// (response) => {
}
// if (response.statusInfo && response.statusInfo.statusCode === APP.CODE.SUCCESS) {
// console.log(response.responseData);
// Notify.success('Form deleted successfully!');
saveFormDetails
=
(
formData
,
isDelete
)
=>
{
// getAllForms();
FormService
.
add
(
formData
).
then
(
// } else {
(
response
)
=>
{
// Notify.error(response.statusInfo.errorMessage);
if
(
response
.
statusInfo
.
statusCode
===
APP
.
CODE
.
SUCCESS
)
{
// }
if
(
isDelete
)
{
// this.setState({showConfirmModal: false});
this
.
setState
({
showConfirmModal
:
false
});
// },
Notify
.
success
(
"
Form deleted successfully
"
)
// (error) => {
}
else
{
// error.statusInfo
Notify
.
success
(
response
.
statusInfo
.
statusMessage
);
// ? Notify.error(error.statusInfo.errorMessage)
}
// : Notify.error(error.message);
// this.props.updateParent(response.responseData.id);
// this.setState({showConfirmModal: false});
setTimeout
(()
=>
{
// }
this
.
getAllForms
();
// );
},
500
);
}
else
{
Notify
.
error
(
response
.
statusInfo
.
errorMessage
);
}
},
(
error
)
=>
{
error
.
statusInfo
?
Notify
.
error
(
error
.
statusInfo
.
errorMessage
)
:
Notify
.
error
(
error
.
message
);
}
);
}
}
render
()
{
render
()
{
...
...
This diff is collapsed.
Click to expand it.
src/constants/LangConstants.ts
+
2
−
1
Edit
View file @
be5008e0
...
@@ -28,7 +28,8 @@ export const LANG = {
...
@@ -28,7 +28,8 @@ export const LANG = {
APPROVED
:
"
APPROVED
"
,
APPROVED
:
"
APPROVED
"
,
REJECTED
:
"
REJECTED
"
,
REJECTED
:
"
REJECTED
"
,
LEAD_INSPECTION_COMPLETED
:
"
LEADINSCOMPLETED
"
,
LEAD_INSPECTION_COMPLETED
:
"
LEADINSCOMPLETED
"
,
ASSISTING_INSPECTION_COMPLETED
:
"
INSCOMPLETED
"
ASSISTING_INSPECTION_COMPLETED
:
"
INSCOMPLETED
"
,
DELETED
:
"
DELETED
"
},
},
COL
:
{
COL
:
{
1
:
1
,
1
:
1
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets