mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02:30
Merge pull request #639 from mabashian/list-no-results
Merged - part of #564
This commit is contained in:
@@ -130,6 +130,7 @@ table, tbody {
|
|||||||
|
|
||||||
.List-header {
|
.List-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
height: 34px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.List-title {
|
.List-title {
|
||||||
@@ -231,3 +232,15 @@ table, tbody {
|
|||||||
background-color: @list-srch-btn-hov-bg;
|
background-color: @list-srch-btn-hov-bg;
|
||||||
color: @list-srch-btn-icon;
|
color: @list-srch-btn-icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.List-noItems {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid @list-no-items-bord;
|
||||||
|
background-color: @list-no-items-bg;
|
||||||
|
color: @list-no-items-txt;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc function
|
* @ngdoc function
|
||||||
* @name helpers.function:search
|
* @name helpers.function:search
|
||||||
@@ -499,6 +499,14 @@ export default
|
|||||||
if (load) {
|
if (load) {
|
||||||
scope[set] = []; //clear the list array to make sure 'Loading' is the only thing visible on the list
|
scope[set] = []; //clear the list array to make sure 'Loading' is the only thing visible on the list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(scope[iterator + 'SearchValue' + modifier] && scope[iterator + 'SearchValue' + modifier] != '') {
|
||||||
|
scope[iterator + '_active_search'] = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope[iterator + '_active_search'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
scope.$emit('prepareSearch', iterator, page, load, calcOnly, deferWaitStop, spinner);
|
scope.$emit('prepareSearch', iterator, page, load, calcOnly, deferWaitStop, spinner);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ export default function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
columnClass: 'col-md-2 col-sm-3 col-xs-3',
|
||||||
|
|
||||||
edit: {
|
edit: {
|
||||||
ngClick: "editCustomInv(inventory_script.id)",
|
ngClick: "editCustomInv(inventory_script.id)",
|
||||||
icon: 'fa-edit',
|
icon: 'fa-edit',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('AllJobsDefinition', ['sanitizeFilter', 'capitalizeFilter'])
|
angular.module('AllJobsDefinition', ['sanitizeFilter', 'capitalizeFilter'])
|
||||||
@@ -85,6 +85,9 @@ export default
|
|||||||
actions: { },
|
actions: { },
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
columnClass: 'col-lg-2 col-md-3 col-sm-4 col-xs-4',
|
||||||
|
|
||||||
submit: {
|
submit: {
|
||||||
icon: 'icon-rocket',
|
icon: 'icon-rocket',
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
columnClass: 'col-md-3 col-sm-3 col-xs-3',
|
||||||
|
|
||||||
edit: {
|
edit: {
|
||||||
ngClick: "editCredential(credential.id)",
|
ngClick: "editCredential(credential.id)",
|
||||||
icon: 'fa-edit',
|
icon: 'fa-edit',
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
columnClass: 'col-md-2 col-sm-4 col-xs-4',
|
||||||
|
|
||||||
edit: {
|
edit: {
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
ngClick: 'editInventory(inventory.id)', //'editInventoryProperties(inventory.id)',
|
ngClick: 'editInventory(inventory.id)', //'editInventoryProperties(inventory.id)',
|
||||||
|
|||||||
@@ -23,15 +23,15 @@ export default
|
|||||||
name: {
|
name: {
|
||||||
key: true,
|
key: true,
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
// columnClass: 'col-lg-5 col-md-5 col-sm-9 col-xs-8'
|
columnClass: 'col-lg-4 col-md-5 col-sm-6 col-xs-6'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
// columnClass: 'col-lg-4 col-md-3 hidden-sm hidden-xs'
|
columnClass: 'col-lg-3 col-md-3 hidden-sm hidden-xs'
|
||||||
},
|
},
|
||||||
smart_status: {
|
smart_status: {
|
||||||
label: 'Status',
|
label: 'Status',
|
||||||
columnClass: 'List-tableCell col-lg-1 col-md-2 col-sm-2 col-xs-4',
|
columnClass: 'List-tableCell col-lg-3 col-md-2 col-sm-3 col-xs-3',
|
||||||
searchable: false,
|
searchable: false,
|
||||||
nosort: true,
|
nosort: true,
|
||||||
ngInclude: "'/static/partials/job-template-smart-status.html'",
|
ngInclude: "'/static/partials/job-template-smart-status.html'",
|
||||||
@@ -52,6 +52,9 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
columnClass: 'col-lg-2 col-md-2 col-sm-3 col-xs-3',
|
||||||
|
|
||||||
submit: {
|
submit: {
|
||||||
label: 'Launch',
|
label: 'Launch',
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
columnClass: 'col-lg-3 col-md-2 col-sm-3 col-xs-3',
|
||||||
|
|
||||||
edit: {
|
edit: {
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
ngClick: "editTeam(team.id)",
|
ngClick: "editTeam(team.id)",
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
columnClass: 'col-md-3 col-sm-3 col-xs-3',
|
||||||
|
|
||||||
edit: {
|
edit: {
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
ngClick: "editUser(user.id)",
|
ngClick: "editUser(user.id)",
|
||||||
|
|||||||
@@ -62,6 +62,9 @@
|
|||||||
@list-srch-btn-icon: @default-icon;
|
@list-srch-btn-icon: @default-icon;
|
||||||
@list-srch-btn-bg: @default-bg;
|
@list-srch-btn-bg: @default-bg;
|
||||||
@list-srch-btn-hov-bg: @default-tertiary-bg;
|
@list-srch-btn-hov-bg: @default-tertiary-bg;
|
||||||
|
@list-no-items-txt: @default-icon;
|
||||||
|
@list-no-items-bord: #F6F6F6;
|
||||||
|
@list-no-items-bg: @default-secondary-bg;
|
||||||
|
|
||||||
// tooltups
|
// tooltups
|
||||||
@tooltip-bg: @default-interface-txt;
|
@tooltip-bg: @default-interface-txt;
|
||||||
|
|||||||
@@ -341,8 +341,12 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
|||||||
html += "<div class=\"List-well\">\n";
|
html += "<div class=\"List-well\">\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show the "no items" box when loading is done and the user isn't actively searching and there are no results
|
||||||
|
html += "<div class=\"List-noItems\" ng-show=\"" + list.iterator + "Loading == false && " + list.iterator + "_active_search == false && " + list.iterator + "_total_rows < 1\">PLEASE ADD ITEMS TO THIS LIST</div>";
|
||||||
|
|
||||||
if (options.showSearch=== undefined || options.showSearch === true) {
|
if (options.showSearch=== undefined || options.showSearch === true) {
|
||||||
html += "<div class=\"row\">\n";
|
// Only show the search bar if we are loading results or if we have at least 1 base result
|
||||||
|
html += "<div class=\"row\" ng-show=\"" + list.iterator + "Loading == true || " + list.iterator + "_active_search == true || (" + list.iterator + "Loading == false && " + list.iterator + "_active_search == false && " + list.iterator + "_total_rows > 0)\">\n";
|
||||||
if (options.searchSize) {
|
if (options.searchSize) {
|
||||||
html += SearchWidget({
|
html += SearchWidget({
|
||||||
iterator: list.iterator,
|
iterator: list.iterator,
|
||||||
@@ -373,6 +377,11 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
html += "</div><!-- row -->\n";
|
html += "</div><!-- row -->\n";
|
||||||
|
|
||||||
|
// Message for when a search returns no results. This should only get shown after a search is executed with no results.
|
||||||
|
html += "<div class=\"row\" ng-show=\"" + list.iterator + "Loading == false && " + list.iterator + "_active_search == true && " + list.name + ".length == 0\">\n";
|
||||||
|
html += "<div class=\"col-lg-12\">No records matched your search.</div>\n";
|
||||||
|
html += "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a title and optionally a close button (used on Inventory->Groups)
|
// Add a title and optionally a close button (used on Inventory->Groups)
|
||||||
@@ -383,7 +392,7 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
|||||||
}
|
}
|
||||||
|
|
||||||
// table header row
|
// table header row
|
||||||
html += "<div class=\"list-table-container\"";
|
html += "<div class=\"list-table-container\" ng-show=\"" + list.iterator + "Loading == true || (" + list.iterator + "Loading == false && " + list.name + ".length > 0)\"";
|
||||||
html += (list.awCustomScroll) ? " aw-custom-scroll " : "";
|
html += (list.awCustomScroll) ? " aw-custom-scroll " : "";
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
|
|
||||||
@@ -520,11 +529,6 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
|||||||
}
|
}
|
||||||
innerTable += "</tr>\n";
|
innerTable += "</tr>\n";
|
||||||
|
|
||||||
// Message for when a collection is empty
|
|
||||||
innerTable += "<tr class=\"loading-info\" ng-show=\"" + list.iterator + "Loading == false && " + list.name + ".length == 0\">\n";
|
|
||||||
innerTable += "<td colspan=\"" + cnt + "\" class=\"List-tableCell\"><div class=\"loading-info\">No records matched your search.</div></td>\n";
|
|
||||||
innerTable += "</tr>\n";
|
|
||||||
|
|
||||||
// Message for loading
|
// Message for loading
|
||||||
innerTable += "<tr class=\"loading-info\" ng-show=\"" + list.iterator + "Loading == true\">\n";
|
innerTable += "<tr class=\"loading-info\" ng-show=\"" + list.iterator + "Loading == true\">\n";
|
||||||
innerTable += "<td colspan=\"" + cnt + "\" class=\"List-tableCell\"><div class=\"loading-info\">Loading...</div></td>\n";
|
innerTable += "<td colspan=\"" + cnt + "\" class=\"List-tableCell\"><div class=\"loading-info\">Loading...</div></td>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user