@@ -91,43 +91,39 @@ export class UserListPage extends WithLicenseSummary(
9191 public override searchPlaceholder = msg ( "Search by username, email, etc..." ) ;
9292 public override searchLabel = msg ( "User Search" ) ;
9393
94- public pageTitle = msg ( "Users" ) ;
95- public pageDescription = "" ;
96- public pageIcon = "pf-icon pf-icon-user" ;
94+ public override pageTitle = msg ( "Users" ) ;
95+ public override pageDescription = "" ;
96+ public override pageIcon = "pf-icon pf-icon-user" ;
9797
9898 @property ( { type : String } )
9999 public order = "-last_login" ;
100100
101- @property ( { type : String } )
102- public activePath : string ;
101+ @property ( { type : String , useDefault : true } )
102+ public activePath : string = DefaultUIConfig . defaults . userPath ;
103103
104104 @state ( )
105105 protected hideDeactivated = getURLParam < boolean > ( "hideDeactivated" , false ) ;
106106
107107 @state ( )
108108 protected userPaths : UserPath | null = null ;
109109
110- constructor ( ) {
111- super ( ) ;
112-
113- const defaultPath = DefaultUIConfig . defaults . userPath ;
114-
115- this . activePath = getURLParam < string > ( "path" , defaultPath ) ;
116-
117- if ( this . uiConfig . defaults . userPath !== defaultPath ) {
118- this . activePath = this . uiConfig . defaults . userPath ;
119- }
120- }
121-
122110 protected canImpersonate = false ;
123111
124112 public override connectedCallback ( ) : void {
125113 super . connectedCallback ( ) ;
126114
127115 this . canImpersonate = this . can ( CapabilitiesEnum . CanImpersonate ) ;
116+
117+ const initialDefaultUserPath = DefaultUIConfig . defaults . userPath ;
118+ const brandDefaultUserPath = this . uiConfig . defaults . userPath ;
119+
120+ this . activePath = getURLParam < string > (
121+ "path" ,
122+ brandDefaultUserPath || initialDefaultUserPath ,
123+ ) ;
128124 }
129125
130- async apiEndpoint ( ) : Promise < PaginatedResponse < User > > {
126+ protected override async apiEndpoint ( ) : Promise < PaginatedResponse < User > > {
131127 const users = await this . #api. coreUsersList ( {
132128 ...( await this . defaultEndpointConfig ( ) ) ,
133129 pathStartswith : this . activePath ,
@@ -142,6 +138,18 @@ export class UserListPage extends WithLicenseSummary(
142138 return users ;
143139 }
144140
141+ protected buildExportParams = async ( ) : Promise < CoreUsersExportCreateRequest > => {
142+ return {
143+ ...( await this . defaultEndpointConfig ( ) ) ,
144+ pathStartswith : this . activePath ,
145+ isActive : this . hideDeactivated ? true : undefined ,
146+ } ;
147+ } ;
148+
149+ protected createExport = ( params : CoreUsersExportCreateRequest ) => {
150+ return this . #api. coreUsersExportCreate ( params ) ;
151+ } ;
152+
145153 protected override rowLabel ( item : User ) : string {
146154 if ( item . name ) {
147155 return msg ( str `${ item . username } (${ item . name } )` ) ;
@@ -159,6 +167,8 @@ export class UserListPage extends WithLicenseSummary(
159167 [ msg ( "Actions" ) , null , msg ( "Row Actions" ) ] ,
160168 ] ;
161169
170+ //#region Renderering
171+
162172 protected override renderToolbarSelected ( ) : TemplateResult {
163173 const disabled = this . selectedElements . length < 1 ;
164174 const { currentUser, originalUser } = this ;
@@ -249,7 +259,7 @@ export class UserListPage extends WithLicenseSummary(
249259 </ div > ` ;
250260 }
251261
252- protected row ( item : User ) {
262+ protected override row ( item : User ) : SlottedTemplateResult [ ] {
253263 const { currentUser } = this ;
254264
255265 const showImpersonation = this . canImpersonate && currentUser && item . pk !== currentUser . pk ;
@@ -294,7 +304,7 @@ export class UserListPage extends WithLicenseSummary(
294304 ] ;
295305 }
296306
297- renderExpanded ( item : User ) : TemplateResult {
307+ protected override renderExpanded ( item : User ) : SlottedTemplateResult {
298308 return html `< dl class ="pf-c-description-list pf-m-horizontal ">
299309 < div class ="pf-c-description-list__group ">
300310 < dt class ="pf-c-description-list__term ">
@@ -335,18 +345,6 @@ export class UserListPage extends WithLicenseSummary(
335345 </ dl > ` ;
336346 }
337347
338- protected buildExportParams = async ( ) => {
339- return {
340- ...( await this . defaultEndpointConfig ( ) ) ,
341- pathStartswith : this . activePath ,
342- isActive : this . hideDeactivated ? true : undefined ,
343- } ;
344- } ;
345-
346- protected createExport = ( params : CoreUsersExportCreateRequest ) => {
347- return this . #api. coreUsersExportCreate ( params ) ;
348- } ;
349-
350348 protected renderObjectCreate ( ) : SlottedTemplateResult {
351349 const { activePath } = this ;
352350
@@ -370,7 +368,7 @@ export class UserListPage extends WithLicenseSummary(
370368 } ) ;
371369 }
372370
373- protected renderSidebarBefore ( ) : TemplateResult {
371+ protected renderSidebarBefore ( ) : SlottedTemplateResult {
374372 return html `< aside aria-labelledby ="sidebar-left-panel-header " class ="pf-c-sidebar__panel ">
375373 < div class ="pf-c-card tree ">
376374 < div
@@ -394,6 +392,8 @@ export class UserListPage extends WithLicenseSummary(
394392 </ div >
395393 </ aside > ` ;
396394 }
395+
396+ //#endregion
397397}
398398
399399declare global {
0 commit comments