|
37 | 37 | <div class="slds-tabs_default"> |
38 | 38 | <ul class="slds-tabs_default__nav" role="tablist"> |
39 | 39 | <li class="slds-tabs_default__item slds-is-active" title="Role Explorer" role="presentation"> |
40 | | - <a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="0" aria-selected="true" aria-controls="tab-default-1" id="tab-default-1__item">Role Explorer</a> |
| 40 | + <a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="0" aria-selected="true" aria-controls="tab-default-1" id="tab-default-explorer__item">Role Explorer</a> |
41 | 41 | </li> |
42 | 42 | <li class="slds-tabs_default__item" title="Role Listing" role="presentation"> |
43 | | - <a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="-1" aria-selected="false" aria-controls="tab-default-2" id="tab-default-2__item">Role Listing</a> |
| 43 | + <a class="slds-tabs_default__link" href="javascript:void(0);" role="tab" tabindex="-1" aria-selected="false" aria-controls="tab-default-2" id="tab-default-table__item">Role Listing</a> |
44 | 44 | </li> |
45 | 45 | </ul> |
46 | | - <div id="tab-default-1" class="slds-tabs_default__content slds-show" role="tabpanel" aria-labelledby="tab-default-1__item"> |
| 46 | + <div id="tab-default-1" class="slds-tabs_default__content slds-show" role="tabpanel" aria-labelledby="tab-default-explorer__item"> |
47 | 47 | <div class="slds-scrollable"> |
48 | 48 | <div id="chart-container" name="chart-container" /> |
49 | 49 | </div> |
50 | 50 | </div> |
51 | | - <div id="tab-default-2" class="slds-tabs_default__content slds-hide" role="tabpanel" aria-labelledby="tab-default-2__item"> |
| 51 | + <div id="tab-default-2" class="slds-tabs_default__content slds-hide" role="tabpanel" aria-labelledby="tab-default-table__item"> |
52 | 52 | <div id="datatable" /> |
53 | 53 | </div> |
54 | 54 | </div> |
|
124 | 124 | if (mdepth < d.depth) mdepth = d.depth; |
125 | 125 | }); |
126 | 126 |
|
| 127 | + // Show alert about too many number of levels in the hierarchy |
| 128 | + const MAX_LEVEL_DEPTH_ROLES = 7; |
| 129 | + if (mdepth > MAX_LEVEL_DEPTH_ROLES) { |
| 130 | + let html = ''; |
| 131 | + html += 'You have more than '+MAX_LEVEL_DEPTH_ROLES+' levels of roles in your Role Hierarchy '; |
| 132 | + html += '(exactly '+mdepth+' levels).<br /><br />'; |
| 133 | + html += 'The Role Hierarchy is not there to mimic the hierarchy of your '; |
| 134 | + html += 'company, it is there for visibility purpose.<br /><br />'; |
| 135 | + html += 'Please reduce it!<br />'; |
| 136 | + helper.html.modal.show('Too many levels in your Role Hierarchy!', html); |
| 137 | + } |
| 138 | + |
127 | 139 | // Set some attributes that we use to render each nodes |
128 | 140 | root.each(function(d) { |
129 | 141 | const nodeData = roles_map[d.data]; |
|
396 | 408 | }, |
397 | 409 | actions: { |
398 | 410 | exportTable: [{ |
| 411 | + visibleTab: 'tab-default-table__item', |
399 | 412 | table: 'datatable', |
400 | 413 | filename: 'Roles' |
401 | 414 | }], |
|
0 commit comments