-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Updated UI for versioned objects and all its versioned relations #2912
ENH Updated UI for versioned objects and all its versioned relations #2912
Conversation
7e232bb
to
11391a0
Compare
7b09a31
to
d8d0b32
Compare
d8d0b32
to
f5b6fc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to bump the constraint for silverstripe/frameworktest in composer.json to whatever the new patch release of frameworktest is
code/Controllers/CMSMain.php
Outdated
$flags = []; | ||
if ($record->isOnLiveOnly()) { | ||
$flags['removedfromdraft'] = [ | ||
'text' => _t(__CLASS__.'.ONLIVEONLYSHORT', 'On live only'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'text' => _t(__CLASS__.'.ONLIVEONLYSHORT', 'On live only'), | |
'text' => _t(__CLASS__ . '.ON_LIVE_ONLY_SHORT', 'On live only'), |
Need spaces around the .
used for concatenation, and add underscores between words
Do this for all added translations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ONLIVEONLYSHORT
, ARCHIVEDPAGESHORT
, MODIFIEDONDRAFTSHORT
already exist in yml
files for CMSMain
class. And ADDEDTODRAFTSHORT
I've added as new for CMSMain
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. I left ONLIVEONLYSHORT
as is since we already have this key in lang files.
lang/en.yml
Outdated
@@ -14,8 +14,12 @@ en: | |||
SilverStripe\CMS\Controllers\CMSMain: | |||
ACCESS: "Access to '{title}' section" | |||
ACCESS_HELP: 'Allow viewing of the section containing page tree and content. View and edit permissions can be handled through page specific dropdowns, as well as the separate "Content permissions".' | |||
ADDEDTODRAFTSHORT: 'Draft' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just revert changes to en.yml - this file will be automatically added when we run https://github.com/silverstripe/silverstripe-tx-translator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Then I should see "My Page" in the ".breadcrumbs-wrapper" element | ||
And I should see "Draft" in the ".breadcrumbs-wrapper" element | ||
And I click on the "#tab-Root_NonVersionedParentObjects" element | ||
Then I click "My Non Versioned Parent Object" in the "#Form_EditForm_NonVersionedParentObjects" element on page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to use the whatever is decided that we use in silverstripe/silverstripe-behat-extension#259 (review)
Also updated any other references in this behat test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
code/Controllers/CMSMain.php
Outdated
$flags .= sprintf( | ||
'<span class="badge version-status version-status--%s" %s>%s</span>', | ||
'status-' . Convert::raw2xml($flag), | ||
(isset($flagData['title'])) ? sprintf(' title="%s"', Convert::raw2xml($flagData['title'])) : '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This nested line is a little messy, could you assign it to a variable above the sprintf()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
code/Controllers/CMSMain.php
Outdated
$this->extend('updateBreadcrumbs', $items); | ||
|
||
return $items; | ||
} | ||
|
||
private function getStatusFlag($record) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strongly type param and return type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
15ba825
to
4ea4fc7
Compare
4ea4fc7
to
57bdb2b
Compare
Closing - we can reference this PR if we decide to go forward with this work in the future, pending the spike. |
Description
These changes add the "Modified" badge to the record if the current object does not have the Versioned extension, and child objects have the Versioned extension, and also have new changes.
Parent issue