foldermodel: hide undo action when it's not available

This action appears only in the context menu, and context menus are
inherently contextual: they should only show things relevant to what was
right-clicked. Therefore it never makes sense to have disabled items in
a context menu; they should be hidden instead.

This commit does that for the Undo action, only showing it in the
context menu when it is contextually relevant.
2 jobs for !814 with hide-undo-action-when-not-available in 4 minutes and 58 seconds (queued for 1 second)
latest merge request