Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
mage-os-ci committed Dec 6, 2023
2 parents 0f59bd3 + 993a4cb commit 4d5e2e1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For more detailed information on contribution please read our [beginners guide](
1. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
1. PRs which include new logic or new features must be submitted along with:
* Unit/integration test coverage
* Proposed [documentation](https://devdocs.magento.com) updates. Documentation contributions can be submitted via the [devdocs GitHub](https://github.com/magento/devdocs).
* Proposed [documentation](https://developer.adobe.com/commerce) updates. Use feedback buttons __Edit in GitHub__ and __Log an issue__ at the top of a relevant topic.
1. For larger features or changes, please [open an issue](https://github.com/magento/inventory/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
1. All automated tests must pass.

Expand Down
10 changes: 10 additions & 0 deletions InventoryAdminUi/Test/Mftf/Test/AdminFilterSourcesInGridTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<see userInput="$$createSource3.source[source_code]$$" selector="{{AdminGridRow.rowOne}}" stepKey="seeCodeInRow1"/>
<see userInput="$$createSource3.source[name]$$" selector="{{AdminGridRow.rowOne}}" stepKey="seeNameInRow1"/>
<see userInput="Enabled" selector="{{AdminGridRow.rowOne}}" stepKey="seeIsEnabledInRow1"/>
<grabTextFrom selector="{{AdminGridHeaders.totalRecords}}" stepKey="grabTotalRecords1"/>
<assertEquals stepKey="assertTotalRecords1">
<expectedResult type="string">1 records found</expectedResult>
<actualResult type="string">$grabTotalRecords1</actualResult>
</assertEquals>

<click selector="{{AdminGridColumnsControls.columns}}" stepKey="clickOnColumns1"/>
<click selector="{{AdminGridColumnsControls.reset}}" stepKey="clickOnResetToRestoreDefaultColumns1"/>
Expand All @@ -57,5 +62,10 @@
<see userInput="$$createSource4.source[source_code]$$" selector="{{AdminGridRow.rowOne}}" stepKey="seeCodeInRow2"/>
<see userInput="$$createSource4.source[name]$$" selector="{{AdminGridRow.rowOne}}" stepKey="seeNameInRow2"/>
<see userInput="Enabled" selector="{{AdminGridRow.rowOne}}" stepKey="seeIsEnabledInRow2"/>
<grabTextFrom selector="{{AdminGridHeaders.totalRecords}}" stepKey="grabTotalRecords2"/>
<assertEquals stepKey="assertTotalRecords2">
<expectedResult type="string">1 records found</expectedResult>
<actualResult type="string">$grabTotalRecords2</actualResult>
</assertEquals>
</test>
</tests>
13 changes: 9 additions & 4 deletions InventoryAdminUi/Ui/DataProvider/SourceDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
*/
class SourceDataProvider extends DataProvider
{
const SOURCE_FORM_NAME = 'inventory_source_form_data_source';
/**
* constant for Source Form Name
*
* @const SOURCE_FORM_NAME
*/
public const SOURCE_FORM_NAME = 'inventory_source_form_data_source';

/**
* @var SourceRepositoryInterface
Expand Down Expand Up @@ -157,17 +162,17 @@ public function getSearchResult()
}

/**
* Get total sources count, without filter be source name.
* Get total sources count, with or without filter be source name.
*
* Get total sources count, without filter in order to ui/grid/columns/multiselect::updateState()
* Get total sources count, with or without filter in order to ui/grid/columns/multiselect::updateState()
* works correctly with sources selection.
*
* @return int
*/
private function getSourcesCount(): int
{
if (!$this->sourceCount) {
$this->sourceCount = $this->sourceRepository->getList()->getTotalCount();
$this->sourceCount = $this->getSearchResult()->getTotalCount();
}

return $this->sourceCount;
Expand Down

0 comments on commit 4d5e2e1

Please sign in to comment.