Skip to content

Commit e844ca6

Browse files
committed
improve extensibility
1 parent ac968f2 commit e844ca6

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

Diff for: Model/DocumentRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use Opengento\Document\Model\ResourceModel\Document\Collection;
2727
use Opengento\Document\Model\ResourceModel\Document\CollectionFactory;
2828

29-
final class DocumentRepository implements DocumentRepositoryInterface
29+
class DocumentRepository implements DocumentRepositoryInterface
3030
{
3131
/**
3232
* @var DocumentInterfaceFactory

Diff for: Model/DocumentTypeRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use Opengento\Document\Model\ResourceModel\DocumentType\Collection;
2727
use Opengento\Document\Model\ResourceModel\DocumentType\CollectionFactory;
2828

29-
final class DocumentTypeRepository implements DocumentTypeRepositoryInterface
29+
class DocumentTypeRepository implements DocumentTypeRepositoryInterface
3030
{
3131
/**
3232
* @var DocumentTypeInterfaceFactory

Diff for: Model/Validator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\Validator\AbstractValidator;
1111
use Magento\Framework\Validator\ValidatorInterface;
1212

13-
final class Validator extends AbstractValidator
13+
class Validator extends AbstractValidator
1414
{
1515
/**
1616
* @var ValidatorInterface[]

Diff for: etc/frontend/di.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
</argument>
2323
</arguments>
2424
</type>
25-
<virtualType name="Opengento\Document\Model\Document\Collection\FrontendVisibilityModifier" type="Opengento\Document\Model\Document\Collection\VisibilityModifier">
25+
<type name="Opengento\Document\Model\Document\Collection\VisibilityModifier">
2626
<arguments>
2727
<argument name="visibilities" xsi:type="array">
2828
<item name="public" xsi:type="const">Opengento\Document\Model\DocumentType\Visibility::VISIBILITY_PUBLIC</item>
2929
</argument>
3030
</arguments>
31-
</virtualType>
31+
</type>
3232
</config>

Diff for: view/adminhtml/ui_component/document_type_form.xml

+10-12
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,22 @@
7373
<dataScope>code</dataScope>
7474
</settings>
7575
</input>
76-
<field name="scheduled_import" formElement="select" sortOrder="40" >
76+
<checkbox name="scheduled_import" component="Magento_Ui/js/form/element/single-checkbox-toggle-notice" sortOrder="40">
7777
<settings>
78-
<dataType>select</dataType>
78+
<dataType>boolean</dataType>
7979
<label translate="true">Scheduled Import</label>
80+
<description>If set to "yes", this will restrict import documents on schedule.</description>
81+
<valueMap>
82+
<map name="false" xsi:type="number">0</map>
83+
<map name="true" xsi:type="number">1</map>
84+
</valueMap>
85+
<prefer>toggle</prefer>
8086
<validation>
8187
<rule name="required-entry" xsi:type="boolean">true</rule>
8288
</validation>
8389
<dataScope>scheduled_import</dataScope>
8490
</settings>
85-
<formElements>
86-
<select>
87-
<settings>
88-
<options class="Magento\Config\Model\Config\Source\Enabledisable"/>
89-
<caption translate="true">-- Please Select --</caption>
90-
</settings>
91-
</select>
92-
</formElements>
93-
</field>
91+
</checkbox>
9492
<field name="visibility" formElement="select" sortOrder="50" >
9593
<settings>
9694
<dataType>select</dataType>
@@ -161,7 +159,7 @@
161159
</input>
162160
<dynamicRows name="file_allowed_extensions" sortOrder="100">
163161
<settings>
164-
<label translate="true">File Allowed Extensions</label>
162+
<label translate="true">Allowed Files</label>
165163
<addButton>true</addButton>
166164
<addButtonLabel translate="true">Add Extension</addButtonLabel>
167165
<recordTemplate>record</recordTemplate>

0 commit comments

Comments
 (0)