Skip to content

Commit

Permalink
Merge pull request #487 from wazuh/3.9-479
Browse files Browse the repository at this point in the history
Customized empty results message in tables directive
  • Loading branch information
Jesús Ángel authored Jan 21, 2019
2 parents f9c7289 + 542dd01 commit 0942d6c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<!-- Group agents table -->
<div layout="row" ng-if="lookingGroup && groupsSelectedTab==='agents' && currentGroup" class="md-padding">
<wazuh-table admin-mode='adminMode' flex path="'/agents/groups/' + currentGroup.name" keys="['id','name','ip','status','os.name','os.version','version']"
allow-click="true" row-sizes="[14,12,10]" />
allow-click="true" row-sizes="[14,12,10]" empty-results="'No agents were added to this group.'"/>
</div>
<!-- End Group agents table -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ define([
implicitFilter: '=implicitFilter',
rowSizes: '=rowSizes',
extraLimit: '=extraLimit',
adminMode: '=adminMode'
adminMode: '=adminMode',
emptyResults: '=emptyResults'
},
controller(
$rootScope,
Expand All @@ -77,7 +78,10 @@ define([
$scope.totalItems = 0
$scope.wazuhTableLoading = true
$scope.items = []

$scope.customEmptyResults =
$scope.emptyResults && typeof $scope.emptyResults === 'string'
? $scope.emptyResults
: 'Empty results for this table.'
/**
* Resizing. Calculate number of table rows depending on the screen height
*/
Expand Down Expand Up @@ -147,7 +151,10 @@ define([
* @param {String} term
* @param {Boolean} removeFilters
*/
const search = async (term, removeFilters) =>
const search = async (term, removeFilters) => {
if (term && typeof term === 'string') {
$scope.customEmptyResults = 'No results match your search criteria.'
}
data.searchData(
term,
removeFilters,
Expand All @@ -157,6 +164,7 @@ define([
$tableFilterService,
$notificationService
)
}

/**
* Queries to the API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
</defs>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#help-a" fill-rule="evenodd"></use>
</svg>
<span class="euiCallOutHeader__title">No results match your search criteria</span>
<span class="euiCallOutHeader__title">{{customEmptyResults}}</span>
</div>
</div>
</div>
Expand Down
Binary file modified SplunkAppForWazuh/static/appIconAlt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified SplunkAppForWazuh/static/appLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0942d6c

Please sign in to comment.