Skip to content

Conversation

@emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Aug 15, 2024

Issue silverstripe/silverstripe-admin#1799

GraphQL is becoming an optional module, so docs are being re-housed in the GraphQL module

@emteknetnz emteknetnz force-pushed the pulls/6/remove-graphql branch 5 times, most recently from fcb8db7 to ac22c8f Compare August 19, 2024 05:39
@emteknetnz emteknetnz marked this pull request as ready for review August 19, 2024 22:14
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emteknetnz emteknetnz force-pushed the pulls/6/remove-graphql branch 2 times, most recently from 5c3771a to 906da23 Compare August 22, 2024 02:05
@emteknetnz
Copy link
Member Author

emteknetnz commented Aug 22, 2024

Have removed the other mentions of graphql in the docs


See [Reading versions by stage](#reading-versions-by-stage) for more about using reading modes.

## Using the history viewer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to document the new way to do it, rather than just deleting the docs altogether. This is still a valid thing for people to want to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out you can just add HistoryViewerField to your form and it works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still hasn't been updated? It should be pretty quick docs to write. Just a short php example adding that field to a new Root.History tab.

Copy link
Member Author

@emteknetnz emteknetnz Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added.

In my testing I noticed pretty quickly the DataObjects with has_many relations doesn't work in the history viewer, because there's no react GridField. I've opted to just remove the GridFields

  • I'm manually removing them in the versioned-admin PR here
  • I've added a comment to the framework PR about why we don't use the structural schema data type

I also noticed that when reverting a DataObject that the edit form still shows the old record instead of the reverted to version, so I've opted to simply refresh the entire page. Regular pages don't have this issue because the pages reloads when switching between tabs (which doesn't happen with regular DataObjects). New code to do that here

@GuySartorelli
Copy link
Member

Linting failure as well.

@emteknetnz emteknetnz force-pushed the pulls/6/remove-graphql branch from 906da23 to 6129be0 Compare August 22, 2024 06:27

See [Reading versions by stage](#reading-versions-by-stage) for more about using reading modes.

## Using the history viewer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still hasn't been updated? It should be pretty quick docs to write. Just a short php example adding that field to a new Root.History tab.

@emteknetnz emteknetnz force-pushed the pulls/6/remove-graphql branch 3 times, most recently from b7ef6aa to 01392da Compare August 28, 2024 02:09
@GuySartorelli
Copy link
Member

Still has a linting failure.

@emteknetnz emteknetnz force-pushed the pulls/6/remove-graphql branch 2 times, most recently from d339e38 to f48b162 Compare August 29, 2024 00:58
@emteknetnz emteknetnz force-pushed the pulls/6/remove-graphql branch from f48b162 to b5a8f84 Compare August 30, 2024 00:06
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-approved most recent changes

This example assumes you have some `DataObject` model and somewhere to view that model (e.g. in a `ModelAdmin`). We'll walk you through the steps required to add some JavaScript to tell the history viewer how to handle requests for your model.

For this example we'll start with this simple `DataObject`:
You can add the [`HistoryViewerField`](api:SilverStripe\VersionedAdmin\Forms\HistoryViewerField) to the edit form of any [`DataObject`](api:SilverStripe\ORM\DataObject) with the [`Versioned`](api:SilverStripe\Versioned\Versioned) extension. This will allow CMS users revert to a previous version of the record.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can add the [`HistoryViewerField`](api:SilverStripe\VersionedAdmin\Forms\HistoryViewerField) to the edit form of any [`DataObject`](api:SilverStripe\ORM\DataObject) with the [`Versioned`](api:SilverStripe\Versioned\Versioned) extension. This will allow CMS users revert to a previous version of the record.
You can add the [`HistoryViewerField`](api:SilverStripe\VersionedAdmin\Forms\HistoryViewerField) to the edit form of any [`DataObject`](api:SilverStripe\ORM\DataObject) with the [`Versioned`](api:SilverStripe\Versioned\Versioned) extension. This will allow CMS users to view the version history for the record and revert to a previous version of the record.

@GuySartorelli GuySartorelli merged commit a14f291 into silverstripe:6 Sep 2, 2024
@GuySartorelli GuySartorelli deleted the pulls/6/remove-graphql branch September 2, 2024 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants