Nemanja Karadzic

query for reading object is readOneMyAppMyVersionedObjectQuery (note that only first part of namespace is added to class name) and HistoryViewerToolbar.VersionedAdmin.HistoryViewer.MyVersionedObject.HistoryViewerVersionDetail (no namespace in name)

Nemanja Karadzic

Show 1 attachment(s)
Changed "revert" button title when revert is possible. by manja · Pull Request #135 · silverstripe/silverstripe-versioned-admin

If revert wasn't already in process, button was always showing 'Unavailable for the current version' message - both for the latest version (which clearly one can't revert to) and al...

Hide attachment content
Nemanja Karadzic

mainly because it's not MyVersionedObject but MyApp\MyDataObjects\MyVersionedObject

Nemanja Karadzic

and if I had to bet, I would say that I fucked up somewhere around this:

  1. Injector.transform(
  2. 'myversionedobject-history-revert', (updater) => {
  3. updater.component(
  4. 'HistoryViewerToolbar.VersionedAdmin.HistoryViewer.MyVersionedObject.HistoryViewerVersionDetail',
  5. revertToMyVersionedObjectVersionMutation,
  6. 'MyVersionedObjectRevertMutation'
  7. );
  8. }
  9. );
Nemanja Karadzic

title attribute of the button (given that revert is not in progress) is always Unavailable for the current version - no matter is it available or not. Which means I spent some hours trying to figure out why was it unavailable, instead of checking why click handler is not attached 🙂

Nemanja Karadzic
  1. const revertButtonTitle = isReverting
  2. ? i18n._t('HistoryViewerToolbar.REVERT_IN_PROGRESS', 'Revert in progress...')
  3. : i18n._t('HistoryViewerToolbar.REVERT_UNAVAILABLE', 'Unavailable for the current version');