mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
FIX Add 'add document set' button and update label for Page
This commit is contained in:
parent
886fd217f2
commit
cbd3a65fa9
@ -43,8 +43,6 @@ class DMSDocumentAdmin extends ModelAdmin
|
||||
$gridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
|
||||
$gridFieldConfig->addComponent(new DMSGridFieldAddNewButton('buttons-before-left'), 'GridFieldExportButton');
|
||||
} elseif ($this->modelClass === 'DMSDocumentSet') {
|
||||
$gridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
|
||||
|
||||
$dataColumns = $gridFieldConfig->getComponentByType('GridFieldDataColumns');
|
||||
$fields = $dataColumns->getDisplayFields($gridField);
|
||||
$fields = array('Title' => 'Title', 'Page.Title' => 'Page') + $fields;
|
||||
|
@ -117,6 +117,9 @@ class DMSDocumentSet extends DataObject
|
||||
$gridFieldConfig->addComponent($sortableComponent);
|
||||
}
|
||||
|
||||
$field = $fields->fieldByName('Root.Main.PageID');
|
||||
$field->setTitle(_t('DMSDocumentSet.SHOWONPAGE', 'Show on page'));
|
||||
|
||||
$gridFieldConfig->getComponentByType('GridFieldDataColumns')
|
||||
->setDisplayFields($self->getDocumentDisplayFields())
|
||||
->setFieldCasting(array('LastEdited' => 'Datetime->Ago'))
|
||||
|
@ -26,6 +26,7 @@ en:
|
||||
ADDDOCUMENTSBUTTON: Add Documents
|
||||
GRIDFIELD_NOTICE: Managing documents will be available once you have created this document set.
|
||||
PLURALNAME: Document Sets
|
||||
SHOWONPAGE: Show on page
|
||||
SINGULARNAME: Document Set
|
||||
DMSDocumentTaxonomyExtension:
|
||||
TAGS: Tags
|
||||
|
@ -47,15 +47,6 @@ class DMSDocumentAdminTest extends FunctionalTest
|
||||
$this->assertEquals(200, $this->get('admin/documents')->getStatusCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the document sets GridField has had its "add new" button removed
|
||||
*/
|
||||
public function testDocumentSetsGridFieldHasNoAddButton()
|
||||
{
|
||||
$result = (string) $this->get('admin/documents/DMSDocumentSet')->getBody();
|
||||
$this->assertNotContains('Add Document Set', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the document sets GridField has a data column for the parent page title. Here we check for the
|
||||
* Page title existing in the DOM, since "Page" is guaranteed to exist somewhere else.
|
||||
|
Loading…
Reference in New Issue
Block a user