Skip to content
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

Closed

Conversation

sabina-talipova
Copy link
Contributor

@sabina-talipova sabina-talipova commented Dec 21, 2023

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

@sabina-talipova sabina-talipova force-pushed the pulls/5/versioned-ui branch 2 times, most recently from 7b09a31 to d8d0b32 Compare December 21, 2023 23:50
Copy link
Member

@emteknetnz emteknetnz left a 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

$flags = [];
if ($record->isOnLiveOnly()) {
$flags['removedfromdraft'] = [
'text' => _t(__CLASS__.'.ONLIVEONLYSHORT', 'On live only'),
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
'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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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'
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

$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'])) : '',
Copy link
Member

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()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

$this->extend('updateBreadcrumbs', $items);

return $items;
}

private function getStatusFlag($record)
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@sabina-talipova sabina-talipova force-pushed the pulls/5/versioned-ui branch 5 times, most recently from 15ba825 to 4ea4fc7 Compare January 10, 2024 00:51
@GuySartorelli
Copy link
Member

Closing - we can reference this PR if we decide to go forward with this work in the future, pending the spike.

@GuySartorelli GuySartorelli deleted the pulls/5/versioned-ui branch May 28, 2024 23:14
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.

3 participants