Skip to content

Commit e90da1a

Browse files
committed
add tool-tips to the file-actions buttons
1 parent bb28172 commit e90da1a

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

webapp/src/ZSD/Components/ActionButton.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Data.Monoid (guard)
1111

1212
type Props
1313
= { text :: String
14+
, title :: String
1415
, textConfirm :: String
1516
, icon :: String
1617
, action :: Effect Unit
@@ -47,6 +48,7 @@ actionButton = make component { initialState, render }
4748
Clean ->
4849
R.button
4950
{ className: className <> guard (not self.props.enabled) " disabled"
51+
, title: self.props.title
5052
, onClick: capture_ $ update self Clicked
5153
, children:
5254
[ R.span { className: self.props.icon <> " p-1" }
@@ -56,6 +58,7 @@ actionButton = make component { initialState, render }
5658
Clicked ->
5759
R.button
5860
{ className: className <> " btn-warning"
61+
, title: self.props.title
5962
, onClick: capture_ $ update self Confirmed
6063
, children:
6164
[ R.span { className: "fas fa-exclamation p-1" }

webapp/src/ZSD/Fragments/FileActions.purs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ fileAction = make component { initialState, render, didMount, didUpdate }
118118
[ R.div
119119
{ className: "btn-group"
120120
, children:
121-
[ btn "View" "fas fa-eye" View
121+
[ btn "View" "Display file content" "fas fa-eye" View
122122
$ A.any (\f -> f self.state.mimeType) [ MimeType.isText, MimeType.isImage, MimeType.isPDF ]
123-
, btn "Diff" "fas fa-random" Diff $ MimeType.isText self.state.mimeType
124-
, btn "Download" "fas fa-download" Download true
123+
, btn "Diff" "Display a diff to the actual version" "fas fa-random" Diff $ MimeType.isText self.state.mimeType
124+
, btn "Download" "Download the selected version" "fas fa-download" Download true
125125
, actionButton
126126
{ text: "Restore"
127+
, title: "Restore the selected version"
127128
, icon: "fas fa-archive"
128129
, textConfirm: "Restore the old version of " <> (unwrap self.props.file).name
129130
, action: update self Restore
@@ -161,12 +162,13 @@ fileAction = make component { initialState, render, didMount, didUpdate }
161162
]
162163
}
163164
where
164-
btn title icon action enabled =
165+
btn name title icon action enabled =
165166
R.button
166167
{ className:
167168
"btn btn-secondary" <> guard (not enabled) " disabled"
168169
<> guard (self.state.cmd == action) " active"
169-
, id: "btn-" <> S.toLower title
170+
, id: "btn-" <> S.toLower name
171+
, title
170172
, onClick:
171173
capture_
172174
$ if (enabled) then
@@ -175,7 +177,7 @@ fileAction = make component { initialState, render, didMount, didUpdate }
175177
pure unit
176178
, children:
177179
[ R.span { className: icon <> " p-1" }
178-
, R.text title
180+
, R.text name
179181
]
180182
}
181183

webapp/src/ZSD/Fragments/FileActions/ViewDiff.purs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ viewDiff = make component { initialState, render, didMount, didUpdate }
120120
, children:
121121
[ actionButton
122122
{ text: "Revert"
123+
, title: "Revert this change"
123124
, textConfirm: "Revert this change"
124125
, icon: ""
125126
, action: update self (Revert idx)
@@ -138,6 +139,7 @@ viewDiff = make component { initialState, render, didMount, didUpdate }
138139
, children:
139140
[ actionButton
140141
{ text: "Revert"
142+
, title: "Revert this change"
141143
, textConfirm: "Revert this change"
142144
, icon: ""
143145
, action: update self (Revert idx)

0 commit comments

Comments
 (0)