Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Luc Didry
kresus
Commits
3206600e
Commit
3206600e
authored
Mar 05, 2019
by
Nicolas Frandeboeuf
Committed by
Benjamin Bouvier
Mar 07, 2019
Browse files
Ask for confirmation before clearing logs
parent
95e870b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/components/settings/logs/index.js
View file @
3206600e
...
...
@@ -4,6 +4,35 @@ import { connect } from 'react-redux';
import
{
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
get
,
actions
}
from
'
../../../store
'
;
import
{
registerModal
}
from
'
../../ui/modal
'
;
import
CancelAndDelete
from
'
../../ui/modal/cancel-and-delete-buttons
'
;
import
ModalContent
from
'
../../ui/modal/content
'
;
export
const
MODAL_SLUG
=
'
confirm-logs-clear
'
;
const
ConfirmClearModal
=
connect
(
null
,
dispatch
=>
{
return
{
handleDelete
:
()
=>
{
actions
.
clearLogs
(
dispatch
);
actions
.
hideModal
(
dispatch
);
}
};
}
)(
props
=>
{
let
footer
=
<
CancelAndDelete
onDelete
=
{
props
.
handleDelete
}
/>
;
return
(
<
ModalContent
title
=
{
$t
(
'
client.settings.logs.clear
'
)}
body
=
{
$t
(
'
client.settings.logs.confirm_clear
'
)}
footer
=
{
footer
}
/
>
);
});
registerModal
(
MODAL_SLUG
,
()
=>
<
ConfirmClearModal
/>
);
class
LogsSection
extends
React
.
PureComponent
{
handleRefresh
=
()
=>
{
this
.
props
.
resetLogs
();
...
...
@@ -11,7 +40,7 @@ class LogsSection extends React.PureComponent {
};
handleClear
=
()
=>
{
this
.
props
.
clearLogs
();
this
.
props
.
showClearModal
();
};
handleCopy
=
()
=>
{
...
...
@@ -94,8 +123,8 @@ const dispatchToProps = dispatch => {
fetchLogs
()
{
actions
.
fetchLogs
(
dispatch
);
},
clearLogs
()
{
actions
.
clearLogs
(
dispatch
);
showClearModal
()
{
actions
.
showModal
(
dispatch
,
MODAL_SLUG
);
},
resetLogs
()
{
actions
.
resetLogs
(
dispatch
);
...
...
shared/locales/en.json
View file @
3206600e
...
...
@@ -351,7 +351,8 @@
"refresh"
:
"Refresh"
,
"copy"
:
"Copy to clipboard"
,
"copied"
:
"Logs copied to clipboard"
,
"clear"
:
"Clear logs"
"clear"
:
"Clear logs"
,
"confirm_clear"
:
"This will reset your logs. Do you wish to continue?"
}
},
"similarity"
:
{
...
...
shared/locales/fr.json
View file @
3206600e
...
...
@@ -351,7 +351,8 @@
"refresh"
:
"Rafraîchir"
,
"copy"
:
"Copier dans le presse-papiers"
,
"copied"
:
"Journaux copiés dans le presse-papiers"
,
"clear"
:
"Effacer les journaux"
"clear"
:
"Effacer les journaux"
,
"confirm_clear"
:
"Cela effacera tous vos journaux. Voulez-vous continuer ?"
}
},
"similarity"
:
{
...
...
Write
Preview
Supports
Markdown
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