Merge pull request #199 from creative-commoners/pulls/2.1/rename-documentsets-tab-name

API Rename the DocumentSets tab name to remove spaces
This commit is contained in:
Robbie Averill 2017-12-01 14:52:15 +13:00 committed by GitHub
commit 14b615f1e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View File

@ -39,9 +39,17 @@ class DMSSiteTreeExtension extends DataExtension
);
$fields->addFieldToTab(
'Root.Document Sets (' . $this->owner->DocumentSets()->count() . ')',
'Root.DocumentSets',
$gridField
);
$fields
->findOrMakeTab('Root.DocumentSets')
->setTitle(_t(
__CLASS__ . '.DocumentSetsTabTitle',
'Document Sets ({count})',
array('count' => $this->owner->DocumentSets()->count())
));
}
/**

View File

@ -32,6 +32,8 @@ en:
SHOWONPAGE: Show on page
SINGULARNAME: Document Set
TAGS_RIGHT_TITLE: Tags can be set in the taxonomy area, and can be assigned when editing a document.
DMSSiteTreeExtension:
DocumentSetsTabTitle: 'Document Sets ({count})'
DMSDocumentTaxonomyExtension:
TAGS: Tags
NOTAGS: No tags found

View File

@ -22,7 +22,7 @@ class DMSSiteTreeExtensionTest extends SapphireTest
{
Config::inst()->update('SiteTree', 'documents_enabled', $configSetting);
$siteTree = $this->objFromFixture('SiteTree', 's2');
$this->$assertionMethod($siteTree->getCMSFields()->fieldByName('Root.Document Sets (1).Document Sets'));
$this->$assertionMethod($siteTree->getCMSFields()->fieldByName('Root.DocumentSets.DocumentSets'));
}
/**
@ -45,7 +45,7 @@ class DMSSiteTreeExtensionTest extends SapphireTest
{
Config::inst()->update('SiteTree', 'documents_enabled', true);
$siteTree = $this->objFromFixture('SiteTree', 's2');
$gridField = $siteTree->getCMSFields()->fieldByName('Root.Document Sets (1).Document Sets');
$gridField = $siteTree->getCMSFields()->fieldByName('Root.DocumentSets.DocumentSets');
$this->assertInstanceOf('GridField', $gridField);
$this->assertTrue((bool) $gridField->hasClass('documentsets'));
@ -90,7 +90,7 @@ class DMSSiteTreeExtensionTest extends SapphireTest
public function testGetRelatedDocumentsForAutocompleter()
{
$page = $this->objFromFixture('SiteTree', 's1');
$gridField = $page->getCMSFields()->fieldByName('Root.Document Sets (2).Document Sets');
$gridField = $page->getCMSFields()->fieldByName('Root.DocumentSets.DocumentSets');
$this->assertInstanceOf('GridField', $gridField);
$autocompleter = $gridField->getConfig()->getComponentByType('GridFieldAddExistingAutocompleter');