Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customized empty results message in tables directive #487

Merged
merged 4 commits into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.