Avoid assuming a permission description value is non-NULL in the
permission group editor interfaces since values are not required in the
database.
Fixes: ERROR TypeError: "l.description(...) is null"
Similarly repair the permission list title attributes so they display
the permission code (instead of an empty string) for titles when no
description is available.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
const entries: ComboboxEntry[] = [];
this.trimmedPerms.forEach(p => {
if (p.code().toLowerCase().includes(term) ||
- p.description().toLowerCase().includes(term)) {
+ (p.description() || '').toLowerCase().includes(term)) {
entries.push({id: p.id(), label: p.code()});
}
});
<div class="row" *ngFor="let map of groupPermMaps()"
[ngClass]="{'bg-warning': map.isdeleted()}">
<div class="col-lg-5">
- <span title="{{map.perm().description()}}">{{map.perm().code()}}</span>
+ <span i18n-title
+ title="{{map.perm().description() || map.perm().code()}}">
+ {{map.perm().code()}}
+ </span>
</div>
<ng-container *ngIf="permIsInherited(map); else nativeMap">
<div class="col-lg-4">
const parts = this.filterText.toLowerCase().split(' ');
maps = maps.filter(m => {
- const target = m.perm().code().toLowerCase()
- + ' ' + m.perm().description().toLowerCase();
+ const desc = m.perm().description() || ''; // null-able
+
+ const target =
+ m.perm().code().toLowerCase() + ' ' + desc.toLowerCase();
for (let i = 0; i < parts.length; i++) {
const part = parts[i];