Skip to content

Commit 2a18c3e

Browse files
committed
Some improvment in the role explorer #75
1 parent eeb2ba1 commit 2a18c3e

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

force-app/main/default/pages/OrgCheck_Roles_VFP.page

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@
3737
<div class="slds-tabs_default">
3838
<ul class="slds-tabs_default__nav" role="tablist">
3939
<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>
4141
</li>
4242
<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>
4444
</li>
4545
</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">
4747
<div class="slds-scrollable">
4848
<div id="chart-container" name="chart-container" />
4949
</div>
5050
</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">
5252
<div id="datatable" />
5353
</div>
5454
</div>
@@ -124,6 +124,18 @@
124124
if (mdepth < d.depth) mdepth = d.depth;
125125
});
126126

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+
127139
// Set some attributes that we use to render each nodes
128140
root.each(function(d) {
129141
const nodeData = roles_map[d.data];
@@ -396,6 +408,7 @@
396408
},
397409
actions: {
398410
exportTable: [{
411+
visibleTab: 'tab-default-table__item',
399412
table: 'datatable',
400413
filename: 'Roles'
401414
}],

0 commit comments

Comments
 (0)